@toclocoinc/lattice-grid 1.122.0 → 1.122.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/angular/package.json +1 -1
- package/docs/API.html +5 -5
- package/docs/api/adapters.html +1 -1
- package/docs/api/ai.html +1 -1
- package/docs/api/alarms.html +1 -1
- package/docs/api/calendar.html +1 -1
- package/docs/api/charts.html +1 -1
- package/docs/api/dashboard.html +1 -1
- package/docs/api/data-router.html +1 -1
- package/docs/api/dataview.html +1 -1
- package/docs/api/deckgl.html +1 -1
- package/docs/api/designer.html +1 -1
- package/docs/api/form.html +1 -1
- package/docs/api/gantt.html +2 -2
- package/docs/api/geometry.html +1 -1
- package/docs/api/grid.html +2 -2
- package/docs/api/index.html +1 -1
- package/docs/api/kanban.html +1 -1
- package/docs/api/kpi.html +1 -1
- package/docs/api/layout.html +1 -1
- package/docs/api/leaflet.html +1 -1
- package/docs/api/list.html +1 -1
- package/docs/api/listview.html +1 -1
- package/docs/api/mapview.html +1 -1
- package/docs/api/mock-socket.html +1 -1
- package/docs/api/pdf.html +1 -1
- package/docs/api/presets.html +1 -1
- package/docs/api/scheduler.html +1 -1
- package/docs/api/shell.html +1 -1
- package/docs/api/tabs.html +1 -1
- package/docs/api/tree.html +1 -1
- package/docs/api/types.html +1 -1
- package/docs/api-detail.html +5 -5
- package/docs/warnings.json +1 -1
- package/lattice-grid.d.ts +1 -1
- package/lattice-grid.esm.min.js +2 -2
- package/lattice-grid.min.cjs +2 -2
- package/lattice-grid.min.js +2 -2
- package/locales/all.d.ts +1 -1
- package/locales/all.esm.min.js +1 -1
- package/locales/all.min.cjs +1 -1
- package/locales/all.min.js +1 -1
- package/locales/ar.d.ts +1 -1
- package/locales/ar.esm.min.js +1 -1
- package/locales/ar.min.cjs +1 -1
- package/locales/ar.min.js +1 -1
- package/locales/cs-CZ.d.ts +1 -1
- package/locales/cs-CZ.esm.min.js +1 -1
- package/locales/cs-CZ.min.cjs +1 -1
- package/locales/cs-CZ.min.js +1 -1
- package/locales/da-DK.d.ts +1 -1
- package/locales/da-DK.esm.min.js +1 -1
- package/locales/da-DK.min.cjs +1 -1
- package/locales/da-DK.min.js +1 -1
- package/locales/de-DE.d.ts +1 -1
- package/locales/de-DE.esm.min.js +1 -1
- package/locales/de-DE.min.cjs +1 -1
- package/locales/de-DE.min.js +1 -1
- package/locales/el-GR.d.ts +1 -1
- package/locales/el-GR.esm.min.js +1 -1
- package/locales/el-GR.min.cjs +1 -1
- package/locales/el-GR.min.js +1 -1
- package/locales/en-US.d.ts +1 -1
- package/locales/en-US.esm.min.js +1 -1
- package/locales/en-US.min.cjs +1 -1
- package/locales/en-US.min.js +1 -1
- package/locales/es-ES.d.ts +1 -1
- package/locales/es-ES.esm.min.js +1 -1
- package/locales/es-ES.min.cjs +1 -1
- package/locales/es-ES.min.js +1 -1
- package/locales/fi-FI.d.ts +1 -1
- package/locales/fi-FI.esm.min.js +1 -1
- package/locales/fi-FI.min.cjs +1 -1
- package/locales/fi-FI.min.js +1 -1
- package/locales/fr-CA.d.ts +1 -1
- package/locales/fr-CA.esm.min.js +1 -1
- package/locales/fr-CA.min.cjs +1 -1
- package/locales/fr-CA.min.js +1 -1
- package/locales/fr-FR.d.ts +1 -1
- package/locales/fr-FR.esm.min.js +1 -1
- package/locales/fr-FR.min.cjs +1 -1
- package/locales/fr-FR.min.js +1 -1
- package/locales/hu-HU.d.ts +1 -1
- package/locales/hu-HU.esm.min.js +1 -1
- package/locales/hu-HU.min.cjs +1 -1
- package/locales/hu-HU.min.js +1 -1
- package/locales/it-IT.d.ts +1 -1
- package/locales/it-IT.esm.min.js +1 -1
- package/locales/it-IT.min.cjs +1 -1
- package/locales/it-IT.min.js +1 -1
- package/locales/ja-JP.d.ts +1 -1
- package/locales/ja-JP.esm.min.js +1 -1
- package/locales/ja-JP.min.cjs +1 -1
- package/locales/ja-JP.min.js +1 -1
- package/locales/nb-NO.d.ts +1 -1
- package/locales/nb-NO.esm.min.js +1 -1
- package/locales/nb-NO.min.cjs +1 -1
- package/locales/nb-NO.min.js +1 -1
- package/locales/nl-NL.d.ts +1 -1
- package/locales/nl-NL.esm.min.js +1 -1
- package/locales/nl-NL.min.cjs +1 -1
- package/locales/nl-NL.min.js +1 -1
- package/locales/pl-PL.d.ts +1 -1
- package/locales/pl-PL.esm.min.js +1 -1
- package/locales/pl-PL.min.cjs +1 -1
- package/locales/pl-PL.min.js +1 -1
- package/locales/pt-BR.d.ts +1 -1
- package/locales/pt-BR.esm.min.js +1 -1
- package/locales/pt-BR.min.cjs +1 -1
- package/locales/pt-BR.min.js +1 -1
- package/locales/ro-RO.d.ts +1 -1
- package/locales/ro-RO.esm.min.js +1 -1
- package/locales/ro-RO.min.cjs +1 -1
- package/locales/ro-RO.min.js +1 -1
- package/locales/sv-SE.d.ts +1 -1
- package/locales/sv-SE.esm.min.js +1 -1
- package/locales/sv-SE.min.cjs +1 -1
- package/locales/sv-SE.min.js +1 -1
- package/locales/uk-UA.d.ts +1 -1
- package/locales/uk-UA.esm.min.js +1 -1
- package/locales/uk-UA.min.cjs +1 -1
- package/locales/uk-UA.min.js +1 -1
- package/modules/ai.d.ts +1 -1
- package/modules/ai.esm.min.js +1 -1
- package/modules/ai.min.cjs +1 -1
- package/modules/ai.min.js +1 -1
- package/modules/alarms.d.ts +1 -1
- package/modules/alarms.esm.min.js +1 -1
- package/modules/alarms.min.cjs +1 -1
- package/modules/alarms.min.js +1 -1
- package/modules/angular.d.ts +1 -1
- package/modules/angular.esm.min.js +1 -1
- package/modules/angular.min.cjs +1 -1
- package/modules/angular.min.js +1 -1
- package/modules/calendar.d.ts +1 -1
- package/modules/calendar.esm.min.js +1 -1
- package/modules/calendar.min.cjs +1 -1
- package/modules/calendar.min.js +1 -1
- package/modules/chart-alluvial.d.ts +1 -1
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-alluvial.min.cjs +1 -1
- package/modules/chart-alluvial.min.js +1 -1
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +1 -1
- package/modules/chart-arc.min.js +1 -1
- package/modules/chart-barrace.d.ts +1 -1
- package/modules/chart-barrace.esm.min.js +1 -1
- package/modules/chart-barrace.min.cjs +1 -1
- package/modules/chart-barrace.min.js +1 -1
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +1 -1
- package/modules/chart-bubblemap.min.cjs +1 -1
- package/modules/chart-bubblemap.min.js +1 -1
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +1 -1
- package/modules/chart-bump.min.js +1 -1
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +1 -1
- package/modules/chart-calendar.min.js +1 -1
- package/modules/chart-choropleth.d.ts +1 -1
- package/modules/chart-choropleth.esm.min.js +1 -1
- package/modules/chart-choropleth.min.cjs +1 -1
- package/modules/chart-choropleth.min.js +1 -1
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +1 -1
- package/modules/chart-decomposition.min.js +1 -1
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +1 -1
- package/modules/chart-diverging.min.js +1 -1
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +1 -1
- package/modules/chart-dumbbell.min.js +1 -1
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +1 -1
- package/modules/chart-fan.min.js +1 -1
- package/modules/chart-forcetree.d.ts +1 -1
- package/modules/chart-forcetree.esm.min.js +1 -1
- package/modules/chart-forcetree.min.cjs +1 -1
- package/modules/chart-forcetree.min.js +1 -1
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +1 -1
- package/modules/chart-hexbin.min.js +1 -1
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +1 -1
- package/modules/chart-hexmap.min.cjs +1 -1
- package/modules/chart-hexmap.min.js +1 -1
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +1 -1
- package/modules/chart-icicle.min.js +1 -1
- package/modules/chart-markermap.d.ts +1 -1
- package/modules/chart-markermap.esm.min.js +1 -1
- package/modules/chart-markermap.min.cjs +1 -1
- package/modules/chart-markermap.min.js +1 -1
- package/modules/chart-motion.d.ts +1 -1
- package/modules/chart-motion.esm.min.js +1 -1
- package/modules/chart-motion.min.cjs +1 -1
- package/modules/chart-motion.min.js +1 -1
- package/modules/chart-pack.d.ts +1 -1
- package/modules/chart-pack.esm.min.js +1 -1
- package/modules/chart-pack.min.cjs +1 -1
- package/modules/chart-pack.min.js +1 -1
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +1 -1
- package/modules/chart-parallel.min.js +1 -1
- package/modules/chart-pictorial.d.ts +1 -1
- package/modules/chart-pictorial.esm.min.js +1 -1
- package/modules/chart-pictorial.min.cjs +1 -1
- package/modules/chart-pictorial.min.js +1 -1
- package/modules/chart-polararea.d.ts +1 -1
- package/modules/chart-polararea.esm.min.js +1 -1
- package/modules/chart-polararea.min.cjs +1 -1
- package/modules/chart-polararea.min.js +1 -1
- package/modules/chart-polarscatter.d.ts +1 -1
- package/modules/chart-polarscatter.esm.min.js +1 -1
- package/modules/chart-polarscatter.min.cjs +1 -1
- package/modules/chart-polarscatter.min.js +1 -1
- package/modules/chart-pyramid.d.ts +1 -1
- package/modules/chart-pyramid.esm.min.js +1 -1
- package/modules/chart-pyramid.min.cjs +1 -1
- package/modules/chart-pyramid.min.js +1 -1
- package/modules/chart-radialbar.d.ts +1 -1
- package/modules/chart-radialbar.esm.min.js +1 -1
- package/modules/chart-radialbar.min.cjs +1 -1
- package/modules/chart-radialbar.min.js +1 -1
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +1 -1
- package/modules/chart-ridgeline.min.js +1 -1
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +1 -1
- package/modules/chart-roc.min.js +1 -1
- package/modules/chart-scatter3d.d.ts +1 -1
- package/modules/chart-scatter3d.esm.min.js +1 -1
- package/modules/chart-scatter3d.min.cjs +1 -1
- package/modules/chart-scatter3d.min.js +1 -1
- package/modules/chart-serpentine.d.ts +1 -1
- package/modules/chart-serpentine.esm.min.js +1 -1
- package/modules/chart-serpentine.min.cjs +1 -1
- package/modules/chart-serpentine.min.js +1 -1
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +1 -1
- package/modules/chart-slope.min.js +1 -1
- package/modules/chart-spiral.d.ts +1 -1
- package/modules/chart-spiral.esm.min.js +1 -1
- package/modules/chart-spiral.min.cjs +1 -1
- package/modules/chart-spiral.min.js +1 -1
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +1 -1
- package/modules/chart-splom.min.js +1 -1
- package/modules/chart-tree.d.ts +1 -1
- package/modules/chart-tree.esm.min.js +1 -1
- package/modules/chart-tree.min.cjs +1 -1
- package/modules/chart-tree.min.js +1 -1
- package/modules/chart-venn.d.ts +1 -1
- package/modules/chart-venn.esm.min.js +1 -1
- package/modules/chart-venn.min.cjs +1 -1
- package/modules/chart-venn.min.js +1 -1
- package/modules/chart-voronoi.d.ts +1 -1
- package/modules/chart-voronoi.esm.min.js +1 -1
- package/modules/chart-voronoi.min.cjs +1 -1
- package/modules/chart-voronoi.min.js +1 -1
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +1 -1
- package/modules/chart-waffle.min.js +1 -1
- package/modules/chart-wordcloud.d.ts +1 -1
- package/modules/chart-wordcloud.esm.min.js +1 -1
- package/modules/chart-wordcloud.min.cjs +1 -1
- package/modules/chart-wordcloud.min.js +1 -1
- package/modules/charts.d.ts +1 -1
- package/modules/charts.esm.min.js +1 -1
- package/modules/charts.min.cjs +1 -1
- package/modules/charts.min.js +1 -1
- package/modules/contextmenu.d.ts +1 -1
- package/modules/contextmenu.esm.min.js +1 -1
- package/modules/contextmenu.min.cjs +1 -1
- package/modules/contextmenu.min.js +1 -1
- package/modules/dashboard.d.ts +1 -1
- package/modules/dashboard.esm.min.js +1 -1
- package/modules/dashboard.min.cjs +1 -1
- package/modules/dashboard.min.js +1 -1
- package/modules/data-router.d.ts +1 -1
- package/modules/data-router.esm.min.js +1 -1
- package/modules/data-router.min.cjs +1 -1
- package/modules/data-router.min.js +1 -1
- package/modules/dataview.d.ts +1 -1
- package/modules/dataview.esm.min.js +1 -1
- package/modules/dataview.min.cjs +1 -1
- package/modules/dataview.min.js +1 -1
- package/modules/deckgl.d.ts +1 -1
- package/modules/deckgl.esm.min.js +1 -1
- package/modules/deckgl.min.cjs +1 -1
- package/modules/deckgl.min.js +1 -1
- package/modules/designer.d.ts +1 -1
- package/modules/designer.esm.min.js +1 -1
- package/modules/designer.min.cjs +1 -1
- package/modules/designer.min.js +1 -1
- package/modules/devtools.d.ts +1 -1
- package/modules/devtools.esm.min.js +1 -1
- package/modules/devtools.min.cjs +1 -1
- package/modules/devtools.min.js +1 -1
- package/modules/dhtmlx-compat.d.ts +1 -1
- package/modules/dhtmlx-compat.esm.min.js +1 -1
- package/modules/dhtmlx-compat.min.cjs +1 -1
- package/modules/dhtmlx-compat.min.js +1 -1
- package/modules/form.d.ts +1 -1
- package/modules/form.esm.min.js +1 -1
- package/modules/form.min.cjs +1 -1
- package/modules/form.min.js +1 -1
- package/modules/gantt.d.ts +2 -2
- package/modules/gantt.esm.min.js +165 -156
- package/modules/gantt.esm.min.js.map +2 -2
- package/modules/gantt.min.cjs +165 -156
- package/modules/gantt.min.js +165 -156
- package/modules/gantt.min.js.map +2 -2
- package/modules/geo-europe-nuts.d.ts +1 -1
- package/modules/geo-europe-nuts.esm.min.js +1 -1
- package/modules/geo-europe-nuts.min.cjs +1 -1
- package/modules/geo-europe-nuts.min.js +1 -1
- package/modules/geo-uk.d.ts +1 -1
- package/modules/geo-uk.esm.min.js +1 -1
- package/modules/geo-uk.min.cjs +1 -1
- package/modules/geo-uk.min.js +1 -1
- package/modules/geo-us-states.d.ts +1 -1
- package/modules/geo-us-states.esm.min.js +1 -1
- package/modules/geo-us-states.min.cjs +1 -1
- package/modules/geo-us-states.min.js +1 -1
- package/modules/geo-world-110m.d.ts +1 -1
- package/modules/geo-world-110m.esm.min.js +1 -1
- package/modules/geo-world-110m.min.cjs +1 -1
- package/modules/geo-world-110m.min.js +1 -1
- package/modules/geo-world-50m.d.ts +1 -1
- package/modules/geo-world-50m.esm.min.js +1 -1
- package/modules/geo-world-50m.min.cjs +1 -1
- package/modules/geo-world-50m.min.js +1 -1
- package/modules/geometry.d.ts +1 -1
- package/modules/geometry.esm.min.js +1 -1
- package/modules/geometry.min.cjs +1 -1
- package/modules/geometry.min.js +1 -1
- package/modules/htmx.d.ts +1 -1
- package/modules/htmx.esm.min.js +2 -2
- package/modules/htmx.min.cjs +2 -2
- package/modules/htmx.min.js +2 -2
- package/modules/htmx.shared.esm.min.js +1 -1
- package/modules/htmx.shared.min.cjs +1 -1
- package/modules/htmx.shared.min.js +1 -1
- package/modules/kanban.d.ts +1 -1
- package/modules/kanban.esm.min.js +1 -1
- package/modules/kanban.min.cjs +1 -1
- package/modules/kanban.min.js +1 -1
- package/modules/kpi.d.ts +1 -1
- package/modules/kpi.esm.min.js +1 -1
- package/modules/kpi.min.cjs +1 -1
- package/modules/kpi.min.js +1 -1
- package/modules/layout.d.ts +1 -1
- package/modules/layout.esm.min.js +1 -1
- package/modules/layout.min.cjs +1 -1
- package/modules/layout.min.js +1 -1
- package/modules/leaflet.d.ts +1 -1
- package/modules/leaflet.esm.min.js +1 -1
- package/modules/leaflet.min.cjs +1 -1
- package/modules/leaflet.min.js +1 -1
- package/modules/list.d.ts +1 -1
- package/modules/list.esm.min.js +1 -1
- package/modules/list.min.cjs +1 -1
- package/modules/list.min.js +1 -1
- package/modules/listview.d.ts +1 -1
- package/modules/listview.esm.min.js +1 -1
- package/modules/listview.min.cjs +1 -1
- package/modules/listview.min.js +1 -1
- package/modules/mapview.d.ts +1 -1
- package/modules/mapview.esm.min.js +1 -1
- package/modules/mapview.min.cjs +1 -1
- package/modules/mapview.min.js +1 -1
- package/modules/mock-socket.d.ts +1 -1
- package/modules/mock-socket.esm.min.js +1 -1
- package/modules/mock-socket.min.cjs +1 -1
- package/modules/mock-socket.min.js +1 -1
- package/modules/pdf.d.ts +1 -1
- package/modules/pdf.esm.min.js +1 -1
- package/modules/pdf.min.cjs +1 -1
- package/modules/pdf.min.js +1 -1
- package/modules/presets.d.ts +1 -1
- package/modules/presets.esm.min.js +1 -1
- package/modules/presets.min.cjs +1 -1
- package/modules/presets.min.js +1 -1
- package/modules/react.d.ts +1 -1
- package/modules/react.esm.min.js +1 -1
- package/modules/react.min.cjs +1 -1
- package/modules/react.min.js +1 -1
- package/modules/recordeditor.d.ts +1 -1
- package/modules/recordeditor.esm.min.js +1 -1
- package/modules/recordeditor.min.cjs +1 -1
- package/modules/recordeditor.min.js +1 -1
- package/modules/scheduler.d.ts +1 -1
- package/modules/scheduler.esm.min.js +7 -7
- package/modules/scheduler.esm.min.js.map +2 -2
- package/modules/scheduler.min.cjs +7 -7
- package/modules/scheduler.min.js +7 -7
- package/modules/scheduler.min.js.map +2 -2
- package/modules/shell.d.ts +1 -1
- package/modules/shell.esm.min.js +1 -1
- package/modules/shell.min.cjs +1 -1
- package/modules/shell.min.js +1 -1
- package/modules/sidebar.d.ts +1 -1
- package/modules/sidebar.esm.min.js +1 -1
- package/modules/sidebar.min.cjs +1 -1
- package/modules/sidebar.min.js +1 -1
- package/modules/svelte.d.ts +1 -1
- package/modules/svelte.esm.min.js +1 -1
- package/modules/svelte.min.cjs +1 -1
- package/modules/svelte.min.js +1 -1
- package/modules/tabs.d.ts +1 -1
- package/modules/tabs.esm.min.js +1 -1
- package/modules/tabs.min.cjs +1 -1
- package/modules/tabs.min.js +1 -1
- package/modules/toolbar.d.ts +1 -1
- package/modules/toolbar.esm.min.js +1 -1
- package/modules/toolbar.min.cjs +1 -1
- package/modules/toolbar.min.js +1 -1
- package/modules/tree.d.ts +1 -1
- package/modules/tree.esm.min.js +1 -1
- package/modules/tree.min.cjs +1 -1
- package/modules/tree.min.js +1 -1
- package/modules/vue.d.ts +1 -1
- package/modules/vue.esm.min.js +1 -1
- package/modules/vue.min.cjs +1 -1
- package/modules/vue.min.js +1 -1
- package/modules/webcomponent.d.ts +1 -1
- package/modules/webcomponent.esm.min.js +2 -2
- package/modules/webcomponent.min.cjs +2 -2
- package/modules/webcomponent.min.js +2 -2
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.122.
|
|
2
|
+
* Lattice Grid 1.122.1, scheduler module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(yt){"use strict";var wt=!0,dt=Object.create(null),ft=Object.create(null);function Re(s,te){dt[s]=te}function ht(s){var te=ft[s];if(te)return te;var $e=Object.create(null);ft[s]=$e;var z=dt[s];if(!z)throw new Error("[lattice] missing module: "+s);return z($e,ht),$e}Re("packages/core/src/internal/predicates.js",function(s,te){"use strict";Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return U}});function $e(R){return R!==null&&typeof R=="object"&&!Array.isArray(R)}function z(R){return typeof R=="function"}function N(R){return R==null}function ie(R){return R==null||R===""}function U(R){return typeof R!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(R))?!0:!!(R.prototype&&Object.getOwnPropertyNames(R.prototype).length>1)}}),Re("packages/core/src/internal/warn.js",function(s,te){"use strict";Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return S}});const $e=new Set,z=2e3;function N(i){if($e.add(i),$e.size>z){const d=$e.values().next().value;d!==void 0&&$e.delete(d)}}const ie=[],U=500;function R(i,d,c){ie.push({key:i,level:d,message:c.map(k=>typeof k=="string"?k:L(k)).join(" "),at:Date.now()}),ie.length>U&&ie.shift()}function L(i){if(i instanceof Error)return i.message;try{return JSON.stringify(i)}catch{return String(i)}}function f(){return ie.map(i=>({...i}))}function $(i){if(i.length===0||typeof i[0]!="string")return i;const d=i[0].replace(/^\[lattice\]\s*/,"");return d===i[0]?i:[d,...i.slice(1)]}function E(i,...d){if($e.has(i))return;N(i);const c=$(d);R(i,"warn",c),console.warn("[lattice]",...c)}function F(i,...d){if($e.has(i))return;N(i);const c=$(d);R(i,"info",c),console.info("[lattice]",...c)}function W(){$e.clear(),ie.length=0}function A(i,d){const c=new Error(`[lattice] ${i}`);throw d!==void 0&&(c.cause=d),c}function q(i,d){i||A(d)}const S=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})()}),Re("packages/core/src/internal/merge.js",function(s,te){"use strict";Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return L}});const z=te("packages/core/src/internal/predicates.js").isObject;function N(f,$,E){if(f!==void 0)return f===!0?{enabled:!0,...E}:f===!1?{enabled:!1}:z(f)?f:{[$]:f,enabled:!0}}function ie(f){return f==null?[]:Array.isArray(f)?f:[f]}const U=Object.freeze(new Set(["__proto__","constructor","prototype"]));function R(f,$){if(!z(f))return z($)?{...$}:$;if(!z($))return $===void 0?f:$;const E={...f};for(const F of Object.keys($)){if(U.has(F))continue;const W=$[F];W!==void 0&&(E[F]=z(W)&&z(E[F])?R(E[F],W):W)}return E}function L(f,$){if(!z(f)||!z($)||f===$)return $;const E=Object.create(Object.getPrototypeOf(f));return Object.assign(E,f,$),E}}),Re("packages/core/src/internal/paths.js",function(s,te){"use strict";Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return R}});const $e=new Map;function z(L){let f=$e.get(L);if(f)return f;if(!L.includes("."))f=$=>$?.[L];else{const $=L.split("."),E=$.length;f=F=>{let W=F;for(let A=0;A<E;A++){if(W==null)return;W=W[$[A]]}return W}}return $e.set(L,f),f}const N=new Map;function ie(L){let f=N.get(L);if(f)return f;if(!L.includes("."))f=($,E)=>{$!=null&&($[L]=E)};else{const $=L.split("."),E=$.length-1;f=(F,W)=>{let A=F;for(let q=0;q<E;q++){if(A==null)return;const S=$[q];A[S]==null&&(A[S]={}),A=A[S]}A!=null&&(A[$[E]]=W)}}return N.set(L,f),f}function U(L,f){return z(f)(L)}function R(L,f,$){ie(f)(L,$)}}),Re("packages/modules/gantt/time.js",function(s,te){"use strict";Object.defineProperty(s,"toDayNumber",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"fromDayNumber",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"toISODate",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"resolveProjectEpoch",{enumerable:!0,get:function(){return L}});const z=te("packages/core/src/internal/warn.js").warnOnce,N=864e5;function ie(f){if(f==null||f==="")return null;if(typeof f=="number")return Number.isFinite(f)?f:null;if(f instanceof Date)return Number.isFinite(f.getTime())?Math.floor(Date.UTC(f.getFullYear(),f.getMonth(),f.getDate())/N):null;const $=Date.parse(f);return Number.isFinite($)?Math.floor($/N):null}function U(f){return Number.isFinite(f)?new Date(Math.round(f)*N):null}function R(f){const $=U(f);return $?$.toISOString().slice(0,10):null}function L(f){if(f==null||f==="")return 0;const $=ie(f);return Number.isFinite($)?$:(z(`gantt.projectEpoch:${String(f)}`,`[lattice] gantt: projectEpoch ${JSON.stringify(f)} is not a date or a day number; the plan is rendered against the Unix epoch (day 0 = 1970-01-01).`),0)}}),Re("packages/modules/gantt/calendar.js",function(s,te){"use strict";Object.defineProperty(s,"createCalendar",{enumerable:!0,get:function(){return ie}});const z=te("packages/modules/gantt/time.js").toDayNumber,N=Object.freeze([1,2,3,4,5]);function ie(U,R=0){if(U==null)return null;let L,f;U==="weekends"?(L=N,f=new Set):(L=Array.isArray(U.workdays)&&U.workdays.length?U.workdays.map(Number).filter(c=>c>=0&&c<=6):N,f=new Set((Array.isArray(U.holidays)?U.holidays:[]).map(c=>z(c)).filter(c=>c!=null)));const $=new Set(L);if($.size===7&&f.size===0||$.size===0)return null;const E=c=>{let k=(c%7+4)%7;return k<0&&(k+=7),k},F=c=>{if(!Number.isFinite(c))return!1;const k=Math.round(c);return $.has(E(k))&&!f.has(k)},W=c=>{let k=c;for(;!F(k);)k+=1;return k},A=W(Math.round(Number.isFinite(R)?R:0)),q=$.size,S=(c,k)=>{if(k<c)return 0;const Q=k-c+1,J=Math.floor(Q/7);let H=J*q;const se=E(c);for(let fe=J*7;fe<Q;fe+=1)$.has((se+fe)%7)&&(H+=1);for(const fe of f)fe>=c&&fe<=k&&$.has(E(fe))&&(H-=1);return H};return{isWorking:F,nextWorking:W,dayOf:c=>{const k=Math.round(c);if(k===0)return A;if(k>0){const ke=Math.floor(k/q);let ge=A+ke*7,ue=k-ke*q;for(;ue>0;)ge+=1,$.has(E(ge))&&(ue-=1);let X=0;for(const ee of f)ee>A&&ee<=ge&&$.has(E(ee))&&(X+=1);for(;X>0;)ge+=1,F(ge)&&(X-=1);for(;!F(ge);)ge+=1;return ge}const Q=-k,J=Math.floor(Q/q);let H=A-J*7,se=Q-J*q;for(;se>0;)H-=1,$.has(E(H))&&(se-=1);let fe=0;for(const ke of f)ke>=H&&ke<A&&$.has(E(ke))&&(fe+=1);for(;fe>0;)H-=1,F(H)&&(fe-=1);for(;!F(H);)H-=1;return H},indexOf:c=>{const k=W(Math.round(c));return k>=A?S(A,k)-1:-(S(k,A)-1)},anchor:A}}}),Re("packages/modules/gantt/week.js",function(s,te){"use strict";Object.defineProperty(s,"EXPLICIT_WEEK_START_DAY",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"localeWeekStartDay",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"validWeekStartDay",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"resolveWeekStartDay",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"weekStartOf",{enumerable:!0,get:function(){return f}});const z=te("packages/modules/gantt/time.js").fromDayNumber,N=Symbol("gantt.explicitWeekStartDay"),ie=new Set(["US","CA","MX","BR","AR","CO","VE","EC","PE","CL","IL","JP","KR","TW","HK","PH","ZA","EG"]);function U($){if(!$||typeof $!="string")return null;try{const E=new Intl.Locale($),F=E.weekInfo??(typeof E.getWeekInfo=="function"?E.getWeekInfo():null);if(F&&Number.isFinite(F.firstDay))return F.firstDay===7?0:F.firstDay;const W=E.region||$.split(/[-_]/).find(A=>A.length===2);if(W)return ie.has(W.toUpperCase())?0:1}catch{}return null}function R($){return Number.isFinite($)&&$>=0&&$<=6?Math.floor($):null}function L($,E){const F=R($);if(F!=null)return F;const W=U(E);return W??0}function f($,E){const F=z($),W=F?F.getUTCDay():0;return $-((W-E)%7+7)%7}}),Re("packages/modules/gantt/zoom.js",function(s,te){"use strict";Object.defineProperty(s,"ZOOM_PRESETS",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"ZOOM_LEVEL_NAMES",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"resolveZoomPreset",{enumerable:!0,get:function(){return N}});const $e=Object.freeze({hour:Object.freeze({px:624,step:1/24,level:"hour"}),day:Object.freeze({px:26,step:1,level:"day"}),week:Object.freeze({px:12,step:7,level:"week"}),month:Object.freeze({px:4,step:30,level:"month"}),quarter:Object.freeze({px:1.8,step:91,level:"quarter"})}),z=Object.freeze(["hour","day","week","month","quarter"]);function N(ie,U="day"){if(typeof ie=="number"&&Number.isFinite(ie)&&ie>0){const R=ie>=60?"hour":ie>=18?"day":ie>=8?"week":ie>=2.5?"month":"quarter";return{px:ie,step:$e[R].step,level:R}}return typeof ie=="string"&&Object.prototype.hasOwnProperty.call($e,ie)?{...$e[ie]}:{...$e[U]||$e.day}}}),Re("packages/modules/gantt/workload-groups.js",function(s,te){"use strict";Object.defineProperty(s,"GROUP_KEY_PREFIX",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"isGroupKey",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"normalizeGroupBy",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"groupOfResource",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"groupBookingSubRows",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"groupWorkloadRows",{enumerable:!0,get:function(){return f}});const $e="group:";function z($){return typeof $=="string"&&$.startsWith($e)}function N($){return typeof $=="function"||typeof $=="string"&&$.trim()!==""?$:null}function ie($,E){let F=null;try{F=typeof $=="function"?$(E):E?E[$]:null}catch{F=null}return F==null||F===""?null:String(F)}function U($,E){return Array.isArray(E)?$?$.map((F,W)=>{const A=E[W];return A==null?F:F==null?A:F+A}):E.map(F=>F??null):$}function R($,E){return E==null||!Number.isFinite(E)?$:$==null?E:$+E}function L($){const E=[],F=new Map;for(const W of $){if(!W.external||W.group==null){E.push(W);continue}const A=F.get(W.group);if(A){A.cells=U(A.cells,W.cells),A.total+=Number(W.total)||0,A.bookings.push(W);continue}const q={...W,id:`${$e}${W.group}`,name:W.group,cells:U(null,W.cells),total:Number(W.total)||0,bookings:[W]};F.set(W.group,q),E.push(q)}return E}function f($,E){const F=new Map;for(const A of $){const q=E(A.resource==null?null:A.resource);F.has(q)||F.set(q,[]),F.get(q).push(A)}return[...F.keys()].sort((A,q)=>A==null?q==null?0:1:q==null?-1:A.localeCompare(q,void 0,{numeric:!0,sensitivity:"base"})).map(A=>{const q=F.get(A);let S=null,i=null,d=null,c=null,k=null,Q=0;for(const H of q)S=U(S,H.cells),i=U(i,H.available),d=U(d,H.costCells),c=R(c,H.availableTotal),k=R(k,H.costTotal),Q+=Number(H.total)||0;S=S||[];const J=S.map((H,se)=>H!=null&&i!=null&&i[se]!=null&&H>i[se]+1e-9);return{value:A,key:`${$e}${A??""}`,rows:q,cells:S,available:i,availableTotal:c,total:Q,costCells:d,costTotal:k,over:J}})}}),Re("packages/modules/shared/axislabels.js",function(s,te){"use strict";Object.defineProperty(s,"CHAR_RATIO",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"BOLD_FACTOR",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"MIN_GAP",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"estimateLabelWidth",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"thinLabels",{enumerable:!0,get:function(){return U}});const $e=.62,z=1.05,N=6;function ie(R,L,f=!1){return String(R??"").length*L*$e*(f?z:1)}function U(R,L){const f=Number.isFinite(L.gap)?Number(L.gap):N,$=Number.isFinite(L.fontSize)?Number(L.fontSize):11,E=typeof L.measure=="function"?L.measure:S=>ie(S,$,!!L.bold),F=R.filter(S=>S&&Number.isFinite(S.at)).map(S=>({...S,width:E(String(S.text??""))})).sort((S,i)=>S.at-i.at);if(F.length<2)return{every:1,kept:F};const W=S=>{let i=null;for(let d=0;d<F.length;d+=S){const c=F[d];if(i&&c.at-i.at<i.width+f)return!1;i=c}return!0};let A=1;for(;A<F.length&&!W(A);)A++;const q=[];for(let S=0;S<F.length;S+=A)q.push(F[S]);return{every:A,kept:q}}}),Re("packages/modules/scheduler/ticklabels.js",function(s,te){"use strict";Object.defineProperty(s,"TICK_FONT_SIZE",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"TICK_INSET",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"labelWidth",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"resolveTickLabels",{enumerable:!0,get:function(){return R}});const z=te("packages/modules/shared/axislabels.js").thinLabels,N=11,ie=7;function U(L,f){const $=String(L??"");let E=0;for(const F of $)E+=F>="A"&&F<="Z"?1:.62;return E*f}function R(L,f,$){const E=$.px,F=$.startDay,W=$.endDay,A=Number.isFinite($.fontSize)&&$.fontSize>0?$.fontSize:N,q=L.map(c=>({day:c,at:(c-F)*E,label:""}));if(q.length===0)return q;let S=1/0;for(let c=1;c<q.length;c++){const k=q[c].at-q[c-1].at;k<S&&(S=k)}let i=null;for(const c of f){let k=0;for(const Q of L){const J=U(c.label(Q),A);J>k&&(k=J)}if(k<=S){i=c;break}}if(i)for(const c of q)c.label=i.label(c.day);else{const c=f[f.length-1],k=q.map(H=>({at:H.at,text:c.label(H.day)})),Q=z(k,{fontSize:A,measure:H=>U(H,A)}).kept,J=new Set(Q.map(H=>H.at));for(const H of q)H.label=J.has(H.at)?c.label(H.day):""}const d=(W-F)*E;for(let c=q.length-1;c>=0;c--){const k=q[c];if(k.label)if(k.at+ie+U(k.label,A)>d)k.label="";else break}return q}}),Re("packages/modules/scheduler/model.js",function(s,te){"use strict";Object.defineProperty(s,"GROUP_KEY_PREFIX",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"parseDate",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"accessorFor",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"dateToDay",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"eventSpan",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"addMinutes",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"defaultResourceColumns",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"resolveWorkload",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"resolveContext",{enumerable:!0,get:function(){return u}}),Object.defineProperty(s,"anchorDay",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"axisSpan",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"monthStartOf",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"monthEndOf",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"computeTicks",{enumerable:!0,get:function(){return v}}),Object.defineProperty(s,"assignLanes",{enumerable:!0,get:function(){return e}}),Object.defineProperty(s,"placeEvents",{enumerable:!0,get:function(){return n}}),Object.defineProperty(s,"colorFor",{enumerable:!0,get:function(){return o}}),Object.defineProperty(s,"resourceNonWorking",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"laneCount",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"eventText",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"searchableText",{enumerable:!0,get:function(){return a}}),Object.defineProperty(s,"visibleEvents",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"visibleResources",{enumerable:!0,get:function(){return re}}),Object.defineProperty(s,"buildDisplayRows",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(s,"snapToStep",{enumerable:!0,get:function(){return be}}),Object.defineProperty(s,"formatFieldDate",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(s,"formatFieldDateLike",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(s,"isEventReadOnly",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"isResourceReadOnly",{enumerable:!0,get:function(){return Ee}});const z=te("packages/core/src/internal/warn.js").warnOnce,ie=te("packages/core/src/internal/paths.js").getPath,U=te("packages/core/src/internal/predicates.js"),R=U.isFunction,L=U.isNil,f=U.isObject,$=te("packages/modules/gantt/time.js"),E=$.toDayNumber,F=$.fromDayNumber,A=te("packages/modules/gantt/calendar.js").createCalendar,q=te("packages/modules/gantt/week.js"),S=q.resolveWeekStartDay,i=q.weekStartOf,c=te("packages/modules/gantt/zoom.js").resolveZoomPreset,k=te("packages/modules/gantt/workload-groups.js"),Q=k.normalizeGroupBy,J=k.groupOfResource,se=te("packages/modules/scheduler/ticklabels.js").resolveTickLabels,fe=864e5,ke="sched:";function ge(M){if(M instanceof Date)return Number.isNaN(M.getTime())?null:M;if(typeof M=="number"&&Number.isFinite(M))return new Date(M);if(typeof M!="string")return null;const h=M.trim();if(!h)return null;let ae=/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})(?::(\d{2}))?$/.exec(h);if(ae){const t=new Date(+ae[1],+ae[2]-1,+ae[3],+ae[4],+ae[5],ae[6]?+ae[6]:0);return Number.isNaN(t.getTime())?null:t}if(ae=/^(\d{4})-(\d{2})-(\d{2})$/.exec(h),ae){const t=new Date(+ae[1],+ae[2]-1,+ae[3]);return Number.isNaN(t.getTime())?null:t}const ye=new Date(h);return Number.isNaN(ye.getTime())?null:ye}function ue(M){return R(M)?M:typeof M=="string"?h=>ie(h,M):()=>{}}function X(M){const h=E(M),ae=((M.getHours()*60+M.getMinutes())*60+M.getSeconds())/86400;return{day:h??0,frac:ae}}function ee(M,h){const ae=ue(M.fields.startDate)(h),ye=ge(ae);if(!ye)return{start:null,end:null};const t=X(ye);let T;const I=ue(M.fields.endDate)(h),m=ge(I);return m?T=X(m):T=x(t,M.defaultDuration),(T.day<t.day||T.day===t.day&&T.frac<t.frac)&&(T=x(t,M.defaultDuration)),{start:t,end:T}}function x(M,h){const ae=M.day*1440+Math.round(M.frac*1440)+h;return{day:Math.floor(ae/1440),frac:ae%1440/1440}}function K(){return[{id:"name",field:"name",title:"Name",layout:{width:160}},{id:"role",field:"role",title:"Role",layout:{width:120}},{id:"capacity",field:"capacity",title:"Capacity",type:"number",layout:{width:90}}]}function Y(M){if(M===!0)return{hoursPerDay:8,defaultCapacity:1,decimals:1};if(M&&typeof M=="object"&&!Array.isArray(M)){const h=(ye,t)=>typeof ye=="number"&&Number.isFinite(ye)&&ye>0?ye:t,ae=typeof M.decimals=="number"&&Number.isFinite(M.decimals)&&M.decimals>=0?Math.round(M.decimals):1;return{hoursPerDay:h(M.hoursPerDay,8),defaultCapacity:h(M.defaultCapacity,1),decimals:ae}}return null}function u(M){const h=f(M)?M:{},ae=f(h.fields)?h.fields:{};return{resources:Array.isArray(h.resources)?h.resources:[],events:Array.isArray(h.events)?h.events:[],createGrid:R(h.createGrid)?h.createGrid:null,fields:{resourceId:typeof ae.resourceId=="string"?ae.resourceId:"resourceId",startDate:typeof ae.startDate=="string"?ae.startDate:"startDate",endDate:typeof ae.endDate=="string"?ae.endDate:"endDate",name:typeof ae.name=="string"?ae.name:"name",calendar:typeof ae.calendar=="string"?ae.calendar:"calendar"},resourceKey:typeof h.resourceKey=="string"?h.resourceKey:"id",eventKey:typeof h.eventKey=="string"?h.eventKey:"id",columns:Array.isArray(h.columns)&&h.columns.length?h.columns:K(),zoom:c(h.zoom==="fit"?"day":h.zoom,"day"),fit:h.zoom==="fit",zoomName:typeof h.zoom=="string"?h.zoom:"day",anchor:ge(h.date)||ge(h.startDate)||null,defaultDuration:typeof h.defaultDuration=="number"&&h.defaultDuration>0?h.defaultDuration:60,rowHeight:typeof h.rowHeight=="number"&&h.rowHeight>0?h.rowHeight:34,resourceWidth:typeof h.resourceWidth=="number"&&Number.isFinite(h.resourceWidth)&&h.resourceWidth>0?h.resourceWidth:300,locale:typeof h.locale=="string"?h.locale:void 0,timeZone:typeof h.timeZone=="string"?h.timeZone:void 0,weekStartDay:S(h.weekStartDay,typeof h.locale=="string"?h.locale:void 0),todayLine:h.todayLine!==!1,pinchZoom:h.pinchZoom!==!1,nonWorking:h.nonWorking!==!1,calendars:f(h.calendars)?h.calendars:null,workload:Y(h.workload),ariaLabel:typeof h.ariaLabel=="string"?h.ariaLabel:"",messages:f(h.messages)?h.messages:null,labels:f(h.labels)?h.labels:{},overscan:typeof h.overscan=="number"&&h.overscan>=0?h.overscan:5,colorProperty:typeof h.colorProperty=="string"?h.colorProperty:null,colorMap:f(h.colorMap)?h.colorMap:null,groupBy:Q(h.groupBy),search:typeof h.search=="string"?h.search.trim():"",resourceFilter:R(h.resourceFilter)?h.resourceFilter:null,eventFilter:R(h.eventFilter)?h.eventFilter:null,editable:h.editable!==!1,readOnlyWhen:R(h.readOnlyWhen)?h.readOnlyWhen:null,resourceReadOnlyWhen:R(h.resourceReadOnlyWhen)?h.resourceReadOnlyWhen:null}}function j(M){if(M.anchor)return E(M.anchor);let h=null;for(const ae of M.events){const ye=ge(ue(M.fields.startDate)(ae));if(ye){const t=E(ye);(h==null||t<h)&&(h=t)}}return h??E(new Date)}function B(M,h){let ae=h,ye=h+1;for(const I of M.events){const m=ee(M,I);m.start&&(m.start.day<ae&&(ae=m.start.day),m.end.day>ye&&(ye=m.end.day))}const t=i(ae,M.weekStartDay);let T=ye+1;return M.zoom.level==="month"||M.zoom.level==="quarter"?{startDay:Z(t),endDay:le(T)}:(T-t<14&&(T=t+14),{startDay:t,endDay:T})}function Z(M){const h=F(M);return Math.floor(Date.UTC(h.getUTCFullYear(),h.getUTCMonth(),1)/fe)}function le(M){const h=F(M);return Math.floor(Date.UTC(h.getUTCFullYear(),h.getUTCMonth()+1,1)/fe)}function v(M,h,ae){const ye=M.zoom.level,t=M.zoom.px,T=M.locale||void 0,I=M.timeZone||"UTC",m=O=>new Date(Math.round(O)*fe),b=O=>new Intl.DateTimeFormat(T,{...O,timeZone:I}),g=(O,oe)=>b(oe).format(m(O)),D=[];let V;if(ye==="hour"){for(let O=h;O<ae;O+=1/24)D.push(O);V=[{name:"hour-minute",label:O=>b({hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(O*fe))},{name:"hour",label:O=>b({hour:"2-digit",hour12:!1}).format(new Date(O*fe))}]}else if(ye==="day"){for(let O=h;O<ae;O+=1)D.push(O);V=[{name:"weekday-day",label:O=>g(O,{weekday:"short",day:"numeric"})},{name:"weekday",label:O=>g(O,{weekday:"short"})},{name:"weekday-narrow",label:O=>g(O,{weekday:"narrow"})}]}else if(ye==="week"){for(let O=i(h,M.weekStartDay);O<ae;O+=7)D.push(O);V=[{name:"month-day",label:O=>g(O,{month:"short",day:"numeric"})},{name:"day",label:O=>g(O,{day:"numeric"})}]}else{const O=ye==="quarter"?3:1;let oe=Z(h);for(;oe<ae;){D.push(oe);const de=m(oe);oe=Math.floor(Date.UTC(de.getUTCFullYear(),de.getUTCMonth()+O,1)/fe)}ye==="quarter"?V=[{name:"quarter",label:de=>m(de).getUTCMonth()===0?g(de,{month:"short",year:"numeric"}):g(de,{month:"short"})},{name:"month",label:de=>g(de,{month:"short"})}]:V=[{name:"month-year",label:de=>g(de,{month:"short",year:"numeric"})},{name:"month",label:de=>g(de,{month:"short"})}]}return se(D,V,{px:t,startDay:h,endDay:ae})}function e(M){M.sort((ae,ye)=>ae.startDay-ye.startDay||ye.endDay-ye.startDay-(ae.endDay-ae.startDay)||(String(ae.key)<String(ye.key)?-1:String(ae.key)>String(ye.key)?1:0));const h=[];for(const ae of M){const ye=h[h.length-1];ye&&ae.startDay<ye.endDay?(ye.items.push(ae),ae.endDay>ye.endDay&&(ye.endDay=ae.endDay)):h.push({items:[ae],endDay:ae.endDay})}for(const ae of h){const ye=[];for(const t of ae.items){let T=0;for(;T<ye.length&&ye[T]>t.startDay;)T++;t.lane=T,T===ye.length?ye.push(t.endDay):ye[T]=t.endDay}for(const t of ae.items)t.lanes=ye.length}return M}function n(M,h=M.events){const ae=ue(M.fields.resourceId),ye=ue(M.eventKey),t=ue(M.fields.name),T=new Map,I=[],m=new Map;let b=!1;for(const g of h){const D=ye(g),V=ae(g),O=ee(M,g);if(!O.start){I.push({key:D,row:g}),b||(b=!0,z("scheduler:unparsable-start",`scheduler: an event's "${M.fields.startDate}" is empty or unparsable, so it is not shown; count it in \`unscheduled\`.`));continue}const oe={key:D,row:g,resourceKey:V,name:t(g),startDay:O.start.day+O.start.frac,endDay:O.end.day+O.end.frac,lane:0,lanes:1,color:o(M,g)};T.has(V)||T.set(V,[]),T.get(V).push(oe),m.set(D,oe)}for(const[,g]of T)e(g);return{byResource:T,unscheduled:I,keys:m}}function o(M,h){const ae=M.colorProperty;if(!ae)return null;const ye=ue(ae)(h);return L(ye)?null:M.colorMap&&f(M.colorMap)&&typeof M.colorMap[String(ye)]=="string"?M.colorMap[String(ye)]:typeof ye=="string"&&/^(#|rgb|hsl|oklch|var\()/.test(ye.trim())?ye.trim():null}function p(M,h){const ae=ue(M.fields.calendar)(h);let ye=ae;if(typeof ae=="string"&&M.calendars&&Object.prototype.hasOwnProperty.call(M.calendars,ae)&&(ye=M.calendars[ae]),ye==null)return null;const t=A(ye,0);return t?T=>!t.isWorking(Math.round(T)):null}function l(M){let h=1;for(const ae of M)ae.lanes>h&&(h=ae.lanes);return h}function _(M,h,ae){const ye=ue(M.fields.name)(h);return L(ye)?String(ae):String(ye)}function a(M){return M==null?"":typeof M!="object"?String(M):Object.keys(M).filter(h=>M[h]!=null&&(typeof M[h]=="string"||typeof M[h]=="number")).map(h=>String(M[h])).join(" ")}function y(M,h){return h===""||String(M||"").toLocaleLowerCase().includes(h)}function w(M,h){try{return M(h)!==!1}catch{return!0}}function P(M){return(M.search||"").trim().toLocaleLowerCase()}function G(M){const h=P(M);return M.events.filter(ae=>M.eventFilter&&!w(M.eventFilter,ae)?!1:y(a(ae),h))}function re(M){const h=P(M),ae=ue(M.resourceKey),ye=ue(M.fields.resourceId);return M.resources.filter(t=>{if(M.resourceFilter&&!w(M.resourceFilter,t))return!1;if(!h||y(a(t),h))return!0;const T=ae(t);return M.events.some(I=>ye(I)===T&&y(a(I),h))})}function Se(M,h,ae,ye){const t=[];if(!h){for(const m of M)t.push({type:"resource",resource:m});return t}const T=new Map,I=[];for(const m of M){const b=J(h,m);T.has(b)||(T.set(b,[]),I.push(b)),T.get(b).push(m)}I.sort((m,b)=>m==null?b==null?0:1:b==null?-1:m.localeCompare(b,void 0,{numeric:!0,sensitivity:"base"}));for(const m of I){const b=m==null?ye||"Ungrouped":String(m);if(t.push({type:"group",key:`${ke}${m??""}`,value:m,label:b,expanded:!ae.has(m)}),!ae.has(m))for(const g of T.get(m))t.push({type:"resource",resource:g})}return t}function be(M,h){return!Number.isFinite(M)||M<=0?h:Math.round(h/M)*M}function Oe(M){if(!Number.isFinite(M))return null;const h=F(Math.floor(M));if(!h)return null;const ae=Math.round((M-Math.floor(M))*1440),ye=Math.floor(ae/60),t=ae%60,T=I=>String(I).padStart(2,"0");return`${h.getUTCFullYear()}-${T(h.getUTCMonth()+1)}-${T(h.getUTCDate())} ${T(ye)}:${T(t)}`}function Ae(M,h){const ae=Oe(h);return ae&&typeof M=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(M)?ae.slice(0,10):ae}function me(M,h){if(!h)return!1;if(h.readOnly===!0)return!0;if(R(M.readOnlyWhen))try{return!!M.readOnlyWhen(h)}catch{return!1}return!1}function Ee(M,h){if(!h)return!1;if(h.readOnly===!0)return!0;if(R(M.resourceReadOnlyWhen))try{return!!M.resourceReadOnlyWhen(h)}catch{return!1}return!1}}),Re("packages/modules/shared/emitter.js",function(s,te){"use strict";Object.defineProperty(s,"WILDCARD",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"Emitter",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"gate",{enumerable:!0,get:function(){return $}});const z=te("packages/core/src/internal/predicates.js").isFunction,ie=te("packages/core/src/internal/warn.js").warnOnce,U="*",R=new Set(["api","user","init","ai"]);function L(E,F){return E&&E.name?E.name:`#${F}`}class f{#e=new Map;#t;constructor(F="module"){this.#t=String(F)}on(F,W){if(!z(W))return()=>{};let A=this.#e.get(F);return A||(A=new Set,this.#e.set(F,A)),A.add(W),()=>this.off(F,W)}off(F,W){const A=this.#e.get(F);A&&A.delete(W)}count(F){const W=this.#e.get(F);return W?W.size:0}emit(F,W){const A=this.#e.get(F),q=this.#e.get(U);if((!A||A.size===0)&&(!q||q.size===0))return;const S={...W||null,type:F};A&&A.size&&this.#n([...A],S,F),q&&q.size&&this.#n([...q],S,U)}#n(F,W,A){for(let q=0;q<F.length;q++)try{F[q](W)}catch(S){ie(`${this.#t}.emit.throw:${A}:${L(F[q],q)}`,`${this.#t}: a '${A}' handler threw; other handlers were unaffected.`,S)}}emitBefore(F,W,A){const q=A??(W&&W.origin),S=R.has(q)?q:"user";let i=!1,d=null;const c=fe=>{i=!0,fe!=null&&d===null&&(d=String(fe))},k={...W||null,type:F,origin:S,get defaultPrevented(){return i},get reason(){return d},preventDefault(fe){c(fe)}},Q=this.#e.get(F);if(!Q||Q.size===0)return!0;const J=[...Q],H=()=>(i&&d===null&&(d="prevented"),i&&W&&typeof W=="object"&&(W.reason=d),!i),se=[];for(let fe=0;fe<J.length;fe++){const ke=J[fe];try{const ge=ke(k);ge&&z(ge.then)?se.push(ge):ge===!1&&c("prevented")}catch(ge){c("error"),ie(`${this.#t}.beforeThrow:${F}:${L(ke,fe)}`,`${this.#t}: a '${F}' before-handler threw; the action was cancelled.`,ge)}}return se.length===0?H():Promise.allSettled(se).then(fe=>{for(const ke of fe)ke.status==="rejected"?(c("error"),ie(`${this.#t}.beforeReject:${F}`,`${this.#t}: a '${F}' before-handler rejected; the action was cancelled.`,ke.reason)):ke.value===!1&&c("prevented");return H()})}clear(){this.#e.clear()}}function $(E,F,W,A,q){const S=E.emitBefore(F,A,A.origin),i=()=>(E.emit(W,{...A,reason:A.reason||"prevented"}),!1);return S===!1?i():S&&z(S.then)?S.then(d=>d?q():i()):q()}}),Re("packages/modules/charts/svg.js",function(s,te){"use strict";Object.defineProperty(s,"SVG_NS",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"el",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"svg",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"attr",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"attrs",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"setText",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"clear",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"append",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"path",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"ribbonPath",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"round",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"pathRings",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"insideRings",{enumerable:!0,get:function(){return q}});const $e="http://www.w3.org/2000/svg";function z(S){const i=S.indexOf(")");return i<0?S:S.slice(i+1).trim()||"#0072b2"}function N(S,i,d){const c=S.createElement(i);return d&&c.setAttribute("class",d),c}function ie(S,i,d){const c=S.createElementNS($e,i);if(d)for(const k of Object.keys(d))c.setAttribute(k,String(d[k]));return c}function U(S,i,d){if(!S)return;if(d==null){S.removeAttribute(i);return}let c=String(d);c.startsWith("url(#")&&(i==="stroke"||i==="fill"&&S.localName==="text")&&(c=z(c)),S.setAttribute(i,c)}function R(S,i){if(S)for(const d of Object.keys(i))U(S,d,i[d])}function L(S,i){S&&(S.textContent=i==null?"":String(i))}function f(S){if(S)for(;S.firstChild;)S.removeChild(S.firstChild)}function $(S,i){for(const d of i)d&&S.appendChild(d);return S}function E(S){return S.join(" ")}function F(S){if(!S||S.length<2)return"";const i=["M",S[0].x,S[0].upper];for(let d=1;d<S.length;d++)i.push("L",S[d].x,S[d].upper);for(let d=S.length-1;d>=0;d--)i.push("L",S[d].x,S[d].lower);return i.push("Z"),E(i)}function W(S){return Math.round(S*100)/100}function A(S){const i=[];let d=[];const c=String(S||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let k="",Q=[];const J=()=>{if(!k||!Q.length){Q=[];return}if(k==="M"||k==="L")for(let H=0;H+1<Q.length;H+=2)d.push([Q[H],Q[H+1]]);else k!=="Z"&&Q.length>=2&&d.push([Q[Q.length-2],Q[Q.length-1]]);Q=[]};for(const H of c){if(/[A-Za-z]/.test(H)){if(J(),H==="Z"||H==="z"){d.length>2&&i.push(d),d=[],k="";continue}H==="M"&&d.length>2&&(i.push(d),d=[]),k=H;continue}Q.push(Number(H))}return J(),d.length>2&&i.push(d),i}function q(S,i,d){let c=!1;for(const k of S)for(let Q=0,J=k.length-1;Q<k.length;J=Q++){const[H,se]=k[Q],[fe,ke]=k[J];se>d!=ke>d&&i<(fe-H)*(d-se)/(ke-se||1e-12)+H&&(c=!c)}return c}}),Re("packages/modules/gantt/assignments.js",function(s,te){"use strict";Object.defineProperty(s,"parseAssignments",{enumerable:!0,get:function(){return z}});function $e(N){if(N==null||N==="")return null;const ie=typeof N=="number"?N:Number(N);return Number.isFinite(ie)?ie:null}function z(N){if(N&&Array.isArray(N.assignments))return N.assignments.map(R=>{const L=R&&(R.resource??R.name??R.id);if(L==null||L==="")return null;const f=$e(R.units)??$e(R.allocation)??1;return{resource:String(L),units:f}}).filter(Boolean);const ie=N?N.assignee??N.assignees??N.owner:null;return(Array.isArray(ie)?ie:ie==null||ie===""?[]:[ie]).map(R=>String(R)).filter(R=>R!=="").map(R=>({resource:R,units:1}))}}),Re("packages/modules/gantt/task-calendars.js",function(s,te){"use strict";Object.defineProperty(s,"PLAN_CALENDAR_ID",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"parseHolidayDays",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"planWorkingTime",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"normalizeCalendarSpec",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"resolveCalendars",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"PLAIN_TIME",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"createTimeModel",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"workingRuns",{enumerable:!0,get:function(){return q}});const z=te("packages/modules/gantt/calendar.js").createCalendar,ie=te("packages/modules/gantt/time.js").toDayNumber,U="plan",R=Object.freeze([0,1,2,3,4,5,6]),L=Object.freeze([1,2,3,4,5]);function f(S){const i=new Set;for(const d of Array.isArray(S)?S:[]){if(d&&typeof d=="object"&&!(d instanceof Date)&&("from"in d||"to"in d)){const k=ie(d.from),Q=ie(d.to??d.from);if(k==null)continue;const J=Q??k;for(let H=Math.min(k,J);H<=Math.max(k,J);H+=1)i.add(H);continue}const c=ie(d);c!=null&&i.add(c)}return[...i].sort((d,c)=>d-c)}function $(S){return S==null?{workdays:[...R],holidays:[],hoursPerDay:null}:S==="weekends"?{workdays:[...L],holidays:[],hoursPerDay:null}:{workdays:Array.isArray(S.workdays)&&S.workdays.length?S.workdays.map(Number).filter(d=>d>=0&&d<=6):[...L],holidays:f(S.holidays),hoursPerDay:null}}function E(S,i){let d,c,k=null;if(S==="weekends")d=[...L],c=[];else if(S&&typeof S=="object"&&!Array.isArray(S)&&!(S instanceof Date)){const J=S,H=J.workdays??J.workingDays;d=Array.isArray(H)&&H.length?H.map(Number).filter(fe=>fe>=0&&fe<=6):i.workdays;const se=J.holidays??J.exceptions;c=Array.isArray(se)?f(se):i.holidays,J.hoursPerDay!=null&&(k=J.hoursPerDay)}else return null;const Q=[...new Set(d)].sort((J,H)=>J-H);return{workdays:Q,holidays:c,hoursPerDay:k,key:`${Q.join(",")}|${c.join(",")}`}}function F(S){const i=$(S.calendar),d=Number.isFinite(S.projectStart)?S.projectStart:0,c=E({workdays:i.workdays,holidays:i.holidays},i).key,k=new Map,Q=[],J=new Map;for(const[ue,X]of Object.entries(S.calendars&&typeof S.calendars=="object"?S.calendars:{})){const ee=E(X,i);ee&&J.set(ue,ee)}const H=(ue,X)=>{if(!k.has(ue)){const ee=z({workdays:X.workdays,holidays:X.holidays},d);k.set(ue,{id:ue,workdays:X.workdays,holidays:X.holidays,hoursPerDay:X.hoursPerDay,calendar:ee,isWorking:ee?x=>ee.isWorking(x):()=>!0,key:X.key})}return k.get(ue)};H(U,{...i,key:c});const se=(ue,X,ee)=>{if(ue==null||ue==="")return U;if(typeof ue=="string"&&J.has(ue))return H(ue,J.get(ue)).id;const x=ue==="weekends"||ue&&typeof ue=="object"?E(ue,i):null;if(x){const Y=ue==="weekends"?"weekends":`${ee}:${X}`;return H(Y,x).id}const K=typeof ue=="string"?ue:JSON.stringify(ue);return Q.push({code:"unknown-calendar",message:`${ee} "${X}" names unknown calendar "${K}"`,id:X,calendar:K,owner:ee}),null},fe=new Map;let ke=!1;for(const ue of S.tasks||[]){const X=se(ue.calendar,ue.id,"task");X!=null&&(fe.set(ue.id,X),k.get(X).key!==c&&(ke=!0))}const ge=new Map;for(const ue of S.resources||[]){const X=se(ue.calendar,ue.id,"resource");if(X==null||X===U)continue;const ee=k.get(X);ge.set(ue.id,{workingDays:ee.workdays,holidays:ee.holidays,...ee.hoursPerDay!=null?{hoursPerDay:ee.hoursPerDay}:null})}return{errors:Q,customised:ke,models:k,ofTask:fe,resourceSpec:ge}}const W=Object.freeze({custom:!1,norm:(S,i)=>i,fin:(S,i,d)=>i+d,back:(S,i,d)=>i-d,shift:(S,i,d)=>i+d,unshift:(S,i,d)=>i-d,between:(S,i,d)=>i-d});function A(S){return{custom:!0,norm:(i,d)=>{const c=S(i);return c?c.nextWorking(d):d},fin:(i,d,c)=>{const k=S(i);return k?k.dayOf(k.indexOf(d)+c):d+c},back:(i,d,c)=>{const k=S(i);return k?k.dayOf(k.indexOf(d)-c):d-c},shift:(i,d,c)=>{const k=S(i);return k?k.dayOf(k.indexOf(d)+c):d+c},unshift:(i,d,c)=>{const k=S(i);return k?k.dayOf(k.indexOf(d)-c):d-c},between:(i,d,c)=>{const k=S(i);return k?k.indexOf(d)-k.indexOf(c):d-c}}}function q(S,i,d){const c=[];let k=null;for(let Q=Math.round(S);Q<Math.round(i);Q+=1)d(Q)?k==null&&(k=Q):k!=null&&(c.push([k,Q]),k=null);return k!=null&&c.push([k,Math.round(i)]),c}}),Re("packages/modules/gantt/unscheduled.js",function(s,te){"use strict";Object.defineProperty(s,"UNSCHEDULED_DEFAULT_DURATION",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"isUnscheduled",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"findUnscheduled",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"activeEdges",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"unscheduledRecord",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"completeUnscheduledPatch",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"unscheduledMarker",{enumerable:!0,get:function(){return L}});const $e=1;function z(f){return!!(f&&f.unscheduled===!0)}function N(f,$,E){const F=new Set;for(const W of f)!E.isSummary(W)&&$.get(W).duration==null&&F.add(W);if(!F.size)return F;for(const W of f)E.isSummary(W)&&E.descendantLeaves(W).every(A=>F.has(A))&&F.add(W);return F}function ie(f,$){return $.size?f.filter(E=>!$.has(E.from)&&!$.has(E.to)):f}function U(f,$){return{id:f.id,name:f.name,duration:null,es:null,ef:null,ls:null,lf:null,totalFloat:null,critical:!1,percentComplete:$?null:f.percentComplete,parent:f.parent,isSummary:$,isMilestone:!1,locked:$?!1:!!f.locked,unscheduled:!0,children:[]}}function R(f,$){if(!z($)||$.isSummary||f.duration!==void 0)return f;const E=f.start!=null&&f.start!=="",F=f.end!=null&&f.end!=="";if(!E&&!F)return f;const W={...f,duration:$e};if(!E){const A=Number(f.end);Number.isFinite(A)&&(W.start=A-$e)}return W}function L(f,$,E){const F=f.createElement("span");return F.setAttribute("class",`${$}__unscheduled`),F.textContent=E("gantt.unscheduled"),F}}),Re("packages/modules/gantt/inactive.js",function(s,te){"use strict";Object.defineProperty(s,"bridgeInactive",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"inactiveRecord",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"inactiveMarker",{enumerable:!0,get:function(){return R}});const $e=Object.freeze({FS:"es",SS:"es",FF:"ef",SF:"ef"}),z=Object.freeze({FS:"ef",SS:"es",FF:"ef",SF:"es"});function N(L,f){const $=L.lag+f.lag,E=z[L.type],F=$e[f.type];let W;return E==="ef"&&F==="es"?W="FS":E==="ef"&&F==="ef"?W="FF":E==="es"&&F==="es"?W="SS":W="SF",{from:L.from,to:f.to,type:W,lag:$}}function ie(L,f){if(!f.size)return L;let $=L;for(const E of f){if(!$.some(i=>i.from===E||i.to===E))continue;const W=$.filter(i=>i.to===E),A=$.filter(i=>i.from===E),q=$.filter(i=>i.from!==E&&i.to!==E),S=[];for(const i of W)for(const d of A)i.from!==d.to&&S.push(N(i,d));$=q.concat(S)}return $}function U(L){const f=L.earliestStart??null,$=L.duration??null,E=f!=null&&$!=null?f+$:null;return{id:L.id,name:L.name,duration:$,es:f,ef:E,ls:f,lf:E,totalFloat:null,critical:!1,percentComplete:L.percentComplete,parent:L.parent,isSummary:!1,isMilestone:$===0,locked:!!L.locked,inactive:!0,children:[],colour:L.colour??null}}function R(L,f,$){const E=L.createElement("span");return E.setAttribute("class",`${f}__inactive-marker`),E.textContent=$("gantt.inactive"),E}}),Re("packages/modules/gantt/schedule.js",function(s,te){"use strict";Object.defineProperty(s,"LINK_TYPES",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(s,"CONSTRAINT_TYPES",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"resolveConstraintCode",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"SCHEDULING_MODES",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"resolveSchedulingMode",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"effortRate",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"recomputeEffort",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"reconcileEffort",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"EPS",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"SCHEDULE_ERROR",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"TASK_FIELDS",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"taskIdReader",{enumerable:!0,get:function(){return v}}),Object.defineProperty(s,"taskFieldWriters",{enumerable:!0,get:function(){return e}}),Object.defineProperty(s,"isTaskLocked",{enumerable:!0,get:function(){return o}}),Object.defineProperty(s,"normalizeTasks",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"buildTree",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"normalizeLinkSpec",{enumerable:!0,get:function(){return a}}),Object.defineProperty(s,"normalizeDependencies",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"expandDependencies",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"topoOrder",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"wouldCreateCycle",{enumerable:!0,get:function(){return be}}),Object.defineProperty(s,"computeSchedule",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(s,"findViolations",{enumerable:!0,get:function(){return ye}});const z=te("packages/core/src/internal/warn.js").warnOnce,ie=te("packages/modules/gantt/calendar.js").createCalendar,U=te("packages/modules/gantt/task-calendars.js"),R=U.PLAIN_TIME,L=U.createTimeModel,f=U.resolveCalendars,E=te("packages/modules/gantt/assignments.js").parseAssignments,W=te("packages/modules/gantt/time.js").toDayNumber,A=te("packages/modules/gantt/unscheduled.js"),q=A.activeEdges,S=A.findUnscheduled,i=A.unscheduledRecord,d=te("packages/modules/gantt/inactive.js"),c=d.bridgeInactive,k=d.inactiveRecord,Q=["FS","SS","FF","SF"],J=["ASAP","MSO","MFO","ALAP","SNET","SNLT","FNET","FNLT"],H=Object.freeze({asap:"ASAP","as-soon-as-possible":"ASAP",assoonaspossible:"ASAP",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",snet:"SNET","start-no-earlier-than":"SNET",startnoearlierthan:"SNET",snlt:"SNLT","start-no-later-than":"SNLT",startnolaterthan:"SNLT",fnet:"FNET","finish-no-earlier-than":"FNET",finishnoearlierthan:"FNET",fnlt:"FNLT","finish-no-later-than":"FNLT",finishnolaterthan:"FNLT"});function se(t){if(t==null||t===""||typeof t=="object"&&!Array.isArray(t)&&!(t instanceof Date)&&(t=t.type??t.constraint??t.code??null,t==null||t===""))return null;const T=String(t).toLowerCase().replace(/\s+/g,"-");return H[T]??(J.includes(String(t).toUpperCase())?String(t).toUpperCase():null)}const fe=["fixedDuration","fixedEffort","fixedUnits"],ke=Object.freeze({fixedduration:"fixedDuration","fixed-duration":"fixedDuration",duration:"fixedDuration",fixedeffort:"fixedEffort","fixed-effort":"fixedEffort",effort:"fixedEffort",work:"fixedEffort",fixedwork:"fixedEffort",fixedunits:"fixedUnits","fixed-units":"fixedUnits",units:"fixedUnits"});function ge(t){if(t==null||t==="")return null;const T=String(t).toLowerCase().replace(/\s+/g,"-");if(ke[T])return ke[T];const I=T.replace(/-/g,"");return ke[I]??null}const ue=8;function X(t,T){const I=T.hoursPerDay,m=T.resourceHours instanceof Map?T.resourceHours:new Map;if(!t||t.length===0)return{rate:I,units:1};let b=0,g=0;for(const D of t){const V=m.has(D.resource)?m.get(D.resource):I;b+=D.units*V,g+=D.units}return{rate:b,units:g}}function ee(t,T){const I=t.schedulingMode||T.defaultMode||"fixedDuration",m=t.effortDriven!=null?!!t.effortDriven:!!T.defaultEffortDriven,{rate:b,units:g}=X(t.assignments,T),D=t.duration,V=t.statedEffort;let O=D,oe=V??(D!=null?D*b:null);return I==="fixedEffort"?V!=null&&b>0?O=V/b:oe=D!=null?D*b:null:I==="fixedUnits"?D!=null?(O=D,oe=D*b):V!=null&&b>0&&(O=V/b,oe=V):O=D,{duration:O,effort:oe,units:g,schedulingMode:I,effortDriven:m}}function x(t,T){const I=ge(t.mode)||t.mode||"fixedDuration",m=!!t.effortDriven,b=t.hoursPerDay>0?t.hoursPerDay:ue;let g=t.duration,D=t.units;const V=g*D*b,O=T.field,oe=T.units!=null?T.units:1;if(O==="duration")g=T.value,I==="fixedEffort"&&(D=g>0?V/(g*b):D);else if(O==="effort"){const de=T.value;I==="fixedDuration"?D=g>0?de/(g*b):D:g=D>0?de/(D*b):g}else if(O==="units")D=T.value,I!=="fixedDuration"&&(g=D>0?V/(D*b):g);else if(O==="addResource"||O==="removeResource"){const de=O==="addResource"?oe:-oe;I==="fixedDuration"?m||(D=D+de):(D=D+de,g=D>0?V/(D*b):g)}return{duration:g,units:D,effort:g*D*b}}const K=1e-9,Y={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",UNKNOWN_CALENDAR:"unknown-calendar"};function u(t){if(t==null||t==="")return null;const T=typeof t=="number"?t:Number(t);return Number.isFinite(T)?T:null}function j(t){if(!t)return null;const T=u(t.effort)??(Array.isArray(t.work)?null:u(t.work))??u(t.hours);if(T!=null)return T;if(Array.isArray(t.work)){let I=0,m=!1;for(const b of t.work){const g=u(b&&b.hours);g!=null&&(I+=g,m=!0)}return m?I:null}return null}function B(t){return t==null||t===""?null:W(t)}const Z=Object.freeze(["id","name","start","end","duration","milestone","percentComplete","parent","baselineStart","baselineEnd","constraint","constraintDate","deadline"]);function le(t){const T=t&&typeof t=="object"?t:{},I={};for(const m of Z){const b=T[m];if(typeof b=="function")I[m]=b;else if(typeof b=="string"&&b!==""){const g=b;I[m]=D=>D[g]}else I[m]=g=>g[m]}return I}function v(t){return le(t).id}function e(t){const T=t&&typeof t=="object"?t:{},I={};for(const m of Z){const b=T[m];typeof b=="string"&&b!==""?I[m]=b:typeof b=="function"?I[m]=null:I[m]=m}return I}function n(t,T){const I=T.constraint(t);let m=I??(t&&t.constraintType),b=null;if(m&&typeof m=="object"&&!Array.isArray(m)&&!(m instanceof Date)&&(b=m.date??m.at??m.constraintDate??null,m=m.type??m.constraint??m.code??null),m==null||m==="")return null;const g=se(m);if(!g)return null;const D=B(b??T.constraintDate(t)??t.constraintAt??t.at);return{type:g,at:D}}function o(t,T){if(!t)return!1;if(t.locked===!0||typeof t.constraintMode=="string"&&t.constraintMode.toLowerCase()==="hard")return!0;if(typeof T=="function")try{return!!T(t)}catch{return!1}return!1}function p(t,T,I){const m=new Map,b=[],g=le(T);if(!Array.isArray(t))return{ok:!1,error:{code:Y.BAD_DURATION,message:"tasks must be an array"},order:b,byId:m};for(const D of t){const V=D?g.id(D):null,O=V!=null?String(V):null;if(O==null)return{ok:!1,error:{code:Y.UNKNOWN_TASK,message:"every task needs an id"},order:b,byId:m};if(m.has(O))return{ok:!1,error:{code:Y.DUPLICATE_ID,message:`duplicate task id "${O}"`,id:O},order:b,byId:m};const oe=B(g.start(D)),de=B(g.end(D)),De=g.milestone(D)===!0;let ve=De?0:u(g.duration(D));if(ve==null&&oe!=null&&de!=null&&(ve=de-oe),ve!=null&&ve<0)return{ok:!1,error:{code:Y.BAD_DURATION,message:`task "${O}" has negative duration ${ve}`,id:O},order:b,byId:m};const Pe=g.name(D),Ne=g.parent(D),_e=D.colour??D.color;m.set(O,{id:O,name:Pe!=null?String(Pe):O,colour:typeof _e=="string"&&_e.trim()!==""?_e.trim():null,duration:ve,milestoneFlag:De,earliestStart:oe,placedStart:oe,placedEnd:de,percentComplete:u(g.percentComplete(D)),parent:Ne!=null?String(Ne):null,constraint:n(D,g),locked:o(D,I),inactive:D.inactive===!0,baselineStart:B(g.baselineStart(D)??(D.baseline&&D.baseline.start)),baselineEnd:B(g.baselineEnd(D)??(D.baseline&&D.baseline.end)),deadline:B(g.deadline(D)),schedulingMode:ge(D.schedulingMode??D.taskType),effortDriven:D.effortDriven==null?null:!!D.effortDriven,statedEffort:j(D),assignments:E(D)}),b.push(O)}return{ok:!0,order:b,byId:m}}function l(t,T){const I=new Map(t.map(V=>[V,[]]));for(const V of t){const O=T.get(V).parent;if(O!=null){if(!T.has(O))return{ok:!1,error:{code:Y.UNKNOWN_PARENT,message:`task "${V}" names unknown parent "${O}"`,id:V}};I.get(O).push(V)}}for(const V of t){const O=new Set;let oe=T.get(V).parent;for(;oe!=null;){if(oe===V||O.has(oe))return{ok:!1,error:{code:Y.PARENT_CYCLE,message:`parent cycle at "${V}"`,id:V}};O.add(oe),oe=T.get(oe)?.parent??null}}const m=V=>I.get(V).length>0,b=new Map,g=V=>{if(b.has(V))return b.get(V);const O=I.get(V),oe=O.length===0?[V]:O.flatMap(de=>g(de));return b.set(V,oe),oe};return{ok:!0,children:I,isSummary:m,descendantLeaves:g,ancestors:V=>{const O=new Set;let oe=T.get(V).parent;for(;oe!=null;)O.add(oe),oe=T.get(oe).parent;return O}}}const _=/^\s*(FS|SS|FF|SF)\s*(?:([+-])\s*(\d+(?:\.\d+)?))?\s*$/i;function a(t){const T={...t||null};if(typeof T.type!="string")return T;const I=_.exec(T.type);if(!I||!I[2])return T;const m=(I[2]==="-"?-1:1)*Number(I[3]);T.type=I[1].toUpperCase();const b=u(t.lag);return b!=null&&b!==m?(z(`gantt-link-shorthand-${String(t.type)}-${b}`,`[lattice] gantt: dependency type ${JSON.stringify(t.type)} carries a lag of ${m} but lag: ${b} was also given; the explicit lag wins. Give one or the other.`),T):(T.lag=m,T)}function y(t,T,I={}){const m=[];if(t==null)return{ok:!0,edges:m};if(!Array.isArray(t))return{ok:!1,error:{code:Y.UNKNOWN_TASK,message:"dependencies must be an array"},edges:m};const b=typeof I.ancestors=="function"?I.ancestors:null;for(const g of t){const D=a(g),V=D&&D.from!=null?String(D.from):null,O=D&&D.to!=null?String(D.to):null,oe=D&&D.type!=null?String(D.type).toUpperCase():"FS",de=u(D.lag)??0;if(V==null||O==null)return{ok:!1,error:{code:Y.UNKNOWN_TASK,message:"a dependency needs both `from` and `to`"},edges:m};if(!T.has(V))return{ok:!1,error:{code:Y.UNKNOWN_TASK,message:`dependency references unknown task "${V}"`,id:V},edges:m};if(!T.has(O))return{ok:!1,error:{code:Y.UNKNOWN_TASK,message:`dependency references unknown task "${O}"`,id:O},edges:m};if(V===O)return{ok:!1,error:{code:Y.SELF_DEPENDENCY,message:`task "${V}" depends on itself`,id:V},edges:m};if(!Q.includes(oe))return{ok:!1,error:{code:Y.BAD_LINK_TYPE,message:`unknown link type "${oe}" (expected one of ${Q.join("/")})`},edges:m};if(b&&(b(V).has(O)||b(O).has(V)))return{ok:!1,error:{code:Y.DEP_ACROSS_HIERARCHY,message:`dependency between "${V}" and "${O}" crosses their own parent/child hierarchy`,from:V,to:O},edges:m};m.push({from:V,to:O,type:oe,lag:de})}return{ok:!0,edges:m}}function w(t,T){const I=new Set,m=[];for(const b of t){(T.isSummary(b.from)||T.isSummary(b.to))&&b.type!=="FS"&&z(`gantt-summary-link-${b.type}-${b.from}-${b.to}`,`[lattice] gantt: ${b.type} link with a summary endpoint (${b.from} -> ${b.to}) is expanded to descendant leaves — a conservative v1 reading; only FS is exact for summary endpoints.`);for(const D of T.descendantLeaves(b.from))for(const V of T.descendantLeaves(b.to)){if(D===V)continue;const O=[D,V,b.type,b.lag].join("");I.has(O)||(I.add(O),m.push({from:D,to:V,type:b.type,lag:b.lag}))}}return m}function P(t,T,I,m=R){return t.map(b=>{const g=T.get(b.from),D=T.get(b.to);if(!g||!D||g.earliestStart==null||g.duration==null||D.earliestStart==null||D.duration==null)return b;if(m.custom){const ve=m.norm(b.from,g.earliestStart),Pe=m.fin(b.from,ve,g.duration),Ne=m.norm(b.to,D.earliestStart),_e=m.fin(b.to,Ne,D.duration);switch(b.type){case"FS":return{...b,lag:m.between(b.to,Ne,Pe)};case"SS":return{...b,lag:m.between(b.to,Ne,ve)};case"FF":return{...b,lag:m.between(b.to,_e,Pe)};case"SF":return{...b,lag:m.between(b.to,_e,ve)};default:return b}}const V=I(g.earliestStart),O=V+g.duration,oe=I(D.earliestStart),de=oe+D.duration;let De;switch(b.type){case"FS":De=oe-O;break;case"SS":De=oe-V;break;case"FF":De=de-O;break;case"SF":De=de-V;break;default:return b}return{...b,lag:De}})}function G(t,T){const I=new Map(t.map(D=>[D,0])),m=new Map(t.map(D=>[D,[]]));for(const D of T)re(I,D.to),m.get(D.from).push(D.to);const b=t.filter(D=>I.get(D)===0),g=[];for(;b.length;){const D=b.shift();g.push(D);for(const V of m.get(D)){const O=I.get(V)-1;I.set(V,O),O===0&&b.push(V)}}return g.length===t.length?{ok:!0,sorted:g}:{ok:!1,cycle:Se(t,m,new Set(g))}}function re(t,T){t.set(T,t.get(T)+1)}function Se(t,T,I){const m=t.find(V=>!I.has(V)),b=[],g=new Map;let D=m;for(;D!=null&&!g.has(D);)g.set(D,b.length),b.push(D),D=T.get(D).find(V=>!I.has(V));return D==null?b:b.slice(g.get(D)).concat(D)}function be(t,T,I){const m=String(T),b=String(I);if(m===b)return!0;const g=new Map;for(const O of t){const oe=String(O.from);g.has(oe)||g.set(oe,[]),g.get(oe).push(String(O.to))}const D=new Set,V=[b];for(;V.length;){const O=V.pop();if(O===m)return!0;if(!D.has(O)){D.add(O);for(const oe of g.get(O)||[])V.push(oe)}}return!1}function Oe(t,T,I,m){switch(T.type){case"FS":return t.shift(m.id,I.ef,T.lag);case"SS":return t.shift(m.id,I.es,T.lag);case"FF":return t.back(m.id,t.shift(m.id,I.ef,T.lag),m.duration);case"SF":return t.back(m.id,t.shift(m.id,I.es,T.lag),m.duration);default:return-1/0}}function Ae(t,T,I,m,b,g=new Map,D=new Map,V=!1,O=R){const oe=G(t,I);if(!oe.ok)return z(`gantt-cycle-${oe.cycle.join(">")}`,`[lattice] gantt: dependency cycle detected (${oe.cycle.join(" -> ")}); schedule refused.`),{ok:!1,error:{code:Y.CYCLE,message:`dependency cycle: ${oe.cycle.join(" -> ")}`,cycle:oe.cycle}};const de=oe.sorted,De=new Map(t.map(he=>[he,[]])),ve=new Map(t.map(he=>[he,[]]));for(const he of I)De.get(he.to).push(he),ve.get(he.from).push(he);const Pe=new Map;for(const he of t){const Te=T.get(he);Pe.set(he,{id:he,name:Te.name,duration:Te.duration,es:0,ef:0,ls:0,lf:0,totalFloat:0,critical:!1,percentComplete:Te.percentComplete,parent:Te.parent,isSummary:!1,isMilestone:Te.duration===0,children:[],colour:Te.colour??null,locked:!!Te.locked})}const Ne=[];for(const he of de){const Te=T.get(he),xe=Pe.get(he);let r=Math.max(m,Te.earliestStart??m);for(const ce of De.get(he)){const pe=Pe.get(ce.from),ne=Oe(O,ce,pe,xe);ne>r&&(r=ne)}const C=g.get(he);if(C&&C.at!=null)switch(C.type){case"MSO":C.at<r-K?Ne.push({id:he,type:C.type,date:C.at,scheduled:r,at:C.at,earliestFeasible:r}):r=C.at,xe.pinned=!0;break;case"MFO":{const ce=O.back(he,C.at,xe.duration);ce<r-K?Ne.push({id:he,type:C.type,date:C.at,scheduled:O.fin(he,r,xe.duration),at:C.at,earliestFeasible:r}):r=ce,xe.pinned=!0;break}case"SNET":C.at>r+K&&(r=C.at);break;case"SNLT":r>C.at+K&&Ne.push({id:he,type:C.type,date:C.at,scheduled:r,at:C.at,earliestFeasible:r});break;case"FNET":{const ce=O.back(he,C.at,xe.duration);ce>r+K&&(r=ce);break}case"FNLT":{const ce=O.fin(he,r,xe.duration);ce>C.at+K&&Ne.push({id:he,type:C.type,date:C.at,scheduled:ce,at:C.at,earliestFeasible:r});break}default:break}if(Te.locked){const ce=C&&C.at!=null?C.type==="MFO"?O.back(he,C.at,xe.duration):C.type==="MSO"?C.at:null:null,pe=Te.earliestStart!=null?Te.earliestStart:ce??r;if(r-K>pe)for(const ne of De.get(he)){const je=Pe.get(ne.from),Me=Oe(O,ne,je,xe);Me>pe+K&&Ne.push({id:he,from:ne.from,to:he,type:"LOCKED",date:pe,scheduled:Me,at:pe,earliestFeasible:pe})}r=pe,xe.pinned=!0}r=O.norm(he,r),xe.es=r,xe.ef=O.fin(he,r,xe.duration)}const _e=t.length?Math.max(...t.map(he=>Pe.get(he).ef)):m,ze=Number.isFinite(b)?b:_e;for(let he=de.length-1;he>=0;he-=1){const Te=de[he],xe=Pe.get(Te);let r=ze;const C=D.get(Te);C!=null&&C<r&&(r=C);for(const ce of ve.get(Te)){const pe=Pe.get(ce.to);let ne;switch(ce.type){case"FS":ne=O.unshift(ce.to,pe.ls,ce.lag);break;case"SS":ne=O.fin(Te,O.unshift(ce.to,pe.ls,ce.lag),xe.duration);break;case"FF":ne=O.unshift(ce.to,pe.lf,ce.lag);break;case"SF":ne=O.fin(Te,O.unshift(ce.to,pe.lf,ce.lag),xe.duration);break;default:ne=1/0}ne<r&&(r=ne)}xe.pinned&&(r=xe.ef),xe.lf=r,xe.ls=O.back(Te,r,xe.duration),xe.totalFloat=O.between(Te,xe.ls,xe.es),xe.critical=xe.totalFloat<=K,C!=null&&(xe.deadline=C,xe.late=xe.ef>C+K)}for(const he of t){const Te=g.get(he);if(!Te||Te.type!=="ALAP")continue;const xe=Pe.get(he);xe.es=xe.ls,xe.ef=xe.lf,xe.totalFloat=0,xe.critical=!0}const Le=t.filter(he=>Pe.get(he).critical),Fe=V?[]:ae(t,I,Pe,O);return{ok:!0,tasks:Pe,critical:Le,criticalPaths:Fe,projectFinish:_e,conflicts:Ne}}function me(t,T){let I=null;if(Array.isArray(t))for(const m of t){const b=B(m?T(m):null);b!=null&&(I==null||b<I)&&(I=b)}return I}function Ee(t,T=[],I={}){const m=le(I.fields),b=B(I.projectStart),g=b??0,D=b??me(t,m.start)??0,V=B(I.deadline),O=ie(I.calendar,g),oe=[];for(const we of Array.isArray(t)?t:[]){const Ce=we?m.id(we):null;Ce!=null&&we.calendar!=null&&oe.push({id:String(Ce),calendar:we.calendar})}const de=[];for(const we of Array.isArray(I.resources)?I.resources:[]){const Ce=we&&(we.id??we.name??we.resource);Ce!=null&&we.calendar!=null&&de.push({id:String(Ce),calendar:we.calendar})}const De=I.calendars&&typeof I.calendars=="object"&&Object.keys(I.calendars).length>0,ve=oe.length||de.length||De?f({calendar:I.calendar,calendars:I.calendars,projectStart:g,tasks:oe,resources:de}):null;if(ve&&ve.errors.length){const we=ve.errors.map(Ce=>({...Ce,code:Y.UNKNOWN_CALENDAR}));return{ok:!1,error:we[0],errors:we}}const Pe=!!(ve&&ve.customised),Ne=Pe?null:O,_e=Pe?L(we=>ve.models.get(ve.ofTask.get(we)??"plan").calendar):R,ze=we=>we==null?null:Ne?Ne.indexOf(we):we,Le=we=>Ne?Ne.dayOf(we):we,Fe=p(t,I.fields,I.lockWhen);if(!Fe.ok)return{ok:!1,error:Fe.error,errors:[Fe.error]};const{order:he,byId:Te}=Fe,xe=l(he,Te);if(!xe.ok)return{ok:!1,error:xe.error,errors:[xe.error]};const r=y(T,Te,xe);if(!r.ok)return{ok:!1,error:r.error,errors:[r.error]};const C=I.honourDates?P(r.edges,Te,ze,_e):r.edges,ce={defaultMode:ge(I.schedulingMode)||"fixedDuration",defaultEffortDriven:!!I.effortDriven,hoursPerDay:u(I.hoursPerDay)??ue,resourceHours:I.resourceHours instanceof Map?I.resourceHours:new Map},pe=new Map;for(const we of he){if(xe.isSummary(we))continue;const Ce=Te.get(we);if(!(Ce.schedulingMode!=null||Ce.effortDriven!=null||Ce.statedEffort!=null||I.schedulingMode!=null||I.effortDriven!=null))continue;const Je=ee(Ce,ce);Je.duration!=null&&(Ce.duration=Je.duration),pe.set(we,{schedulingMode:Je.schedulingMode,effortDriven:Je.effortDriven,effort:Je.effort,units:Je.units})}const ne=S(he,Te,xe),je=new Set(he.filter(we=>!xe.isSummary(we)&&Te.get(we).inactive===!0)),Me=new Set([...ne].filter(we=>!je.has(we))),Ie=he.filter(we=>!xe.isSummary(we)&&!Me.has(we)&&!je.has(we)),Ge=new Map(Ie.map(we=>{const Ce=Te.get(we);return[we,{...Ce,earliestStart:ze(Ce.earliestStart)}]})),We=new Map;for(const we of Ie){const Ce=Te.get(we).constraint;Ce&&We.set(we,{type:Ce.type,at:ze(Ce.at)})}const He=Ne?Ne.indexOf(g):g,Be=V==null?void 0:ze(V),Qe=new Map;for(const we of Ie){const Ce=Ge.get(we).deadline;if(Ce==null)continue;const Xe=Ne?Ne.indexOf(Ce):Ce;Number.isFinite(Xe)&&Qe.set(we,Xe)}const tt=c(q(w(C,xe),Me),je),Ye=Ae(Ie,Ge,tt,He,Be,We,Qe,!!I.skipCriticalPaths,_e);if(!Ye.ok)return{ok:!1,error:Ye.error,errors:[Ye.error]};const Ze=Ye.tasks;for(const we of Ie){const Ce=Ze.get(we);Ce.es=Le(Ce.es),Ce.ef=Le(Ce.ef),Ce.ls=Le(Ce.ls),Ce.lf=Le(Ce.lf),Ce.deadline!=null&&(Ce.deadline=Le(Ce.deadline)),M(Ce,Te.get(we).baselineStart,Te.get(we).baselineEnd);const Xe=pe.get(we);Xe&&(Ce.schedulingMode=Xe.schedulingMode,Ce.effortDriven=Xe.effortDriven,Ce.effort=Xe.effort,Ce.units=Xe.units)}for(const we of he)Me.has(we)?Ze.set(we,i(Te.get(we),xe.isSummary(we))):je.has(we)&&Ze.set(we,k(Te.get(we)));if(ve)for(const we of he)Ze.get(we).calendar=ve.ofTask.get(we)??"plan";for(let we=he.length-1;we>=0;we-=1){const Ce=he[we];!xe.isSummary(Ce)||Me.has(Ce)||Ze.set(Ce,h(Ce,Te.get(Ce),xe,Ze))}for(const we of he)xe.isSummary(we)&&(Ze.get(we).children=xe.children.get(we).slice());const rt=O?O.nextWorking(D):D,qe=Le(Ye.projectFinish);return{ok:!0,tasks:Ze,order:he,critical:Ye.critical,criticalPaths:Ye.criticalPaths,projectStart:rt,projectFinish:qe,projectDuration:qe-rt,conflicts:(Ye.conflicts||[]).map(we=>({id:we.id,type:we.type,date:Le(we.date),scheduled:Le(we.scheduled),at:Le(we.at),earliestFeasible:Le(we.earliestFeasible),...we.from!==void 0?{from:we.from,to:we.to}:null})),calendar:!!O,...Pe?{calendars:ve.models}:null,unscheduled:he.filter(we=>Me.has(we)),...I.honourDates?{dependencies:C}:{}}}function M(t,T,I){T==null&&I==null||(t.baselineStart=T??null,t.baselineEnd=I??null,t.startVariance=T==null?null:t.es-T,t.finishVariance=I==null?null:t.ef-I,t.durationVariance=T==null||I==null?null:t.ef-t.es-(I-T))}function h(t,T,I,m){const b=I.children.get(t).map(he=>m.get(he)),g=b.filter(he=>!he.unscheduled&&!he.inactive),D=g.length?g:b,V=Math.min(...D.map(he=>he.es)),O=Math.max(...D.map(he=>he.ef)),oe=Math.min(...D.map(he=>he.ls)),de=Math.max(...D.map(he=>he.lf)),De=I.descendantLeaves(t).map(he=>m.get(he)),ve=De.filter(he=>!he.unscheduled&&!he.inactive),Pe=ve.length?ve:De,Ne=Pe.reduce((he,Te)=>he+Te.duration,0),_e=Ne>K?Pe.reduce((he,Te)=>he+Te.duration*(Te.percentComplete??0),0)/Ne:null,ze={id:t,name:T.name,duration:O-V,es:V,ef:O,ls:oe,lf:de,totalFloat:oe-V,critical:D.some(he=>he.critical),percentComplete:_e,parent:T.parent,isSummary:!0,isMilestone:!1,locked:!1,...T.inactive===!0?{inactive:!0}:null,children:[],colour:T.colour??null},Le=Pe.map(he=>he.baselineStart).filter(he=>he!=null),Fe=Pe.map(he=>he.baselineEnd).filter(he=>he!=null);return(Le.length||Fe.length)&&M(ze,Le.length?Math.min(...Le):null,Fe.length?Math.max(...Fe):null),ze}function ae(t,T,I,m=R){const b=new Map(t.map(oe=>[oe,[]])),g=new Set;for(const oe of T){const de=I.get(oe.from),De=I.get(oe.to);if(!de.critical||!De.critical)continue;const ve=Oe(m,oe,de,De);Math.abs(ve-De.es)<=K&&(b.get(oe.from).push(oe.to),g.add(oe.to))}const D=t.filter(oe=>I.get(oe).critical&&!g.has(oe)),V=[],O=(oe,de)=>{const De=b.get(oe);if(!De.length){V.push(de);return}for(const ve of De)O(ve,de.concat(ve))};for(const oe of D)O(oe,[oe]);return V}function ye(t,T,I){if(!T||!T.ok)return[];const m=[],b=le(I);for(const g of t){const D=g?b.id(g):null,V=D!=null?String(D):null;if(V==null||!T.tasks.has(V))continue;const O=T.tasks.get(V);if(O.isSummary)continue;const oe=u(b.start(g));oe==null||O.unscheduled||oe<O.es-K&&m.push({id:V,placedStart:oe,earliestStart:O.es,by:O.es-oe})}return m}}),Re("packages/modules/gantt/resources.js",function(s,te){"use strict";Object.defineProperty(s,"normalizeCapacities",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"resourceDisplayNames",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"resourceSpecsByKey",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"resourceAvatars",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"normalizeResources",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"resourceDailyHours",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"sweepLoad",{enumerable:!0,get:function(){return u}}),Object.defineProperty(s,"computeResourceLoad",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"normalizeResourceRates",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"rateOn",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"levelResources",{enumerable:!0,get:function(){return o}});const z=te("packages/core/src/internal/warn.js").warnOnce,N=te("packages/modules/gantt/schedule.js"),ie=N.computeSchedule,U=N.EPS,R=N.taskIdReader,L=N.resolveConstraintCode,f=te("packages/modules/gantt/assignments.js"),$=f.parseAssignments,F=te("packages/modules/gantt/calendar.js").createCalendar,W=te("packages/modules/gantt/task-calendars.js"),A=W.parseHolidayDays,q=W.normalizeCalendarSpec,S=W.planWorkingTime,i=W.workingRuns,d=te("packages/modules/gantt/time.js"),c=d.fromDayNumber,k=d.toDayNumber;Object.defineProperty(s,"parseAssignments",{enumerable:!0,get:function(){return f.parseAssignments}});const Q=Object.freeze([1,2,3,4,5]),J=8;function H(l){if(l==null||l==="")return null;const _=typeof l=="number"?l:Number(l);return Number.isFinite(_)?_:null}function se(l,_){const a=new Map;if(Array.isArray(l))for(const y of l){const w=y&&(y.id??y.name??y.resource);if(w==null||w==="")continue;const P=H(y.capacity??y.maxUnits??y.max??y.units);a.set(String(w),P??_)}else if(l&&typeof l=="object")for(const[y,w]of Object.entries(l)){const P=H(w);a.set(String(y),P??_)}return a}function fe(l){const _=new Map;if(Array.isArray(l))for(const a of l){if(!a)continue;const y=a.id??a.name??a.resource;if(y==null||y==="")continue;const w=a.name??a.id??a.resource;_.set(String(y),String(w))}else if(l&&typeof l=="object")for(const[a,y]of Object.entries(l))_.set(a,y&&typeof y=="object"&&y.name!=null?String(y.name):a);return _}function ke(l){const _=new Map;if(Array.isArray(l))for(const a of l){if(!a||typeof a!="object")continue;const y=a.id??a.name??a.resource;y!=null&&y!==""&&_.set(String(y),{...a})}else if(l&&typeof l=="object")for(const[a,y]of Object.entries(l))_.set(a,y&&typeof y=="object"?{...y}:{capacity:y});return _}function ge(l){const _=new Map,a=y=>typeof y=="string"?y.trim():"";if(Array.isArray(l))for(const y of l){if(!y)continue;const w=y.id??y.name??y.resource;if(w==null||w==="")continue;const P=a(y.avatar);P&&_.set(String(w),P)}else if(l&&typeof l=="object")for(const[y,w]of Object.entries(l)){const P=w&&typeof w=="object"?a(w.avatar):"";P&&_.set(y,P)}return _}function ue(l){return new Set(A(l))}function X(l){return l==null?{workdays:[0,1,2,3,4,5,6],holidays:new Set}:l==="weekends"?{workdays:[...Q],holidays:new Set}:{workdays:Array.isArray(l.workdays)&&l.workdays.length?l.workdays.map(Number).filter(a=>a>=0&&a<=6):[...Q],holidays:ue(l.holidays)}}function ee(l,_,a){let y=l;if(typeof l=="string"&&(y=_&&Object.prototype.hasOwnProperty.call(_,l)?_[l]:l==="weekends"?l:null),y==null||typeof y=="string"&&y!=="weekends")return null;const w=q(y,a);if(!w)return null;const P=y;return{...P==="weekends"||P.workdays||P.workingDays?{workingDays:w.workdays}:null,...P!=="weekends"&&(P.holidays||P.exceptions)?{holidays:w.holidays}:null,...w.hoursPerDay!=null?{hoursPerDay:w.hoursPerDay}:null}}function x(l,_,a,y){const w=new Set(Array.isArray(l.workingDays)&&l.workingDays.length?l.workingDays.map(Number).filter(h=>h>=0&&h<=6):y.workdays),P=ue(l.holidays);for(const h of y.holidays)P.add(h);const G=l.hoursPerDay,re=h=>{if(G!=null&&typeof G=="object"){const ye=H(G[h]);return ye??a}const ae=H(G);return ae??a},Se=h=>{const ae=c(h);return ae?w.has(ae.getUTCDay())&&!P.has(h):!1},be=h=>Se(h)?_??re(c(h).getUTCDay()):0,Oe=h=>a>0?be(h)/a:0;let Ae=0;for(const h of w){const ae=_??re(h);ae>Ae&&(Ae=ae)}const me=a>0?Ae/a:0;let Ee=0;for(const h of y.workdays)w.has(h)&&(Ee+=_??re(h));const M=y.workdays.length?Ee/y.workdays.length:a;return{hasCalendar:!0,capacityUnits:me,hoursPerWorkingDay:M,worksOn:Se,capacityHoursOn:be,capacityUnitsOn:Oe}}function K(l,_,a={}){const y=H(a.hoursPerDay)??J,w=X(a.calendar),P=new Map,G=(re,Se)=>{const be=H(Se.capacity??Se.maxUnits??Se.max??Se.units),Oe=ee(Se.calendar,a.calendars,S(a.calendar));Oe?P.set(re,x(Oe,be,y,w)):P.set(re,{hasCalendar:!1,capacityUnits:be??_,hoursPerWorkingDay:y})};if(Array.isArray(l))for(const re of l){const Se=re&&(re.id??re.name??re.resource);Se==null||Se===""||G(String(Se),re)}else if(l&&typeof l=="object")for(const[re,Se]of Object.entries(l))G(String(re),typeof Se=="object"&&Se?Se:{capacity:Se});return P}function Y(l,_,a={}){const y=H(a.hoursPerDay)??J,w=K(l,_,a),P=new Map;for(const[G,re]of w)P.set(G,re.hoursPerWorkingDay!=null?re.hoursPerWorkingDay:y);return P}function u(l){if(!l.length)return[];const _=new Set;for(const w of l)_.add(w.s),_.add(w.e);const a=[..._].sort((w,P)=>w-P),y=[];for(let w=0;w<a.length-1;w+=1){const P=a[w],G=a[w+1];if(G<=P)continue;let re=0;const Se=[];for(const be of l)be.s<=P&&be.e>=G&&(re+=be.units,Se.push(be.taskId));Se.length&&y.push({s:P,e:G,load:re,taskIds:Se})}return y}function j(l,_,a={}){const y={ok:!1,resources:[],overAllocations:[],byResource:new Map};if(!_||!_.ok)return y;const w=H(a.defaultCapacity)??1,P=se(a.resources,w),G=K(a.resources,w,{calendar:a.calendar,calendars:a.calendars,hoursPerDay:a.hoursPerDay}),re=_.calendars instanceof Map?_.calendars:null,Se=a.calendar!=null&&!re?F(a.calendar,_.projectStart):null,be=t=>P.has(t)?P.get(t):w,Oe=t=>Se?Se.indexOf(t):t,Ae=t=>Se?Se.dayOf(t):t,me=R(a.fields),Ee=new Map;for(const t of l){if(!t)continue;const T=me(t);if(T==null)continue;const I=String(T);Ee.has(I)||Ee.set(I,t)}const M=new Map;for(const t of _.order){const T=_.tasks.get(t);if(!T||T.isSummary||T.unscheduled)continue;const I=Ee.get(t);if(!I)continue;const m=$(I);if(!m.length)continue;const b=Oe(T.es),g=Oe(T.ef);if(g<=b)continue;const D=re&&re.get(T.calendar),V=D?i(b,g,D.isWorking):[[b,g]];for(const O of m){M.has(O.resource)||M.set(O.resource,[]);for(const[oe,de]of V)M.get(O.resource).push({s:oe,e:de,units:O.units,taskId:t})}}const h=new Map,ae=[],ye=[];for(const[t,T]of M){const I=G.get(t),m=u(T);let b=0,g,D;if(I&&I.hasCalendar){D=I.capacityUnits,g=[];for(const O of m){O.load>b&&(b=O.load);let oe=O.s,de=I.capacityUnitsOn(Ae(O.s));const De=ve=>{const Pe={start:Ae(oe),end:Ae(ve),load:O.load,taskIds:O.taskIds};g.push(Pe),O.load>de+U&&ye.push({resource:t,capacity:de,start:Pe.start,end:Pe.end,load:O.load,taskIds:O.taskIds.slice()})};for(let ve=O.s+1;ve<O.e;ve+=1){const Pe=I.capacityUnitsOn(Ae(ve));Pe!==de&&(De(ve),oe=ve,de=Pe)}De(O.e)}}else D=be(t),g=m.map(O=>{O.load>b&&(b=O.load);const oe={start:Ae(O.s),end:Ae(O.e),load:O.load,taskIds:O.taskIds};return O.load>D+U&&ye.push({resource:t,capacity:D,start:oe.start,end:oe.end,load:O.load,taskIds:O.taskIds.slice()}),oe});const V={resource:t,capacity:D,peak:b,segments:g};h.set(t,V),ae.push(V)}return ae.sort((t,T)=>t.resource<T.resource?-1:t.resource>T.resource?1:0),ye.sort((t,T)=>t.start-T.start||(t.resource<T.resource?-1:1)),{ok:!0,resources:ae,overAllocations:ye,byResource:h}}function B(l){const _=[];for(const a of Array.isArray(l)?l:[]){const y=k(a&&a.from),w=H(a&&a.rate);y==null||w==null||_.push({from:Math.round(y),rate:w})}return _.sort((a,y)=>a.from-y.from),_}function Z(l){const _=new Map,a=(y,w)=>{if(!w||typeof w!="object")return;const P=w.type==="material"||w.type==="cost"?w.type:"work",G=H(w.rate),re=B(w.rates),Se=H(w.cost);G==null&&!re.length&&Se==null||_.set(y,{type:P,rate:G,rates:re,cost:Se})};if(Array.isArray(l))for(const y of l){const w=y&&(y.id??y.name??y.resource);w==null||w===""||a(String(w),y)}else if(l&&typeof l=="object")for(const[y,w]of Object.entries(l))w&&typeof w=="object"&&a(y,w);return _}function le(l,_){if(!l)return null;let a=l.rate;for(const y of l.rates)if(y.from<=_)a=y.rate;else break;return a??null}function v(l){if(!l)return!1;const _=l.constraint??l.constraintType;if(_==null||_==="")return!1;const a=String(_).toLowerCase().replace(/\s+/g,"-");return a==="mso"||a==="must-start-on"||a==="muststarton"||a==="start-on"||a==="mfo"||a==="must-finish-on"||a==="mustfinishon"||a==="finish-on"}function e(l){if(!l)return null;const _=l.constraint??l.constraintType,a=L(_);if(a!=="SNLT"&&a!=="FNLT")return null;let y=l.constraintDate??l.constraintAt??l.at;if(_&&typeof _=="object"&&y==null&&(y=_.date),y==null||y==="")return null;const w=k(y);return Number.isFinite(w)?{type:a,date:w}:null}function n(l,_){return l?H(l[_])??0:0}function o(l,_,a={}){const y={projectStart:a.projectStart,deadline:a.deadline,calendar:a.calendar,fields:a.fields,calendars:a.calendars,resources:Array.isArray(a.resources)?a.resources:void 0,skipCriticalPaths:!0},w=a.priorityField||"priority",P=a.maxIterations!=null?a.maxIterations:Math.max(100,l.length*l.length*2),G=R(a.fields),re=l.map(g=>({...g})),Se=re.map(g=>String(G(g))),be=new Map(re.map(g=>[String(G(g)),g])),Oe=new Map(Se.map((g,D)=>[g,D])),Ae=g=>Oe.has(g)?Oe.get(g):-1;let me=ie(re,_,y);if(!me.ok)return{ok:!1,error:me.error};const Ee=new Map;for(const g of me.order){const D=me.tasks.get(g);D&&!D.isSummary&&!D.unscheduled&&Ee.set(g,D.es)}const M=H(a.defaultCapacity)??1,h=K(a.resources,M,{calendar:a.calendar,calendars:a.calendars,hoursPerDay:a.hoursPerDay}),ae=a.calendar!=null?F(a.calendar,me.projectStart):null,ye=(g,D,V)=>{const O=$(D).map(de=>h.get(de.resource)).filter(de=>de&&de.hasCalendar);let oe=Math.round(g);for(let de=0;de<3660;de+=1){if((V?V(oe):!ae||ae.isWorking(oe))&&O.every(De=>De.worksOn(oe)))return oe;oe+=1}return Math.round(g)};let t=0;const T=Math.max(32,l.length*2);let I=1/0,m=0;for(;t<P;t+=1){const g=j(re,me,a);g.overAllocations.length<I?(I=g.overAllocations.length,m=0):m+=1;const D=g.overAllocations.filter(ve=>new Set(ve.taskIds).size>=2);if(!D.length)return{ok:!0,resolved:g.overAllocations.length===0,tasks:re,schedule:me,moves:p(Ee,me),remaining:g.overAllocations,iterations:t};if(m>=T)return z("gantt-level-unresolved",`[lattice] gantt: resource leveling could not clear ${g.overAllocations.length} over-allocation(s) after ${t} iterations; the plan cannot be fully levelled, returning the partial result.`),{ok:!0,resolved:!1,tasks:re,schedule:me,moves:p(Ee,me),remaining:g.overAllocations,iterations:t};const O=D.slice().sort((ve,Pe)=>ve.start-Pe.start||Pe.load-ve.load)[0].taskIds.map(ve=>me.tasks.get(ve)).filter(Boolean),oe=O.filter(ve=>!v(be.get(ve.id)));if(!oe.length)return{ok:!0,resolved:!1,tasks:re,schedule:me,moves:p(Ee,me),remaining:g.overAllocations,iterations:t};oe.sort((ve,Pe)=>{if(Pe.totalFloat!==ve.totalFloat)return Pe.totalFloat-ve.totalFloat;const Ne=n(be.get(ve.id),w),_e=n(be.get(Pe.id),w);return Ne!==_e?Ne-_e:Pe.es!==ve.es?Pe.es-ve.es:Ae(Pe.id)-Ae(ve.id)});let de=null,De=null;for(const ve of oe){const Pe=O.filter(Le=>Le.id!==ve.id).map(Le=>Le.ef).filter(Le=>Le>ve.es+U),Ne=Pe.length?Math.min(...Pe):ve.es+1,_e=ye(Ne,be.get(ve.id),me.calendars instanceof Map?me.calendars.get(ve.calendar).isWorking:void 0),ze=e(be.get(ve.id));if(!(ze&&(ze.type==="SNLT"?_e:_e+(ve.ef-ve.es))>ze.date+U)){de=ve,De=_e;break}}if(!de)return{ok:!0,resolved:!1,tasks:re,schedule:me,moves:p(Ee,me),remaining:g.overAllocations,iterations:t};if(be.get(de.id).start=De,me=ie(re,_,y),!me.ok)return{ok:!1,error:me.error}}const b=j(re,me,a);return b.overAllocations.length&&z("gantt-level-unresolved",`[lattice] gantt: resource leveling hit its ${P}-iteration cap with ${b.overAllocations.length} over-allocation(s) unresolved; returning the partial result.`),{ok:!0,resolved:b.overAllocations.length===0,tasks:re,schedule:me,moves:p(Ee,me),remaining:b.overAllocations,iterations:t}}function p(l,_){const a=[];for(const y of _.order){const w=_.tasks.get(y);if(!w||w.isSummary||w.unscheduled)continue;const P=l.get(y);P!=null&&w.es>P+U&&a.push({id:y,from:P,to:w.es,delay:w.es-P})}return a}}),Re("packages/modules/gantt/workload.js",function(s,te){"use strict";Object.defineProperty(s,"WORKLOAD_DEFAULTS",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"HISTOGRAM_DEFAULTS",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"normalizeThresholds",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"thresholdFor",{enumerable:!0,get:function(){return k}}),Object.defineProperty(s,"normalizeExternalLoad",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"statedHours",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"taskContour",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"contourTotal",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"serializeContour",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"contourSpan",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"spanDuration",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"spreadHours",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"setContourBucket",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"retimeContour",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"recordWorkingDays",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"workloadBuckets",{enumerable:!0,get:function(){return u}}),Object.defineProperty(s,"taskAssignmentEffort",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"computeWorkload",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"formatHours",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"formatPercent",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"formatCost",{enumerable:!0,get:function(){return v}});const $e=te("packages/modules/gantt/resources.js"),z=$e.parseAssignments,N=$e.rateOn,ie=te("packages/modules/gantt/schedule.js"),U=ie.EPS,R=ie.taskIdReader,L=te("packages/modules/gantt/time.js"),f=L.fromDayNumber,$=L.toDayNumber,E=L.toISODate,W=te("packages/core/src/internal/warn.js").warnOnce,q=te("packages/modules/gantt/week.js").weekStartOf,S=Object.freeze({hoursPerDay:8,height:160,rowHeight:28,decimals:1,totals:!0,maxHeight:null,unit:"hours",thresholds:null,showUnassigned:!0,labelWidth:null}),i=Object.freeze({resources:null,unit:"hours",stacked:!1,height:160,rowHeight:48,maxHeight:null,labelWidth:null});function d(e){if(e==null||e===""||typeof e=="boolean")return null;const n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?n:null}function c(e){if(!Array.isArray(e))return null;const n=[];for(const o of e){if(!o||typeof o!="object")continue;const p=d(o.at);if(p==null||p<0)continue;const l=typeof o.className=="string"&&o.className?o.className:null,_=typeof o.colour=="string"&&o.colour?o.colour:typeof o.color=="string"&&o.color?o.color:null;!l&&!_||n.push({at:p,className:l,colour:_})}return n.length?(n.sort((o,p)=>o.at-p.at),n):null}function k(e,n){if(!e||n==null||!Number.isFinite(n))return null;let o=null;for(const p of e)if(n>=p.at)o=p;else break;return o}function Q(e,n){if(e==null||e==="")return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const o=$(e);return Number.isFinite(o)?o-n:null}function J(e,n=0){if(!Array.isArray(e))return[];const o=[];for(let p=0;p<e.length;p+=1){const l=e[p],_=l&&typeof l=="object"&&l.resource!=null&&l.resource!==""?String(l.resource):null,a=l&&typeof l=="object"?Q(l.start,n):null,y=l&&typeof l=="object"?Q(l.end,n):null;if(_==null||a==null||y==null){W(`gantt.workloadExternal.${p}`,`[lattice] gantt: workload.external entry ${p} has no resource or no drawable start/end; it is skipped.`);continue}const w=typeof l.label=="string"&&l.label!==""?l.label:null,P=typeof l.group=="string"&&l.group!==""?l.group:null;o.push({index:p,resource:_,start:a,end:y,units:d(l.units),hours:d(l.hours),label:w,group:P})}return o}function H(e){const n=$(e.start);if(!Number.isFinite(n))return null;const o=$(e.end);if(Number.isFinite(o))return{es:n,ef:o};const p=d(e.duration);return{es:n,ef:n+(p??0)}}function se(e){if(!e||Array.isArray(e.work))return null;const n=d(e.work);return n??d(e.hours)}function fe(e){if(!e||!Array.isArray(e.work))return null;const n=[];for(const p of e.work){if(!p||typeof p!="object")continue;const l=$(p.date),_=d(p.hours);l==null||_==null||n.push({day:Math.round(l),hours:_})}n.sort((p,l)=>p.day-l.day);const o=[];for(const p of n){const l=o[o.length-1];l&&l.day===p.day?l.hours+=p.hours:o.push({day:p.day,hours:p.hours})}return o}function ke(e){return(Array.isArray(e)?e:[]).reduce((n,o)=>n+(d(o.hours)??0),0)}function ge(e){const n=[];for(const o of Array.isArray(e)?e:[]){const p=d(o.hours);if(p==null||!(Math.abs(p)>U))continue;const l=E(o.day);l!=null&&n.push({date:l,hours:Math.round(p*1e6)/1e6})}return n}function ue(e){const n=(Array.isArray(e)?e:[]).filter(o=>Math.abs(d(o.hours)??0)>U);return n.length?{first:n[0].day,last:n[n.length-1].day}:null}function X(e,n,o=null){if(!Number.isFinite(e)||!Number.isFinite(n)||n<e)return 0;if(typeof o!="function")return Math.round(n-e)+1;let p=0;for(let l=Math.round(e);l<=Math.round(n);l+=1)o(l)&&(p+=1);return p}function ee(e,n){if(!Array.isArray(e)||!e.length)return[];const o=n/e.length;return e.map(p=>({day:p,hours:o}))}function x(e,n,o,p){const l=(Array.isArray(e)?e:[]).filter(a=>!(a.day>=n.start&&a.day<n.end)),_=Math.abs(p)>U?ee(o,p):[];return[...l,..._].sort((a,y)=>a.day-y.day)}function K(e,n,o){const p=Array.isArray(n)?n:[],l=Array.isArray(o)?o:[];if(!Array.isArray(e)||!p.length||!l.length)return Array.isArray(e)?e:[];const _=new Map(e.map(P=>[P.day,d(P.hours)??0])),a=p.map(P=>_.get(P)??0),y=a.length,w=[];for(let P=0;P<l.length;P+=1){const G=a[Math.min(y-1,Math.floor(P*y/l.length))];Math.abs(G)>U&&w.push({day:l[P],hours:G})}return w}function Y(e,n=null){const o=[];if(!e||!Number.isFinite(e.es)||!Number.isFinite(e.ef))return o;for(let p=Math.floor(e.es);p<Math.ceil(e.ef);p+=1)(typeof n!="function"||n(p))&&o.push(p);return o}function u(e,n,o,p=0){const l=Math.floor(n),_=Math.ceil(o),a=[];if(!(_>l))return a;if(e==="day"){for(let w=l;w<_;w+=1)a.push({start:w,end:w+1});return a}if(e==="month"||e==="quarter"){const w=f(l);if(!w)return a;let P=Date.UTC(w.getUTCFullYear(),w.getUTCMonth(),1)/864e5;for(;P<_;){const G=f(P),re=Date.UTC(G.getUTCFullYear(),G.getUTCMonth()+1,1)/864e5;a.push({start:P,end:re}),P=re}return a}let y=q(l,p);for(;y<_;y+=7)a.push({start:y,end:y+7});return a}function j(e,n,o={}){const p=d(o.hoursPerDay)??S.hoursPerDay,l=typeof o.isWorking=="function"?o.isWorking:null,_=Y(n,l),a=fe(e);if(!a&&!_.length)return[];const y=z(e),w=y.length?y:[{resource:null,units:1}],P=w.reduce((re,Se)=>re+(d(Se.units)??0),0);if(!(P>0))return[];let G;if(a)G=a.filter(re=>Math.abs(re.hours)>U);else{const re=se(e),Se=re??_.length*p*P;if(!(Math.abs(Se)>U))return[];G=ee(_,Se)}return G.length?w.map(re=>{const Se=d(re.units)??0,be=Se/P;return{resource:re.resource,units:Se,unitsTotal:P,perDay:be>0?G.map(Oe=>({day:Oe.day,hours:Oe.hours*be})):[]}}):[]}function B(e,n,o={}){const p=Array.isArray(o.buckets)?o.buckets:[],l={ok:!1,buckets:[],rows:[],totals:p.map(()=>null),totalsAvailable:p.map(()=>null),totalsCost:p.map(()=>null),grandTotal:0,grandAvailableTotal:null,grandCostTotal:null};if(!n||!n.ok)return l;const _=d(o.hoursPerDay)??S.hoursPerDay,a=typeof o.isWorking=="function"?o.isWorking:null,y=o.capacities instanceof Map?o.capacities:null,w=o.resourceModels instanceof Map?o.resourceModels:null,P=o.resourceRates instanceof Map?o.resourceRates:null,G=R(o.fields),re=new Map,Se=(g,D,V,O)=>{re.has(g)||re.set(g,{days:new Map,costs:new Map,tasks:new Map});const oe=re.get(g);if(oe.days.set(D,(oe.days.get(D)||0)+V),P&&g!=null){const De=N(P.get(g),D);De!=null&&oe.costs.set(D,(oe.costs.get(D)||0)+V*De)}oe.tasks.has(O.id)||oe.tasks.set(O.id,{...O,days:new Map});const de=oe.tasks.get(O.id);de.days.set(D,(de.days.get(D)||0)+V)},be=new Map;for(const g of Array.isArray(e)?e:[]){const D=g?G(g):null;D!=null&&be.set(String(D),g)}const Oe=Array.isArray(e)&&n.order.length===e.length;for(let g=0;g<n.order.length;g+=1){const D=n.order[g],V=n.tasks.get(D);if(!V||V.isSummary||V.unscheduled||V.inactive)continue;const O=be.get(D)||(Oe?e[g]:null);if(!O||O.loadOnly===!0)continue;const oe=n.calendars instanceof Map?n.calendars.get(V.calendar):null,de=j(O,V,{hoursPerDay:_,isWorking:oe?oe.isWorking:a});for(const De of de){if(!De.perDay.length)continue;const ve={id:D,name:V.name,units:De.units,unitsTotal:De.unitsTotal,raw:O,loadOnly:!1,external:!1,group:null};for(const Pe of De.perDay)Se(De.resource,Pe.day,Pe.hours,ve)}}for(const g of Array.isArray(e)?e:[]){if(!g||g.loadOnly!==!0)continue;const D=H(g);if(!D)continue;const V=G(g),O=V!=null?String(V):`loadOnly:${e.indexOf(g)}`,oe=g.name!=null?String(g.name):O,de=j(g,D,{hoursPerDay:_,isWorking:a});for(const De of de){if(!De.perDay.length)continue;const ve={id:O,name:oe,units:De.units,unitsTotal:De.unitsTotal,raw:g,loadOnly:!0,external:!1,group:null};for(const Pe of De.perDay)Se(De.resource,Pe.day,Pe.hours,ve)}}for(const g of Array.isArray(o.external)?o.external:[]){if(!g||g.resource==null)continue;const D=d(g.start),V=d(g.end);if(D==null||V==null)continue;const O=Y({es:D,ef:V},a),oe=g.hours!=null?d(g.hours):O.length*_*(d(g.units)??1);if(oe==null||!(Math.abs(oe)>U)||!O.length)continue;const De={id:`external:${g.index??e.length}`,name:g.label,units:null,unitsTotal:null,raw:null,loadOnly:!0,external:!0,group:g.group??null};for(const ve of ee(O,oe))Se(String(g.resource),ve.day,ve.hours,De)}const Ae=g=>{let D=0,V=p.length-1;for(;D<=V;){const O=D+V>>1;if(g<p[O].start)V=O-1;else if(g>=p[O].end)D=O+1;else return O}return-1},me=p.map(g=>{let D=0;for(let V=Math.floor(g.start);V<Math.ceil(g.end);V+=1)(!a||a(V))&&(D+=1);return{start:g.start,end:g.end,workingDays:D}}),Ee=g=>{const D=me.map(()=>0);for(const[V,O]of g){const oe=Ae(V);oe>=0&&(D[oe]+=O)}return D},M=[...re.keys()].filter(g=>g!=null).sort(),h=re.has(null)?[...M,null]:M,ae=[],ye=me.map(()=>0),t=me.map(()=>null),T=P?me.map(()=>0):me.map(()=>null);let I=0,m=P?0:null;for(const g of h){const D=re.get(g),V=Ee(D.days),O=P?Ee(D.costs):null,oe=g!=null&&y&&y.has(g)?y.get(g):null,de=g!=null&&w?w.get(g):null,De=V.map(Fe=>Math.abs(Fe)>U?Fe:null),ve=V.map((Fe,he)=>{if(de&&de.hasCalendar){let Te=0;for(let xe=Math.floor(me[he].start);xe<Math.ceil(me[he].end);xe+=1)(!a||a(xe))&&(Te+=de.capacityHoursOn(xe));return Te}return oe==null?null:oe*_*me[he].workingDays}),Pe=V.map((Fe,he)=>ve[he]!=null&&Fe>ve[he]+U);let Ne=0,_e=null,ze=P?0:null;V.forEach((Fe,he)=>{Ne+=Fe,ye[he]+=Fe,ve[he]!=null&&(_e=(_e??0)+ve[he],t[he]=(t[he]??0)+ve[he]),O&&(ze+=O[he],T[he]+=O[he])}),I+=Ne,P&&(m+=ze);const Le=[...D.tasks.values()].map(Fe=>{const he=Ee(Fe.days);return{id:Fe.id,name:Fe.name,units:Fe.units,unitsTotal:Fe.unitsTotal,raw:Fe.raw,cells:he.map(Te=>Math.abs(Te)>U?Te:null),total:he.reduce((Te,xe)=>Te+xe,0),loadOnly:!!Fe.loadOnly,external:!!Fe.external,group:Fe.group??null}});ae.push({resource:g,capacity:oe,available:ve,availableTotal:_e,cells:De,over:Pe,total:Ne,costCells:O?O.map(Fe=>Math.abs(Fe)>U?Fe:null):null,costTotal:ze,tasks:Le})}let b=null;for(const g of t)g!=null&&(b=(b??0)+g);return{ok:!0,buckets:me,rows:ae,totals:ye.map(g=>Math.abs(g)>U?g:null),totalsAvailable:t,totalsCost:T,grandTotal:I,grandAvailableTotal:b,grandCostTotal:m}}function Z(e,n){if(e==null||!Number.isFinite(e))return"";const p=10**(Number.isFinite(n)?Math.max(0,Math.min(6,Math.round(n))):1),l=Math.round(e*p)/p;return Object.is(l,-0)||l===0?"0":String(l)}function le(e,n,o){if(n==null||!(n>U))return"–";const p=Number.isFinite(e)?e:0;return Z(p/n*100,o)}function v(e,n=2){return Z(e,n)}}),Re("packages/modules/gantt/tooltip.js",function(s,te){"use strict";Object.defineProperty(s,"taskTooltipRows",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"taskTooltipText",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"buildTooltipCard",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"resolveTaskTooltip",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"positionTooltip",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"tooltipCss",{enumerable:!0,get:function(){return d}});const $e=te("packages/modules/charts/svg.js"),z=$e.el,N=$e.setText,ie=$e.round,R=te("packages/modules/gantt/assignments.js").parseAssignments,f=te("packages/modules/gantt/workload.js").formatCost,$=["start","end","duration","percentComplete","effort","resources","cost","slack","deadline"],E=new Set(["start","end","duration","slack"]);function F(c,k,Q,J){const{t:H,formatDate:se}=J;switch(c){case"start":return{label:H("gantt.tip.start"),value:se(k.es)};case"end":return{label:H("gantt.tip.end"),value:se(k.ef)};case"duration":return{label:H("gantt.tip.durationLabel"),value:H("gantt.tip.durationValue",{days:ie(k.duration)})};case"percentComplete":return k.percentComplete==null?null:{label:H("gantt.tip.complete"),value:`${Math.round(k.percentComplete)}%`};case"effort":return k.effort==null?null:{label:H("gantt.tip.effortLabel"),value:H("gantt.tip.effortValue",{hours:ie(k.effort)})};case"resources":{const fe=R(Q).map(ke=>ke.resource);return fe.length?{label:H("gantt.tip.assigned"),value:fe.map(ke=>J.resourceName(ke)).join(", ")}:null}case"cost":{const fe=Q&&Q.cost!=null?Number(Q.cost):NaN;return Number.isFinite(fe)?{label:H("gantt.tip.cost"),value:f(fe)}:null}case"slack":return Number.isFinite(k.totalFloat)?{label:H("gantt.tip.slackLabel"),value:H("gantt.tip.slackValue",{days:ie(k.totalFloat)})}:null;case"deadline":return Number.isFinite(k.deadline)?{label:H("gantt.tip.deadline"),value:se(k.deadline)}:null;default:return null}}function W(c,k,Q,J){if(c.isMilestone&&!c.unscheduled)return[{label:J.t("gantt.tip.date"),value:J.formatDate(c.es)}];let H=Array.isArray(Q)&&Q.length?Q:$;c.unscheduled&&(H=H.filter(fe=>!E.has(fe)));const se=[];for(const fe of H){const ke=F(fe,c,k,J);ke&&se.push(ke)}return se}function A(c,k,Q){return[c.name,...k.map(J=>Q("gantt.tip.row",{label:J.label,value:J.value}))].join(`
|
|
7
|
-
`)}function q(c,k,Q,J){const H=z(c,"div",`${k}__tip-card`),se=z(c,"div",`${k}__tip-title`);N(se,Q.name),H.appendChild(se);for(const fe of J){const ke=z(c,"div",`${k}__tip-row`),ge=z(c,"span",`${k}__tip-label`);N(ge,fe.label);const ue=z(c,"span",`${k}__tip-value`);N(ue,fe.value),ke.appendChild(ge),ke.appendChild(ue),H.appendChild(ke)}return H}function S(c,k,Q,J,H,se){if(typeof H=="function"){const ge=H(Q,{...se,rawTask:J});if(ge==null||ge==="")return null;if(typeof ge=="string")return{node:null,text:ge};const ue=ge.textContent||"",X=z(c,"div",`${k}__tip-card`);return X.appendChild(ge),{node:X,text:ue}}const fe=H&&typeof H=="object"&&Array.isArray(H.fields)?H.fields:null,ke=W(Q,J,fe,se);return{node:q(c,k,Q,ke),text:
|
|
6
|
+
(function(yt){"use strict";var wt=!0,dt=Object.create(null),ft=Object.create(null);function Re(s,te){dt[s]=te}function ht(s){var te=ft[s];if(te)return te;var $e=Object.create(null);ft[s]=$e;var z=dt[s];if(!z)throw new Error("[lattice] missing module: "+s);return z($e,ht),$e}Re("packages/core/src/internal/predicates.js",function(s,te){"use strict";Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return U}});function $e(R){return R!==null&&typeof R=="object"&&!Array.isArray(R)}function z(R){return typeof R=="function"}function N(R){return R==null}function ie(R){return R==null||R===""}function U(R){return typeof R!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(R))?!0:!!(R.prototype&&Object.getOwnPropertyNames(R.prototype).length>1)}}),Re("packages/core/src/internal/warn.js",function(s,te){"use strict";Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return S}});const $e=new Set,z=2e3;function N(i){if($e.add(i),$e.size>z){const d=$e.values().next().value;d!==void 0&&$e.delete(d)}}const ie=[],U=500;function R(i,d,c){ie.push({key:i,level:d,message:c.map(k=>typeof k=="string"?k:L(k)).join(" "),at:Date.now()}),ie.length>U&&ie.shift()}function L(i){if(i instanceof Error)return i.message;try{return JSON.stringify(i)}catch{return String(i)}}function f(){return ie.map(i=>({...i}))}function $(i){if(i.length===0||typeof i[0]!="string")return i;const d=i[0].replace(/^\[lattice\]\s*/,"");return d===i[0]?i:[d,...i.slice(1)]}function E(i,...d){if($e.has(i))return;N(i);const c=$(d);R(i,"warn",c),console.warn("[lattice]",...c)}function F(i,...d){if($e.has(i))return;N(i);const c=$(d);R(i,"info",c),console.info("[lattice]",...c)}function W(){$e.clear(),ie.length=0}function P(i,d){const c=new Error(`[lattice] ${i}`);throw d!==void 0&&(c.cause=d),c}function q(i,d){i||P(d)}const S=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})()}),Re("packages/core/src/internal/merge.js",function(s,te){"use strict";Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return L}});const z=te("packages/core/src/internal/predicates.js").isObject;function N(f,$,E){if(f!==void 0)return f===!0?{enabled:!0,...E}:f===!1?{enabled:!1}:z(f)?f:{[$]:f,enabled:!0}}function ie(f){return f==null?[]:Array.isArray(f)?f:[f]}const U=Object.freeze(new Set(["__proto__","constructor","prototype"]));function R(f,$){if(!z(f))return z($)?{...$}:$;if(!z($))return $===void 0?f:$;const E={...f};for(const F of Object.keys($)){if(U.has(F))continue;const W=$[F];W!==void 0&&(E[F]=z(W)&&z(E[F])?R(E[F],W):W)}return E}function L(f,$){if(!z(f)||!z($)||f===$)return $;const E=Object.create(Object.getPrototypeOf(f));return Object.assign(E,f,$),E}}),Re("packages/core/src/internal/paths.js",function(s,te){"use strict";Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return R}});const $e=new Map;function z(L){let f=$e.get(L);if(f)return f;if(!L.includes("."))f=$=>$?.[L];else{const $=L.split("."),E=$.length;f=F=>{let W=F;for(let P=0;P<E;P++){if(W==null)return;W=W[$[P]]}return W}}return $e.set(L,f),f}const N=new Map;function ie(L){let f=N.get(L);if(f)return f;if(!L.includes("."))f=($,E)=>{$!=null&&($[L]=E)};else{const $=L.split("."),E=$.length-1;f=(F,W)=>{let P=F;for(let q=0;q<E;q++){if(P==null)return;const S=$[q];P[S]==null&&(P[S]={}),P=P[S]}P!=null&&(P[$[E]]=W)}}return N.set(L,f),f}function U(L,f){return z(f)(L)}function R(L,f,$){ie(f)(L,$)}}),Re("packages/modules/gantt/time.js",function(s,te){"use strict";Object.defineProperty(s,"toDayNumber",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"fromDayNumber",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"toISODate",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"resolveProjectEpoch",{enumerable:!0,get:function(){return L}});const z=te("packages/core/src/internal/warn.js").warnOnce,N=864e5;function ie(f){if(f==null||f==="")return null;if(typeof f=="number")return Number.isFinite(f)?f:null;if(f instanceof Date)return Number.isFinite(f.getTime())?Math.floor(Date.UTC(f.getFullYear(),f.getMonth(),f.getDate())/N):null;const $=Date.parse(f);return Number.isFinite($)?Math.floor($/N):null}function U(f){return Number.isFinite(f)?new Date(Math.round(f)*N):null}function R(f){const $=U(f);return $?$.toISOString().slice(0,10):null}function L(f){if(f==null||f==="")return 0;const $=ie(f);return Number.isFinite($)?$:(z(`gantt.projectEpoch:${String(f)}`,`[lattice] gantt: projectEpoch ${JSON.stringify(f)} is not a date or a day number; the plan is rendered against the Unix epoch (day 0 = 1970-01-01).`),0)}}),Re("packages/modules/gantt/calendar.js",function(s,te){"use strict";Object.defineProperty(s,"createCalendar",{enumerable:!0,get:function(){return ie}});const z=te("packages/modules/gantt/time.js").toDayNumber,N=Object.freeze([1,2,3,4,5]);function ie(U,R=0){if(U==null)return null;let L,f;U==="weekends"?(L=N,f=new Set):(L=Array.isArray(U.workdays)&&U.workdays.length?U.workdays.map(Number).filter(c=>c>=0&&c<=6):N,f=new Set((Array.isArray(U.holidays)?U.holidays:[]).map(c=>z(c)).filter(c=>c!=null)));const $=new Set(L);if($.size===7&&f.size===0||$.size===0)return null;const E=c=>{let k=(c%7+4)%7;return k<0&&(k+=7),k},F=c=>{if(!Number.isFinite(c))return!1;const k=Math.round(c);return $.has(E(k))&&!f.has(k)},W=c=>{let k=c;for(;!F(k);)k+=1;return k},P=W(Math.round(Number.isFinite(R)?R:0)),q=$.size,S=(c,k)=>{if(k<c)return 0;const Q=k-c+1,J=Math.floor(Q/7);let H=J*q;const se=E(c);for(let fe=J*7;fe<Q;fe+=1)$.has((se+fe)%7)&&(H+=1);for(const fe of f)fe>=c&&fe<=k&&$.has(E(fe))&&(H-=1);return H};return{isWorking:F,nextWorking:W,dayOf:c=>{const k=Math.round(c);if(k===0)return P;if(k>0){const ke=Math.floor(k/q);let ge=P+ke*7,ue=k-ke*q;for(;ue>0;)ge+=1,$.has(E(ge))&&(ue-=1);let X=0;for(const ee of f)ee>P&&ee<=ge&&$.has(E(ee))&&(X+=1);for(;X>0;)ge+=1,F(ge)&&(X-=1);for(;!F(ge);)ge+=1;return ge}const Q=-k,J=Math.floor(Q/q);let H=P-J*7,se=Q-J*q;for(;se>0;)H-=1,$.has(E(H))&&(se-=1);let fe=0;for(const ke of f)ke>=H&&ke<P&&$.has(E(ke))&&(fe+=1);for(;fe>0;)H-=1,F(H)&&(fe-=1);for(;!F(H);)H-=1;return H},indexOf:c=>{const k=W(Math.round(c));return k>=P?S(P,k)-1:-(S(k,P)-1)},anchor:P}}}),Re("packages/modules/gantt/week.js",function(s,te){"use strict";Object.defineProperty(s,"EXPLICIT_WEEK_START_DAY",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"localeWeekStartDay",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"validWeekStartDay",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"resolveWeekStartDay",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"weekStartOf",{enumerable:!0,get:function(){return f}});const z=te("packages/modules/gantt/time.js").fromDayNumber,N=Symbol("gantt.explicitWeekStartDay"),ie=new Set(["US","CA","MX","BR","AR","CO","VE","EC","PE","CL","IL","JP","KR","TW","HK","PH","ZA","EG"]);function U($){if(!$||typeof $!="string")return null;try{const E=new Intl.Locale($),F=E.weekInfo??(typeof E.getWeekInfo=="function"?E.getWeekInfo():null);if(F&&Number.isFinite(F.firstDay))return F.firstDay===7?0:F.firstDay;const W=E.region||$.split(/[-_]/).find(P=>P.length===2);if(W)return ie.has(W.toUpperCase())?0:1}catch{}return null}function R($){return Number.isFinite($)&&$>=0&&$<=6?Math.floor($):null}function L($,E){const F=R($);if(F!=null)return F;const W=U(E);return W??0}function f($,E){const F=z($),W=F?F.getUTCDay():0;return $-((W-E)%7+7)%7}}),Re("packages/modules/gantt/zoom.js",function(s,te){"use strict";Object.defineProperty(s,"ZOOM_PRESETS",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"ZOOM_LEVEL_NAMES",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"resolveZoomPreset",{enumerable:!0,get:function(){return N}});const $e=Object.freeze({hour:Object.freeze({px:624,step:1/24,level:"hour"}),day:Object.freeze({px:26,step:1,level:"day"}),week:Object.freeze({px:12,step:7,level:"week"}),month:Object.freeze({px:4,step:30,level:"month"}),quarter:Object.freeze({px:1.8,step:91,level:"quarter"})}),z=Object.freeze(["hour","day","week","month","quarter"]);function N(ie,U="day"){if(typeof ie=="number"&&Number.isFinite(ie)&&ie>0){const R=ie>=60?"hour":ie>=18?"day":ie>=8?"week":ie>=2.5?"month":"quarter";return{px:ie,step:$e[R].step,level:R}}return typeof ie=="string"&&Object.prototype.hasOwnProperty.call($e,ie)?{...$e[ie]}:{...$e[U]||$e.day}}}),Re("packages/modules/gantt/workload-groups.js",function(s,te){"use strict";Object.defineProperty(s,"GROUP_KEY_PREFIX",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"isGroupKey",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"normalizeGroupBy",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"groupOfResource",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"groupBookingSubRows",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"groupWorkloadRows",{enumerable:!0,get:function(){return f}});const $e="group:";function z($){return typeof $=="string"&&$.startsWith($e)}function N($){return typeof $=="function"||typeof $=="string"&&$.trim()!==""?$:null}function ie($,E){let F=null;try{F=typeof $=="function"?$(E):E?E[$]:null}catch{F=null}return F==null||F===""?null:String(F)}function U($,E){return Array.isArray(E)?$?$.map((F,W)=>{const P=E[W];return P==null?F:F==null?P:F+P}):E.map(F=>F??null):$}function R($,E){return E==null||!Number.isFinite(E)?$:$==null?E:$+E}function L($){const E=[],F=new Map;for(const W of $){if(!W.external||W.group==null){E.push(W);continue}const P=F.get(W.group);if(P){P.cells=U(P.cells,W.cells),P.total+=Number(W.total)||0,P.bookings.push(W);continue}const q={...W,id:`${$e}${W.group}`,name:W.group,cells:U(null,W.cells),total:Number(W.total)||0,bookings:[W]};F.set(W.group,q),E.push(q)}return E}function f($,E){const F=new Map;for(const P of $){const q=E(P.resource==null?null:P.resource);F.has(q)||F.set(q,[]),F.get(q).push(P)}return[...F.keys()].sort((P,q)=>P==null?q==null?0:1:q==null?-1:P.localeCompare(q,void 0,{numeric:!0,sensitivity:"base"})).map(P=>{const q=F.get(P);let S=null,i=null,d=null,c=null,k=null,Q=0;for(const H of q)S=U(S,H.cells),i=U(i,H.available),d=U(d,H.costCells),c=R(c,H.availableTotal),k=R(k,H.costTotal),Q+=Number(H.total)||0;S=S||[];const J=S.map((H,se)=>H!=null&&i!=null&&i[se]!=null&&H>i[se]+1e-9);return{value:P,key:`${$e}${P??""}`,rows:q,cells:S,available:i,availableTotal:c,total:Q,costCells:d,costTotal:k,over:J}})}}),Re("packages/modules/shared/axislabels.js",function(s,te){"use strict";Object.defineProperty(s,"CHAR_RATIO",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"BOLD_FACTOR",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"MIN_GAP",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"estimateLabelWidth",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"thinLabels",{enumerable:!0,get:function(){return U}});const $e=.62,z=1.05,N=6;function ie(R,L,f=!1){return String(R??"").length*L*$e*(f?z:1)}function U(R,L){const f=Number.isFinite(L.gap)?Number(L.gap):N,$=Number.isFinite(L.fontSize)?Number(L.fontSize):11,E=typeof L.measure=="function"?L.measure:S=>ie(S,$,!!L.bold),F=R.filter(S=>S&&Number.isFinite(S.at)).map(S=>({...S,width:E(String(S.text??""))})).sort((S,i)=>S.at-i.at);if(F.length<2)return{every:1,kept:F};const W=S=>{let i=null;for(let d=0;d<F.length;d+=S){const c=F[d];if(i&&c.at-i.at<i.width+f)return!1;i=c}return!0};let P=1;for(;P<F.length&&!W(P);)P++;const q=[];for(let S=0;S<F.length;S+=P)q.push(F[S]);return{every:P,kept:q}}}),Re("packages/modules/scheduler/ticklabels.js",function(s,te){"use strict";Object.defineProperty(s,"TICK_FONT_SIZE",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"TICK_INSET",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"labelWidth",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"resolveTickLabels",{enumerable:!0,get:function(){return R}});const z=te("packages/modules/shared/axislabels.js").thinLabels,N=11,ie=7;function U(L,f){const $=String(L??"");let E=0;for(const F of $)E+=F>="A"&&F<="Z"?1:.62;return E*f}function R(L,f,$){const E=$.px,F=$.startDay,W=$.endDay,P=Number.isFinite($.fontSize)&&$.fontSize>0?$.fontSize:N,q=L.map(c=>({day:c,at:(c-F)*E,label:""}));if(q.length===0)return q;let S=1/0;for(let c=1;c<q.length;c++){const k=q[c].at-q[c-1].at;k<S&&(S=k)}let i=null;for(const c of f){let k=0;for(const Q of L){const J=U(c.label(Q),P);J>k&&(k=J)}if(k<=S){i=c;break}}if(i)for(const c of q)c.label=i.label(c.day);else{const c=f[f.length-1],k=q.map(H=>({at:H.at,text:c.label(H.day)})),Q=z(k,{fontSize:P,measure:H=>U(H,P)}).kept,J=new Set(Q.map(H=>H.at));for(const H of q)H.label=J.has(H.at)?c.label(H.day):""}const d=(W-F)*E;for(let c=q.length-1;c>=0;c--){const k=q[c];if(k.label)if(k.at+ie+U(k.label,P)>d)k.label="";else break}return q}}),Re("packages/modules/scheduler/model.js",function(s,te){"use strict";Object.defineProperty(s,"GROUP_KEY_PREFIX",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"parseDate",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"accessorFor",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"dateToDay",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"eventSpan",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"addMinutes",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"defaultResourceColumns",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"resolveWorkload",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"resolveContext",{enumerable:!0,get:function(){return u}}),Object.defineProperty(s,"anchorDay",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"axisSpan",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"monthStartOf",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"monthEndOf",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"computeTicks",{enumerable:!0,get:function(){return v}}),Object.defineProperty(s,"assignLanes",{enumerable:!0,get:function(){return e}}),Object.defineProperty(s,"placeEvents",{enumerable:!0,get:function(){return n}}),Object.defineProperty(s,"colorFor",{enumerable:!0,get:function(){return o}}),Object.defineProperty(s,"resourceNonWorking",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"laneCount",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"eventText",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"searchableText",{enumerable:!0,get:function(){return a}}),Object.defineProperty(s,"visibleEvents",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"visibleResources",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"buildDisplayRows",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(s,"snapToStep",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"formatFieldDate",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(s,"formatFieldDateLike",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(s,"isEventReadOnly",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"isResourceReadOnly",{enumerable:!0,get:function(){return Ee}});const z=te("packages/core/src/internal/warn.js").warnOnce,ie=te("packages/core/src/internal/paths.js").getPath,U=te("packages/core/src/internal/predicates.js"),R=U.isFunction,L=U.isNil,f=U.isObject,$=te("packages/modules/gantt/time.js"),E=$.toDayNumber,F=$.fromDayNumber,P=te("packages/modules/gantt/calendar.js").createCalendar,q=te("packages/modules/gantt/week.js"),S=q.resolveWeekStartDay,i=q.weekStartOf,c=te("packages/modules/gantt/zoom.js").resolveZoomPreset,k=te("packages/modules/gantt/workload-groups.js"),Q=k.normalizeGroupBy,J=k.groupOfResource,se=te("packages/modules/scheduler/ticklabels.js").resolveTickLabels,fe=864e5,ke="sched:";function ge(M){if(M instanceof Date)return Number.isNaN(M.getTime())?null:M;if(typeof M=="number"&&Number.isFinite(M))return new Date(M);if(typeof M!="string")return null;const h=M.trim();if(!h)return null;let ae=/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})(?::(\d{2}))?$/.exec(h);if(ae){const t=new Date(+ae[1],+ae[2]-1,+ae[3],+ae[4],+ae[5],ae[6]?+ae[6]:0);return Number.isNaN(t.getTime())?null:t}if(ae=/^(\d{4})-(\d{2})-(\d{2})$/.exec(h),ae){const t=new Date(+ae[1],+ae[2]-1,+ae[3]);return Number.isNaN(t.getTime())?null:t}const be=new Date(h);return Number.isNaN(be.getTime())?null:be}function ue(M){return R(M)?M:typeof M=="string"?h=>ie(h,M):()=>{}}function X(M){const h=E(M),ae=((M.getHours()*60+M.getMinutes())*60+M.getSeconds())/86400;return{day:h??0,frac:ae}}function ee(M,h){const ae=ue(M.fields.startDate)(h),be=ge(ae);if(!be)return{start:null,end:null};const t=X(be);let T;const I=ue(M.fields.endDate)(h),m=ge(I);return m?T=X(m):T=A(t,M.defaultDuration),(T.day<t.day||T.day===t.day&&T.frac<t.frac)&&(T=A(t,M.defaultDuration)),{start:t,end:T}}function A(M,h){const ae=M.day*1440+Math.round(M.frac*1440)+h;return{day:Math.floor(ae/1440),frac:ae%1440/1440}}function K(){return[{id:"name",field:"name",title:"Name",layout:{width:160}},{id:"role",field:"role",title:"Role",layout:{width:120}},{id:"capacity",field:"capacity",title:"Capacity",type:"number",layout:{width:90}}]}function Y(M){if(M===!0)return{hoursPerDay:8,defaultCapacity:1,decimals:1};if(M&&typeof M=="object"&&!Array.isArray(M)){const h=(be,t)=>typeof be=="number"&&Number.isFinite(be)&&be>0?be:t,ae=typeof M.decimals=="number"&&Number.isFinite(M.decimals)&&M.decimals>=0?Math.round(M.decimals):1;return{hoursPerDay:h(M.hoursPerDay,8),defaultCapacity:h(M.defaultCapacity,1),decimals:ae}}return null}function u(M){const h=f(M)?M:{},ae=f(h.fields)?h.fields:{};return{resources:Array.isArray(h.resources)?h.resources:[],events:Array.isArray(h.events)?h.events:[],createGrid:R(h.createGrid)?h.createGrid:null,fields:{resourceId:typeof ae.resourceId=="string"?ae.resourceId:"resourceId",startDate:typeof ae.startDate=="string"?ae.startDate:"startDate",endDate:typeof ae.endDate=="string"?ae.endDate:"endDate",name:typeof ae.name=="string"?ae.name:"name",calendar:typeof ae.calendar=="string"?ae.calendar:"calendar"},resourceKey:typeof h.resourceKey=="string"?h.resourceKey:"id",eventKey:typeof h.eventKey=="string"?h.eventKey:"id",columns:Array.isArray(h.columns)&&h.columns.length?h.columns:K(),zoom:c(h.zoom==="fit"?"day":h.zoom,"day"),fit:h.zoom==="fit",zoomName:typeof h.zoom=="string"?h.zoom:"day",anchor:ge(h.date)||ge(h.startDate)||null,defaultDuration:typeof h.defaultDuration=="number"&&h.defaultDuration>0?h.defaultDuration:60,rowHeight:typeof h.rowHeight=="number"&&h.rowHeight>0?h.rowHeight:34,resourceWidth:typeof h.resourceWidth=="number"&&Number.isFinite(h.resourceWidth)&&h.resourceWidth>0?h.resourceWidth:300,locale:typeof h.locale=="string"?h.locale:void 0,timeZone:typeof h.timeZone=="string"?h.timeZone:void 0,weekStartDay:S(h.weekStartDay,typeof h.locale=="string"?h.locale:void 0),todayLine:h.todayLine!==!1,pinchZoom:h.pinchZoom!==!1,nonWorking:h.nonWorking!==!1,calendars:f(h.calendars)?h.calendars:null,workload:Y(h.workload),ariaLabel:typeof h.ariaLabel=="string"?h.ariaLabel:"",messages:f(h.messages)?h.messages:null,labels:f(h.labels)?h.labels:{},overscan:typeof h.overscan=="number"&&h.overscan>=0?h.overscan:5,colorProperty:typeof h.colorProperty=="string"?h.colorProperty:null,colorMap:f(h.colorMap)?h.colorMap:null,groupBy:Q(h.groupBy),search:typeof h.search=="string"?h.search.trim():"",resourceFilter:R(h.resourceFilter)?h.resourceFilter:null,eventFilter:R(h.eventFilter)?h.eventFilter:null,editable:h.editable!==!1,readOnlyWhen:R(h.readOnlyWhen)?h.readOnlyWhen:null,resourceReadOnlyWhen:R(h.resourceReadOnlyWhen)?h.resourceReadOnlyWhen:null}}function j(M){if(M.anchor)return E(M.anchor);let h=null;for(const ae of M.events){const be=ge(ue(M.fields.startDate)(ae));if(be){const t=E(be);(h==null||t<h)&&(h=t)}}return h??E(new Date)}function B(M,h){let ae=h,be=h+1;for(const I of M.events){const m=ee(M,I);m.start&&(m.start.day<ae&&(ae=m.start.day),m.end.day>be&&(be=m.end.day))}const t=i(ae,M.weekStartDay);let T=be+1;return M.zoom.level==="month"||M.zoom.level==="quarter"?{startDay:Z(t),endDay:le(T)}:(T-t<14&&(T=t+14),{startDay:t,endDay:T})}function Z(M){const h=F(M);return Math.floor(Date.UTC(h.getUTCFullYear(),h.getUTCMonth(),1)/fe)}function le(M){const h=F(M);return Math.floor(Date.UTC(h.getUTCFullYear(),h.getUTCMonth()+1,1)/fe)}function v(M,h,ae){const be=M.zoom.level,t=M.zoom.px,T=M.locale||void 0,I=M.timeZone||"UTC",m=O=>new Date(Math.round(O)*fe),b=O=>new Intl.DateTimeFormat(T,{...O,timeZone:I}),g=(O,oe)=>b(oe).format(m(O)),D=[];let V;if(be==="hour"){for(let O=h;O<ae;O+=1/24)D.push(O);V=[{name:"hour-minute",label:O=>b({hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(O*fe))},{name:"hour",label:O=>b({hour:"2-digit",hour12:!1}).format(new Date(O*fe))}]}else if(be==="day"){for(let O=h;O<ae;O+=1)D.push(O);V=[{name:"weekday-day",label:O=>g(O,{weekday:"short",day:"numeric"})},{name:"weekday",label:O=>g(O,{weekday:"short"})},{name:"weekday-narrow",label:O=>g(O,{weekday:"narrow"})}]}else if(be==="week"){for(let O=i(h,M.weekStartDay);O<ae;O+=7)D.push(O);V=[{name:"month-day",label:O=>g(O,{month:"short",day:"numeric"})},{name:"day",label:O=>g(O,{day:"numeric"})}]}else{const O=be==="quarter"?3:1;let oe=Z(h);for(;oe<ae;){D.push(oe);const de=m(oe);oe=Math.floor(Date.UTC(de.getUTCFullYear(),de.getUTCMonth()+O,1)/fe)}be==="quarter"?V=[{name:"quarter",label:de=>m(de).getUTCMonth()===0?g(de,{month:"short",year:"numeric"}):g(de,{month:"short"})},{name:"month",label:de=>g(de,{month:"short"})}]:V=[{name:"month-year",label:de=>g(de,{month:"short",year:"numeric"})},{name:"month",label:de=>g(de,{month:"short"})}]}return se(D,V,{px:t,startDay:h,endDay:ae})}function e(M){M.sort((ae,be)=>ae.startDay-be.startDay||be.endDay-be.startDay-(ae.endDay-ae.startDay)||(String(ae.key)<String(be.key)?-1:String(ae.key)>String(be.key)?1:0));const h=[];for(const ae of M){const be=h[h.length-1];be&&ae.startDay<be.endDay?(be.items.push(ae),ae.endDay>be.endDay&&(be.endDay=ae.endDay)):h.push({items:[ae],endDay:ae.endDay})}for(const ae of h){const be=[];for(const t of ae.items){let T=0;for(;T<be.length&&be[T]>t.startDay;)T++;t.lane=T,T===be.length?be.push(t.endDay):be[T]=t.endDay}for(const t of ae.items)t.lanes=be.length}return M}function n(M,h=M.events){const ae=ue(M.fields.resourceId),be=ue(M.eventKey),t=ue(M.fields.name),T=new Map,I=[],m=new Map;let b=!1;for(const g of h){const D=be(g),V=ae(g),O=ee(M,g);if(!O.start){I.push({key:D,row:g}),b||(b=!0,z("scheduler:unparsable-start",`scheduler: an event's "${M.fields.startDate}" is empty or unparsable, so it is not shown; count it in \`unscheduled\`.`));continue}const oe={key:D,row:g,resourceKey:V,name:t(g),startDay:O.start.day+O.start.frac,endDay:O.end.day+O.end.frac,lane:0,lanes:1,color:o(M,g)};T.has(V)||T.set(V,[]),T.get(V).push(oe),m.set(D,oe)}for(const[,g]of T)e(g);return{byResource:T,unscheduled:I,keys:m}}function o(M,h){const ae=M.colorProperty;if(!ae)return null;const be=ue(ae)(h);return L(be)?null:M.colorMap&&f(M.colorMap)&&typeof M.colorMap[String(be)]=="string"?M.colorMap[String(be)]:typeof be=="string"&&/^(#|rgb|hsl|oklch|var\()/.test(be.trim())?be.trim():null}function p(M,h){const ae=ue(M.fields.calendar)(h);let be=ae;if(typeof ae=="string"&&M.calendars&&Object.prototype.hasOwnProperty.call(M.calendars,ae)&&(be=M.calendars[ae]),be==null)return null;const t=P(be,0);return t?T=>!t.isWorking(Math.round(T)):null}function l(M){let h=1;for(const ae of M)ae.lanes>h&&(h=ae.lanes);return h}function _(M,h,ae){const be=ue(M.fields.name)(h);return L(be)?String(ae):String(be)}function a(M){return M==null?"":typeof M!="object"?String(M):Object.keys(M).filter(h=>M[h]!=null&&(typeof M[h]=="string"||typeof M[h]=="number")).map(h=>String(M[h])).join(" ")}function y(M,h){return h===""||String(M||"").toLocaleLowerCase().includes(h)}function w(M,h){try{return M(h)!==!1}catch{return!0}}function x(M){return(M.search||"").trim().toLocaleLowerCase()}function G(M){const h=x(M);return M.events.filter(ae=>M.eventFilter&&!w(M.eventFilter,ae)?!1:y(a(ae),h))}function ne(M){const h=x(M),ae=ue(M.resourceKey),be=ue(M.fields.resourceId);return M.resources.filter(t=>{if(M.resourceFilter&&!w(M.resourceFilter,t))return!1;if(!h||y(a(t),h))return!0;const T=ae(t);return M.events.some(I=>be(I)===T&&y(a(I),h))})}function ve(M,h,ae,be){const t=[];if(!h){for(const m of M)t.push({type:"resource",resource:m});return t}const T=new Map,I=[];for(const m of M){const b=J(h,m);T.has(b)||(T.set(b,[]),I.push(b)),T.get(b).push(m)}I.sort((m,b)=>m==null?b==null?0:1:b==null?-1:m.localeCompare(b,void 0,{numeric:!0,sensitivity:"base"}));for(const m of I){const b=m==null?be||"Ungrouped":String(m);if(t.push({type:"group",key:`${ke}${m??""}`,value:m,label:b,expanded:!ae.has(m)}),!ae.has(m))for(const g of T.get(m))t.push({type:"resource",resource:g})}return t}function pe(M,h){return!Number.isFinite(M)||M<=0?h:Math.round(h/M)*M}function Oe(M){if(!Number.isFinite(M))return null;const h=F(Math.floor(M));if(!h)return null;const ae=Math.round((M-Math.floor(M))*1440),be=Math.floor(ae/60),t=ae%60,T=I=>String(I).padStart(2,"0");return`${h.getUTCFullYear()}-${T(h.getUTCMonth()+1)}-${T(h.getUTCDate())} ${T(be)}:${T(t)}`}function Ae(M,h){const ae=Oe(h);return ae&&typeof M=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(M)?ae.slice(0,10):ae}function me(M,h){if(!h)return!1;if(h.readOnly===!0)return!0;if(R(M.readOnlyWhen))try{return!!M.readOnlyWhen(h)}catch{return!1}return!1}function Ee(M,h){if(!h)return!1;if(h.readOnly===!0)return!0;if(R(M.resourceReadOnlyWhen))try{return!!M.resourceReadOnlyWhen(h)}catch{return!1}return!1}}),Re("packages/modules/shared/emitter.js",function(s,te){"use strict";Object.defineProperty(s,"WILDCARD",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"Emitter",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"gate",{enumerable:!0,get:function(){return $}});const z=te("packages/core/src/internal/predicates.js").isFunction,ie=te("packages/core/src/internal/warn.js").warnOnce,U="*",R=new Set(["api","user","init","ai"]);function L(E,F){return E&&E.name?E.name:`#${F}`}class f{#e=new Map;#t;constructor(F="module"){this.#t=String(F)}on(F,W){if(!z(W))return()=>{};let P=this.#e.get(F);return P||(P=new Set,this.#e.set(F,P)),P.add(W),()=>this.off(F,W)}off(F,W){const P=this.#e.get(F);P&&P.delete(W)}count(F){const W=this.#e.get(F);return W?W.size:0}emit(F,W){const P=this.#e.get(F),q=this.#e.get(U);if((!P||P.size===0)&&(!q||q.size===0))return;const S={...W||null,type:F};P&&P.size&&this.#n([...P],S,F),q&&q.size&&this.#n([...q],S,U)}#n(F,W,P){for(let q=0;q<F.length;q++)try{F[q](W)}catch(S){ie(`${this.#t}.emit.throw:${P}:${L(F[q],q)}`,`${this.#t}: a '${P}' handler threw; other handlers were unaffected.`,S)}}emitBefore(F,W,P){const q=P??(W&&W.origin),S=R.has(q)?q:"user";let i=!1,d=null;const c=fe=>{i=!0,fe!=null&&d===null&&(d=String(fe))},k={...W||null,type:F,origin:S,get defaultPrevented(){return i},get reason(){return d},preventDefault(fe){c(fe)}},Q=this.#e.get(F);if(!Q||Q.size===0)return!0;const J=[...Q],H=()=>(i&&d===null&&(d="prevented"),i&&W&&typeof W=="object"&&(W.reason=d),!i),se=[];for(let fe=0;fe<J.length;fe++){const ke=J[fe];try{const ge=ke(k);ge&&z(ge.then)?se.push(ge):ge===!1&&c("prevented")}catch(ge){c("error"),ie(`${this.#t}.beforeThrow:${F}:${L(ke,fe)}`,`${this.#t}: a '${F}' before-handler threw; the action was cancelled.`,ge)}}return se.length===0?H():Promise.allSettled(se).then(fe=>{for(const ke of fe)ke.status==="rejected"?(c("error"),ie(`${this.#t}.beforeReject:${F}`,`${this.#t}: a '${F}' before-handler rejected; the action was cancelled.`,ke.reason)):ke.value===!1&&c("prevented");return H()})}clear(){this.#e.clear()}}function $(E,F,W,P,q){const S=E.emitBefore(F,P,P.origin),i=()=>(E.emit(W,{...P,reason:P.reason||"prevented"}),!1);return S===!1?i():S&&z(S.then)?S.then(d=>d?q():i()):q()}}),Re("packages/modules/charts/svg.js",function(s,te){"use strict";Object.defineProperty(s,"SVG_NS",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"el",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"svg",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"attr",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"attrs",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"setText",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"clear",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"append",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"path",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"ribbonPath",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"round",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"pathRings",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"insideRings",{enumerable:!0,get:function(){return q}});const $e="http://www.w3.org/2000/svg";function z(S){const i=S.indexOf(")");return i<0?S:S.slice(i+1).trim()||"#0072b2"}function N(S,i,d){const c=S.createElement(i);return d&&c.setAttribute("class",d),c}function ie(S,i,d){const c=S.createElementNS($e,i);if(d)for(const k of Object.keys(d))c.setAttribute(k,String(d[k]));return c}function U(S,i,d){if(!S)return;if(d==null){S.removeAttribute(i);return}let c=String(d);c.startsWith("url(#")&&(i==="stroke"||i==="fill"&&S.localName==="text")&&(c=z(c)),S.setAttribute(i,c)}function R(S,i){if(S)for(const d of Object.keys(i))U(S,d,i[d])}function L(S,i){S&&(S.textContent=i==null?"":String(i))}function f(S){if(S)for(;S.firstChild;)S.removeChild(S.firstChild)}function $(S,i){for(const d of i)d&&S.appendChild(d);return S}function E(S){return S.join(" ")}function F(S){if(!S||S.length<2)return"";const i=["M",S[0].x,S[0].upper];for(let d=1;d<S.length;d++)i.push("L",S[d].x,S[d].upper);for(let d=S.length-1;d>=0;d--)i.push("L",S[d].x,S[d].lower);return i.push("Z"),E(i)}function W(S){return Math.round(S*100)/100}function P(S){const i=[];let d=[];const c=String(S||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let k="",Q=[];const J=()=>{if(!k||!Q.length){Q=[];return}if(k==="M"||k==="L")for(let H=0;H+1<Q.length;H+=2)d.push([Q[H],Q[H+1]]);else k!=="Z"&&Q.length>=2&&d.push([Q[Q.length-2],Q[Q.length-1]]);Q=[]};for(const H of c){if(/[A-Za-z]/.test(H)){if(J(),H==="Z"||H==="z"){d.length>2&&i.push(d),d=[],k="";continue}H==="M"&&d.length>2&&(i.push(d),d=[]),k=H;continue}Q.push(Number(H))}return J(),d.length>2&&i.push(d),i}function q(S,i,d){let c=!1;for(const k of S)for(let Q=0,J=k.length-1;Q<k.length;J=Q++){const[H,se]=k[Q],[fe,ke]=k[J];se>d!=ke>d&&i<(fe-H)*(d-se)/(ke-se||1e-12)+H&&(c=!c)}return c}}),Re("packages/modules/gantt/assignments.js",function(s,te){"use strict";Object.defineProperty(s,"parseAssignments",{enumerable:!0,get:function(){return z}});function $e(N){if(N==null||N==="")return null;const ie=typeof N=="number"?N:Number(N);return Number.isFinite(ie)?ie:null}function z(N){if(N&&Array.isArray(N.assignments))return N.assignments.map(R=>{const L=R&&(R.resource??R.name??R.id);if(L==null||L==="")return null;const f=$e(R.units)??$e(R.allocation)??1;return{resource:String(L),units:f}}).filter(Boolean);const ie=N?N.assignee??N.assignees??N.owner:null;return(Array.isArray(ie)?ie:ie==null||ie===""?[]:[ie]).map(R=>String(R)).filter(R=>R!=="").map(R=>({resource:R,units:1}))}}),Re("packages/modules/gantt/task-calendars.js",function(s,te){"use strict";Object.defineProperty(s,"PLAN_CALENDAR_ID",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"parseHolidayDays",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"planWorkingTime",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"normalizeCalendarSpec",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"resolveCalendars",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"PLAIN_TIME",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"createTimeModel",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"workingRuns",{enumerable:!0,get:function(){return q}});const z=te("packages/modules/gantt/calendar.js").createCalendar,ie=te("packages/modules/gantt/time.js").toDayNumber,U="plan",R=Object.freeze([0,1,2,3,4,5,6]),L=Object.freeze([1,2,3,4,5]);function f(S){const i=new Set;for(const d of Array.isArray(S)?S:[]){if(d&&typeof d=="object"&&!(d instanceof Date)&&("from"in d||"to"in d)){const k=ie(d.from),Q=ie(d.to??d.from);if(k==null)continue;const J=Q??k;for(let H=Math.min(k,J);H<=Math.max(k,J);H+=1)i.add(H);continue}const c=ie(d);c!=null&&i.add(c)}return[...i].sort((d,c)=>d-c)}function $(S){return S==null?{workdays:[...R],holidays:[],hoursPerDay:null}:S==="weekends"?{workdays:[...L],holidays:[],hoursPerDay:null}:{workdays:Array.isArray(S.workdays)&&S.workdays.length?S.workdays.map(Number).filter(d=>d>=0&&d<=6):[...L],holidays:f(S.holidays),hoursPerDay:null}}function E(S,i){let d,c,k=null;if(S==="weekends")d=[...L],c=[];else if(S&&typeof S=="object"&&!Array.isArray(S)&&!(S instanceof Date)){const J=S,H=J.workdays??J.workingDays;d=Array.isArray(H)&&H.length?H.map(Number).filter(fe=>fe>=0&&fe<=6):i.workdays;const se=J.holidays??J.exceptions;c=Array.isArray(se)?f(se):i.holidays,J.hoursPerDay!=null&&(k=J.hoursPerDay)}else return null;const Q=[...new Set(d)].sort((J,H)=>J-H);return{workdays:Q,holidays:c,hoursPerDay:k,key:`${Q.join(",")}|${c.join(",")}`}}function F(S){const i=$(S.calendar),d=Number.isFinite(S.projectStart)?S.projectStart:0,c=E({workdays:i.workdays,holidays:i.holidays},i).key,k=new Map,Q=[],J=new Map;for(const[ue,X]of Object.entries(S.calendars&&typeof S.calendars=="object"?S.calendars:{})){const ee=E(X,i);ee&&J.set(ue,ee)}const H=(ue,X)=>{if(!k.has(ue)){const ee=z({workdays:X.workdays,holidays:X.holidays},d);k.set(ue,{id:ue,workdays:X.workdays,holidays:X.holidays,hoursPerDay:X.hoursPerDay,calendar:ee,isWorking:ee?A=>ee.isWorking(A):()=>!0,key:X.key})}return k.get(ue)};H(U,{...i,key:c});const se=(ue,X,ee)=>{if(ue==null||ue==="")return U;if(typeof ue=="string"&&J.has(ue))return H(ue,J.get(ue)).id;const A=ue==="weekends"||ue&&typeof ue=="object"?E(ue,i):null;if(A){const Y=ue==="weekends"?"weekends":`${ee}:${X}`;return H(Y,A).id}const K=typeof ue=="string"?ue:JSON.stringify(ue);return Q.push({code:"unknown-calendar",message:`${ee} "${X}" names unknown calendar "${K}"`,id:X,calendar:K,owner:ee}),null},fe=new Map;let ke=!1;for(const ue of S.tasks||[]){const X=se(ue.calendar,ue.id,"task");X!=null&&(fe.set(ue.id,X),k.get(X).key!==c&&(ke=!0))}const ge=new Map;for(const ue of S.resources||[]){const X=se(ue.calendar,ue.id,"resource");if(X==null||X===U)continue;const ee=k.get(X);ge.set(ue.id,{workingDays:ee.workdays,holidays:ee.holidays,...ee.hoursPerDay!=null?{hoursPerDay:ee.hoursPerDay}:null})}return{errors:Q,customised:ke,models:k,ofTask:fe,resourceSpec:ge}}const W=Object.freeze({custom:!1,norm:(S,i)=>i,fin:(S,i,d)=>i+d,back:(S,i,d)=>i-d,shift:(S,i,d)=>i+d,unshift:(S,i,d)=>i-d,between:(S,i,d)=>i-d});function P(S){return{custom:!0,norm:(i,d)=>{const c=S(i);return c?c.nextWorking(d):d},fin:(i,d,c)=>{const k=S(i);return k?k.dayOf(k.indexOf(d)+c):d+c},back:(i,d,c)=>{const k=S(i);return k?k.dayOf(k.indexOf(d)-c):d-c},shift:(i,d,c)=>{const k=S(i);return k?k.dayOf(k.indexOf(d)+c):d+c},unshift:(i,d,c)=>{const k=S(i);return k?k.dayOf(k.indexOf(d)-c):d-c},between:(i,d,c)=>{const k=S(i);return k?k.indexOf(d)-k.indexOf(c):d-c}}}function q(S,i,d){const c=[];let k=null;for(let Q=Math.round(S);Q<Math.round(i);Q+=1)d(Q)?k==null&&(k=Q):k!=null&&(c.push([k,Q]),k=null);return k!=null&&c.push([k,Math.round(i)]),c}}),Re("packages/modules/gantt/unscheduled.js",function(s,te){"use strict";Object.defineProperty(s,"UNSCHEDULED_DEFAULT_DURATION",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"isUnscheduled",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"findUnscheduled",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"activeEdges",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"unscheduledRecord",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"completeUnscheduledPatch",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"unscheduledMarker",{enumerable:!0,get:function(){return L}});const $e=1;function z(f){return!!(f&&f.unscheduled===!0)}function N(f,$,E){const F=new Set;for(const W of f)!E.isSummary(W)&&$.get(W).duration==null&&F.add(W);if(!F.size)return F;for(const W of f)E.isSummary(W)&&E.descendantLeaves(W).every(P=>F.has(P))&&F.add(W);return F}function ie(f,$){return $.size?f.filter(E=>!$.has(E.from)&&!$.has(E.to)):f}function U(f,$){return{id:f.id,name:f.name,duration:null,es:null,ef:null,ls:null,lf:null,totalFloat:null,critical:!1,percentComplete:$?null:f.percentComplete,parent:f.parent,isSummary:$,isMilestone:!1,locked:$?!1:!!f.locked,unscheduled:!0,children:[]}}function R(f,$){if(!z($)||$.isSummary||f.duration!==void 0)return f;const E=f.start!=null&&f.start!=="",F=f.end!=null&&f.end!=="";if(!E&&!F)return f;const W={...f,duration:$e};if(!E){const P=Number(f.end);Number.isFinite(P)&&(W.start=P-$e)}return W}function L(f,$,E){const F=f.createElement("span");return F.setAttribute("class",`${$}__unscheduled`),F.textContent=E("gantt.unscheduled"),F}}),Re("packages/modules/gantt/inactive.js",function(s,te){"use strict";Object.defineProperty(s,"bridgeInactive",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"inactiveRecord",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"inactiveMarker",{enumerable:!0,get:function(){return R}});const $e=Object.freeze({FS:"es",SS:"es",FF:"ef",SF:"ef"}),z=Object.freeze({FS:"ef",SS:"es",FF:"ef",SF:"es"});function N(L,f){const $=L.lag+f.lag,E=z[L.type],F=$e[f.type];let W;return E==="ef"&&F==="es"?W="FS":E==="ef"&&F==="ef"?W="FF":E==="es"&&F==="es"?W="SS":W="SF",{from:L.from,to:f.to,type:W,lag:$}}function ie(L,f){if(!f.size)return L;let $=L;for(const E of f){if(!$.some(i=>i.from===E||i.to===E))continue;const W=$.filter(i=>i.to===E),P=$.filter(i=>i.from===E),q=$.filter(i=>i.from!==E&&i.to!==E),S=[];for(const i of W)for(const d of P)i.from!==d.to&&S.push(N(i,d));$=q.concat(S)}return $}function U(L){const f=L.earliestStart??null,$=L.duration??null,E=f!=null&&$!=null?f+$:null;return{id:L.id,name:L.name,duration:$,es:f,ef:E,ls:f,lf:E,totalFloat:null,critical:!1,percentComplete:L.percentComplete,parent:L.parent,isSummary:!1,isMilestone:$===0,locked:!!L.locked,inactive:!0,children:[],colour:L.colour??null}}function R(L,f,$){const E=L.createElement("span");return E.setAttribute("class",`${f}__inactive-marker`),E.textContent=$("gantt.inactive"),E}}),Re("packages/modules/gantt/schedule.js",function(s,te){"use strict";Object.defineProperty(s,"LINK_TYPES",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(s,"CONSTRAINT_TYPES",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"resolveConstraintCode",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"SCHEDULING_MODES",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"resolveSchedulingMode",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"effortRate",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"recomputeEffort",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"reconcileEffort",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"EPS",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"SCHEDULE_ERROR",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"TASK_FIELDS",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"taskIdReader",{enumerable:!0,get:function(){return v}}),Object.defineProperty(s,"taskFieldWriters",{enumerable:!0,get:function(){return e}}),Object.defineProperty(s,"isTaskLocked",{enumerable:!0,get:function(){return o}}),Object.defineProperty(s,"normalizeTasks",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"buildTree",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"normalizeLinkSpec",{enumerable:!0,get:function(){return a}}),Object.defineProperty(s,"normalizeDependencies",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"expandDependencies",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"topoOrder",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"wouldCreateCycle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"computeSchedule",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(s,"findViolations",{enumerable:!0,get:function(){return be}});const z=te("packages/core/src/internal/warn.js").warnOnce,ie=te("packages/modules/gantt/calendar.js").createCalendar,U=te("packages/modules/gantt/task-calendars.js"),R=U.PLAIN_TIME,L=U.createTimeModel,f=U.resolveCalendars,E=te("packages/modules/gantt/assignments.js").parseAssignments,W=te("packages/modules/gantt/time.js").toDayNumber,P=te("packages/modules/gantt/unscheduled.js"),q=P.activeEdges,S=P.findUnscheduled,i=P.unscheduledRecord,d=te("packages/modules/gantt/inactive.js"),c=d.bridgeInactive,k=d.inactiveRecord,Q=["FS","SS","FF","SF"],J=["ASAP","MSO","MFO","ALAP","SNET","SNLT","FNET","FNLT"],H=Object.freeze({asap:"ASAP","as-soon-as-possible":"ASAP",assoonaspossible:"ASAP",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",snet:"SNET","start-no-earlier-than":"SNET",startnoearlierthan:"SNET",snlt:"SNLT","start-no-later-than":"SNLT",startnolaterthan:"SNLT",fnet:"FNET","finish-no-earlier-than":"FNET",finishnoearlierthan:"FNET",fnlt:"FNLT","finish-no-later-than":"FNLT",finishnolaterthan:"FNLT"});function se(t){if(t==null||t===""||typeof t=="object"&&!Array.isArray(t)&&!(t instanceof Date)&&(t=t.type??t.constraint??t.code??null,t==null||t===""))return null;const T=String(t).toLowerCase().replace(/\s+/g,"-");return H[T]??(J.includes(String(t).toUpperCase())?String(t).toUpperCase():null)}const fe=["fixedDuration","fixedEffort","fixedUnits"],ke=Object.freeze({fixedduration:"fixedDuration","fixed-duration":"fixedDuration",duration:"fixedDuration",fixedeffort:"fixedEffort","fixed-effort":"fixedEffort",effort:"fixedEffort",work:"fixedEffort",fixedwork:"fixedEffort",fixedunits:"fixedUnits","fixed-units":"fixedUnits",units:"fixedUnits"});function ge(t){if(t==null||t==="")return null;const T=String(t).toLowerCase().replace(/\s+/g,"-");if(ke[T])return ke[T];const I=T.replace(/-/g,"");return ke[I]??null}const ue=8;function X(t,T){const I=T.hoursPerDay,m=T.resourceHours instanceof Map?T.resourceHours:new Map;if(!t||t.length===0)return{rate:I,units:1};let b=0,g=0;for(const D of t){const V=m.has(D.resource)?m.get(D.resource):I;b+=D.units*V,g+=D.units}return{rate:b,units:g}}function ee(t,T){const I=t.schedulingMode||T.defaultMode||"fixedDuration",m=t.effortDriven!=null?!!t.effortDriven:!!T.defaultEffortDriven,{rate:b,units:g}=X(t.assignments,T),D=t.duration,V=t.statedEffort;let O=D,oe=V??(D!=null?D*b:null);return I==="fixedEffort"?V!=null&&b>0?O=V/b:oe=D!=null?D*b:null:I==="fixedUnits"?D!=null?(O=D,oe=D*b):V!=null&&b>0&&(O=V/b,oe=V):O=D,{duration:O,effort:oe,units:g,schedulingMode:I,effortDriven:m}}function A(t,T){const I=ge(t.mode)||t.mode||"fixedDuration",m=!!t.effortDriven,b=t.hoursPerDay>0?t.hoursPerDay:ue;let g=t.duration,D=t.units;const V=g*D*b,O=T.field,oe=T.units!=null?T.units:1;if(O==="duration")g=T.value,I==="fixedEffort"&&(D=g>0?V/(g*b):D);else if(O==="effort"){const de=T.value;I==="fixedDuration"?D=g>0?de/(g*b):D:g=D>0?de/(D*b):g}else if(O==="units")D=T.value,I!=="fixedDuration"&&(g=D>0?V/(D*b):g);else if(O==="addResource"||O==="removeResource"){const de=O==="addResource"?oe:-oe;I==="fixedDuration"?m||(D=D+de):(D=D+de,g=D>0?V/(D*b):g)}return{duration:g,units:D,effort:g*D*b}}const K=1e-9,Y={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",UNKNOWN_CALENDAR:"unknown-calendar"};function u(t){if(t==null||t==="")return null;const T=typeof t=="number"?t:Number(t);return Number.isFinite(T)?T:null}function j(t){if(!t)return null;const T=u(t.effort)??(Array.isArray(t.work)?null:u(t.work))??u(t.hours);if(T!=null)return T;if(Array.isArray(t.work)){let I=0,m=!1;for(const b of t.work){const g=u(b&&b.hours);g!=null&&(I+=g,m=!0)}return m?I:null}return null}function B(t){return t==null||t===""?null:W(t)}const Z=Object.freeze(["id","name","start","end","duration","milestone","percentComplete","parent","baselineStart","baselineEnd","constraint","constraintDate","deadline"]);function le(t){const T=t&&typeof t=="object"?t:{},I={};for(const m of Z){const b=T[m];if(typeof b=="function")I[m]=b;else if(typeof b=="string"&&b!==""){const g=b;I[m]=D=>D[g]}else I[m]=g=>g[m]}return I}function v(t){return le(t).id}function e(t){const T=t&&typeof t=="object"?t:{},I={};for(const m of Z){const b=T[m];typeof b=="string"&&b!==""?I[m]=b:typeof b=="function"?I[m]=null:I[m]=m}return I}function n(t,T){const I=T.constraint(t);let m=I??(t&&t.constraintType),b=null;if(m&&typeof m=="object"&&!Array.isArray(m)&&!(m instanceof Date)&&(b=m.date??m.at??m.constraintDate??null,m=m.type??m.constraint??m.code??null),m==null||m==="")return null;const g=se(m);if(!g)return null;const D=B(b??T.constraintDate(t)??t.constraintAt??t.at);return{type:g,at:D}}function o(t,T){if(!t)return!1;if(t.locked===!0||typeof t.constraintMode=="string"&&t.constraintMode.toLowerCase()==="hard")return!0;if(typeof T=="function")try{return!!T(t)}catch{return!1}return!1}function p(t,T,I){const m=new Map,b=[],g=le(T);if(!Array.isArray(t))return{ok:!1,error:{code:Y.BAD_DURATION,message:"tasks must be an array"},order:b,byId:m};for(const D of t){const V=D?g.id(D):null,O=V!=null?String(V):null;if(O==null)return{ok:!1,error:{code:Y.UNKNOWN_TASK,message:"every task needs an id"},order:b,byId:m};if(m.has(O))return{ok:!1,error:{code:Y.DUPLICATE_ID,message:`duplicate task id "${O}"`,id:O},order:b,byId:m};const oe=B(g.start(D)),de=B(g.end(D)),De=g.milestone(D)===!0;let Se=De?0:u(g.duration(D));if(Se==null&&oe!=null&&de!=null&&(Se=de-oe),Se!=null&&Se<0)return{ok:!1,error:{code:Y.BAD_DURATION,message:`task "${O}" has negative duration ${Se}`,id:O},order:b,byId:m};const Pe=g.name(D),Ne=g.parent(D),_e=D.colour??D.color;m.set(O,{id:O,name:Pe!=null?String(Pe):O,colour:typeof _e=="string"&&_e.trim()!==""?_e.trim():null,duration:Se,milestoneFlag:De,earliestStart:oe,placedStart:oe,placedEnd:de,percentComplete:u(g.percentComplete(D)),parent:Ne!=null?String(Ne):null,constraint:n(D,g),locked:o(D,I),inactive:D.inactive===!0,baselineStart:B(g.baselineStart(D)??(D.baseline&&D.baseline.start)),baselineEnd:B(g.baselineEnd(D)??(D.baseline&&D.baseline.end)),deadline:B(g.deadline(D)),schedulingMode:ge(D.schedulingMode??D.taskType),effortDriven:D.effortDriven==null?null:!!D.effortDriven,statedEffort:j(D),assignments:E(D)}),b.push(O)}return{ok:!0,order:b,byId:m}}function l(t,T){const I=new Map(t.map(V=>[V,[]]));for(const V of t){const O=T.get(V).parent;if(O!=null){if(!T.has(O))return{ok:!1,error:{code:Y.UNKNOWN_PARENT,message:`task "${V}" names unknown parent "${O}"`,id:V}};I.get(O).push(V)}}for(const V of t){const O=new Set;let oe=T.get(V).parent;for(;oe!=null;){if(oe===V||O.has(oe))return{ok:!1,error:{code:Y.PARENT_CYCLE,message:`parent cycle at "${V}"`,id:V}};O.add(oe),oe=T.get(oe)?.parent??null}}const m=V=>I.get(V).length>0,b=new Map,g=V=>{if(b.has(V))return b.get(V);const O=I.get(V),oe=O.length===0?[V]:O.flatMap(de=>g(de));return b.set(V,oe),oe};return{ok:!0,children:I,isSummary:m,descendantLeaves:g,ancestors:V=>{const O=new Set;let oe=T.get(V).parent;for(;oe!=null;)O.add(oe),oe=T.get(oe).parent;return O}}}const _=/^\s*(FS|SS|FF|SF)\s*(?:([+-])\s*(\d+(?:\.\d+)?))?\s*$/i;function a(t){const T={...t||null};if(typeof T.type!="string")return T;const I=_.exec(T.type);if(!I||!I[2])return T;const m=(I[2]==="-"?-1:1)*Number(I[3]);T.type=I[1].toUpperCase();const b=u(t.lag);return b!=null&&b!==m?(z(`gantt-link-shorthand-${String(t.type)}-${b}`,`[lattice] gantt: dependency type ${JSON.stringify(t.type)} carries a lag of ${m} but lag: ${b} was also given; the explicit lag wins. Give one or the other.`),T):(T.lag=m,T)}function y(t,T,I={}){const m=[];if(t==null)return{ok:!0,edges:m};if(!Array.isArray(t))return{ok:!1,error:{code:Y.UNKNOWN_TASK,message:"dependencies must be an array"},edges:m};const b=typeof I.ancestors=="function"?I.ancestors:null;for(const g of t){const D=a(g),V=D&&D.from!=null?String(D.from):null,O=D&&D.to!=null?String(D.to):null,oe=D&&D.type!=null?String(D.type).toUpperCase():"FS",de=u(D.lag)??0;if(V==null||O==null)return{ok:!1,error:{code:Y.UNKNOWN_TASK,message:"a dependency needs both `from` and `to`"},edges:m};if(!T.has(V))return{ok:!1,error:{code:Y.UNKNOWN_TASK,message:`dependency references unknown task "${V}"`,id:V},edges:m};if(!T.has(O))return{ok:!1,error:{code:Y.UNKNOWN_TASK,message:`dependency references unknown task "${O}"`,id:O},edges:m};if(V===O)return{ok:!1,error:{code:Y.SELF_DEPENDENCY,message:`task "${V}" depends on itself`,id:V},edges:m};if(!Q.includes(oe))return{ok:!1,error:{code:Y.BAD_LINK_TYPE,message:`unknown link type "${oe}" (expected one of ${Q.join("/")})`},edges:m};if(b&&(b(V).has(O)||b(O).has(V)))return{ok:!1,error:{code:Y.DEP_ACROSS_HIERARCHY,message:`dependency between "${V}" and "${O}" crosses their own parent/child hierarchy`,from:V,to:O},edges:m};m.push({from:V,to:O,type:oe,lag:de})}return{ok:!0,edges:m}}function w(t,T){const I=new Set,m=[];for(const b of t){(T.isSummary(b.from)||T.isSummary(b.to))&&b.type!=="FS"&&z(`gantt-summary-link-${b.type}-${b.from}-${b.to}`,`[lattice] gantt: ${b.type} link with a summary endpoint (${b.from} -> ${b.to}) is expanded to descendant leaves — a conservative v1 reading; only FS is exact for summary endpoints.`);for(const D of T.descendantLeaves(b.from))for(const V of T.descendantLeaves(b.to)){if(D===V)continue;const O=[D,V,b.type,b.lag].join("");I.has(O)||(I.add(O),m.push({from:D,to:V,type:b.type,lag:b.lag}))}}return m}function x(t,T,I,m=R){return t.map(b=>{const g=T.get(b.from),D=T.get(b.to);if(!g||!D||g.earliestStart==null||g.duration==null||D.earliestStart==null||D.duration==null)return b;if(m.custom){const Se=m.norm(b.from,g.earliestStart),Pe=m.fin(b.from,Se,g.duration),Ne=m.norm(b.to,D.earliestStart),_e=m.fin(b.to,Ne,D.duration);switch(b.type){case"FS":return{...b,lag:m.between(b.to,Ne,Pe)};case"SS":return{...b,lag:m.between(b.to,Ne,Se)};case"FF":return{...b,lag:m.between(b.to,_e,Pe)};case"SF":return{...b,lag:m.between(b.to,_e,Se)};default:return b}}const V=I(g.earliestStart),O=V+g.duration,oe=I(D.earliestStart),de=oe+D.duration;let De;switch(b.type){case"FS":De=oe-O;break;case"SS":De=oe-V;break;case"FF":De=de-O;break;case"SF":De=de-V;break;default:return b}return{...b,lag:De}})}function G(t,T){const I=new Map(t.map(D=>[D,0])),m=new Map(t.map(D=>[D,[]]));for(const D of T)ne(I,D.to),m.get(D.from).push(D.to);const b=t.filter(D=>I.get(D)===0),g=[];for(;b.length;){const D=b.shift();g.push(D);for(const V of m.get(D)){const O=I.get(V)-1;I.set(V,O),O===0&&b.push(V)}}return g.length===t.length?{ok:!0,sorted:g}:{ok:!1,cycle:ve(t,m,new Set(g))}}function ne(t,T){t.set(T,t.get(T)+1)}function ve(t,T,I){const m=t.find(V=>!I.has(V)),b=[],g=new Map;let D=m;for(;D!=null&&!g.has(D);)g.set(D,b.length),b.push(D),D=T.get(D).find(V=>!I.has(V));return D==null?b:b.slice(g.get(D)).concat(D)}function pe(t,T,I){const m=String(T),b=String(I);if(m===b)return!0;const g=new Map;for(const O of t){const oe=String(O.from);g.has(oe)||g.set(oe,[]),g.get(oe).push(String(O.to))}const D=new Set,V=[b];for(;V.length;){const O=V.pop();if(O===m)return!0;if(!D.has(O)){D.add(O);for(const oe of g.get(O)||[])V.push(oe)}}return!1}function Oe(t,T,I,m){switch(T.type){case"FS":return t.shift(m.id,I.ef,T.lag);case"SS":return t.shift(m.id,I.es,T.lag);case"FF":return t.back(m.id,t.shift(m.id,I.ef,T.lag),m.duration);case"SF":return t.back(m.id,t.shift(m.id,I.es,T.lag),m.duration);default:return-1/0}}function Ae(t,T,I,m,b,g=new Map,D=new Map,V=!1,O=R){const oe=G(t,I);if(!oe.ok)return z(`gantt-cycle-${oe.cycle.join(">")}`,`[lattice] gantt: dependency cycle detected (${oe.cycle.join(" -> ")}); schedule refused.`),{ok:!1,error:{code:Y.CYCLE,message:`dependency cycle: ${oe.cycle.join(" -> ")}`,cycle:oe.cycle}};const de=oe.sorted,De=new Map(t.map(he=>[he,[]])),Se=new Map(t.map(he=>[he,[]]));for(const he of I)De.get(he.to).push(he),Se.get(he.from).push(he);const Pe=new Map;for(const he of t){const Te=T.get(he);Pe.set(he,{id:he,name:Te.name,duration:Te.duration,es:0,ef:0,ls:0,lf:0,totalFloat:0,critical:!1,percentComplete:Te.percentComplete,parent:Te.parent,isSummary:!1,isMilestone:Te.duration===0,children:[],colour:Te.colour??null,locked:!!Te.locked})}const Ne=[];for(const he of de){const Te=T.get(he),xe=Pe.get(he);let r=Math.max(m,Te.earliestStart??m);for(const ce of De.get(he)){const ye=Pe.get(ce.from),re=Oe(O,ce,ye,xe);re>r&&(r=re)}const C=g.get(he);if(C&&C.at!=null)switch(C.type){case"MSO":C.at<r-K?Ne.push({id:he,type:C.type,date:C.at,scheduled:r,at:C.at,earliestFeasible:r}):r=C.at,xe.pinned=!0;break;case"MFO":{const ce=O.back(he,C.at,xe.duration);ce<r-K?Ne.push({id:he,type:C.type,date:C.at,scheduled:O.fin(he,r,xe.duration),at:C.at,earliestFeasible:r}):r=ce,xe.pinned=!0;break}case"SNET":C.at>r+K&&(r=C.at);break;case"SNLT":r>C.at+K&&Ne.push({id:he,type:C.type,date:C.at,scheduled:r,at:C.at,earliestFeasible:r});break;case"FNET":{const ce=O.back(he,C.at,xe.duration);ce>r+K&&(r=ce);break}case"FNLT":{const ce=O.fin(he,r,xe.duration);ce>C.at+K&&Ne.push({id:he,type:C.type,date:C.at,scheduled:ce,at:C.at,earliestFeasible:r});break}default:break}if(Te.locked){const ce=C&&C.at!=null?C.type==="MFO"?O.back(he,C.at,xe.duration):C.type==="MSO"?C.at:null:null,ye=Te.earliestStart!=null?Te.earliestStart:ce??r;if(r-K>ye)for(const re of De.get(he)){const je=Pe.get(re.from),Me=Oe(O,re,je,xe);Me>ye+K&&Ne.push({id:he,from:re.from,to:he,type:"LOCKED",date:ye,scheduled:Me,at:ye,earliestFeasible:ye})}r=ye,xe.pinned=!0}r=O.norm(he,r),xe.es=r,xe.ef=O.fin(he,r,xe.duration)}const _e=t.length?Math.max(...t.map(he=>Pe.get(he).ef)):m,ze=Number.isFinite(b)?b:_e;for(let he=de.length-1;he>=0;he-=1){const Te=de[he],xe=Pe.get(Te);let r=ze;const C=D.get(Te);C!=null&&C<r&&(r=C);for(const ce of Se.get(Te)){const ye=Pe.get(ce.to);let re;switch(ce.type){case"FS":re=O.unshift(ce.to,ye.ls,ce.lag);break;case"SS":re=O.fin(Te,O.unshift(ce.to,ye.ls,ce.lag),xe.duration);break;case"FF":re=O.unshift(ce.to,ye.lf,ce.lag);break;case"SF":re=O.fin(Te,O.unshift(ce.to,ye.lf,ce.lag),xe.duration);break;default:re=1/0}re<r&&(r=re)}xe.pinned&&(r=xe.ef),xe.lf=r,xe.ls=O.back(Te,r,xe.duration),xe.totalFloat=O.between(Te,xe.ls,xe.es),xe.critical=xe.totalFloat<=K,C!=null&&(xe.deadline=C,xe.late=xe.ef>C+K)}for(const he of t){const Te=g.get(he);if(!Te||Te.type!=="ALAP")continue;const xe=Pe.get(he);xe.es=xe.ls,xe.ef=xe.lf,xe.totalFloat=0,xe.critical=!0}const Le=t.filter(he=>Pe.get(he).critical),Fe=V?[]:ae(t,I,Pe,O);return{ok:!0,tasks:Pe,critical:Le,criticalPaths:Fe,projectFinish:_e,conflicts:Ne}}function me(t,T){let I=null;if(Array.isArray(t))for(const m of t){const b=B(m?T(m):null);b!=null&&(I==null||b<I)&&(I=b)}return I}function Ee(t,T=[],I={}){const m=le(I.fields),b=B(I.projectStart),g=b??0,D=b??me(t,m.start)??0,V=B(I.deadline),O=ie(I.calendar,g),oe=[];for(const we of Array.isArray(t)?t:[]){const Ce=we?m.id(we):null;Ce!=null&&we.calendar!=null&&oe.push({id:String(Ce),calendar:we.calendar})}const de=[];for(const we of Array.isArray(I.resources)?I.resources:[]){const Ce=we&&(we.id??we.name??we.resource);Ce!=null&&we.calendar!=null&&de.push({id:String(Ce),calendar:we.calendar})}const De=I.calendars&&typeof I.calendars=="object"&&Object.keys(I.calendars).length>0,Se=oe.length||de.length||De?f({calendar:I.calendar,calendars:I.calendars,projectStart:g,tasks:oe,resources:de}):null;if(Se&&Se.errors.length){const we=Se.errors.map(Ce=>({...Ce,code:Y.UNKNOWN_CALENDAR}));return{ok:!1,error:we[0],errors:we}}const Pe=!!(Se&&Se.customised),Ne=Pe?null:O,_e=Pe?L(we=>Se.models.get(Se.ofTask.get(we)??"plan").calendar):R,ze=we=>we==null?null:Ne?Ne.indexOf(we):we,Le=we=>Ne?Ne.dayOf(we):we,Fe=p(t,I.fields,I.lockWhen);if(!Fe.ok)return{ok:!1,error:Fe.error,errors:[Fe.error]};const{order:he,byId:Te}=Fe,xe=l(he,Te);if(!xe.ok)return{ok:!1,error:xe.error,errors:[xe.error]};const r=y(T,Te,xe);if(!r.ok)return{ok:!1,error:r.error,errors:[r.error]};const C=I.honourDates?x(r.edges,Te,ze,_e):r.edges,ce={defaultMode:ge(I.schedulingMode)||"fixedDuration",defaultEffortDriven:!!I.effortDriven,hoursPerDay:u(I.hoursPerDay)??ue,resourceHours:I.resourceHours instanceof Map?I.resourceHours:new Map},ye=new Map;for(const we of he){if(xe.isSummary(we))continue;const Ce=Te.get(we);if(!(Ce.schedulingMode!=null||Ce.effortDriven!=null||Ce.statedEffort!=null||I.schedulingMode!=null||I.effortDriven!=null))continue;const Je=ee(Ce,ce);Je.duration!=null&&(Ce.duration=Je.duration),ye.set(we,{schedulingMode:Je.schedulingMode,effortDriven:Je.effortDriven,effort:Je.effort,units:Je.units})}const re=S(he,Te,xe),je=new Set(he.filter(we=>!xe.isSummary(we)&&Te.get(we).inactive===!0)),Me=new Set([...re].filter(we=>!je.has(we))),Ie=he.filter(we=>!xe.isSummary(we)&&!Me.has(we)&&!je.has(we)),Ge=new Map(Ie.map(we=>{const Ce=Te.get(we);return[we,{...Ce,earliestStart:ze(Ce.earliestStart)}]})),We=new Map;for(const we of Ie){const Ce=Te.get(we).constraint;Ce&&We.set(we,{type:Ce.type,at:ze(Ce.at)})}const He=Ne?Ne.indexOf(g):g,Be=V==null?void 0:ze(V),Qe=new Map;for(const we of Ie){const Ce=Ge.get(we).deadline;if(Ce==null)continue;const Xe=Ne?Ne.indexOf(Ce):Ce;Number.isFinite(Xe)&&Qe.set(we,Xe)}const tt=c(q(w(C,xe),Me),je),Ye=Ae(Ie,Ge,tt,He,Be,We,Qe,!!I.skipCriticalPaths,_e);if(!Ye.ok)return{ok:!1,error:Ye.error,errors:[Ye.error]};const Ze=Ye.tasks;for(const we of Ie){const Ce=Ze.get(we);Ce.es=Le(Ce.es),Ce.ef=Le(Ce.ef),Ce.ls=Le(Ce.ls),Ce.lf=Le(Ce.lf),Ce.deadline!=null&&(Ce.deadline=Le(Ce.deadline)),M(Ce,Te.get(we).baselineStart,Te.get(we).baselineEnd);const Xe=ye.get(we);Xe&&(Ce.schedulingMode=Xe.schedulingMode,Ce.effortDriven=Xe.effortDriven,Ce.effort=Xe.effort,Ce.units=Xe.units)}for(const we of he)Me.has(we)?Ze.set(we,i(Te.get(we),xe.isSummary(we))):je.has(we)&&Ze.set(we,k(Te.get(we)));if(Se)for(const we of he)Ze.get(we).calendar=Se.ofTask.get(we)??"plan";for(let we=he.length-1;we>=0;we-=1){const Ce=he[we];!xe.isSummary(Ce)||Me.has(Ce)||Ze.set(Ce,h(Ce,Te.get(Ce),xe,Ze))}for(const we of he)xe.isSummary(we)&&(Ze.get(we).children=xe.children.get(we).slice());const rt=O?O.nextWorking(D):D,qe=Le(Ye.projectFinish);return{ok:!0,tasks:Ze,order:he,critical:Ye.critical,criticalPaths:Ye.criticalPaths,projectStart:rt,projectFinish:qe,projectDuration:qe-rt,conflicts:(Ye.conflicts||[]).map(we=>({id:we.id,type:we.type,date:Le(we.date),scheduled:Le(we.scheduled),at:Le(we.at),earliestFeasible:Le(we.earliestFeasible),...we.from!==void 0?{from:we.from,to:we.to}:null})),calendar:!!O,...Pe?{calendars:Se.models}:null,unscheduled:he.filter(we=>Me.has(we)),...I.honourDates?{dependencies:C}:{}}}function M(t,T,I){T==null&&I==null||(t.baselineStart=T??null,t.baselineEnd=I??null,t.startVariance=T==null?null:t.es-T,t.finishVariance=I==null?null:t.ef-I,t.durationVariance=T==null||I==null?null:t.ef-t.es-(I-T))}function h(t,T,I,m){const b=I.children.get(t).map(he=>m.get(he)),g=b.filter(he=>!he.unscheduled&&!he.inactive),D=g.length?g:b,V=Math.min(...D.map(he=>he.es)),O=Math.max(...D.map(he=>he.ef)),oe=Math.min(...D.map(he=>he.ls)),de=Math.max(...D.map(he=>he.lf)),De=I.descendantLeaves(t).map(he=>m.get(he)),Se=De.filter(he=>!he.unscheduled&&!he.inactive),Pe=Se.length?Se:De,Ne=Pe.reduce((he,Te)=>he+Te.duration,0),_e=Ne>K?Pe.reduce((he,Te)=>he+Te.duration*(Te.percentComplete??0),0)/Ne:null,ze={id:t,name:T.name,duration:O-V,es:V,ef:O,ls:oe,lf:de,totalFloat:oe-V,critical:D.some(he=>he.critical),percentComplete:_e,parent:T.parent,isSummary:!0,isMilestone:!1,locked:!1,...T.inactive===!0?{inactive:!0}:null,children:[],colour:T.colour??null},Le=Pe.map(he=>he.baselineStart).filter(he=>he!=null),Fe=Pe.map(he=>he.baselineEnd).filter(he=>he!=null);return(Le.length||Fe.length)&&M(ze,Le.length?Math.min(...Le):null,Fe.length?Math.max(...Fe):null),ze}function ae(t,T,I,m=R){const b=new Map(t.map(oe=>[oe,[]])),g=new Set;for(const oe of T){const de=I.get(oe.from),De=I.get(oe.to);if(!de.critical||!De.critical)continue;const Se=Oe(m,oe,de,De);Math.abs(Se-De.es)<=K&&(b.get(oe.from).push(oe.to),g.add(oe.to))}const D=t.filter(oe=>I.get(oe).critical&&!g.has(oe)),V=[],O=(oe,de)=>{const De=b.get(oe);if(!De.length){V.push(de);return}for(const Se of De)O(Se,de.concat(Se))};for(const oe of D)O(oe,[oe]);return V}function be(t,T,I){if(!T||!T.ok)return[];const m=[],b=le(I);for(const g of t){const D=g?b.id(g):null,V=D!=null?String(D):null;if(V==null||!T.tasks.has(V))continue;const O=T.tasks.get(V);if(O.isSummary)continue;const oe=u(b.start(g));oe==null||O.unscheduled||oe<O.es-K&&m.push({id:V,placedStart:oe,earliestStart:O.es,by:O.es-oe})}return m}}),Re("packages/modules/gantt/resources.js",function(s,te){"use strict";Object.defineProperty(s,"normalizeCapacities",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"resourceDisplayNames",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"resourceSpecsByKey",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"resourceAvatars",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"normalizeResources",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"resourceDailyHours",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"sweepLoad",{enumerable:!0,get:function(){return u}}),Object.defineProperty(s,"computeResourceLoad",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"normalizeResourceRates",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"rateOn",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"levelResources",{enumerable:!0,get:function(){return o}});const z=te("packages/core/src/internal/warn.js").warnOnce,N=te("packages/modules/gantt/schedule.js"),ie=N.computeSchedule,U=N.EPS,R=N.taskIdReader,L=N.resolveConstraintCode,f=te("packages/modules/gantt/assignments.js"),$=f.parseAssignments,F=te("packages/modules/gantt/calendar.js").createCalendar,W=te("packages/modules/gantt/task-calendars.js"),P=W.parseHolidayDays,q=W.normalizeCalendarSpec,S=W.planWorkingTime,i=W.workingRuns,d=te("packages/modules/gantt/time.js"),c=d.fromDayNumber,k=d.toDayNumber;Object.defineProperty(s,"parseAssignments",{enumerable:!0,get:function(){return f.parseAssignments}});const Q=Object.freeze([1,2,3,4,5]),J=8;function H(l){if(l==null||l==="")return null;const _=typeof l=="number"?l:Number(l);return Number.isFinite(_)?_:null}function se(l,_){const a=new Map;if(Array.isArray(l))for(const y of l){const w=y&&(y.id??y.name??y.resource);if(w==null||w==="")continue;const x=H(y.capacity??y.maxUnits??y.max??y.units);a.set(String(w),x??_)}else if(l&&typeof l=="object")for(const[y,w]of Object.entries(l)){const x=H(w);a.set(String(y),x??_)}return a}function fe(l){const _=new Map;if(Array.isArray(l))for(const a of l){if(!a)continue;const y=a.id??a.name??a.resource;if(y==null||y==="")continue;const w=a.name??a.id??a.resource;_.set(String(y),String(w))}else if(l&&typeof l=="object")for(const[a,y]of Object.entries(l))_.set(a,y&&typeof y=="object"&&y.name!=null?String(y.name):a);return _}function ke(l){const _=new Map;if(Array.isArray(l))for(const a of l){if(!a||typeof a!="object")continue;const y=a.id??a.name??a.resource;y!=null&&y!==""&&_.set(String(y),{...a})}else if(l&&typeof l=="object")for(const[a,y]of Object.entries(l))_.set(a,y&&typeof y=="object"?{...y}:{capacity:y});return _}function ge(l){const _=new Map,a=y=>typeof y=="string"?y.trim():"";if(Array.isArray(l))for(const y of l){if(!y)continue;const w=y.id??y.name??y.resource;if(w==null||w==="")continue;const x=a(y.avatar);x&&_.set(String(w),x)}else if(l&&typeof l=="object")for(const[y,w]of Object.entries(l)){const x=w&&typeof w=="object"?a(w.avatar):"";x&&_.set(y,x)}return _}function ue(l){return new Set(P(l))}function X(l){return l==null?{workdays:[0,1,2,3,4,5,6],holidays:new Set}:l==="weekends"?{workdays:[...Q],holidays:new Set}:{workdays:Array.isArray(l.workdays)&&l.workdays.length?l.workdays.map(Number).filter(a=>a>=0&&a<=6):[...Q],holidays:ue(l.holidays)}}function ee(l,_,a){let y=l;if(typeof l=="string"&&(y=_&&Object.prototype.hasOwnProperty.call(_,l)?_[l]:l==="weekends"?l:null),y==null||typeof y=="string"&&y!=="weekends")return null;const w=q(y,a);if(!w)return null;const x=y;return{...x==="weekends"||x.workdays||x.workingDays?{workingDays:w.workdays}:null,...x!=="weekends"&&(x.holidays||x.exceptions)?{holidays:w.holidays}:null,...w.hoursPerDay!=null?{hoursPerDay:w.hoursPerDay}:null}}function A(l,_,a,y){const w=new Set(Array.isArray(l.workingDays)&&l.workingDays.length?l.workingDays.map(Number).filter(h=>h>=0&&h<=6):y.workdays),x=ue(l.holidays);for(const h of y.holidays)x.add(h);const G=l.hoursPerDay,ne=h=>{if(G!=null&&typeof G=="object"){const be=H(G[h]);return be??a}const ae=H(G);return ae??a},ve=h=>{const ae=c(h);return ae?w.has(ae.getUTCDay())&&!x.has(h):!1},pe=h=>ve(h)?_??ne(c(h).getUTCDay()):0,Oe=h=>a>0?pe(h)/a:0;let Ae=0;for(const h of w){const ae=_??ne(h);ae>Ae&&(Ae=ae)}const me=a>0?Ae/a:0;let Ee=0;for(const h of y.workdays)w.has(h)&&(Ee+=_??ne(h));const M=y.workdays.length?Ee/y.workdays.length:a;return{hasCalendar:!0,capacityUnits:me,hoursPerWorkingDay:M,worksOn:ve,capacityHoursOn:pe,capacityUnitsOn:Oe}}function K(l,_,a={}){const y=H(a.hoursPerDay)??J,w=X(a.calendar),x=new Map,G=(ne,ve)=>{const pe=H(ve.capacity??ve.maxUnits??ve.max??ve.units),Oe=ee(ve.calendar,a.calendars,S(a.calendar));Oe?x.set(ne,A(Oe,pe,y,w)):x.set(ne,{hasCalendar:!1,capacityUnits:pe??_,hoursPerWorkingDay:y})};if(Array.isArray(l))for(const ne of l){const ve=ne&&(ne.id??ne.name??ne.resource);ve==null||ve===""||G(String(ve),ne)}else if(l&&typeof l=="object")for(const[ne,ve]of Object.entries(l))G(String(ne),typeof ve=="object"&&ve?ve:{capacity:ve});return x}function Y(l,_,a={}){const y=H(a.hoursPerDay)??J,w=K(l,_,a),x=new Map;for(const[G,ne]of w)x.set(G,ne.hoursPerWorkingDay!=null?ne.hoursPerWorkingDay:y);return x}function u(l){if(!l.length)return[];const _=new Set;for(const w of l)_.add(w.s),_.add(w.e);const a=[..._].sort((w,x)=>w-x),y=[];for(let w=0;w<a.length-1;w+=1){const x=a[w],G=a[w+1];if(G<=x)continue;let ne=0;const ve=[];for(const pe of l)pe.s<=x&&pe.e>=G&&(ne+=pe.units,ve.push(pe.taskId));ve.length&&y.push({s:x,e:G,load:ne,taskIds:ve})}return y}function j(l,_,a={}){const y={ok:!1,resources:[],overAllocations:[],byResource:new Map};if(!_||!_.ok)return y;const w=H(a.defaultCapacity)??1,x=se(a.resources,w),G=K(a.resources,w,{calendar:a.calendar,calendars:a.calendars,hoursPerDay:a.hoursPerDay}),ne=_.calendars instanceof Map?_.calendars:null,ve=a.calendar!=null&&!ne?F(a.calendar,_.projectStart):null,pe=t=>x.has(t)?x.get(t):w,Oe=t=>ve?ve.indexOf(t):t,Ae=t=>ve?ve.dayOf(t):t,me=R(a.fields),Ee=new Map;for(const t of l){if(!t)continue;const T=me(t);if(T==null)continue;const I=String(T);Ee.has(I)||Ee.set(I,t)}const M=new Map;for(const t of _.order){const T=_.tasks.get(t);if(!T||T.isSummary||T.unscheduled)continue;const I=Ee.get(t);if(!I)continue;const m=$(I);if(!m.length)continue;const b=Oe(T.es),g=Oe(T.ef);if(g<=b)continue;const D=ne&&ne.get(T.calendar),V=D?i(b,g,D.isWorking):[[b,g]];for(const O of m){M.has(O.resource)||M.set(O.resource,[]);for(const[oe,de]of V)M.get(O.resource).push({s:oe,e:de,units:O.units,taskId:t})}}const h=new Map,ae=[],be=[];for(const[t,T]of M){const I=G.get(t),m=u(T);let b=0,g,D;if(I&&I.hasCalendar){D=I.capacityUnits,g=[];for(const O of m){O.load>b&&(b=O.load);let oe=O.s,de=I.capacityUnitsOn(Ae(O.s));const De=Se=>{const Pe={start:Ae(oe),end:Ae(Se),load:O.load,taskIds:O.taskIds};g.push(Pe),O.load>de+U&&be.push({resource:t,capacity:de,start:Pe.start,end:Pe.end,load:O.load,taskIds:O.taskIds.slice()})};for(let Se=O.s+1;Se<O.e;Se+=1){const Pe=I.capacityUnitsOn(Ae(Se));Pe!==de&&(De(Se),oe=Se,de=Pe)}De(O.e)}}else D=pe(t),g=m.map(O=>{O.load>b&&(b=O.load);const oe={start:Ae(O.s),end:Ae(O.e),load:O.load,taskIds:O.taskIds};return O.load>D+U&&be.push({resource:t,capacity:D,start:oe.start,end:oe.end,load:O.load,taskIds:O.taskIds.slice()}),oe});const V={resource:t,capacity:D,peak:b,segments:g};h.set(t,V),ae.push(V)}return ae.sort((t,T)=>t.resource<T.resource?-1:t.resource>T.resource?1:0),be.sort((t,T)=>t.start-T.start||(t.resource<T.resource?-1:1)),{ok:!0,resources:ae,overAllocations:be,byResource:h}}function B(l){const _=[];for(const a of Array.isArray(l)?l:[]){const y=k(a&&a.from),w=H(a&&a.rate);y==null||w==null||_.push({from:Math.round(y),rate:w})}return _.sort((a,y)=>a.from-y.from),_}function Z(l){const _=new Map,a=(y,w)=>{if(!w||typeof w!="object")return;const x=w.type==="material"||w.type==="cost"?w.type:"work",G=H(w.rate),ne=B(w.rates),ve=H(w.cost);G==null&&!ne.length&&ve==null||_.set(y,{type:x,rate:G,rates:ne,cost:ve})};if(Array.isArray(l))for(const y of l){const w=y&&(y.id??y.name??y.resource);w==null||w===""||a(String(w),y)}else if(l&&typeof l=="object")for(const[y,w]of Object.entries(l))w&&typeof w=="object"&&a(y,w);return _}function le(l,_){if(!l)return null;let a=l.rate;for(const y of l.rates)if(y.from<=_)a=y.rate;else break;return a??null}function v(l){if(!l)return!1;const _=l.constraint??l.constraintType;if(_==null||_==="")return!1;const a=String(_).toLowerCase().replace(/\s+/g,"-");return a==="mso"||a==="must-start-on"||a==="muststarton"||a==="start-on"||a==="mfo"||a==="must-finish-on"||a==="mustfinishon"||a==="finish-on"}function e(l){if(!l)return null;const _=l.constraint??l.constraintType,a=L(_);if(a!=="SNLT"&&a!=="FNLT")return null;let y=l.constraintDate??l.constraintAt??l.at;if(_&&typeof _=="object"&&y==null&&(y=_.date),y==null||y==="")return null;const w=k(y);return Number.isFinite(w)?{type:a,date:w}:null}function n(l,_){return l?H(l[_])??0:0}function o(l,_,a={}){const y={projectStart:a.projectStart,deadline:a.deadline,calendar:a.calendar,fields:a.fields,calendars:a.calendars,resources:Array.isArray(a.resources)?a.resources:void 0,skipCriticalPaths:!0},w=a.priorityField||"priority",x=a.maxIterations!=null?a.maxIterations:Math.max(100,l.length*l.length*2),G=R(a.fields),ne=l.map(g=>({...g})),ve=ne.map(g=>String(G(g))),pe=new Map(ne.map(g=>[String(G(g)),g])),Oe=new Map(ve.map((g,D)=>[g,D])),Ae=g=>Oe.has(g)?Oe.get(g):-1;let me=ie(ne,_,y);if(!me.ok)return{ok:!1,error:me.error};const Ee=new Map;for(const g of me.order){const D=me.tasks.get(g);D&&!D.isSummary&&!D.unscheduled&&Ee.set(g,D.es)}const M=H(a.defaultCapacity)??1,h=K(a.resources,M,{calendar:a.calendar,calendars:a.calendars,hoursPerDay:a.hoursPerDay}),ae=a.calendar!=null?F(a.calendar,me.projectStart):null,be=(g,D,V)=>{const O=$(D).map(de=>h.get(de.resource)).filter(de=>de&&de.hasCalendar);let oe=Math.round(g);for(let de=0;de<3660;de+=1){if((V?V(oe):!ae||ae.isWorking(oe))&&O.every(De=>De.worksOn(oe)))return oe;oe+=1}return Math.round(g)};let t=0;const T=Math.max(32,l.length*2);let I=1/0,m=0;for(;t<x;t+=1){const g=j(ne,me,a);g.overAllocations.length<I?(I=g.overAllocations.length,m=0):m+=1;const D=g.overAllocations.filter(Se=>new Set(Se.taskIds).size>=2);if(!D.length)return{ok:!0,resolved:g.overAllocations.length===0,tasks:ne,schedule:me,moves:p(Ee,me),remaining:g.overAllocations,iterations:t};if(m>=T)return z("gantt-level-unresolved",`[lattice] gantt: resource leveling could not clear ${g.overAllocations.length} over-allocation(s) after ${t} iterations; the plan cannot be fully levelled, returning the partial result.`),{ok:!0,resolved:!1,tasks:ne,schedule:me,moves:p(Ee,me),remaining:g.overAllocations,iterations:t};const O=D.slice().sort((Se,Pe)=>Se.start-Pe.start||Pe.load-Se.load)[0].taskIds.map(Se=>me.tasks.get(Se)).filter(Boolean),oe=O.filter(Se=>!v(pe.get(Se.id)));if(!oe.length)return{ok:!0,resolved:!1,tasks:ne,schedule:me,moves:p(Ee,me),remaining:g.overAllocations,iterations:t};oe.sort((Se,Pe)=>{if(Pe.totalFloat!==Se.totalFloat)return Pe.totalFloat-Se.totalFloat;const Ne=n(pe.get(Se.id),w),_e=n(pe.get(Pe.id),w);return Ne!==_e?Ne-_e:Pe.es!==Se.es?Pe.es-Se.es:Ae(Pe.id)-Ae(Se.id)});let de=null,De=null;for(const Se of oe){const Pe=O.filter(Le=>Le.id!==Se.id).map(Le=>Le.ef).filter(Le=>Le>Se.es+U),Ne=Pe.length?Math.min(...Pe):Se.es+1,_e=be(Ne,pe.get(Se.id),me.calendars instanceof Map?me.calendars.get(Se.calendar).isWorking:void 0),ze=e(pe.get(Se.id));if(!(ze&&(ze.type==="SNLT"?_e:_e+(Se.ef-Se.es))>ze.date+U)){de=Se,De=_e;break}}if(!de)return{ok:!0,resolved:!1,tasks:ne,schedule:me,moves:p(Ee,me),remaining:g.overAllocations,iterations:t};if(pe.get(de.id).start=De,me=ie(ne,_,y),!me.ok)return{ok:!1,error:me.error}}const b=j(ne,me,a);return b.overAllocations.length&&z("gantt-level-unresolved",`[lattice] gantt: resource leveling hit its ${x}-iteration cap with ${b.overAllocations.length} over-allocation(s) unresolved; returning the partial result.`),{ok:!0,resolved:b.overAllocations.length===0,tasks:ne,schedule:me,moves:p(Ee,me),remaining:b.overAllocations,iterations:t}}function p(l,_){const a=[];for(const y of _.order){const w=_.tasks.get(y);if(!w||w.isSummary||w.unscheduled)continue;const x=l.get(y);x!=null&&w.es>x+U&&a.push({id:y,from:x,to:w.es,delay:w.es-x})}return a}}),Re("packages/modules/gantt/workload.js",function(s,te){"use strict";Object.defineProperty(s,"WORKLOAD_DEFAULTS",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"HISTOGRAM_DEFAULTS",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"normalizeThresholds",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"thresholdFor",{enumerable:!0,get:function(){return k}}),Object.defineProperty(s,"normalizeExternalLoad",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"statedHours",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"taskContour",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"contourTotal",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"serializeContour",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"contourSpan",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"spanDuration",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"spreadHours",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"setContourBucket",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"retimeContour",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"recordWorkingDays",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(s,"workloadBuckets",{enumerable:!0,get:function(){return u}}),Object.defineProperty(s,"taskAssignmentEffort",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"computeWorkload",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"formatHours",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"formatPercent",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"formatCost",{enumerable:!0,get:function(){return v}});const $e=te("packages/modules/gantt/resources.js"),z=$e.parseAssignments,N=$e.rateOn,ie=te("packages/modules/gantt/schedule.js"),U=ie.EPS,R=ie.taskIdReader,L=te("packages/modules/gantt/time.js"),f=L.fromDayNumber,$=L.toDayNumber,E=L.toISODate,W=te("packages/core/src/internal/warn.js").warnOnce,q=te("packages/modules/gantt/week.js").weekStartOf,S=Object.freeze({hoursPerDay:8,height:160,rowHeight:28,decimals:1,totals:!0,maxHeight:null,unit:"hours",thresholds:null,showUnassigned:!0,labelWidth:null}),i=Object.freeze({resources:null,unit:"hours",stacked:!1,height:160,rowHeight:48,maxHeight:null,labelWidth:null});function d(e){if(e==null||e===""||typeof e=="boolean")return null;const n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?n:null}function c(e){if(!Array.isArray(e))return null;const n=[];for(const o of e){if(!o||typeof o!="object")continue;const p=d(o.at);if(p==null||p<0)continue;const l=typeof o.className=="string"&&o.className?o.className:null,_=typeof o.colour=="string"&&o.colour?o.colour:typeof o.color=="string"&&o.color?o.color:null;!l&&!_||n.push({at:p,className:l,colour:_})}return n.length?(n.sort((o,p)=>o.at-p.at),n):null}function k(e,n){if(!e||n==null||!Number.isFinite(n))return null;let o=null;for(const p of e)if(n>=p.at)o=p;else break;return o}function Q(e,n){if(e==null||e==="")return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const o=$(e);return Number.isFinite(o)?o-n:null}function J(e,n=0){if(!Array.isArray(e))return[];const o=[];for(let p=0;p<e.length;p+=1){const l=e[p],_=l&&typeof l=="object"&&l.resource!=null&&l.resource!==""?String(l.resource):null,a=l&&typeof l=="object"?Q(l.start,n):null,y=l&&typeof l=="object"?Q(l.end,n):null;if(_==null||a==null||y==null){W(`gantt.workloadExternal.${p}`,`[lattice] gantt: workload.external entry ${p} has no resource or no drawable start/end; it is skipped.`);continue}const w=typeof l.label=="string"&&l.label!==""?l.label:null,x=typeof l.group=="string"&&l.group!==""?l.group:null;o.push({index:p,resource:_,start:a,end:y,units:d(l.units),hours:d(l.hours),label:w,group:x})}return o}function H(e){const n=$(e.start);if(!Number.isFinite(n))return null;const o=$(e.end);if(Number.isFinite(o))return{es:n,ef:o};const p=d(e.duration);return{es:n,ef:n+(p??0)}}function se(e){if(!e||Array.isArray(e.work))return null;const n=d(e.work);return n??d(e.hours)}function fe(e){if(!e||!Array.isArray(e.work))return null;const n=[];for(const p of e.work){if(!p||typeof p!="object")continue;const l=$(p.date),_=d(p.hours);l==null||_==null||n.push({day:Math.round(l),hours:_})}n.sort((p,l)=>p.day-l.day);const o=[];for(const p of n){const l=o[o.length-1];l&&l.day===p.day?l.hours+=p.hours:o.push({day:p.day,hours:p.hours})}return o}function ke(e){return(Array.isArray(e)?e:[]).reduce((n,o)=>n+(d(o.hours)??0),0)}function ge(e){const n=[];for(const o of Array.isArray(e)?e:[]){const p=d(o.hours);if(p==null||!(Math.abs(p)>U))continue;const l=E(o.day);l!=null&&n.push({date:l,hours:Math.round(p*1e6)/1e6})}return n}function ue(e){const n=(Array.isArray(e)?e:[]).filter(o=>Math.abs(d(o.hours)??0)>U);return n.length?{first:n[0].day,last:n[n.length-1].day}:null}function X(e,n,o=null){if(!Number.isFinite(e)||!Number.isFinite(n)||n<e)return 0;if(typeof o!="function")return Math.round(n-e)+1;let p=0;for(let l=Math.round(e);l<=Math.round(n);l+=1)o(l)&&(p+=1);return p}function ee(e,n){if(!Array.isArray(e)||!e.length)return[];const o=n/e.length;return e.map(p=>({day:p,hours:o}))}function A(e,n,o,p){const l=(Array.isArray(e)?e:[]).filter(a=>!(a.day>=n.start&&a.day<n.end)),_=Math.abs(p)>U?ee(o,p):[];return[...l,..._].sort((a,y)=>a.day-y.day)}function K(e,n,o){const p=Array.isArray(n)?n:[],l=Array.isArray(o)?o:[];if(!Array.isArray(e)||!p.length||!l.length)return Array.isArray(e)?e:[];const _=new Map(e.map(x=>[x.day,d(x.hours)??0])),a=p.map(x=>_.get(x)??0),y=a.length,w=[];for(let x=0;x<l.length;x+=1){const G=a[Math.min(y-1,Math.floor(x*y/l.length))];Math.abs(G)>U&&w.push({day:l[x],hours:G})}return w}function Y(e,n=null){const o=[];if(!e||!Number.isFinite(e.es)||!Number.isFinite(e.ef))return o;for(let p=Math.floor(e.es);p<Math.ceil(e.ef);p+=1)(typeof n!="function"||n(p))&&o.push(p);return o}function u(e,n,o,p=0){const l=Math.floor(n),_=Math.ceil(o),a=[];if(!(_>l))return a;if(e==="day"){for(let w=l;w<_;w+=1)a.push({start:w,end:w+1});return a}if(e==="month"||e==="quarter"){const w=f(l);if(!w)return a;const x=e==="quarter"?w.getUTCMonth()-w.getUTCMonth()%3:w.getUTCMonth();let G=Date.UTC(w.getUTCFullYear(),x,1)/864e5;for(;G<_;){const ne=f(G),ve=e==="quarter"?3-ne.getUTCMonth()%3:1,pe=Date.UTC(ne.getUTCFullYear(),ne.getUTCMonth()+ve,1)/864e5;a.push({start:G,end:pe}),G=pe}return a}let y=q(l,p);for(;y<_;y+=7)a.push({start:y,end:y+7});return a}function j(e,n,o={}){const p=d(o.hoursPerDay)??S.hoursPerDay,l=typeof o.isWorking=="function"?o.isWorking:null,_=Y(n,l),a=fe(e);if(!a&&!_.length)return[];const y=z(e),w=y.length?y:[{resource:null,units:1}],x=w.reduce((ne,ve)=>ne+(d(ve.units)??0),0);if(!(x>0))return[];let G;if(a)G=a.filter(ne=>Math.abs(ne.hours)>U);else{const ne=se(e),ve=ne??_.length*p*x;if(!(Math.abs(ve)>U))return[];G=ee(_,ve)}return G.length?w.map(ne=>{const ve=d(ne.units)??0,pe=ve/x;return{resource:ne.resource,units:ve,unitsTotal:x,perDay:pe>0?G.map(Oe=>({day:Oe.day,hours:Oe.hours*pe})):[]}}):[]}function B(e,n,o={}){const p=Array.isArray(o.buckets)?o.buckets:[],l={ok:!1,buckets:[],rows:[],totals:p.map(()=>null),totalsAvailable:p.map(()=>null),totalsCost:p.map(()=>null),grandTotal:0,grandAvailableTotal:null,grandCostTotal:null};if(!n||!n.ok)return l;const _=d(o.hoursPerDay)??S.hoursPerDay,a=typeof o.isWorking=="function"?o.isWorking:null,y=o.capacities instanceof Map?o.capacities:null,w=o.resourceModels instanceof Map?o.resourceModels:null,x=o.resourceRates instanceof Map?o.resourceRates:null,G=R(o.fields),ne=new Map,ve=(g,D,V,O)=>{ne.has(g)||ne.set(g,{days:new Map,costs:new Map,tasks:new Map});const oe=ne.get(g);if(oe.days.set(D,(oe.days.get(D)||0)+V),x&&g!=null){const De=N(x.get(g),D);De!=null&&oe.costs.set(D,(oe.costs.get(D)||0)+V*De)}oe.tasks.has(O.id)||oe.tasks.set(O.id,{...O,days:new Map});const de=oe.tasks.get(O.id);de.days.set(D,(de.days.get(D)||0)+V)},pe=new Map;for(const g of Array.isArray(e)?e:[]){const D=g?G(g):null;D!=null&&pe.set(String(D),g)}const Oe=Array.isArray(e)&&n.order.length===e.length;for(let g=0;g<n.order.length;g+=1){const D=n.order[g],V=n.tasks.get(D);if(!V||V.isSummary||V.unscheduled||V.inactive)continue;const O=pe.get(D)||(Oe?e[g]:null);if(!O||O.loadOnly===!0)continue;const oe=n.calendars instanceof Map?n.calendars.get(V.calendar):null,de=j(O,V,{hoursPerDay:_,isWorking:oe?oe.isWorking:a});for(const De of de){if(!De.perDay.length)continue;const Se={id:D,name:V.name,units:De.units,unitsTotal:De.unitsTotal,raw:O,loadOnly:!1,external:!1,group:null};for(const Pe of De.perDay)ve(De.resource,Pe.day,Pe.hours,Se)}}for(const g of Array.isArray(e)?e:[]){if(!g||g.loadOnly!==!0)continue;const D=H(g);if(!D)continue;const V=G(g),O=V!=null?String(V):`loadOnly:${e.indexOf(g)}`,oe=g.name!=null?String(g.name):O,de=j(g,D,{hoursPerDay:_,isWorking:a});for(const De of de){if(!De.perDay.length)continue;const Se={id:O,name:oe,units:De.units,unitsTotal:De.unitsTotal,raw:g,loadOnly:!0,external:!1,group:null};for(const Pe of De.perDay)ve(De.resource,Pe.day,Pe.hours,Se)}}for(const g of Array.isArray(o.external)?o.external:[]){if(!g||g.resource==null)continue;const D=d(g.start),V=d(g.end);if(D==null||V==null)continue;const O=Y({es:D,ef:V},a),oe=g.hours!=null?d(g.hours):O.length*_*(d(g.units)??1);if(oe==null||!(Math.abs(oe)>U)||!O.length)continue;const De={id:`external:${g.index??e.length}`,name:g.label,units:null,unitsTotal:null,raw:null,loadOnly:!0,external:!0,group:g.group??null};for(const Se of ee(O,oe))ve(String(g.resource),Se.day,Se.hours,De)}const Ae=g=>{let D=0,V=p.length-1;for(;D<=V;){const O=D+V>>1;if(g<p[O].start)V=O-1;else if(g>=p[O].end)D=O+1;else return O}return-1},me=p.map(g=>{let D=0;for(let V=Math.floor(g.start);V<Math.ceil(g.end);V+=1)(!a||a(V))&&(D+=1);return{start:g.start,end:g.end,workingDays:D}}),Ee=g=>{const D=me.map(()=>0);for(const[V,O]of g){const oe=Ae(V);oe>=0&&(D[oe]+=O)}return D},M=[...ne.keys()].filter(g=>g!=null).sort(),h=ne.has(null)?[...M,null]:M,ae=[],be=me.map(()=>0),t=me.map(()=>null),T=x?me.map(()=>0):me.map(()=>null);let I=0,m=x?0:null;for(const g of h){const D=ne.get(g),V=Ee(D.days),O=x?Ee(D.costs):null,oe=g!=null&&y&&y.has(g)?y.get(g):null,de=g!=null&&w?w.get(g):null,De=V.map(Fe=>Math.abs(Fe)>U?Fe:null),Se=V.map((Fe,he)=>{if(de&&de.hasCalendar){let Te=0;for(let xe=Math.floor(me[he].start);xe<Math.ceil(me[he].end);xe+=1)(!a||a(xe))&&(Te+=de.capacityHoursOn(xe));return Te}return oe==null?null:oe*_*me[he].workingDays}),Pe=V.map((Fe,he)=>Se[he]!=null&&Fe>Se[he]+U);let Ne=0,_e=null,ze=x?0:null;V.forEach((Fe,he)=>{Ne+=Fe,be[he]+=Fe,Se[he]!=null&&(_e=(_e??0)+Se[he],t[he]=(t[he]??0)+Se[he]),O&&(ze+=O[he],T[he]+=O[he])}),I+=Ne,x&&(m+=ze);const Le=[...D.tasks.values()].map(Fe=>{const he=Ee(Fe.days);return{id:Fe.id,name:Fe.name,units:Fe.units,unitsTotal:Fe.unitsTotal,raw:Fe.raw,cells:he.map(Te=>Math.abs(Te)>U?Te:null),total:he.reduce((Te,xe)=>Te+xe,0),loadOnly:!!Fe.loadOnly,external:!!Fe.external,group:Fe.group??null}});ae.push({resource:g,capacity:oe,available:Se,availableTotal:_e,cells:De,over:Pe,total:Ne,costCells:O?O.map(Fe=>Math.abs(Fe)>U?Fe:null):null,costTotal:ze,tasks:Le})}let b=null;for(const g of t)g!=null&&(b=(b??0)+g);return{ok:!0,buckets:me,rows:ae,totals:be.map(g=>Math.abs(g)>U?g:null),totalsAvailable:t,totalsCost:T,grandTotal:I,grandAvailableTotal:b,grandCostTotal:m}}function Z(e,n){if(e==null||!Number.isFinite(e))return"";const p=10**(Number.isFinite(n)?Math.max(0,Math.min(6,Math.round(n))):1),l=Math.round(e*p)/p;return Object.is(l,-0)||l===0?"0":String(l)}function le(e,n,o){if(n==null||!(n>U))return"–";const p=Number.isFinite(e)?e:0;return Z(p/n*100,o)}function v(e,n=2){return Z(e,n)}}),Re("packages/modules/gantt/tooltip.js",function(s,te){"use strict";Object.defineProperty(s,"taskTooltipRows",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"taskTooltipText",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"buildTooltipCard",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"resolveTaskTooltip",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"positionTooltip",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"tooltipCss",{enumerable:!0,get:function(){return d}});const $e=te("packages/modules/charts/svg.js"),z=$e.el,N=$e.setText,ie=$e.round,R=te("packages/modules/gantt/assignments.js").parseAssignments,f=te("packages/modules/gantt/workload.js").formatCost,$=["start","end","duration","percentComplete","effort","resources","cost","slack","deadline"],E=new Set(["start","end","duration","slack"]);function F(c,k,Q,J){const{t:H,formatDate:se}=J;switch(c){case"start":return{label:H("gantt.tip.start"),value:se(k.es)};case"end":return{label:H("gantt.tip.end"),value:se(k.ef)};case"duration":return{label:H("gantt.tip.durationLabel"),value:H("gantt.tip.durationValue",{days:ie(k.duration)})};case"percentComplete":return k.percentComplete==null?null:{label:H("gantt.tip.complete"),value:`${Math.round(k.percentComplete)}%`};case"effort":return k.effort==null?null:{label:H("gantt.tip.effortLabel"),value:H("gantt.tip.effortValue",{hours:ie(k.effort)})};case"resources":{const fe=R(Q).map(ke=>ke.resource);return fe.length?{label:H("gantt.tip.assigned"),value:fe.map(ke=>J.resourceName(ke)).join(", ")}:null}case"cost":{const fe=Q&&Q.cost!=null?Number(Q.cost):NaN;return Number.isFinite(fe)?{label:H("gantt.tip.cost"),value:f(fe)}:null}case"slack":return Number.isFinite(k.totalFloat)?{label:H("gantt.tip.slackLabel"),value:H("gantt.tip.slackValue",{days:ie(k.totalFloat)})}:null;case"deadline":return Number.isFinite(k.deadline)?{label:H("gantt.tip.deadline"),value:se(k.deadline)}:null;default:return null}}function W(c,k,Q,J){if(c.isMilestone&&!c.unscheduled)return[{label:J.t("gantt.tip.date"),value:J.formatDate(c.es)}];let H=Array.isArray(Q)&&Q.length?Q:$;c.unscheduled&&(H=H.filter(fe=>!E.has(fe)));const se=[];for(const fe of H){const ke=F(fe,c,k,J);ke&&se.push(ke)}return se}function P(c,k,Q){return[c.name,...k.map(J=>Q("gantt.tip.row",{label:J.label,value:J.value}))].join(`
|
|
7
|
+
`)}function q(c,k,Q,J){const H=z(c,"div",`${k}__tip-card`),se=z(c,"div",`${k}__tip-title`);N(se,Q.name),H.appendChild(se);for(const fe of J){const ke=z(c,"div",`${k}__tip-row`),ge=z(c,"span",`${k}__tip-label`);N(ge,fe.label);const ue=z(c,"span",`${k}__tip-value`);N(ue,fe.value),ke.appendChild(ge),ke.appendChild(ue),H.appendChild(ke)}return H}function S(c,k,Q,J,H,se){if(typeof H=="function"){const ge=H(Q,{...se,rawTask:J});if(ge==null||ge==="")return null;if(typeof ge=="string")return{node:null,text:ge};const ue=ge.textContent||"",X=z(c,"div",`${k}__tip-card`);return X.appendChild(ge),{node:X,text:ue}}const fe=H&&typeof H=="object"&&Array.isArray(H.fields)?H.fields:null,ke=W(Q,J,fe,se);return{node:q(c,k,Q,ke),text:P(Q,ke,se.t)}}function i(c,k,Q,J,H,se={}){const fe=Number.isFinite(se.gap)?se.gap:8,ke=c.offsetWidth||0,ge=c.offsetHeight||0,ue=Q.left+Q.width/2,X=Q.top+Q.height/2;let ee="top",A=ue-ke/2,K=Q.top-ge-fe;if(K<J.top&&(ee="bottom",K=Q.bottom+fe),ee==="bottom"&&K+ge>J.bottom&&(K=X-ge/2,ee=Q.right+fe+ke<=J.right?"right":"left",A=ee==="right"?Q.right+fe:Q.left-ke-fe),A=Math.min(Math.max(A,J.left),Math.max(J.left,J.right-ke)),K=Math.min(Math.max(K,J.top),Math.max(J.top,J.bottom-ge)),c.setAttribute("data-placement",ee),c.style.left=`${ie(A-H.left)}px`,c.style.top=`${ie(K-H.top)}px`,!k)return;const Y=(k.offsetWidth||0)/2,u=(k.offsetHeight||0)/2;if(ee==="top"||ee==="bottom"){const j=Math.min(Math.max(ue-A-Y,10-Y),Math.max(10-Y,ke-10-Y));k.style.left=`${ie(j)}px`,k.style.top=""}else{const j=Math.min(Math.max(X-K-u,10-u),Math.max(10-u,ge-10-u));k.style.top=`${ie(j)}px`,k.style.left=""}}function d(c){return`
|
|
8
8
|
.${c}__tip-card{position:relative;max-width:280px;padding:6px 10px;border-radius:var(--lattice-radius);font-size:var(--lattice-font-size-sm);line-height:1.5;
|
|
9
9
|
background:var(--lattice-surface);color:var(--lattice-foreground);
|
|
10
10
|
border:1px solid var(--lattice-border-color);
|
|
@@ -224,7 +224,7 @@ ${z(N)}
|
|
|
224
224
|
@scope ([data-theme="dark"]){:scope.${N},.${N}{color-scheme:dark}}
|
|
225
225
|
@scope ([data-theme="light"],[data-theme="auto"]){:scope.${N},.${N}{color-scheme:light}}
|
|
226
226
|
@media (prefers-color-scheme:dark){@scope ([data-theme="auto"]){:scope.${N},.${N}{color-scheme:dark}}}
|
|
227
|
-
`.trim()}function R(L){const f=L&&L.documentElement;if(!f||f.getAttribute(ie))return;f.setAttribute(ie,"1");const $=L.createElement("style");$.textContent=U(),(L.head||L.body||f).appendChild($)}}),Re("packages/core/src/internal/text.js",function(s,te){"use strict";Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return ie}});function $e(U){return U?(U.includes(".")?U.slice(U.lastIndexOf(".")+1):U).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(/^./,L=>L.toUpperCase()):""}const z={"&":"&","<":"<",">":">",'"':""","'":"'"};function N(U){const R=U==null?"":String(U);return/[&<>"']/.test(R)?R.replace(/[&<>"']/g,L=>z[L]):R}function ie(U){return String(U).replace(/\w\S*/g,R=>R[0].toUpperCase()+R.slice(1).toLowerCase())}}),Re("packages/modules/scheduler/workload.js",function(s,te){"use strict";Object.defineProperty(s,"bucketPeriodLabel",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"computeWorkloadModel",{enumerable:!0,get:function(){return S}});const $e=te("packages/modules/gantt/workload.js"),z=$e.computeWorkload,N=$e.workloadBuckets,ie=te("packages/modules/gantt/resources.js"),U=ie.normalizeCapacities,R=ie.normalizeResources,L=ie.resourceDisplayNames,f=te("packages/modules/scheduler/model.js"),$=f.accessorFor,E=f.eventSpan,F=f.eventText,W=864e5;function A(i){return typeof i=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(i.trim())}function q(i,d){const c=i.locale||void 0,k=i.timeZone||"UTC";return new Intl.DateTimeFormat(c,{month:"short",day:"numeric",timeZone:k}).format(new Date(Math.round(d)*W))}function S(i,d){const c=i.workload;if(!c||!d)return null;const k=i.zoom.level==="hour"?"day":i.zoom.level,Q=N(k,d.startDay,d.endDay,i.weekStartDay),J=$(i.resourceKey),H=$(i.fields.resourceId),se=$(i.eventKey),fe=$(i.fields.calendar),ke=[];for(const Z of i.resources){const le=J(Z);le==null||le===""||ke.push({...Z,id:String(le),calendar:fe(Z)})}const ge=U(ke,c.defaultCapacity),ue=R(ke,c.defaultCapacity,{calendar:null,calendars:i.calendars,hoursPerDay:c.hoursPerDay}),X=new Map;for(const[Z,le]of ue)le&&le.hasCalendar&&typeof le.worksOn=="function"&&X.set(Z,{isWorking:v=>le.worksOn(v)});const ee=[],x=[],K=new Map;for(const Z of i.events){const le=E(i,Z);if(!le.start)continue;const v=H(Z);if(v==null||v==="")continue;const e=String(v),n=se(Z),o=n==null?`event:${i.events.indexOf(Z)}`:String(n),p=F(i,Z,n),l=$(i.fields.startDate)(Z),_=$(i.fields.endDate)(Z),y=A(l)&&A(_)?null:(le.end.day+le.end.frac-le.start.day-le.start.frac)*24;ee.push({id:o,name:p,assignee:e,hours:y}),x.push(o),K.set(o,{es:le.start.day+le.start.frac,ef:le.end.day+le.end.frac,isSummary:!1,unscheduled:!1,inactive:!1,name:p,calendar:X.has(e)?e:null})}const Y=z(ee,{ok:!0,order:x,tasks:K,calendars:X},{buckets:Q,hoursPerDay:c.hoursPerDay,isWorking:null,capacities:ge,resourceModels:ue}),u=new Map;for(const Z of Y.rows)Z.resource!=null&&u.set(Z.resource,Z);for(const[Z,le]of ue){if(u.has(Z))continue;const v=ge.has(Z)?ge.get(Z):null,e=Y.buckets.map(o=>{if(le.hasCalendar){let p=0;for(let l=Math.floor(o.start);l<Math.ceil(o.end);l+=1)p+=le.capacityHoursOn(l);return p}return v==null?null:v*c.hoursPerDay*o.workingDays});let n=null;for(const o of e)o!=null&&(n=(n??0)+o);u.set(Z,{resource:Z,capacity:v,available:e,availableTotal:n,cells:Y.buckets.map(()=>null),over:Y.buckets.map(()=>!1),total:0})}const j=L(ke),B=[];for(const Z of Y.rows){if(Z.resource==null)continue;const le=[];Z.over.forEach((v,e)=>{v&&le.push(e)}),le.length&&B.push({resource:Z.resource,name:j.get(Z.resource)||Z.resource,count:le.length,periods:le.map(v=>q(i,Y.buckets[v].start))})}return{buckets:Y.buckets,rows:u,overAllocated:B,hoursPerDay:c.hoursPerDay,decimals:c.decimals}}}),Re("packages/modules/scheduler/messages.js",function(s,te){"use strict";Object.defineProperty(s,"FALLBACK_EN",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"t",{enumerable:!0,get:function(){return U}});const z=te("packages/core/src/internal/predicates.js").isFunction,N=Object.freeze({"scheduler.scheduler":"Scheduler","scheduler.resource":"Resource","scheduler.event":{one:"event",other:"events"},"scheduler.print.page":"Page {page} of {pages}","scheduler.print.printed":"Printed {date}","scheduler.readOnlyEvent":"The event is read-only.","scheduler.readOnlyResource":"The resource is read-only.","scheduler.delete":"Delete","scheduler.ungrouped":"Ungrouped","scheduler.group":"Group","scheduler.timeline":"Time axis","scheduler.divider":"Resource pane divider","scheduler.divider.resize":"Resource pane {width} pixels wide","scheduler.divider.min":"Resource pane at its minimum width","scheduler.divider.max":"Resource pane at its maximum width","scheduler.toggleGroup":"Toggle {group}","scheduler.eventActivated":"{name}","scheduler.tip.start":"Start","scheduler.tip.end":"End","scheduler.tip.duration":"Duration","scheduler.tip.durationValue":"{hours} h","scheduler.tip.resource":"Resource","scheduler.tip.row":"{label}: {value}","scheduler.workload.overSummary":"Over-allocated: {list}","scheduler.workload.overItem":"{resource} ({periods})","scheduler.workload.overCell":"{resource}, {period}: {percent} — over-allocated"});function ie(R,L){const f=N[R];if(!f)return R;const $=L&&typeof L.count=="number"?L.count:NaN;return(typeof f=="string"?f:($===1?f.one:f.other)||f.other).replace(/\{(\w+)\}/g,(F,W)=>L&&W in L?String(L[W]):F)}function U(R,L,f){const $=R&&R.config?R.config:{},E=$.messages&&z($.messages.t)?$.messages:null;if(E){let F;try{F=E.t(L,f)}catch{F=null}if(typeof F=="string"&&F&&F!==L)return F}return ie(L,f)}}),Re("packages/modules/shared/drag-gesture.js",function(s,te){"use strict";Object.defineProperty(s,"attachDragGesture",{enumerable:!0,get:function(){return U}});const $e=300,z=3,N=24,ie=12;function U(R,L={}){const f=L.holdMs==null?$e:L.holdMs,$=typeof L.canStart=="function"?L.canStart:null,E=typeof L.onStart=="function"?L.onStart:null,F=typeof L.onMove=="function"?L.onMove:null,W=typeof L.onEnd=="function"?L.onEnd:null,A=typeof L.onCancel=="function"?L.onCancel:null,q=typeof L.autoScroll=="function"?L.autoScroll:null,S=Array.isArray(L.autoScroll)?L.autoScroll:[],i=R&&R.ownerDocument?R.ownerDocument:R;if(!R||!i||typeof R.addEventListener!="function")return()=>{};let d=null;function c(u,j,B,Z,le){if(B>=u&&B<u+N&&Z>0){const v=N-(B-u);return-Math.max(1,Math.round(ie*v/N))}if(B>j-N&&B<=j&&Z<le){const v=N-(j-B);return Math.max(1,Math.round(ie*v/N))}return 0}function k(){const u=d;if(u){if(d=null,u.holdTimer&&clearTimeout(u.holdTimer),Y(u),u.started&&u.pressed&&u.pressed.style&&(u.pressed.style.touchAction=u.prevTouchAction),u.pressed&&typeof u.pressed.releasePointerCapture=="function"&&u.pointerId!==void 0)try{u.pressed.releasePointerCapture(u.pointerId)}catch{}i.removeEventListener("pointermove",fe),i.removeEventListener("pointerup",ge),i.removeEventListener("pointercancel",ue),i.removeEventListener("keydown",X),i.removeEventListener("pointerdown",ee),i.removeEventListener("touchmove",ke)}}function Q(u){if(!u.started){if(u.started=!0,u.pressed&&u.pressed.style&&(u.prevTouchAction=u.pressed.style.touchAction||"",u.pressed.style.touchAction="none"),u.pressed&&typeof u.pressed.setPointerCapture=="function"&&u.pointerId!==void 0)try{u.pressed.setPointerCapture(u.pointerId)}catch{}E&&E(u.drag,u.downEvent),K(u)}}function J(u,j){const B=u.started;k(),B&&W&&W(u.drag,j)}function H(u,j){const B=u.started;k(),B&&A&&A(u.drag,j)}function se(){const u=d;u&&!u.started&&Q(u)}function fe(u){const j=d;if(!j||u.pointerId!==void 0&&u.pointerId!==j.pointerId)return;const B=typeof u.clientX=="number"?u.clientX:j.lastX,Z=typeof u.clientY=="number"?u.clientY:j.lastY;if(j.lastX=B,j.lastY=Z,j.lastEvent=u,!j.started){if(Math.hypot(B-j.startX,Z-j.startY)<=z)return;if(j.pointerType==="mouse")Q(j);else{k();return}}F&&F(j.drag,u)}function ke(u){d&&d.started&&typeof u.preventDefault=="function"&&u.preventDefault()}function ge(u){const j=d;j&&(u.pointerId!==void 0&&u.pointerId!==j.pointerId||J(j,u))}function ue(u){const j=d;j&&(u.pointerId!==void 0&&u.pointerId!==j.pointerId||H(j,u))}function X(u){d&&u.key==="Escape"&&H(d,u)}function ee(u){const j=d;j&&u.pointerId!==void 0&&u.pointerId!==j.pointerId&&H(j,u)}function x(u){if(u.button!=null&&u.button!==0||d)return;const j=$?$(u):u.target||null;if(!j)return;const B=typeof u.clientX=="number"?u.clientX:0,Z=typeof u.clientY=="number"?u.clientY:0,le=u.pointerId,v=u.pointerType||"mouse";d={drag:{el:j,pointerId:le,pointerType:v,startX:B,startY:Z,lastX:B,lastY:Z},pressed:j,pointerId:le,pointerType:v,startX:B,startY:Z,lastX:B,lastY:Z,started:!1,downEvent:u,lastEvent:u,holdTimer:null,prevTouchAction:"",frameId:null},v!=="mouse"&&(d.holdTimer=setTimeout(se,f)),i.addEventListener("pointermove",fe),i.addEventListener("pointerup",ge),i.addEventListener("pointercancel",ue),i.addEventListener("keydown",X),i.addEventListener("pointerdown",ee),v==="touch"&&i.addEventListener("touchmove",ke,{passive:!1})}function K(u){if(typeof requestAnimationFrame!="function"||!q&&!S.length)return;function j(){const B=d;if(!B||B!==u||!B.started){u.frameId=null;return}const Z=q?q():S;let le=!1;if(Array.isArray(Z))for(const v of Z){if(!v||typeof v.getBoundingClientRect!="function")continue;const e=v.getBoundingClientRect(),n=c(e.left,e.right,B.lastX,v.scrollLeft,v.scrollWidth-v.clientWidth),o=c(e.top,e.bottom,B.lastY,v.scrollTop,v.scrollHeight-v.clientHeight);n&&(v.scrollLeft+=n,le=!0),o&&(v.scrollTop+=o,le=!0)}le&&F&&B.lastEvent&&F(B.drag,B.lastEvent),u.frameId=requestAnimationFrame(j)}u.frameId=requestAnimationFrame(j)}function Y(u){u.frameId!=null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(u.frameId),u.frameId=null}return R.addEventListener("pointerdown",x),()=>{k(),R.removeEventListener("pointerdown",x)}}}),Re("packages/modules/scheduler/gestures.js",function(s,te){"use strict";Object.defineProperty(s,"attachEditing",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"addHandles",{enumerable:!0,get:function(){return W}});const z=te("packages/modules/scheduler/styles.js").NS,ie=te("packages/modules/scheduler/messages.js").t,R=te("packages/modules/shared/drag-gesture.js").attachDragGesture,L=te("packages/modules/scheduler/model.js"),f=L.isEventReadOnly,$=L.isResourceReadOnly,E=L.accessorFor;function F(A){const q=A.ctx,S=A.doc;if(!A.canvas||!S)return;let i=null,d=null;const c=()=>A.pxPerDay||1,k=v=>{const e=A.canvas.getBoundingClientRect(),n=Math.floor((v-e.top)/q.rowHeight),o=A.resources[n];return o?E(q.resourceKey)(o):null},Q=v=>{const e=A.canvas.getBoundingClientRect();return A.span.startDay+(v-e.left)/c()},J=v=>{const e=v&&v.closest?v:null;if(!e)return null;const n=e.closest(`.${z}__handle`),o=n?n.closest(`.${z}__bar`):e.closest(`.${z}__bar`);return o?{key:o.getAttribute("data-key"),bar:o,edge:n?n.getAttribute("data-edge"):null}:null},H=v=>{const e=A.canvas.querySelectorAll(`.${z}__bar`);for(const n of e)if(n.dataset.key===String(v))return n;return null},se=v=>{A.live&&(A.live.textContent=v)},fe=v=>{se(ie(A,v==="event"?"scheduler.readOnlyEvent":"scheduler.readOnlyResource"))},ke=v=>{const e=A.events.get(v);if(!e||!q.editable)return!1;if(f(q,e))return fe("event"),!1;const n=E(q.fields.resourceId)(e),o=n==null?null:A.rows.get(n);return $(q,o)?(fe("resource"),!1):!0},ge=(v,e,n)=>{if(!ke(v.key))return;const o=A.placement.keys.get(v.key);o&&(i={mode:v.edge?"resize":"move",key:v.key,edge:v.edge,startX:e,startY:n,startDay:o.startDay,endDay:o.endDay,resourceKey:o.resourceKey,bar:v.bar,ghost:null,pointerStartDay:Q(e)})},ue=(v,e)=>{if(!q.editable)return;const n=k(e);if(n==null)return;const o=A.rows.get(n);if($(q,o)){fe("resource");return}i={mode:"create",key:null,edge:null,startX:v,startY:e,startDay:Q(v),endDay:Q(v),resourceKey:n,bar:null,ghost:null}},X=(v,e)=>Q(e)-v.pointerStartDay,ee=(v,e)=>{if(!i)return;const n=i;if(n.mode==="move"){const o=H(n.key);if(!o)return;o.style.left=`${(n.startDay+X(n,v)-A.span.startDay)*c()}px`}else if(n.mode==="resize"){const o=H(n.key);if(!o)return;const p=X(n,v);if(n.edge==="start"){const l=(n.startDay-A.span.startDay+p)*c();o.style.left=`${l}px`,o.style.width=`${Math.max(2,(n.endDay-n.startDay-p)*c())}px`}else o.style.width=`${Math.max(2,(n.endDay-n.startDay+p)*c())}px`}else if(n.mode==="create"){n.endDay=Q(v),n.ghost||(n.ghost=A.doc.createElement("div"),n.ghost.className=`${z}__bar ${z}__bar--ghost`,(A.canvas.querySelector(`.${z}__row[data-resource="${CSS.escape(String(n.resourceKey))}"]`)||A.canvas).appendChild(n.ghost));const o=Math.min(n.startDay,n.endDay),p=Math.max(n.startDay,n.endDay);n.ghost.style.left=`${(o-A.span.startDay)*c()}px`,n.ghost.style.width=`${Math.max(2,(p-o)*c())}px`}},x=(v,e)=>{if(!i)return;const n=i;if(i=null,n.ghost&&n.ghost.parentNode&&n.ghost.parentNode.removeChild(n.ghost),n.mode==="move"){const o=k(e);o!=null&&String(o)!==String(n.resourceKey)?A.edit.reassign(n.key,o,{origin:"user"}):A.edit.move(n.key,X(n,v),{origin:"user"})}else if(n.mode==="resize"){const o=(n.edge==="start"?n.startDay:n.endDay)+X(n,v);A.edit.resize(n.key,n.edge,o,{origin:"user"})}else n.mode==="create"&&A.edit.create(n.resourceKey,n.startDay,n.endDay,{origin:"user"})},K=()=>{if(!i)return;const v=i;if(i=null,v.ghost&&v.ghost.parentNode&&v.ghost.parentNode.removeChild(v.ghost),v.mode==="move"||v.mode==="resize"){const e=H(v.key);e&&(e.style.left=`${(v.startDay-A.span.startDay)*c()}px`,e.style.width=`${Math.max(2,(v.endDay-v.startDay)*c())}px`)}},Y=R(A.canvas,{canStart:v=>{const e=v.target;if(!e||!e.closest)return null;const n=e,o=n.closest(`.${z}__handle`),p=o?o.closest(`.${z}__bar`):n.closest(`.${z}__bar`);return p?o||p:null},onStart:v=>{const e=J(v.el);e&&ge(e,v.startX,v.startY)},onMove:(v,e)=>{i&&ee(e.clientX,e.clientY)},onEnd:(v,e)=>{i&&x(e.clientX,e.clientY)},onCancel:()=>K(),autoScroll:[A.timeline]}),u=v=>{if(v.button!=null&&v.button!==0||J(v.target)||!(v.target&&v.target.closest?v.target.closest(`.${z}__row`):null)||(ue(v.clientX,v.clientY),!i))return;const n=p=>ee(p.clientX,p.clientY),o=p=>{x(p.clientX,p.clientY),S.removeEventListener("pointermove",n),S.removeEventListener("pointerup",o)};S.addEventListener("pointermove",n),S.addEventListener("pointerup",o)},j=v=>{const e=J(v.target);if(v.key==="z"&&(v.ctrlKey||v.metaKey)){if(!A.edit)return;v.preventDefault&&v.preventDefault(),v.shiftKey?A.edit.redo({origin:"user"}):A.edit.undo({origin:"user"});return}if(!e)return;const n=q.zoom.step;if(v.key==="Delete"||v.key==="Backspace"){if(!ke(e.key))return;v.preventDefault&&v.preventDefault(),A.edit.remove(e.key,{origin:"user",event:v})}else if(v.key==="ArrowLeft"||v.key==="ArrowRight"){if(!ke(e.key))return;v.preventDefault&&v.preventDefault();const o=v.key==="ArrowRight"?1:-1;if(v.shiftKey){const p=A.placement.keys.get(e.key);p&&A.edit.resize(e.key,"end",p.endDay+o*n,{origin:"user",event:v})}else A.edit.move(e.key,o*n,{origin:"user",event:v})}else if(v.key==="ArrowUp"||v.key==="ArrowDown"){if(!ke(e.key))return;v.preventDefault&&v.preventDefault();const o=A.placement.keys.get(e.key);if(!o)return;const p=A.resources.findIndex(_=>String(E(q.resourceKey)(_))===String(o.resourceKey)),l=A.resources[p+(v.key==="ArrowDown"?1:-1)];if(l){const _=E(q.resourceKey)(l);if($(q,l)){fe("resource");return}A.edit.reassign(e.key,_,{origin:"user",event:v})}}},B=v=>{const e=J(v.target);if(!e||(v.preventDefault&&v.preventDefault(),!ke(e.key)))return;Z(),d=e.key;const n=A.doc.createElement("div");n.className=`${z}__menu`,n.setAttribute("role","menu");const o=A.doc.createElement("button");o.className=`${z}__menu-item`,o.setAttribute("role","menuitem"),o.textContent=ie(A,"scheduler.delete"),o.addEventListener("click",()=>{d!=null&&A.edit.remove(d,{origin:"user"}),Z()}),n.appendChild(o),n.style.left=`${v.clientX}px`,n.style.top=`${v.clientY}px`,n.style.position="fixed",A.el.appendChild(n),n.__menu=!0;const p=l=>{if(!n.contains(l.target)){if(l.key==="Escape"){Z();return}Z()}};S.addEventListener("pointerdown",p,!0),S.addEventListener("keydown",p,!0),n.__cleanup=()=>{S.removeEventListener("pointerdown",p,!0),S.removeEventListener("keydown",p,!0)},o.focus()},Z=()=>{const v=A.el?A.el.querySelector(`.${z}__menu`):null;v&&(v.__cleanup&&v.__cleanup(),v.parentNode&&v.parentNode.removeChild(v)),d=null};A.canvas.addEventListener("pointerdown",u),A.canvas.addEventListener("keydown",j),A.canvas.addEventListener("contextmenu",B);const le=()=>{Z(),Y(),A.canvas.removeEventListener("pointerdown",u),A.canvas.removeEventListener("keydown",j),A.canvas.removeEventListener("contextmenu",B)};A._editDetach=le}function W(A,q){if(A.ctx.editable===!1)return;const S=A.doc;for(const i of["start","end"]){const d=S.createElement("div");d.className=`${z}__handle ${z}__handle--${i}`,d.setAttribute("data-edge",i),d.setAttribute("aria-hidden","true"),q.appendChild(d)}}}),Re("packages/modules/shared/pinch-gesture.js",function(s,te){"use strict";Object.defineProperty(s,"attachPinchGesture",{enumerable:!0,get:function(){return z}});const $e=48;function z(N,ie){const U=ie||{},R=Number.isFinite(U.minSpread)&&U.minSpread>0?U.minSpread:$e;if(!N||typeof N.addEventListener!="function")return()=>{};const L=new Map;let f=null;const $=()=>{const[d,c]=[...L.values()];return{spread:Math.hypot(d.x-c.x,d.y-c.y),cx:(d.x+c.x)/2,cy:(d.y+c.y)/2}},E=()=>{f&&(N.style.touchAction=f.prevTouchAction,f=null)},F=d=>{if(d.pointerType==="touch"&&!(typeof U.enabled=="function"&&!U.enabled())&&((L.has(d.pointerId)||L.size>=2)&&(L.clear(),E()),L.set(d.pointerId,{x:d.clientX,y:d.clientY}),L.size===2&&!f)){const c=$();f={spread:c.spread,cx:c.cx,cy:c.cy,prevTouchAction:N.style.touchAction||""},N.style.touchAction="none"}},W=d=>{const c=L.get(d.pointerId);if(!c||(c.x=d.clientX,c.y=d.clientY,!f||L.size<2))return;const k=$(),Q=N.getBoundingClientRect(),J={x:k.cx-Q.left,y:k.cy-Q.top};let H=!1;for(;k.spread-f.spread>=R;)f.spread+=R,H=!0,typeof U.onStep=="function"&&U.onStep("in",J);for(;f.spread-k.spread>=R;)f.spread-=R,H=!0,typeof U.onStep=="function"&&U.onStep("out",J);const se=k.cx-f.cx,fe=k.cy-f.cy;f.cx=k.cx,f.cy=k.cy,!H&&(typeof U.onPan=="function"?U.onPan(se,fe):(N.scrollLeft-=se,N.scrollTop-=fe))},A=d=>{d.type==="pointercancel"?L.clear():L.delete(d.pointerId),L.size<2&&E()},q=d=>{(!d.touches||d.touches.length<2)&&(L.clear(),E())},S=d=>{(f&&d.type==="touchmove"||d.touches&&d.touches.length>=2)&&d.cancelable&&d.preventDefault()},i=N.ownerDocument||N;return N.addEventListener("pointerdown",F),i.addEventListener("pointermove",W),i.addEventListener("pointerup",A),i.addEventListener("pointercancel",A),i.addEventListener("touchend",q),i.addEventListener("touchcancel",q),N.addEventListener("touchstart",S,{passive:!1}),N.addEventListener("touchmove",S,{passive:!1}),()=>{E(),L.clear(),N.removeEventListener("pointerdown",F),i.removeEventListener("pointermove",W),i.removeEventListener("pointerup",A),i.removeEventListener("pointercancel",A),i.removeEventListener("touchend",q),i.removeEventListener("touchcancel",q),N.removeEventListener("touchstart",S),N.removeEventListener("touchmove",S)}}}),Re("packages/modules/scheduler/pinch.js",function(s,te){"use strict";Object.defineProperty(s,"attachSchedulerPinch",{enumerable:!0,get:function(){return ie}});const z=te("packages/modules/shared/pinch-gesture.js").attachPinchGesture,N=Object.freeze(["quarter","month","week","day","hour"]);function ie(U){return z(U.el,{enabled:()=>U.ctx.pinchZoom!==!1,minSpread:48,onPan(R,L){U.timeline&&(U.timeline.scrollLeft-=R,U.timeline.scrollTop-=L)},onStep(R,L){const f=U.timeline;if(!f||!U.span||!(U.pxPerDay>0))return;const $=N.indexOf(U.ctx.zoom.level),E=N[($<0?N.indexOf("day"):$)+(R==="in"?1:-1)];if(!E)return;const F=L.x-(f.getBoundingClientRect().left-U.el.getBoundingClientRect().left),W=U.span.startDay+(f.scrollLeft+F)/U.pxPerDay;U.setZoom(E),U.timeline.scrollLeft=Math.max(0,Math.round((W-U.span.startDay)*U.pxPerDay-F))}})}}),Re("packages/modules/scheduler/divider.js",function(s,te){"use strict";Object.defineProperty(s,"DEFAULT_RESOURCE_WIDTH",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"MIN_RESOURCE_WIDTH",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"MIN_TIMELINE_SHARE_PX",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"maxResourceWidth",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"clampResourceWidth",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"applyResourceWidth",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"insertDividers",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"wireDivider",{enumerable:!0,get:function(){return S}});const z=te("packages/modules/scheduler/styles.js").NS,ie=te("packages/modules/scheduler/messages.js").t,U=300,R=80,L=120,f=8,$=32;function E(i){const d=i.el&&Number.isFinite(i.el.clientWidth)?i.el.clientWidth:0;return d>0?Math.max(R,d-L):1/0}function F(i,d){return Math.round(Math.max(R,Math.min(E(i),d)))}function W(i,d){const c=F(i,d);return i.ctx.resourceWidth=c,i.el&&i.el.style&&i.el.style.setProperty("--lattice-scheduler-grid-width",`${c}px`),i.divider&&(i.divider.setAttribute("aria-valuenow",String(c)),i.divider.setAttribute("aria-valuemax",String(E(i)))),c}function A(i){if(!i.head||!i.body)return;const{doc:d}=i,c=d.createElement("div");c.className=`${z}__divider`,c.setAttribute("aria-hidden","true"),i.head.insertBefore(c,i.headView);const k=d.createElement("div");k.className=`${z}__divider ${z}__divider--resize`,k.setAttribute("tabindex","0"),k.setAttribute("role","separator"),k.setAttribute("aria-orientation","vertical"),k.setAttribute("aria-label",ie(i,"scheduler.divider")),k.setAttribute("aria-valuemin",String(R)),k.setAttribute("aria-valuemax",String(E(i))),k.setAttribute("aria-valuenow",String(i.ctx.resourceWidth)),i.body.insertBefore(k,i.timeline),i.divider=k,S(i)}function q(i,d,c){i.live&&(i.live.textContent=ie(i,d,c))}function S(i){const d=i.divider;if(!d||!i.doc)return;let c=null;const k=se=>{se&&se.button!=null&&se.button!==0||(c={startX:se&&se.clientX||0,startWidth:i.ctx.resourceWidth},se&&se.preventDefault&&se.preventDefault(),i.doc.addEventListener("pointermove",Q),i.doc.addEventListener("pointerup",J))},Q=se=>{if(!c)return;const fe=(se&&se.clientX||0)-c.startX;W(i,c.startWidth+fe)},J=se=>{const fe=c;if(c=null,i.doc.removeEventListener("pointermove",Q),i.doc.removeEventListener("pointerup",J),!fe)return;const ke=(se&&se.clientX||0)-fe.startX,ge=W(i,fe.startWidth+ke);q(i,"scheduler.divider.resize",{width:ge})},H=se=>{if(se.key!=="ArrowLeft"&&se.key!=="ArrowRight")return;se.preventDefault&&se.preventDefault();const fe=se.shiftKey?$:f,ke=se.key==="ArrowRight"?fe:-fe,ge=i.ctx.resourceWidth,ue=W(i,ge+ke);ue!==ge?q(i,"scheduler.divider.resize",{width:ue}):q(i,ke<0?"scheduler.divider.min":"scheduler.divider.max")};d.addEventListener("pointerdown",k),d.addEventListener("keydown",H),i._dividerOff=()=>{d.removeEventListener("pointerdown",k),d.removeEventListener("keydown",H),i.doc.removeEventListener("pointermove",Q),i.doc.removeEventListener("pointerup",J)}}}),Re("packages/modules/scheduler/view.js",function(s,te){"use strict";Object.defineProperty(s,"HEAD_H",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"GROUP_COL_ID",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"LOAD_H",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"t",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"FALLBACK_EN",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"computeDisplayRows",{enumerable:!0,get:function(){return be}}),Object.defineProperty(s,"refreshVisible",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(s,"layout",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(s,"xOf",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"render",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(s,"mountGrid",{enumerable:!0,get:function(){return M}}),Object.defineProperty(s,"syncGrid",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"toggleGroup",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(s,"renderHead",{enumerable:!0,get:function(){return t}}),Object.defineProperty(s,"renderTimeline",{enumerable:!0,get:function(){return I}});const z=te("packages/core/src/internal/predicates.js").isFunction,ie=te("packages/core/src/internal/text.js").escapeHtml,R=te("packages/modules/charts/svg.js").el,L=te("packages/modules/scheduler/styles.js"),f=L.NS,$=L.injectStyles,E=te("packages/modules/scheduler/model.js"),F=E.accessorFor,W=E.placeEvents,A=E.axisSpan,q=E.anchorDay,S=E.computeTicks,i=E.resourceNonWorking,d=E.laneCount,c=E.eventText,k=E.parseDate,Q=E.visibleEvents,J=E.visibleResources,H=E.buildDisplayRows,se=E.isEventReadOnly,fe=te("packages/modules/scheduler/workload.js"),ke=fe.computeWorkloadModel,ge=fe.bucketPeriodLabel,X=te("packages/modules/gantt/workload.js").formatPercent,ee=te("packages/modules/scheduler/gestures.js"),x=ee.attachEditing,K=ee.addHandles,u=te("packages/modules/scheduler/pinch.js").attachSchedulerPinch,j=te("packages/modules/scheduler/messages.js"),B=j.t,Z=j.FALLBACK_EN,v=te("packages/modules/gantt/time.js").toDayNumber,e=te("packages/modules/gantt/tooltip.js"),n=e.buildTooltipCard,o=e.positionTooltip,l=te("packages/modules/gantt/workload-groups.js").groupOfResource,_=te("packages/modules/scheduler/divider.js"),a=_.insertDividers,y=_.applyResourceWidth,w=32,P="__schedGroup",G=12;function re(r,C){return C==null||C===""?B(r,"scheduler.ungrouped"):String(C)}function Se(r,C,ce){const pe=C&&(C.name??C.label??C.title);return pe!=null&&pe!==""?String(pe):String(ce)}function be(r){const C=r.ctx;if(r.grid&&r.groupColId&&z(r.grid.rows.get)&&z(r.grid.rows.count)){const ce=new Map(r.resources.map(je=>[String(F(C.resourceKey)(je)),je])),pe=[],ne=r.grid.rows.count();for(let je=0;je<ne;je++){const Me=r.grid.rows.get(je);if(Me)if(Me.group)pe.push({type:"group",key:Me.key,value:Me.groupValue,label:re(r,Me.groupValue),expanded:!!Me.expanded});else{const Ie=ce.get(String(Me.key));Ie&&pe.push({type:"resource",resource:Ie})}}return pe}return H(C.visibleResources,C.groupBy,r.collapsedGroups,B(r,"scheduler.ungrouped"))}function Oe(r){r.ctx.visibleEvents=Q(r.ctx),r.ctx.visibleResources=J(r.ctx)}function Ae(r){const C=r.ctx;Oe(r),r.placement=W(C,C.visibleEvents);const ce=q(C);if(r.span=A(C,ce),C.fit){const pe=r.timeline?r.timeline.clientWidth:0,ne=r.span.endDay-r.span.startDay;pe>0&&ne>0&&(C.zoom.px=pe/ne)}r.ticks=S(C,r.span.startDay,r.span.endDay),r.pxPerDay=C.zoom.px,r.totalWidth=(r.span.endDay-r.span.startDay)*r.pxPerDay,r.displayRows||(r.displayRows=be(r)),r.totalHeight=r.displayRows.length*C.rowHeight,r.anchorDay=ce,r.workload=ke(C,r.span),t(r),I(r),Le(r)}function me(r,C){return(C-r.span.startDay)*r.pxPerDay}function Ee(r){const{el:C,doc:ce}=r;if(!C)return;for($(ce),C.classList.add(f),C.classList.add("lattice-tokens"),C.setAttribute("role","grid"),C.setAttribute("aria-label",r.ctx.ariaLabel||r.ctx.labels.scheduler||B(r,"scheduler.scheduler"));C.firstChild;)C.removeChild(C.firstChild);const pe=ce.createElement("div");pe.className=`${f}__head`;const ne=ce.createElement("div");ne.className=`${f}__head-corner`,ne.textContent=r.ctx.labels.resource||B(r,"scheduler.resource"),pe.appendChild(ne);const je=ce.createElement("div");je.className=`${f}__head-view`;const Me=ce.createElement("div");Me.className=`${f}__head-inner`,je.appendChild(Me),pe.appendChild(je),C.appendChild(pe),r.head=pe,r.headView=je,r.headInner=Me;const Ie=ce.createElement("div");Ie.className=`${f}__body`;const Ge=ce.createElement("div");Ge.className=`${f}__grid-space`,Ie.appendChild(Ge);const We=ce.createElement("div");We.className=`${f}__timeline`,We.setAttribute("tabindex","0"),We.setAttribute("aria-label",B(r,"scheduler.timeline"));const He=ce.createElement("div");He.className=`${f}__canvas`,We.appendChild(He),Ie.appendChild(We),C.appendChild(Ie),r.body=Ie;const Be=ce.createElement("div");Be.className=`${f}__grid`,C.appendChild(Be),r.gridHost=Be,r.timeline=We,r.canvas=He;const Qe=R(ce,"div",`${f}__tooltip`);Qe.setAttribute("hidden","");const tt=R(ce,"div",`${f}__tip-arrow`);Qe.appendChild(tt),C.appendChild(Qe),r.tip=Qe,r.tipArrow=tt;const Ye=ce.createElement("div");Ye.className=`${f}__live`,Ye.setAttribute("aria-live","polite"),Ye.setAttribute("role","status"),C.appendChild(Ye),r.live=Ye,y(r,r.ctx.resourceWidth),a(r),Oe(r),M(r),h(r),Ae(r),r.wired||(he(r),r.wired=!0)}function M(r){const{ctx:C}=r;if(r.grid=null,r.groupColId=null,!C.createGrid||!r.gridHost)return;const ce=C.resourceKey,pe=C.groupBy,ne=[...C.columns];let je=null,Me=!1;if(pe){if(typeof pe=="string"){const We=ne.find(He=>He&&(He.id===pe||He.field===pe));We&&(je=We.id)}je||(je=P,Me=!0,ne.push({id:P,field:P,title:B(r,"scheduler.group"),layout:{hidden:!0}}))}const Ie=C.visibleResources.map(We=>{const He={...We,__key:F(ce)(We)};return Me&&(He[P]=l(pe,We)??""),He}),Ge=We=>{const He=re(r,We.value);return`<span class="${f}__group-cell"><button type="button" class="${f}__group-toggle" data-lat-group-toggle aria-expanded="${We.expanded?"true":"false"}" aria-label="${ie(B(r,"scheduler.toggleGroup",{group:He}))}">${We.expanded?"−":"+"}</button><span class="${f}__group-label">${ie(He)}</span><span class="${f}__group-count">(${We.leafCount})</span></span>`};try{const We={columns:ne,rows:Ie,rowKey:"__key",edit:!1,selection:"none",contextMenu:!1,headerHeight:w,rowHeight:C.rowHeight};pe&&(We.groupRenderer=Ge),r.grid=C.createGrid(r.gridHost,We),je&&r.grid.columns&&z(r.grid.columns.group)&&r.grid.columns.group([je]),r.groupColId=je,r._gridKeys=new Set(Ie.map(He=>He.__key))}catch{r.grid=null,r.groupColId=null}Fe(r)}function h(r){const{ctx:C}=r;if(Oe(r),r.grid&&r.grid.rows&&z(r.grid.rows.apply)){const ce=C.resourceKey,pe=C.visibleResources.map(Ie=>{const Ge={...Ie,__key:F(ce)(Ie)};return r.groupColId===P&&(Ge[P]=l(C.groupBy,Ie)??""),Ge}),ne=r._gridKeys||new Set,je=new Set;for(const Ie of pe)je.add(Ie.__key);const Me=[];for(const Ie of ne)je.has(Ie)||Me.push(Ie);try{r.grid.rows.apply({add:pe,remove:Me})}catch{}r._gridKeys=je}r.displayRows=be(r)}function ae(r){r.displayRows=be(r),r.totalHeight=r.displayRows.length*r.ctx.rowHeight,I(r)}function ye(r,C){if(r.groupColId&&r.grid&&z(r.grid.rows.collapse)&&z(r.grid.rows.expand)){r.grid.rows[C.expanded?"collapse":"expand"](C.key);return}C.expanded?r.collapsedGroups.add(C.value):r.collapsedGroups.delete(C.value),ae(r)}function t(r){if(!r.headInner)return;const C=r.doc;for(;r.headInner.firstChild;)r.headInner.removeChild(r.headInner.firstChild);r.headInner.style.width=`${r.totalWidth}px`;for(const ce of r.ticks){const pe=C.createElement("div");pe.className=`${f}__tick`,pe.style.left=`${me(r,ce.day)}px`,pe.textContent=ce.label,r.headInner.appendChild(pe)}}function T(r,C){const ce=r.pxPerDay||1,pe=r.span.startDay+Math.floor(C/ce),ne=r.timeline?r.timeline.clientWidth:0,je=pe+Math.ceil(ne/ce)+1;return{first:pe,last:Math.min(je,r.span.endDay)}}function I(r){if(!r.canvas)return;const C=r.ctx,ce=r.doc,pe=r.timeline?r.timeline.scrollTop:0,ne=r.timeline?r.timeline.scrollLeft:0;for(r.canvas.style.width=`${r.totalWidth}px`,r.canvas.style.height=`${r.totalHeight}px`;r.canvas.firstChild;)r.canvas.removeChild(r.canvas.firstChild);const je=r.displayRows||[],Me=C.rowHeight,Ie=C.overscan,Ge=Math.max(0,Math.floor(pe/Me)-Ie),We=r.timeline?r.timeline.clientHeight:0,He=Math.min(je.length-1,Math.ceil((pe+We)/Me)+Ie),Be=T(r,ne),Qe=F(C.resourceKey),tt=r.workload,Ye=tt?tt.buckets:[];let Ze=0,rt=Ye.length-1;for(;Ze<Ye.length&&Ye[Ze].end<=Be.first;)Ze+=1;for(;rt>=0&&Ye[rt].start>=Be.last;)rt-=1;for(let qe=Ge;qe<=He;qe++){const we=je[qe];if(!we)continue;const Ce=qe*Me;if(we.type==="group"){const Ue=ce.createElement("div");Ue.className=`${f}__group`,Ue.setAttribute("data-group",String(we.value??"")),Ue.setAttribute("role","row"),Ue.setAttribute("aria-label",we.label),Ue.style.top=`${Ce}px`,Ue.style.height=`${Me}px`,Ue.style.width=`${r.totalWidth}px`;const Ve=ce.createElement("button");Ve.className=`${f}__group-toggle`,Ve.type="button",Ve.setAttribute("aria-label",B(r,"scheduler.toggleGroup",{group:we.label})),Ve.setAttribute("aria-expanded",we.expanded?"true":"false"),Ve.textContent=we.expanded?"−":"+",Ve.addEventListener("click",nt=>{nt.stopPropagation(),ye(r,we)}),Ue.appendChild(Ve),r.canvas.appendChild(Ue);continue}const Xe=we.resource,Je=Qe(Xe),mt=r.placement.byResource.get(Je)||[],it=tt&&tt.rows.get(String(Je))||null,bt=it?G:0,et=ce.createElement("div");et.className=`${f}__row`,et.setAttribute("data-resource",String(Je)),et.setAttribute("role","row"),et.setAttribute("aria-label",Se(r,Xe,Je)),et.style.top=`${Ce}px`,et.style.height=`${Me}px`,et.style.width=`${r.totalWidth}px`;const gt=C.nonWorking?i(C,Xe):null;if(gt)for(let Ue=Be.first;Ue<Be.last;Ue++){if(!gt(Ue))continue;const Ve=ce.createElement("div");Ve.className=`${f}__shade`,Ve.style.left=`${me(r,Ue)}px`,Ve.style.width=`${r.pxPerDay}px`,et.appendChild(Ve)}const kt=d(mt),pt=Math.max(4,(Me-bt-4)/kt);for(const Ue of mt){const Ve=Ue.startDay,nt=Ue.endDay;if(nt<Be.first||Ve>Be.last)continue;const Ke=ce.createElement("div");Ke.className=`${f}__bar`,Ke.setAttribute("data-key",String(Ue.key)),Ke.setAttribute("role","gridcell"),Ke.setAttribute("aria-label",c(C,Ue.row,Ue.key));const st=se(C,Ue.row),ot=r.focusKey!=null&&String(r.focusKey)===String(Ue.key);C.editable!==!1?(Ke.setAttribute("tabindex","0"),Ke.setAttribute("role","button"),st&&Ke.setAttribute("aria-readonly","true")):(Ke.setAttribute("tabindex",ot?"0":"-1"),ot&&Ke.setAttribute("data-focused","true"));const at=me(r,Ve),ct=Math.max(2,me(r,nt)-at);Ke.style.left=`${at}px`,Ke.style.width=`${ct}px`,Ke.style.top=`${2+Ue.lane*pt}px`,Ke.style.height=`${Math.max(2,pt-3)}px`,Ue.color&&(Ke.setAttribute("data-accent",""),Ke.style.setProperty("--lattice-scheduler-accent",Ue.color)),Ke.textContent=c(C,Ue.row,Ue.key),C.editable!==!1&&!st&&K(r,Ke),et.appendChild(Ke)}if(it){const Ue=ce.createElement("div");Ue.className=`${f}__load`;for(let Ve=Ze;Ve<=rt;Ve++){const nt=Ye[Ve],Ke=ce.createElement("div");Ke.className=`${f}__load-bucket`,Ke.style.left=`${me(r,nt.start)}px`,Ke.style.width=`${Math.max(1,me(r,nt.end)-me(r,nt.start))}px`;const st=it.cells[Ve],ot=it.available[Ve],at=ot!=null&&ot>0&&st!=null?st/ot*100:null,ct=ce.createElement("div");if(ct.className=`${f}__load-fill`,ct.style.height=`${at==null?0:Math.min(100,Math.round(at))}%`,Ke.appendChild(ct),it.over[Ve]===!0){Ke.classList.add(`${f}__load-bucket--over`);const ut=ce.createElement("span");ut.className=`${f}__load-icon`,ut.setAttribute("aria-hidden","true"),ut.textContent="⚠",Ke.appendChild(ut),Ke.setAttribute("aria-label",B(r,"scheduler.workload.overCell",{resource:Xe.name!=null?String(Xe.name):String(Je),period:ge(C,nt.start),percent:`${X(st,ot,tt.decimals)}%`}))}Ue.appendChild(Ke)}et.appendChild(Ue)}r.canvas.appendChild(et)}if(C.todayLine){const qe=v(new Date);if(qe>=Be.first&&qe<=Be.last){const we=ce.createElement("div");we.className=`${f}__today`,we.setAttribute("data-today","true"),we.style.left=`${me(r,qe)}px`,r.canvas.appendChild(we)}}}function m(r,C){const ce=r.canvas.querySelectorAll(`.${f}__bar`);for(const pe of ce)if(pe.dataset.key===String(C))return pe;return null}function b(r){const C=r.ctx,ce=F(C.resourceKey),pe=[];for(const ne of r.displayRows||[]){if(ne.type!=="resource")continue;const je=ce(ne.resource),Me=r.placement.byResource.get(je)||[];Me.length&&pe.push({resourceKey:je,events:Me})}return pe}function g(r,C){const ce=F(r.ctx.resourceKey),pe=r.displayRows||[];for(let ne=0;ne<pe.length;ne++){const je=pe[ne];if(je.type==="resource"&&String(ce(je.resource))===String(C))return ne}return-1}function D(r,C){r.focusKey=String(C.key);const ce=g(r,C.resourceKey);if(ce>=0&&r.timeline){const ne=r.ctx.rowHeight,je=ce*ne,Me=r.timeline.clientHeight;(je<r.timeline.scrollTop||je+ne>r.timeline.scrollTop+Me)&&(r.timeline.scrollTop=Math.max(0,je-Me/2+ne/2),I(r));const Ie=me(r,C.startDay),Ge=me(r,C.endDay),We=r.timeline.clientWidth;(Ge>r.timeline.scrollLeft+We||Ie<r.timeline.scrollLeft)&&(r.timeline.scrollLeft=Math.max(0,Ie-We/2),I(r))}const pe=m(r,C.key);if(pe){for(const ne of r.canvas.querySelectorAll(`.${f}__bar`))ne.setAttribute("tabindex","-1"),ne.removeAttribute("data-focused");pe.setAttribute("tabindex","0"),pe.setAttribute("data-focused","true"),pe.focus()}}function V(r,C){const ce=b(r);if(!ce.length)return;const pe=r.focusKey==null?null:String(r.focusKey);let ne=-1,je=-1;if(pe!=null)for(let He=0;He<ce.length;He++){const Be=ce[He].events.findIndex(Qe=>String(Qe.key)===pe);if(Be>=0){ne=He,je=Be;break}}if(ne<0){D(r,ce[0].events[0]);return}if(C==="left"||C==="right"){const He=ce[ne].events,Be=C==="right"?je+1:je-1;D(r,He[Be>=0&&Be<He.length?Be:C==="right"?0:He.length-1]);return}const Me=ce[ne+(C==="down"?1:-1)];if(!Me)return;const Ie=ce[ne].events[je].startDay;let Ge=null,We=1/0;for(const He of Me.events){const Be=Math.abs(He.startDay-Ie);Be<We&&(We=Be,Ge=He)}Ge&&D(r,Ge)}function O(r,C){r.live&&(r.live.textContent=C)}function oe(r,C){O(r,B(r,"scheduler.eventActivated",{name:c(r.ctx,C.row,C.key)}));const ce=m(r,C.key);ce&&Ne(r,C,ce)}function de(r,C){if(C==null||C==="")return"";const ce=k(C);if(!ce)return String(C);const ne={year:"numeric",month:"short",day:"numeric",...typeof C=="string"&&/(\d{1,2}:\d{2})/.test(C)?{hour:"2-digit",minute:"2-digit"}:{},...r.timeZone?{timeZone:r.timeZone}:{}};try{return new Intl.DateTimeFormat(r.locale,ne).format(ce)}catch{return String(C)}}function De(r){const C=r*24;return Math.abs(C-Math.round(C))<.05?String(Math.round(C)):C.toFixed(1).replace(/\.0$/,"")}function ve(r,C){const ce=r.ctx,pe=[],ne=de(ce,F(ce.fields.startDate)(C.row)),je=de(ce,F(ce.fields.endDate)(C.row));ne&&pe.push({label:B(r,"scheduler.tip.start"),value:ne}),je&&pe.push({label:B(r,"scheduler.tip.end"),value:je}),pe.push({label:B(r,"scheduler.tip.duration"),value:B(r,"scheduler.tip.durationValue",{hours:De(C.endDay-C.startDay)})});const Me=r.rows.get(C.resourceKey);return Me&&pe.push({label:B(r,"scheduler.tip.resource"),value:Se(r,Me,C.resourceKey)}),pe}function Pe(r,C,ce){return[c(r.ctx,C.row,C.key),...ce.map(pe=>B(r,"scheduler.tip.row",{label:pe.label,value:pe.value}))].join(", ")}function Ne(r,C,ce){if(!r.tip)return;const pe=ve(r,C),ne=n(r.doc,f,{name:c(r.ctx,C.row,C.key)},pe);for(const je of[...r.tip.children])je!==r.tipArrow&&r.tip.removeChild(je);r.tip.appendChild(ne),r.tip.removeAttribute("hidden"),ce.setAttribute("aria-description",Pe(r,C,pe)),ze(r,ce)}function _e(r){if(r.tip){r.tip.setAttribute("hidden","");for(const C of[...r.tip.children])C!==r.tipArrow&&r.tip.removeChild(C)}}function ze(r,C){if(!r.tip||!C||typeof C.getBoundingClientRect!="function")return;const ce=C.getBoundingClientRect(),pe=r.el.getBoundingClientRect(),ne=r.doc.defaultView||globalThis,je=Number.isFinite(ne.innerWidth)?ne.innerWidth:1/0,Me=Number.isFinite(ne.innerHeight)?ne.innerHeight:1/0,Ie={left:Math.max(0,pe.left),top:Math.max(0,pe.top),right:Math.min(je,pe.right),bottom:Math.min(Me,pe.bottom)};o(r.tip,r.tipArrow,ce,Ie,pe)}function Le(r){if(!r.live)return;const C=r.workload;if(!C||!C.overAllocated.length){r.live.textContent="";return}const ce=C.overAllocated.map(pe=>B(r,"scheduler.workload.overItem",{resource:pe.name,periods:pe.periods.join(", ")})).join("; ");r.live.textContent=B(r,"scheduler.workload.overSummary",{list:ce})}function Fe(r){if(r._gridOff){try{r._gridOff()}catch{}r._gridOff=null}if(r._gridGroupOff){try{r._gridGroupOff()}catch{}r._gridGroupOff=null}const C=r.grid;if(!C||!z(C.on))return;const ce=()=>{if(r._syncing)return;r._syncing=!0;const ne=Te(r),je=ne?ne.scrollTop:0;r.timeline.scrollTop!==je&&(r.timeline.scrollTop=je),r._syncing=!1,I(r)};C.on("scroll",ce),r._gridOff=()=>{z(C.off)&&C.off("scroll",ce)};const pe=()=>ae(r);C.on("group:toggled",pe),r._gridGroupOff=()=>{z(C.off)&&C.off("group:toggled",pe)}}function he(r){const C=[];r._listeners=C;const ce=(ne,je)=>{r.el.addEventListener(ne,je),C.push({type:ne,fn:je})},pe=()=>{if(r._syncing)return;r._syncing=!0,r.headView&&r.headView.scrollLeft!==r.timeline.scrollLeft&&(r.headView.scrollLeft=r.timeline.scrollLeft);const ne=Te(r);ne&&ne.scrollTop!==r.timeline.scrollTop&&(ne.scrollTop=r.timeline.scrollTop),r._syncing=!1,I(r)};r.timeline.addEventListener("scroll",pe),r._timelineScroll={target:r.timeline,type:"scroll",fn:pe},ce("wheel",ne=>{if(ne.ctrlKey||ne.metaKey){ne.preventDefault&&ne.preventDefault();const je=ne.deltaY<0?1.25:.8;r.setZoom(xe(r,r.pxPerDay*je),"control")}}),ce("pointerover",ne=>{const je=ne.target&&ne.target.closest?ne.target.closest(`.${f}__bar`):null;if(je){const Me=r.placement.keys.get(je.dataset.key);Me&&Ne(r,Me,je)}}),ce("pointerout",ne=>{ne.target&&ne.target.closest&&ne.target.closest(`.${f}__bar`)&&_e(r)}),ce("focusin",ne=>{const je=ne.target&&ne.target.closest?ne.target.closest(`.${f}__bar`):null;if(je){const Me=r.placement.keys.get(je.dataset.key);Me&&Ne(r,Me,je)}}),ce("focusout",ne=>{ne.target&&ne.target.closest&&ne.target.closest(`.${f}__bar`)&&_e(r)}),ce("keydown",ne=>{const je=r.doc.activeElement&&r.doc.activeElement.closest?r.doc.activeElement.closest(`.${f}__bar`):null;if(je&&r.ctx.editable===!1){const Me=r.placement.keys.get(je.dataset.key);if(ne.key==="ArrowLeft"||ne.key==="ArrowRight"||ne.key==="ArrowUp"||ne.key==="ArrowDown")ne.preventDefault&&ne.preventDefault(),V(r,ne.key==="ArrowLeft"?"left":ne.key==="ArrowRight"?"right":ne.key==="ArrowUp"?"up":"down");else if(ne.key==="Enter"||ne.key===" ")ne.preventDefault&&ne.preventDefault(),Me&&oe(r,Me);else if(ne.key==="Home"||ne.key==="End"){ne.preventDefault&&ne.preventDefault();const Ie=b(r);for(const Ge of Ie)if(Ge.resourceKey===Me.resourceKey){D(r,Ge.events[ne.key==="Home"?0:Ge.events.length-1]);break}}return}ne.target&&ne.target.closest&&ne.target.closest(`.${f}__bar`)||(ne.key==="+"||ne.key==="="?(ne.preventDefault&&ne.preventDefault(),r.setZoom(xe(r,r.pxPerDay*1.25),"control")):ne.key==="-"?(ne.preventDefault&&ne.preventDefault(),r.setZoom(xe(r,r.pxPerDay*.8),"control")):ne.key==="ArrowLeft"||ne.key==="ArrowRight"?(ne.preventDefault&&ne.preventDefault(),r.timeline.scrollLeft+=ne.key==="ArrowRight"?80:-80,I(r)):(ne.key==="ArrowUp"||ne.key==="ArrowDown")&&(ne.preventDefault&&ne.preventDefault(),r.timeline.scrollTop+=ne.key==="ArrowDown"?80:-80,I(r)))}),x(r),r._pinchOff&&r._pinchOff(),r._pinchOff=u(r)}function Te(r){return r.gridHost?r.gridHost.querySelector(".lat-body-viewport"):null}function xe(r,C){return Math.min(624,Math.max(1.8,C))}}),Re("packages/modules/charts/scale.js",function(s,te){"use strict";Object.defineProperty(s,"isNumber",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"toNumber",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"toTime",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"extent",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"niceStep",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"niceDomain",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"measureDomain",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"linearTicks",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"timeStepFor",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"MONTH_STEPS",{enumerable:!0,get:function(){return H}}),Object.defineProperty(s,"timeTicks",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"linearScale",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"timeScale",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"key",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"bandScale",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"sqrtScale",{enumerable:!0,get:function(){return ee}});const $e=[1,2,2.5,5,10],z=6e4,N=36e5,ie=864e5,U=365.25*ie,R=[1,2,5,10,20,25,50,100],L=[1,5,10,25,50,100,250,500,1e3,5e3,15e3,3e4,z,5*z,15*z,30*z,N,3*N,6*N,12*N,ie,2*ie,7*ie,14*ie,30*ie,90*ie,180*ie,...R.map(x=>x*U)];function f(x){return typeof x=="number"&&Number.isFinite(x)}function $(x){if(x==null||x==="")return null;if(x instanceof Date){const Y=x.getTime();return Number.isFinite(Y)?Y:null}if(typeof x=="boolean")return x?1:0;const K=Number(x);return Number.isFinite(K)?K:null}function E(x){if(x==null||x==="")return null;if(x instanceof Date){const Y=x.getTime();return Number.isFinite(Y)?Y:null}if(typeof x=="number")return Number.isFinite(x)?x:null;const K=Date.parse(String(x));return Number.isFinite(K)?K:null}function F(x){let K=1/0,Y=-1/0;for(let u=0;u<x.length;u++){const j=x[u];f(j)&&(j<K&&(K=j),j>Y&&(Y=j))}return K===1/0?null:{min:K,max:Y}}function W(x){if(!(x>0))return 1;const K=10**Math.floor(Math.log10(x));for(const Y of $e)if(x<=Y*K)return Y*K;return 10*K}function A(x,K=5){const Y=W((x.max-x.min)/Math.max(1,K));return{min:Math.floor(x.min/Y)*Y,max:Math.ceil(x.max/Y)*Y,step:Y}}function q(x,K={}){const Y=F(x)||{min:0,max:1};let{min:u,max:j}=Y;if(K.zero&&(u>0&&(u=0),j<0&&(j=0)),u===j){const B=Math.abs(u)>0?Math.abs(u)/10:1;u-=B,j+=B}if(K.nice!==!1){const B=A({min:u,max:j},K.ticks||5);u=B.min,j=B.max}return f(K.min)&&(u=K.min),f(K.max)&&(j=K.max),u===j&&(j=u+1),{min:u,max:j}}function S(x,K=5){const Y=W((x.max-x.min)/Math.max(1,K)),u=Math.ceil(x.min/Y),j=Math.floor(x.max/Y),B=[];for(let Z=u;Z<=j;Z++){const le=Z*Y;B.push(Math.abs(le)<Y/1e6?0:Number(le.toPrecision(12)))}return B}function i(x,K=5){const Y=Math.max(1,K),u=x/Y;let j=L[L.length-1];for(const le of L)if(le>=u){j=le;break}if(j<U)return j;let B=j,Z=Math.abs(x/j-Y);for(const le of L){if(le<U)continue;const v=Math.abs(x/le-Y);v<Z&&(Z=v,B=le)}return B}const d=new Map;function c(x){let K=d.get(x);return K||(K=new Intl.DateTimeFormat("en-US",{timeZone:x,year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),d.set(x,K)),K}function k(x,K){const Y={year:0,month:0,day:1,hour:0,minute:0,second:0};for(const u of c(K).formatToParts(new Date(x)))switch(u.type){case"year":Y.year=Number(u.value);break;case"month":Y.month=Number(u.value)-1;break;case"day":Y.day=Number(u.value);break;case"hour":Y.hour=Number(u.value)%24;break;case"minute":Y.minute=Number(u.value);break;case"second":Y.second=Number(u.value);break;default:break}return Y}function Q(x,K,Y){const u=Date.UTC(x,K,1);let j=u;for(let B=0;B<2;B++){const Z=k(j,Y),le=Date.UTC(Z.year,Z.month,Z.day,Z.hour,Z.minute,Z.second),v=u-le;if(v===0)break;j+=v}return j}function J(x,K,Y){const u=Y?k(x.min,Y).year:new Date(x.min).getUTCFullYear();let j=Math.ceil(u/K)*K;const B=le=>Y?Q(le,0,Y):Date.UTC(le,0,1);B(j)<x.min&&(j+=K);const Z=[];for(;B(j)<=x.max;j+=K)Z.push(B(j));return Z}const H=new Map([[30*ie,1],[90*ie,3],[180*ie,6]]);function se(x,K,Y){const u=Y?k(x.min,Y):{year:new Date(x.min).getUTCFullYear(),month:new Date(x.min).getUTCMonth()};let j=u.year*12+u.month;const B=le=>{const v=Math.floor(le/12),e=le-v*12;return Y?Q(v,e,Y):Date.UTC(v,e,1)};B(j)<x.min&&(j+=1),j=Math.ceil(j/K)*K;const Z=[];for(;;j+=K){const le=B(j);if(le>x.max)break;Z.push(le)}return Z}function fe(x,K=5,Y){const u=i(x.max-x.min,K);if(u>=U)return J(x,Math.round(u/U),Y);const j=H.get(u);if(j)return se(x,j,Y);const B=[],Z=Math.ceil(x.min/u)*u;for(let le=Z;le<=x.max;le+=u)B.push(le);return B}function ke(x,K){const Y=x.max-x.min||1,[u,j]=K;return{kind:"linear",domain:x,range:K,of(B){return u+(B-x.min)/Y*(j-u)},invert(B){return x.min+(B-u)/(j-u||1)*Y},ticks(B=5){return S(x,B)}}}function ge(x,K){return{...ke(x,K),kind:"time",ticks(u=5,j){return fe(x,u,j)}}}function ue(x){if(x==null)return" null";if(x instanceof Date)return` date:${x.getTime()}`;if(typeof x=="object"){const K=x,Y=K.id??K.key??K.value;return Y!==void 0&&typeof Y!="object"?` obj:${String(Y)}`:` obj:${String(x)}`}return String(x)}function X(x,K,Y=.2){const u=Math.min(.9,Math.max(0,Y)),[j,B]=K,Z=new Map;for(let e=0;e<x.length;e++){const n=ue(x[e]);Z.has(n)||Z.set(n,e)}const le=x.length?(B-j)/x.length:B-j,v=Math.max(0,le*(1-u));return{kind:"band",domain:x,range:K,bandwidth:v,step:le,of(e){const n=Z.get(ue(e));return n===void 0?NaN:j+n*le+(le-v)/2},centre(e){const n=this.of(e);return Number.isNaN(n)?NaN:n+v/2},ticks(){return x}}}function ee(x,K){const[Y,u]=K,j=Math.max(Math.abs(x.max),Math.abs(x.min),0)||1;return{kind:"sqrt",domain:x,range:K,of(B){const Z=Math.sqrt(Math.abs(B)/j);return Y+Z*(u-Y)}}}}),Re("packages/modules/gantt/export.js",function(s,te){"use strict";Object.defineProperty(s,"PRINT_NS",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"PAPERS",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"PAGE_MARGIN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"resolveVar",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"resolvePalette",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"resolveFontFamily",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"resolveFontSizes",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"PALETTE",{enumerable:!0,get:function(){return d}}),Object.defineProperty(s,"esc",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"paperPx",{enumerable:!0,get:function(){return k}}),Object.defineProperty(s,"resolveRange",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(s,"cellText",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"barMarkup",{enumerable:!0,get:function(){return H}}),Object.defineProperty(s,"timeHeadMarkup",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"bandRowsMarkup",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"bandGridMarkup",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"dataBandMarkup",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"buildSplitSVG",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"inlineSvgStyles",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"rasterizePNG",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"buildPrintDocument",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"openPrintWindow",{enumerable:!0,get:function(){return v}});const z=te("packages/modules/charts/scale.js").linearScale,N=te("packages/modules/gantt/time.js"),ie=N.toISODate,U=N.toDayNumber,R="lat-gantt-print",L=Object.freeze({A4:{w:794,h:1123},Letter:{w:816,h:1056},A3:{w:1123,h:1587}}),f=36,$=26,E=20,F=24,W=28;function A(e,n,o){if(!e||!n||typeof e.getComputedStyle!="function")return"";const p=e.getComputedStyle(n);return!p||typeof p.getPropertyValue!="function"?"":String(p.getPropertyValue(o)||"").trim()}function q(e,n){const o=l=>A(e,n,l),p=l=>o(`--lattice-gantt-${l}`)||o(`--lattice-gantt-d-${l}`);return{text:o("--lattice-foreground"),muted:o("--lattice-foreground-muted"),border:o("--lattice-border-color"),surface:o("--lattice-surface"),bar:p("bar"),critical:p("critical"),summary:p("summary"),milestone:p("milestone"),progress:p("progress"),today:p("today"),workload:o("--lattice-scheduler-workload"),histogram:o("--lattice-scheduler-workload"),over:o("--lattice-scheduler-overalloc"),pageBg:o("--lattice-background")}}function S(e,n){return A(e,n,"--lattice-font-family")}function i(e,n){return{sm:A(e,n,"--lattice-font-size-sm"),body:A(e,n,"--lattice-font-size")}}const d=Object.freeze({text:"#1f2933",muted:"#57606a",border:"#d0d7de",surface:"#f1f3f5",bar:"#4a90d9",critical:"#e2513b",summary:"#2c3e50",milestone:"#33404d",progress:"rgba(0,0,0,0.28)",today:"#e2513b",workload:"#4a90d9",histogram:"#2c7a7b",over:"#e2513b",pageBg:"#ffffff"});function c(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function k(e,n){const o=L[e]||L.A4;return n==="portrait"?{w:o.w,h:o.h}:{w:o.h,h:o.w}}function Q(e,n){const o=n&&n.from!=null?U(n.from):e.domainMin,p=n&&n.to!=null?U(n.to):e.domainMax;return Number.isFinite(o)&&Number.isFinite(p)&&p>o?{from:o,to:p}:{from:e.domainMin,to:e.domainMax}}function J(e,n,o){if(n.unscheduled&&(e.kind==="start"||e.kind==="end"||e.kind==="duration"))return"";switch(e.kind){case"name":return n.name??"";case"start":return ie(n.es)??String(n.es);case"end":return ie(n.ef)??String(n.ef);case"duration":return String(Math.round(n.ef-n.es));case"assignee":{const p=o?o.assignee??o.assignees??o.owner:null;return(Array.isArray(p)?p:p==null?[]:[p]).map(String).filter(Boolean).join(", ")}case"progress":return n.percentComplete==null?"":`${Math.round(n.percentComplete)}%`;default:return o&&e.key?String(o[e.key]??""):""}}function H(e,n,o,p,l){if(!Number.isFinite(e.es)||!Number.isFinite(e.ef))return"";const _=Math.max(2,Math.round(p*.18)),a=o+_,y=Math.max(2,p-_*2);if(e.milestone){const be=n(e.es),Oe=o+p/2,Ae=Math.max(4,Math.min(9,p*.3)),me=e.critical?l.critical:l.milestone;return`<path d="M ${be} ${Oe-Ae} L ${be+Ae} ${Oe} L ${be} ${Oe+Ae} L ${be-Ae} ${Oe} Z" fill="${me}"/>`}const w=n(e.es),P=n(e.ef),G=Math.max(1,P-w),re=e.isSummary?l.summary:e.critical?l.critical:l.bar;let Se=`<rect x="${w}" y="${a}" width="${G}" height="${y}" rx="3" fill="${re}"/>`;if(!e.isSummary&&e.percentComplete!=null&&e.percentComplete>0){const be=Math.max(0,Math.min(100,e.percentComplete)),Oe=Math.round(G*be/100);Se+=`<rect x="${w}" y="${a}" width="${Oe}" height="${y}" fill="${l.progress}"/>`}return Se}function se(e,n,o,p,l,_,a=d,y="11"){const w=_==="month"||_==="quarter"?30:7;let P=`<rect x="0" y="0" width="${p}" height="${l}" fill="${a.surface}"/>`,G=Math.floor(e/w)*w;for(;G<n;G+=w){const re=o(G);P+=`<line x1="${re}" y1="0" x2="${re}" y2="${l}" stroke="${a.border}"/>`,P+=`<text x="${re+4}" y="${Math.round(l*.68)}" font-size="${y}" font-weight="600" fill="${a.muted}">${c(ie(G)??String(G))}</text>`}return P+=`<line x1="0" y1="${l}" x2="${p}" y2="${l}" stroke="${a.border}"/>`,P}function fe(e,n,o,p,l,_,a,y,w){const P=Math.max(1,...e.flatMap(re=>(re.cells||[]).filter(Se=>Se!=null)));let G="";return(n.cells||[]).forEach((re,Se)=>{if(re==null)return;const be=y[Se];if(!be)return;const Oe=p+o(be.start),Ae=Math.max(1,o(be.end)-o(be.start)-2),me=Math.max(1,Math.round(re/P*(l-8))),Ee=_+l-4-me,M=n.over&&n.over[Se];G+=`<rect x="${Oe}" y="${Ee}" width="${Ae}" height="${me}" fill="${M?w:a}"/>`}),G}function ke(e,n,o,p,l,_,a,y){if(!e||!e.rows||!e.rows.length)return"";let w="";return e.rows.forEach((P,G)=>{const re=l+G*p;w+=`<text x="4" y="${re+p/2+4}" font-size="${y}" fill="${a.text}">${c(P.label)}</text>`,w+=`<line x1="0" y1="${re+p}" x2="${o}" y2="${re+p}" stroke="${a.border}"/>`,w+=fe(e.rows,P,n,o,p,re,_,e.buckets,a.over)}),w}function ge(e,n,o,p,l,_,a){const y=e&&e.grid;if(!y||!y.rows||!y.rows.length)return"";const w=y.columns,P=y.columnWidths,G=P.reduce((be,Oe)=>be+Oe,0);let re="",Se=0;for(let be=0;be<w.length;be++)re+=`<text x="${Se+6}" y="${p+Math.round(o*.65)}" font-size="${a}" font-weight="600" fill="${_.muted}">${c(w[be].title||w[be].id)}</text>`,Se+=P[be];return re+=`<line x1="0" y1="${p+o}" x2="${G}" y2="${p+o}" stroke="${_.border}"/>`,y.rows.forEach((be,Oe)=>{const Ae=p+o+Oe*o;let me=0;for(let Ee=0;Ee<w.length;Ee++){const M=Ee===0&&be.taskId!=null?14:6;re+=`<text x="${me+M}" y="${Ae+o/2+4}" font-size="${a}" fill="${_.text}">${c(be.texts?be.texts[Ee]:"")}</text>`,me+=P[Ee]}re+=`<line x1="0" y1="${Ae+o}" x2="${G}" y2="${Ae+o}" stroke="${_.border}"/>`,re+=fe(y.rows,be,n,G,o,Ae,l,e.buckets,_.over)}),re}function ue(e,n,o,p,l,_,a){const y=e.rowHeight;let w=`<text x="6" y="${p+Math.round(y*.65)}" font-size="${a}" font-weight="600" fill="${_.muted}">${c(e.title)}</text>`;if(w+=`<line x1="0" y1="${p+y}" x2="${o+l}" y2="${p+y}" stroke="${_.border}"/>`,e.collapsed)return w;const P=e.totalsColumn?o-6:null;return e.rows.forEach((G,re)=>{const Se=p+y+re*y,be=Se+y/2+4,Oe=G.isTotal||G.isSummary?600:400;w+=`<text x="${6+(G.depth||0)*14}" y="${be}" font-size="${a}" font-weight="${Oe}" fill="${_.text}">${c(G.label)}</text>`,P!=null&&G.totalText&&(w+=`<text x="${P}" y="${be}" font-size="${a}" font-weight="${Oe}" text-anchor="end" fill="${_.text}">${c(G.totalText)}</text>`),(G.texts||[]).forEach((Ae,me)=>{const Ee=e.buckets[me];if(!Ee||!Ae)return;const M=n(Ee.end);M<=0||n(Ee.start)>=l||(w+=`<text x="${o+Math.min(l,M)-4}" y="${be}" font-size="${a}" font-weight="${Oe}" text-anchor="end" fill="${_.text}">${c(Ae)}</text>`)}),w+=`<line x1="0" y1="${Se+y}" x2="${o+l}" y2="${Se+y}" stroke="${_.border}"/>`}),w}function X(e,n={}){const o=q(n.view,n.el),p=S(n.view,n.el),l=i(n.view,n.el),_=Q(e,n.range),a=Math.max(1,Math.round(e.pxPerDay*(_.to-_.from))),y=z({min:_.from,max:_.to},[0,a]),w=h=>Math.round(y.of(h)),P=e.columnWidths.reduce((h,ae)=>h+ae,0),G=P+a,re=Math.max(F,W),Se=re;let be=0;e.workload&&(be+=e.workload.cfg.height),e.histogram&&(be+=e.histogram.cfg.height);const Oe=Array.isArray(e.dataBands)?e.dataBands:[];for(const h of Oe)be+=h.collapsed?h.rowHeight:(h.rows.length+1)*h.rowHeight;const Ae=Se+e.totalHeight+be;let me="",Ee=0;for(let h=0;h<e.columns.length;h++){const ae=e.columnWidths[h];me+=`<text x="${Ee+6}" y="${Math.round(re*.65)}" font-size="${l.sm}" font-weight="600" fill="${o.muted}">${c(e.columns[h].title||e.columns[h].id||e.columns[h].key)}</text>`,Ee+=ae}if(me+=`<line x1="0" y1="${re}" x2="${P}" y2="${re}" stroke="${o.border}"/>`,me+=`<g transform="translate(${P},0)">${se(_.from,_.to,w,a,re,e.zoomLevel,o,l.sm)}</g>`,e.rows.forEach((h,ae)=>{const ye=Se+h.top;let t=0;for(let T=0;T<e.columns.length;T++){const I=e.columns[T],m=e.columnWidths[T],b=e.cellTexts?e.cellTexts[ae][T]:J(I,h.rec,e.rawById.get(String(h.id))),g=I.kind==="name"?h.depth*14+6:6;me+=`<text x="${t+g}" y="${ye+h.height/2+4}" font-size="${l.body}" font-weight="${h.rec.isSummary?600:400}" fill="${h.rec.isSummary?o.summary:o.text}">${c(b)}</text>`,t+=m}me+=`<line x1="0" y1="${ye+h.height}" x2="${G}" y2="${ye+h.height}" stroke="${o.border}"/>`,me+=`<g transform="translate(${P},${ye})">${H(h.rec,w,0,h.height,o)}</g>`}),e.today!=null&&e.today>=_.from&&e.today<=_.to){const h=P+w(e.today);me+=`<line x1="${h}" y1="0" x2="${h}" y2="${Se+e.totalHeight}" stroke="${o.today}" stroke-width="1.5" stroke-dasharray="4 3"/>`}let M=Se+e.totalHeight;for(const[h,ae]of[[e.workload,o.workload],[e.histogram,o.histogram]])if(h){if(me+=`<rect x="0" y="${M}" width="${G}" height="${h.cfg.height}" fill="${o.pageBg}"/>`,h.data&&h.data.grid)me+=ge(h.data,w,h.cfg.rowHeight,M,ae,o,l.sm);else{const ye=Math.max(40,P);me+=`<g transform="translate(${ye},0)">${ke(h.data,w,0,h.cfg.rowHeight,M,ae,o,l.sm)}</g>`}me+=`<line x1="0" y1="${M}" x2="${G}" y2="${M}" stroke="${o.border}" stroke-width="2"/>`,M+=h.cfg.height}for(const h of Oe){const ae=h.collapsed?h.rowHeight:(h.rows.length+1)*h.rowHeight;me+=`<g data-band="${c(h.id)}">${ue(h,w,P,M,a,o,l.sm)}</g>`,me+=`<line x1="0" y1="${M}" x2="${G}" y2="${M}" stroke="${o.border}" stroke-width="2"/>`,M+=ae}return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${Ae}" viewBox="0 0 ${G} ${Ae}" font-family="${p}"><rect x="0" y="0" width="${G}" height="${Ae}" fill="${o.pageBg}"/>${me}</svg>`}function ee(e,n,o){const p=["fill","fill-opacity","stroke","stroke-width","stroke-opacity","stroke-dasharray","stroke-linejoin","stroke-linecap","font-size","font-family","font-weight","opacity","text-anchor","dominant-baseline","visibility"],l=[e,...e.querySelectorAll("*")],_=[n,...n.querySelectorAll("*")];for(let a=0;a<l.length&&a<_.length;a++){const y=o.getComputedStyle(l[a]),w=[];for(const P of p){const G=y.getPropertyValue(P);G&&w.push(`${P}:${G}`)}w.length&&_[a].setAttribute("style",w.join(";"))}}async function x(e,n,o,p,l,_){const a=e&&e.defaultView||globalThis;if(!a.Image||!e.createElement)return null;const y=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,w=new a.Image;await new Promise((re,Se)=>{w.onload=re,w.onerror=()=>Se(new Error("the plan could not be rasterised")),w.src=y});const P=e.createElement("canvas");P.width=Math.max(1,Math.round(o*l)),P.height=Math.max(1,Math.round(p*l));const G=P.getContext("2d");return _&&(G.fillStyle=_,G.fillRect(0,0,P.width,P.height)),G.drawImage(w,0,0,P.width,P.height),new Promise(re=>P.toBlob(re,"image/png"))}function K(e,n){const o=[];let p=[],l=0;for(const _ of e){const a=Math.max(1,_.height);p.length&&l+a>n&&(o.push(p),p=[],l=0),p.push(_),l+=a}return(p.length||!o.length)&&o.push(p),o}function Y(e,n,o,p){return`
|
|
227
|
+
`.trim()}function R(L){const f=L&&L.documentElement;if(!f||f.getAttribute(ie))return;f.setAttribute(ie,"1");const $=L.createElement("style");$.textContent=U(),(L.head||L.body||f).appendChild($)}}),Re("packages/core/src/internal/text.js",function(s,te){"use strict";Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return ie}});function $e(U){return U?(U.includes(".")?U.slice(U.lastIndexOf(".")+1):U).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(/^./,L=>L.toUpperCase()):""}const z={"&":"&","<":"<",">":">",'"':""","'":"'"};function N(U){const R=U==null?"":String(U);return/[&<>"']/.test(R)?R.replace(/[&<>"']/g,L=>z[L]):R}function ie(U){return String(U).replace(/\w\S*/g,R=>R[0].toUpperCase()+R.slice(1).toLowerCase())}}),Re("packages/modules/scheduler/workload.js",function(s,te){"use strict";Object.defineProperty(s,"bucketPeriodLabel",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"computeWorkloadModel",{enumerable:!0,get:function(){return S}});const $e=te("packages/modules/gantt/workload.js"),z=$e.computeWorkload,N=$e.workloadBuckets,ie=te("packages/modules/gantt/resources.js"),U=ie.normalizeCapacities,R=ie.normalizeResources,L=ie.resourceDisplayNames,f=te("packages/modules/scheduler/model.js"),$=f.accessorFor,E=f.eventSpan,F=f.eventText,W=864e5;function P(i){return typeof i=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(i.trim())}function q(i,d){const c=i.locale||void 0,k=i.timeZone||"UTC";return new Intl.DateTimeFormat(c,{month:"short",day:"numeric",timeZone:k}).format(new Date(Math.round(d)*W))}function S(i,d){const c=i.workload;if(!c||!d)return null;const k=i.zoom.level==="hour"?"day":i.zoom.level,Q=N(k,d.startDay,d.endDay,i.weekStartDay),J=$(i.resourceKey),H=$(i.fields.resourceId),se=$(i.eventKey),fe=$(i.fields.calendar),ke=[];for(const Z of i.resources){const le=J(Z);le==null||le===""||ke.push({...Z,id:String(le),calendar:fe(Z)})}const ge=U(ke,c.defaultCapacity),ue=R(ke,c.defaultCapacity,{calendar:null,calendars:i.calendars,hoursPerDay:c.hoursPerDay}),X=new Map;for(const[Z,le]of ue)le&&le.hasCalendar&&typeof le.worksOn=="function"&&X.set(Z,{isWorking:v=>le.worksOn(v)});const ee=[],A=[],K=new Map;for(const Z of i.events){const le=E(i,Z);if(!le.start)continue;const v=H(Z);if(v==null||v==="")continue;const e=String(v),n=se(Z),o=n==null?`event:${i.events.indexOf(Z)}`:String(n),p=F(i,Z,n),l=$(i.fields.startDate)(Z),_=$(i.fields.endDate)(Z),y=P(l)&&P(_)?null:(le.end.day+le.end.frac-le.start.day-le.start.frac)*24;ee.push({id:o,name:p,assignee:e,hours:y}),A.push(o),K.set(o,{es:le.start.day+le.start.frac,ef:le.end.day+le.end.frac,isSummary:!1,unscheduled:!1,inactive:!1,name:p,calendar:X.has(e)?e:null})}const Y=z(ee,{ok:!0,order:A,tasks:K,calendars:X},{buckets:Q,hoursPerDay:c.hoursPerDay,isWorking:null,capacities:ge,resourceModels:ue}),u=new Map;for(const Z of Y.rows)Z.resource!=null&&u.set(Z.resource,Z);for(const[Z,le]of ue){if(u.has(Z))continue;const v=ge.has(Z)?ge.get(Z):null,e=Y.buckets.map(o=>{if(le.hasCalendar){let p=0;for(let l=Math.floor(o.start);l<Math.ceil(o.end);l+=1)p+=le.capacityHoursOn(l);return p}return v==null?null:v*c.hoursPerDay*o.workingDays});let n=null;for(const o of e)o!=null&&(n=(n??0)+o);u.set(Z,{resource:Z,capacity:v,available:e,availableTotal:n,cells:Y.buckets.map(()=>null),over:Y.buckets.map(()=>!1),total:0})}const j=L(ke),B=[];for(const Z of Y.rows){if(Z.resource==null)continue;const le=[];Z.over.forEach((v,e)=>{v&&le.push(e)}),le.length&&B.push({resource:Z.resource,name:j.get(Z.resource)||Z.resource,count:le.length,periods:le.map(v=>q(i,Y.buckets[v].start))})}return{buckets:Y.buckets,rows:u,overAllocated:B,hoursPerDay:c.hoursPerDay,decimals:c.decimals}}}),Re("packages/modules/scheduler/messages.js",function(s,te){"use strict";Object.defineProperty(s,"FALLBACK_EN",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"t",{enumerable:!0,get:function(){return U}});const z=te("packages/core/src/internal/predicates.js").isFunction,N=Object.freeze({"scheduler.scheduler":"Scheduler","scheduler.resource":"Resource","scheduler.event":{one:"event",other:"events"},"scheduler.print.page":"Page {page} of {pages}","scheduler.print.printed":"Printed {date}","scheduler.readOnlyEvent":"The event is read-only.","scheduler.readOnlyResource":"The resource is read-only.","scheduler.delete":"Delete","scheduler.ungrouped":"Ungrouped","scheduler.group":"Group","scheduler.timeline":"Time axis","scheduler.divider":"Resource pane divider","scheduler.divider.resize":"Resource pane {width} pixels wide","scheduler.divider.min":"Resource pane at its minimum width","scheduler.divider.max":"Resource pane at its maximum width","scheduler.toggleGroup":"Toggle {group}","scheduler.eventActivated":"{name}","scheduler.tip.start":"Start","scheduler.tip.end":"End","scheduler.tip.duration":"Duration","scheduler.tip.durationValue":"{hours} h","scheduler.tip.resource":"Resource","scheduler.tip.row":"{label}: {value}","scheduler.workload.overSummary":"Over-allocated: {list}","scheduler.workload.overItem":"{resource} ({periods})","scheduler.workload.overCell":"{resource}, {period}: {percent} — over-allocated"});function ie(R,L){const f=N[R];if(!f)return R;const $=L&&typeof L.count=="number"?L.count:NaN;return(typeof f=="string"?f:($===1?f.one:f.other)||f.other).replace(/\{(\w+)\}/g,(F,W)=>L&&W in L?String(L[W]):F)}function U(R,L,f){const $=R&&R.config?R.config:{},E=$.messages&&z($.messages.t)?$.messages:null;if(E){let F;try{F=E.t(L,f)}catch{F=null}if(typeof F=="string"&&F&&F!==L)return F}return ie(L,f)}}),Re("packages/modules/shared/drag-gesture.js",function(s,te){"use strict";Object.defineProperty(s,"attachDragGesture",{enumerable:!0,get:function(){return U}});const $e=300,z=3,N=24,ie=12;function U(R,L={}){const f=L.holdMs==null?$e:L.holdMs,$=typeof L.canStart=="function"?L.canStart:null,E=typeof L.onStart=="function"?L.onStart:null,F=typeof L.onMove=="function"?L.onMove:null,W=typeof L.onEnd=="function"?L.onEnd:null,P=typeof L.onCancel=="function"?L.onCancel:null,q=typeof L.autoScroll=="function"?L.autoScroll:null,S=Array.isArray(L.autoScroll)?L.autoScroll:[],i=R&&R.ownerDocument?R.ownerDocument:R;if(!R||!i||typeof R.addEventListener!="function")return()=>{};let d=null;function c(u,j,B,Z,le){if(B>=u&&B<u+N&&Z>0){const v=N-(B-u);return-Math.max(1,Math.round(ie*v/N))}if(B>j-N&&B<=j&&Z<le){const v=N-(j-B);return Math.max(1,Math.round(ie*v/N))}return 0}function k(){const u=d;if(u){if(d=null,u.holdTimer&&clearTimeout(u.holdTimer),Y(u),u.started&&u.pressed&&u.pressed.style&&(u.pressed.style.touchAction=u.prevTouchAction),u.pressed&&typeof u.pressed.releasePointerCapture=="function"&&u.pointerId!==void 0)try{u.pressed.releasePointerCapture(u.pointerId)}catch{}i.removeEventListener("pointermove",fe),i.removeEventListener("pointerup",ge),i.removeEventListener("pointercancel",ue),i.removeEventListener("keydown",X),i.removeEventListener("pointerdown",ee),i.removeEventListener("touchmove",ke)}}function Q(u){if(!u.started){if(u.started=!0,u.pressed&&u.pressed.style&&(u.prevTouchAction=u.pressed.style.touchAction||"",u.pressed.style.touchAction="none"),u.pressed&&typeof u.pressed.setPointerCapture=="function"&&u.pointerId!==void 0)try{u.pressed.setPointerCapture(u.pointerId)}catch{}E&&E(u.drag,u.downEvent),K(u)}}function J(u,j){const B=u.started;k(),B&&W&&W(u.drag,j)}function H(u,j){const B=u.started;k(),B&&P&&P(u.drag,j)}function se(){const u=d;u&&!u.started&&Q(u)}function fe(u){const j=d;if(!j||u.pointerId!==void 0&&u.pointerId!==j.pointerId)return;const B=typeof u.clientX=="number"?u.clientX:j.lastX,Z=typeof u.clientY=="number"?u.clientY:j.lastY;if(j.lastX=B,j.lastY=Z,j.lastEvent=u,!j.started){if(Math.hypot(B-j.startX,Z-j.startY)<=z)return;if(j.pointerType==="mouse")Q(j);else{k();return}}F&&F(j.drag,u)}function ke(u){d&&d.started&&typeof u.preventDefault=="function"&&u.preventDefault()}function ge(u){const j=d;j&&(u.pointerId!==void 0&&u.pointerId!==j.pointerId||J(j,u))}function ue(u){const j=d;j&&(u.pointerId!==void 0&&u.pointerId!==j.pointerId||H(j,u))}function X(u){d&&u.key==="Escape"&&H(d,u)}function ee(u){const j=d;j&&u.pointerId!==void 0&&u.pointerId!==j.pointerId&&H(j,u)}function A(u){if(u.button!=null&&u.button!==0||d)return;const j=$?$(u):u.target||null;if(!j)return;const B=typeof u.clientX=="number"?u.clientX:0,Z=typeof u.clientY=="number"?u.clientY:0,le=u.pointerId,v=u.pointerType||"mouse";d={drag:{el:j,pointerId:le,pointerType:v,startX:B,startY:Z,lastX:B,lastY:Z},pressed:j,pointerId:le,pointerType:v,startX:B,startY:Z,lastX:B,lastY:Z,started:!1,downEvent:u,lastEvent:u,holdTimer:null,prevTouchAction:"",frameId:null},v!=="mouse"&&(d.holdTimer=setTimeout(se,f)),i.addEventListener("pointermove",fe),i.addEventListener("pointerup",ge),i.addEventListener("pointercancel",ue),i.addEventListener("keydown",X),i.addEventListener("pointerdown",ee),v==="touch"&&i.addEventListener("touchmove",ke,{passive:!1})}function K(u){if(typeof requestAnimationFrame!="function"||!q&&!S.length)return;function j(){const B=d;if(!B||B!==u||!B.started){u.frameId=null;return}const Z=q?q():S;let le=!1;if(Array.isArray(Z))for(const v of Z){if(!v||typeof v.getBoundingClientRect!="function")continue;const e=v.getBoundingClientRect(),n=c(e.left,e.right,B.lastX,v.scrollLeft,v.scrollWidth-v.clientWidth),o=c(e.top,e.bottom,B.lastY,v.scrollTop,v.scrollHeight-v.clientHeight);n&&(v.scrollLeft+=n,le=!0),o&&(v.scrollTop+=o,le=!0)}le&&F&&B.lastEvent&&F(B.drag,B.lastEvent),u.frameId=requestAnimationFrame(j)}u.frameId=requestAnimationFrame(j)}function Y(u){u.frameId!=null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(u.frameId),u.frameId=null}return R.addEventListener("pointerdown",A),()=>{k(),R.removeEventListener("pointerdown",A)}}}),Re("packages/modules/scheduler/gestures.js",function(s,te){"use strict";Object.defineProperty(s,"attachEditing",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"addHandles",{enumerable:!0,get:function(){return W}});const z=te("packages/modules/scheduler/styles.js").NS,ie=te("packages/modules/scheduler/messages.js").t,R=te("packages/modules/shared/drag-gesture.js").attachDragGesture,L=te("packages/modules/scheduler/model.js"),f=L.isEventReadOnly,$=L.isResourceReadOnly,E=L.accessorFor;function F(P){const q=P.ctx,S=P.doc;if(!P.canvas||!S)return;let i=null,d=null;const c=()=>P.pxPerDay||1,k=v=>{const e=P.canvas.getBoundingClientRect(),n=Math.floor((v-e.top)/q.rowHeight),o=P.resources[n];return o?E(q.resourceKey)(o):null},Q=v=>{const e=P.canvas.getBoundingClientRect();return P.span.startDay+(v-e.left)/c()},J=v=>{const e=v&&v.closest?v:null;if(!e)return null;const n=e.closest(`.${z}__handle`),o=n?n.closest(`.${z}__bar`):e.closest(`.${z}__bar`);return o?{key:o.getAttribute("data-key"),bar:o,edge:n?n.getAttribute("data-edge"):null}:null},H=v=>{const e=P.canvas.querySelectorAll(`.${z}__bar`);for(const n of e)if(n.dataset.key===String(v))return n;return null},se=v=>{P.live&&(P.live.textContent=v)},fe=v=>{se(ie(P,v==="event"?"scheduler.readOnlyEvent":"scheduler.readOnlyResource"))},ke=v=>{const e=P.events.get(v);if(!e||!q.editable)return!1;if(f(q,e))return fe("event"),!1;const n=E(q.fields.resourceId)(e),o=n==null?null:P.rows.get(n);return $(q,o)?(fe("resource"),!1):!0},ge=(v,e,n)=>{if(!ke(v.key))return;const o=P.placement.keys.get(v.key);o&&(i={mode:v.edge?"resize":"move",key:v.key,edge:v.edge,startX:e,startY:n,startDay:o.startDay,endDay:o.endDay,resourceKey:o.resourceKey,bar:v.bar,ghost:null,pointerStartDay:Q(e)})},ue=(v,e)=>{if(!q.editable)return;const n=k(e);if(n==null)return;const o=P.rows.get(n);if($(q,o)){fe("resource");return}i={mode:"create",key:null,edge:null,startX:v,startY:e,startDay:Q(v),endDay:Q(v),resourceKey:n,bar:null,ghost:null}},X=(v,e)=>Q(e)-v.pointerStartDay,ee=(v,e)=>{if(!i)return;const n=i;if(n.mode==="move"){const o=H(n.key);if(!o)return;o.style.left=`${(n.startDay+X(n,v)-P.span.startDay)*c()}px`}else if(n.mode==="resize"){const o=H(n.key);if(!o)return;const p=X(n,v);if(n.edge==="start"){const l=(n.startDay-P.span.startDay+p)*c();o.style.left=`${l}px`,o.style.width=`${Math.max(2,(n.endDay-n.startDay-p)*c())}px`}else o.style.width=`${Math.max(2,(n.endDay-n.startDay+p)*c())}px`}else if(n.mode==="create"){n.endDay=Q(v),n.ghost||(n.ghost=P.doc.createElement("div"),n.ghost.className=`${z}__bar ${z}__bar--ghost`,(P.canvas.querySelector(`.${z}__row[data-resource="${CSS.escape(String(n.resourceKey))}"]`)||P.canvas).appendChild(n.ghost));const o=Math.min(n.startDay,n.endDay),p=Math.max(n.startDay,n.endDay);n.ghost.style.left=`${(o-P.span.startDay)*c()}px`,n.ghost.style.width=`${Math.max(2,(p-o)*c())}px`}},A=(v,e)=>{if(!i)return;const n=i;if(i=null,n.ghost&&n.ghost.parentNode&&n.ghost.parentNode.removeChild(n.ghost),n.mode==="move"){const o=k(e);o!=null&&String(o)!==String(n.resourceKey)?P.edit.reassign(n.key,o,{origin:"user"}):P.edit.move(n.key,X(n,v),{origin:"user"})}else if(n.mode==="resize"){const o=(n.edge==="start"?n.startDay:n.endDay)+X(n,v);P.edit.resize(n.key,n.edge,o,{origin:"user"})}else n.mode==="create"&&P.edit.create(n.resourceKey,n.startDay,n.endDay,{origin:"user"})},K=()=>{if(!i)return;const v=i;if(i=null,v.ghost&&v.ghost.parentNode&&v.ghost.parentNode.removeChild(v.ghost),v.mode==="move"||v.mode==="resize"){const e=H(v.key);e&&(e.style.left=`${(v.startDay-P.span.startDay)*c()}px`,e.style.width=`${Math.max(2,(v.endDay-v.startDay)*c())}px`)}},Y=R(P.canvas,{canStart:v=>{const e=v.target;if(!e||!e.closest)return null;const n=e,o=n.closest(`.${z}__handle`),p=o?o.closest(`.${z}__bar`):n.closest(`.${z}__bar`);return p?o||p:null},onStart:v=>{const e=J(v.el);e&&ge(e,v.startX,v.startY)},onMove:(v,e)=>{i&&ee(e.clientX,e.clientY)},onEnd:(v,e)=>{i&&A(e.clientX,e.clientY)},onCancel:()=>K(),autoScroll:[P.timeline]}),u=v=>{if(v.button!=null&&v.button!==0||J(v.target)||!(v.target&&v.target.closest?v.target.closest(`.${z}__row`):null)||(ue(v.clientX,v.clientY),!i))return;const n=p=>ee(p.clientX,p.clientY),o=p=>{A(p.clientX,p.clientY),S.removeEventListener("pointermove",n),S.removeEventListener("pointerup",o)};S.addEventListener("pointermove",n),S.addEventListener("pointerup",o)},j=v=>{const e=J(v.target);if(v.key==="z"&&(v.ctrlKey||v.metaKey)){if(!P.edit)return;v.preventDefault&&v.preventDefault(),v.shiftKey?P.edit.redo({origin:"user"}):P.edit.undo({origin:"user"});return}if(!e)return;const n=q.zoom.step;if(v.key==="Delete"||v.key==="Backspace"){if(!ke(e.key))return;v.preventDefault&&v.preventDefault(),P.edit.remove(e.key,{origin:"user",event:v})}else if(v.key==="ArrowLeft"||v.key==="ArrowRight"){if(!ke(e.key))return;v.preventDefault&&v.preventDefault();const o=v.key==="ArrowRight"?1:-1;if(v.shiftKey){const p=P.placement.keys.get(e.key);p&&P.edit.resize(e.key,"end",p.endDay+o*n,{origin:"user",event:v})}else P.edit.move(e.key,o*n,{origin:"user",event:v})}else if(v.key==="ArrowUp"||v.key==="ArrowDown"){if(!ke(e.key))return;v.preventDefault&&v.preventDefault();const o=P.placement.keys.get(e.key);if(!o)return;const p=P.resources.findIndex(_=>String(E(q.resourceKey)(_))===String(o.resourceKey)),l=P.resources[p+(v.key==="ArrowDown"?1:-1)];if(l){const _=E(q.resourceKey)(l);if($(q,l)){fe("resource");return}P.edit.reassign(e.key,_,{origin:"user",event:v})}}},B=v=>{const e=J(v.target);if(!e||(v.preventDefault&&v.preventDefault(),!ke(e.key)))return;Z(),d=e.key;const n=P.doc.createElement("div");n.className=`${z}__menu`,n.setAttribute("role","menu");const o=P.doc.createElement("button");o.className=`${z}__menu-item`,o.setAttribute("role","menuitem"),o.textContent=ie(P,"scheduler.delete"),o.addEventListener("click",()=>{d!=null&&P.edit.remove(d,{origin:"user"}),Z()}),n.appendChild(o),n.style.left=`${v.clientX}px`,n.style.top=`${v.clientY}px`,n.style.position="fixed",P.el.appendChild(n),n.__menu=!0;const p=l=>{if(!n.contains(l.target)){if(l.key==="Escape"){Z();return}Z()}};S.addEventListener("pointerdown",p,!0),S.addEventListener("keydown",p,!0),n.__cleanup=()=>{S.removeEventListener("pointerdown",p,!0),S.removeEventListener("keydown",p,!0)},o.focus()},Z=()=>{const v=P.el?P.el.querySelector(`.${z}__menu`):null;v&&(v.__cleanup&&v.__cleanup(),v.parentNode&&v.parentNode.removeChild(v)),d=null};P.canvas.addEventListener("pointerdown",u),P.canvas.addEventListener("keydown",j),P.canvas.addEventListener("contextmenu",B);const le=()=>{Z(),Y(),P.canvas.removeEventListener("pointerdown",u),P.canvas.removeEventListener("keydown",j),P.canvas.removeEventListener("contextmenu",B)};P._editDetach=le}function W(P,q){if(P.ctx.editable===!1)return;const S=P.doc;for(const i of["start","end"]){const d=S.createElement("div");d.className=`${z}__handle ${z}__handle--${i}`,d.setAttribute("data-edge",i),d.setAttribute("aria-hidden","true"),q.appendChild(d)}}}),Re("packages/modules/shared/pinch-gesture.js",function(s,te){"use strict";Object.defineProperty(s,"attachPinchGesture",{enumerable:!0,get:function(){return z}});const $e=48;function z(N,ie){const U=ie||{},R=Number.isFinite(U.minSpread)&&U.minSpread>0?U.minSpread:$e;if(!N||typeof N.addEventListener!="function")return()=>{};const L=new Map;let f=null;const $=()=>{const[d,c]=[...L.values()];return{spread:Math.hypot(d.x-c.x,d.y-c.y),cx:(d.x+c.x)/2,cy:(d.y+c.y)/2}},E=()=>{f&&(N.style.touchAction=f.prevTouchAction,f=null)},F=d=>{if(d.pointerType==="touch"&&!(typeof U.enabled=="function"&&!U.enabled())&&((L.has(d.pointerId)||L.size>=2)&&(L.clear(),E()),L.set(d.pointerId,{x:d.clientX,y:d.clientY}),L.size===2&&!f)){const c=$();f={spread:c.spread,cx:c.cx,cy:c.cy,prevTouchAction:N.style.touchAction||""},N.style.touchAction="none"}},W=d=>{const c=L.get(d.pointerId);if(!c||(c.x=d.clientX,c.y=d.clientY,!f||L.size<2))return;const k=$(),Q=N.getBoundingClientRect(),J={x:k.cx-Q.left,y:k.cy-Q.top};let H=!1;for(;k.spread-f.spread>=R;)f.spread+=R,H=!0,typeof U.onStep=="function"&&U.onStep("in",J);for(;f.spread-k.spread>=R;)f.spread-=R,H=!0,typeof U.onStep=="function"&&U.onStep("out",J);const se=k.cx-f.cx,fe=k.cy-f.cy;f.cx=k.cx,f.cy=k.cy,!H&&(typeof U.onPan=="function"?U.onPan(se,fe):(N.scrollLeft-=se,N.scrollTop-=fe))},P=d=>{d.type==="pointercancel"?L.clear():L.delete(d.pointerId),L.size<2&&E()},q=d=>{(!d.touches||d.touches.length<2)&&(L.clear(),E())},S=d=>{(f&&d.type==="touchmove"||d.touches&&d.touches.length>=2)&&d.cancelable&&d.preventDefault()},i=N.ownerDocument||N;return N.addEventListener("pointerdown",F),i.addEventListener("pointermove",W),i.addEventListener("pointerup",P),i.addEventListener("pointercancel",P),i.addEventListener("touchend",q),i.addEventListener("touchcancel",q),N.addEventListener("touchstart",S,{passive:!1}),N.addEventListener("touchmove",S,{passive:!1}),()=>{E(),L.clear(),N.removeEventListener("pointerdown",F),i.removeEventListener("pointermove",W),i.removeEventListener("pointerup",P),i.removeEventListener("pointercancel",P),i.removeEventListener("touchend",q),i.removeEventListener("touchcancel",q),N.removeEventListener("touchstart",S),N.removeEventListener("touchmove",S)}}}),Re("packages/modules/scheduler/pinch.js",function(s,te){"use strict";Object.defineProperty(s,"attachSchedulerPinch",{enumerable:!0,get:function(){return ie}});const z=te("packages/modules/shared/pinch-gesture.js").attachPinchGesture,N=Object.freeze(["quarter","month","week","day","hour"]);function ie(U){return z(U.el,{enabled:()=>U.ctx.pinchZoom!==!1,minSpread:48,onPan(R,L){U.timeline&&(U.timeline.scrollLeft-=R,U.timeline.scrollTop-=L)},onStep(R,L){const f=U.timeline;if(!f||!U.span||!(U.pxPerDay>0))return;const $=N.indexOf(U.ctx.zoom.level),E=N[($<0?N.indexOf("day"):$)+(R==="in"?1:-1)];if(!E)return;const F=L.x-(f.getBoundingClientRect().left-U.el.getBoundingClientRect().left),W=U.span.startDay+(f.scrollLeft+F)/U.pxPerDay;U.setZoom(E),U.timeline.scrollLeft=Math.max(0,Math.round((W-U.span.startDay)*U.pxPerDay-F))}})}}),Re("packages/modules/scheduler/divider.js",function(s,te){"use strict";Object.defineProperty(s,"DEFAULT_RESOURCE_WIDTH",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"MIN_RESOURCE_WIDTH",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"MIN_TIMELINE_SHARE_PX",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"maxResourceWidth",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"clampResourceWidth",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"applyResourceWidth",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"insertDividers",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"wireDivider",{enumerable:!0,get:function(){return S}});const z=te("packages/modules/scheduler/styles.js").NS,ie=te("packages/modules/scheduler/messages.js").t,U=300,R=80,L=120,f=8,$=32;function E(i){const d=i.el&&Number.isFinite(i.el.clientWidth)?i.el.clientWidth:0;return d>0?Math.max(R,d-L):1/0}function F(i,d){return Math.round(Math.max(R,Math.min(E(i),d)))}function W(i,d){const c=F(i,d);return i.ctx.resourceWidth=c,i.el&&i.el.style&&i.el.style.setProperty("--lattice-scheduler-grid-width",`${c}px`),i.divider&&(i.divider.setAttribute("aria-valuenow",String(c)),i.divider.setAttribute("aria-valuemax",String(E(i)))),c}function P(i){if(!i.head||!i.body)return;const{doc:d}=i,c=d.createElement("div");c.className=`${z}__divider`,c.setAttribute("aria-hidden","true"),i.head.insertBefore(c,i.headView);const k=d.createElement("div");k.className=`${z}__divider ${z}__divider--resize`,k.setAttribute("tabindex","0"),k.setAttribute("role","separator"),k.setAttribute("aria-orientation","vertical"),k.setAttribute("aria-label",ie(i,"scheduler.divider")),k.setAttribute("aria-valuemin",String(R)),k.setAttribute("aria-valuemax",String(E(i))),k.setAttribute("aria-valuenow",String(i.ctx.resourceWidth)),i.body.insertBefore(k,i.timeline),i.divider=k,S(i)}function q(i,d,c){i.live&&(i.live.textContent=ie(i,d,c))}function S(i){const d=i.divider;if(!d||!i.doc)return;let c=null;const k=se=>{se&&se.button!=null&&se.button!==0||(c={startX:se&&se.clientX||0,startWidth:i.ctx.resourceWidth},se&&se.preventDefault&&se.preventDefault(),i.doc.addEventListener("pointermove",Q),i.doc.addEventListener("pointerup",J))},Q=se=>{if(!c)return;const fe=(se&&se.clientX||0)-c.startX;W(i,c.startWidth+fe)},J=se=>{const fe=c;if(c=null,i.doc.removeEventListener("pointermove",Q),i.doc.removeEventListener("pointerup",J),!fe)return;const ke=(se&&se.clientX||0)-fe.startX,ge=W(i,fe.startWidth+ke);q(i,"scheduler.divider.resize",{width:ge})},H=se=>{if(se.key!=="ArrowLeft"&&se.key!=="ArrowRight")return;se.preventDefault&&se.preventDefault();const fe=se.shiftKey?$:f,ke=se.key==="ArrowRight"?fe:-fe,ge=i.ctx.resourceWidth,ue=W(i,ge+ke);ue!==ge?q(i,"scheduler.divider.resize",{width:ue}):q(i,ke<0?"scheduler.divider.min":"scheduler.divider.max")};d.addEventListener("pointerdown",k),d.addEventListener("keydown",H),i._dividerOff=()=>{d.removeEventListener("pointerdown",k),d.removeEventListener("keydown",H),i.doc.removeEventListener("pointermove",Q),i.doc.removeEventListener("pointerup",J)}}}),Re("packages/modules/scheduler/view.js",function(s,te){"use strict";Object.defineProperty(s,"HEAD_H",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"GROUP_COL_ID",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"LOAD_H",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"t",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"FALLBACK_EN",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"computeDisplayRows",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"refreshVisible",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(s,"layout",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(s,"xOf",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"render",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(s,"mountGrid",{enumerable:!0,get:function(){return M}}),Object.defineProperty(s,"syncGrid",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"toggleGroup",{enumerable:!0,get:function(){return be}}),Object.defineProperty(s,"renderHead",{enumerable:!0,get:function(){return t}}),Object.defineProperty(s,"renderTimeline",{enumerable:!0,get:function(){return I}});const z=te("packages/core/src/internal/predicates.js").isFunction,ie=te("packages/core/src/internal/text.js").escapeHtml,R=te("packages/modules/charts/svg.js").el,L=te("packages/modules/scheduler/styles.js"),f=L.NS,$=L.injectStyles,E=te("packages/modules/scheduler/model.js"),F=E.accessorFor,W=E.placeEvents,P=E.axisSpan,q=E.anchorDay,S=E.computeTicks,i=E.resourceNonWorking,d=E.laneCount,c=E.eventText,k=E.parseDate,Q=E.visibleEvents,J=E.visibleResources,H=E.buildDisplayRows,se=E.isEventReadOnly,fe=te("packages/modules/scheduler/workload.js"),ke=fe.computeWorkloadModel,ge=fe.bucketPeriodLabel,X=te("packages/modules/gantt/workload.js").formatPercent,ee=te("packages/modules/scheduler/gestures.js"),A=ee.attachEditing,K=ee.addHandles,u=te("packages/modules/scheduler/pinch.js").attachSchedulerPinch,j=te("packages/modules/scheduler/messages.js"),B=j.t,Z=j.FALLBACK_EN,v=te("packages/modules/gantt/time.js").toDayNumber,e=te("packages/modules/gantt/tooltip.js"),n=e.buildTooltipCard,o=e.positionTooltip,l=te("packages/modules/gantt/workload-groups.js").groupOfResource,_=te("packages/modules/scheduler/divider.js"),a=_.insertDividers,y=_.applyResourceWidth,w=32,x="__schedGroup",G=12;function ne(r,C){return C==null||C===""?B(r,"scheduler.ungrouped"):String(C)}function ve(r,C,ce){const ye=C&&(C.name??C.label??C.title);return ye!=null&&ye!==""?String(ye):String(ce)}function pe(r){const C=r.ctx;if(r.grid&&r.groupColId&&z(r.grid.rows.get)&&z(r.grid.rows.count)){const ce=new Map(r.resources.map(je=>[String(F(C.resourceKey)(je)),je])),ye=[],re=r.grid.rows.count();for(let je=0;je<re;je++){const Me=r.grid.rows.get(je);if(Me)if(Me.group)ye.push({type:"group",key:Me.key,value:Me.groupValue,label:ne(r,Me.groupValue),expanded:!!Me.expanded});else{const Ie=ce.get(String(Me.key));Ie&&ye.push({type:"resource",resource:Ie})}}return ye}return H(C.visibleResources,C.groupBy,r.collapsedGroups,B(r,"scheduler.ungrouped"))}function Oe(r){r.ctx.visibleEvents=Q(r.ctx),r.ctx.visibleResources=J(r.ctx)}function Ae(r){const C=r.ctx;Oe(r),r.placement=W(C,C.visibleEvents);const ce=q(C);if(r.span=P(C,ce),C.fit){const ye=r.timeline?r.timeline.clientWidth:0,re=r.span.endDay-r.span.startDay;ye>0&&re>0&&(C.zoom.px=ye/re)}r.ticks=S(C,r.span.startDay,r.span.endDay),r.pxPerDay=C.zoom.px,r.totalWidth=(r.span.endDay-r.span.startDay)*r.pxPerDay,r.displayRows||(r.displayRows=pe(r)),r.totalHeight=r.displayRows.length*C.rowHeight,r.anchorDay=ce,r.workload=ke(C,r.span),t(r),I(r),Le(r)}function me(r,C){return(C-r.span.startDay)*r.pxPerDay}function Ee(r){const{el:C,doc:ce}=r;if(!C)return;for($(ce),C.classList.add(f),C.classList.add("lattice-tokens"),C.setAttribute("role","grid"),C.setAttribute("aria-label",r.ctx.ariaLabel||r.ctx.labels.scheduler||B(r,"scheduler.scheduler"));C.firstChild;)C.removeChild(C.firstChild);const ye=ce.createElement("div");ye.className=`${f}__head`;const re=ce.createElement("div");re.className=`${f}__head-corner`,re.textContent=r.ctx.labels.resource||B(r,"scheduler.resource"),ye.appendChild(re);const je=ce.createElement("div");je.className=`${f}__head-view`;const Me=ce.createElement("div");Me.className=`${f}__head-inner`,je.appendChild(Me),ye.appendChild(je),C.appendChild(ye),r.head=ye,r.headView=je,r.headInner=Me;const Ie=ce.createElement("div");Ie.className=`${f}__body`;const Ge=ce.createElement("div");Ge.className=`${f}__grid-space`,Ie.appendChild(Ge);const We=ce.createElement("div");We.className=`${f}__timeline`,We.setAttribute("tabindex","0"),We.setAttribute("aria-label",B(r,"scheduler.timeline"));const He=ce.createElement("div");He.className=`${f}__canvas`,We.appendChild(He),Ie.appendChild(We),C.appendChild(Ie),r.body=Ie;const Be=ce.createElement("div");Be.className=`${f}__grid`,C.appendChild(Be),r.gridHost=Be,r.timeline=We,r.canvas=He;const Qe=R(ce,"div",`${f}__tooltip`);Qe.setAttribute("hidden","");const tt=R(ce,"div",`${f}__tip-arrow`);Qe.appendChild(tt),C.appendChild(Qe),r.tip=Qe,r.tipArrow=tt;const Ye=ce.createElement("div");Ye.className=`${f}__live`,Ye.setAttribute("aria-live","polite"),Ye.setAttribute("role","status"),C.appendChild(Ye),r.live=Ye,y(r,r.ctx.resourceWidth),a(r),Oe(r),M(r),h(r),Ae(r),r.wired||(he(r),r.wired=!0)}function M(r){const{ctx:C}=r;if(r.grid=null,r.groupColId=null,!C.createGrid||!r.gridHost)return;const ce=C.resourceKey,ye=C.groupBy,re=[...C.columns];let je=null,Me=!1;if(ye){if(typeof ye=="string"){const We=re.find(He=>He&&(He.id===ye||He.field===ye));We&&(je=We.id)}je||(je=x,Me=!0,re.push({id:x,field:x,title:B(r,"scheduler.group"),layout:{hidden:!0}}))}const Ie=C.visibleResources.map(We=>{const He={...We,__key:F(ce)(We)};return Me&&(He[x]=l(ye,We)??""),He}),Ge=We=>{const He=ne(r,We.value);return`<span class="${f}__group-cell"><button type="button" class="${f}__group-toggle" data-lat-group-toggle aria-expanded="${We.expanded?"true":"false"}" aria-label="${ie(B(r,"scheduler.toggleGroup",{group:He}))}">${We.expanded?"−":"+"}</button><span class="${f}__group-label">${ie(He)}</span><span class="${f}__group-count">(${We.leafCount})</span></span>`};try{const We={columns:re,rows:Ie,rowKey:"__key",edit:!1,selection:"none",contextMenu:!1,headerHeight:w,rowHeight:C.rowHeight};ye&&(We.groupRenderer=Ge),r.grid=C.createGrid(r.gridHost,We),je&&r.grid.columns&&z(r.grid.columns.group)&&r.grid.columns.group([je]),r.groupColId=je,r._gridKeys=new Set(Ie.map(He=>He.__key))}catch{r.grid=null,r.groupColId=null}Fe(r)}function h(r){const{ctx:C}=r;if(Oe(r),r.grid&&r.grid.rows&&z(r.grid.rows.apply)){const ce=C.resourceKey,ye=C.visibleResources.map(Ie=>{const Ge={...Ie,__key:F(ce)(Ie)};return r.groupColId===x&&(Ge[x]=l(C.groupBy,Ie)??""),Ge}),re=r._gridKeys||new Set,je=new Set;for(const Ie of ye)je.add(Ie.__key);const Me=[];for(const Ie of re)je.has(Ie)||Me.push(Ie);try{r.grid.rows.apply({add:ye,remove:Me})}catch{}r._gridKeys=je}r.displayRows=pe(r)}function ae(r){r.displayRows=pe(r),r.totalHeight=r.displayRows.length*r.ctx.rowHeight,I(r)}function be(r,C){if(r.groupColId&&r.grid&&z(r.grid.rows.collapse)&&z(r.grid.rows.expand)){r.grid.rows[C.expanded?"collapse":"expand"](C.key);return}C.expanded?r.collapsedGroups.add(C.value):r.collapsedGroups.delete(C.value),ae(r)}function t(r){if(!r.headInner)return;const C=r.doc;for(;r.headInner.firstChild;)r.headInner.removeChild(r.headInner.firstChild);r.headInner.style.width=`${r.totalWidth}px`;for(const ce of r.ticks){const ye=C.createElement("div");ye.className=`${f}__tick`,ye.style.left=`${me(r,ce.day)}px`,ye.textContent=ce.label,r.headInner.appendChild(ye)}}function T(r,C){const ce=r.pxPerDay||1,ye=r.span.startDay+Math.floor(C/ce),re=r.timeline?r.timeline.clientWidth:0,je=ye+Math.ceil(re/ce)+1;return{first:ye,last:Math.min(je,r.span.endDay)}}function I(r){if(!r.canvas)return;const C=r.ctx,ce=r.doc,ye=r.timeline?r.timeline.scrollTop:0,re=r.timeline?r.timeline.scrollLeft:0;for(r.canvas.style.width=`${r.totalWidth}px`,r.canvas.style.height=`${r.totalHeight}px`;r.canvas.firstChild;)r.canvas.removeChild(r.canvas.firstChild);const je=r.displayRows||[],Me=C.rowHeight,Ie=C.overscan,Ge=Math.max(0,Math.floor(ye/Me)-Ie),We=r.timeline?r.timeline.clientHeight:0,He=Math.min(je.length-1,Math.ceil((ye+We)/Me)+Ie),Be=T(r,re),Qe=F(C.resourceKey),tt=r.workload,Ye=tt?tt.buckets:[];let Ze=0,rt=Ye.length-1;for(;Ze<Ye.length&&Ye[Ze].end<=Be.first;)Ze+=1;for(;rt>=0&&Ye[rt].start>=Be.last;)rt-=1;for(let qe=Ge;qe<=He;qe++){const we=je[qe];if(!we)continue;const Ce=qe*Me;if(we.type==="group"){const Ue=ce.createElement("div");Ue.className=`${f}__group`,Ue.setAttribute("data-group",String(we.value??"")),Ue.setAttribute("role","row"),Ue.setAttribute("aria-label",we.label),Ue.style.top=`${Ce}px`,Ue.style.height=`${Me}px`,Ue.style.width=`${r.totalWidth}px`;const Ve=ce.createElement("button");Ve.className=`${f}__group-toggle`,Ve.type="button",Ve.setAttribute("aria-label",B(r,"scheduler.toggleGroup",{group:we.label})),Ve.setAttribute("aria-expanded",we.expanded?"true":"false"),Ve.textContent=we.expanded?"−":"+",Ve.addEventListener("click",nt=>{nt.stopPropagation(),be(r,we)}),Ue.appendChild(Ve),r.canvas.appendChild(Ue);continue}const Xe=we.resource,Je=Qe(Xe),mt=r.placement.byResource.get(Je)||[],it=tt&&tt.rows.get(String(Je))||null,bt=it?G:0,et=ce.createElement("div");et.className=`${f}__row`,et.setAttribute("data-resource",String(Je)),et.setAttribute("role","row"),et.setAttribute("aria-label",ve(r,Xe,Je)),et.style.top=`${Ce}px`,et.style.height=`${Me}px`,et.style.width=`${r.totalWidth}px`;const gt=C.nonWorking?i(C,Xe):null;if(gt)for(let Ue=Be.first;Ue<Be.last;Ue++){if(!gt(Ue))continue;const Ve=ce.createElement("div");Ve.className=`${f}__shade`,Ve.style.left=`${me(r,Ue)}px`,Ve.style.width=`${r.pxPerDay}px`,et.appendChild(Ve)}const kt=d(mt),pt=Math.max(4,(Me-bt-4)/kt);for(const Ue of mt){const Ve=Ue.startDay,nt=Ue.endDay;if(nt<Be.first||Ve>Be.last)continue;const Ke=ce.createElement("div");Ke.className=`${f}__bar`,Ke.setAttribute("data-key",String(Ue.key)),Ke.setAttribute("role","gridcell"),Ke.setAttribute("aria-label",c(C,Ue.row,Ue.key));const st=se(C,Ue.row),ot=r.focusKey!=null&&String(r.focusKey)===String(Ue.key);C.editable!==!1?(Ke.setAttribute("tabindex","0"),Ke.setAttribute("role","button"),st&&Ke.setAttribute("aria-readonly","true")):(Ke.setAttribute("tabindex",ot?"0":"-1"),ot&&Ke.setAttribute("data-focused","true"));const at=me(r,Ve),ct=Math.max(2,me(r,nt)-at);Ke.style.left=`${at}px`,Ke.style.width=`${ct}px`,Ke.style.top=`${2+Ue.lane*pt}px`,Ke.style.height=`${Math.max(2,pt-3)}px`,Ue.color&&(Ke.setAttribute("data-accent",""),Ke.style.setProperty("--lattice-scheduler-accent",Ue.color)),Ke.textContent=c(C,Ue.row,Ue.key),C.editable!==!1&&!st&&K(r,Ke),et.appendChild(Ke)}if(it){const Ue=ce.createElement("div");Ue.className=`${f}__load`;for(let Ve=Ze;Ve<=rt;Ve++){const nt=Ye[Ve],Ke=ce.createElement("div");Ke.className=`${f}__load-bucket`,Ke.style.left=`${me(r,nt.start)}px`,Ke.style.width=`${Math.max(1,me(r,nt.end)-me(r,nt.start))}px`;const st=it.cells[Ve],ot=it.available[Ve],at=ot!=null&&ot>0&&st!=null?st/ot*100:null,ct=ce.createElement("div");if(ct.className=`${f}__load-fill`,ct.style.height=`${at==null?0:Math.min(100,Math.round(at))}%`,Ke.appendChild(ct),it.over[Ve]===!0){Ke.classList.add(`${f}__load-bucket--over`);const ut=ce.createElement("span");ut.className=`${f}__load-icon`,ut.setAttribute("aria-hidden","true"),ut.textContent="⚠",Ke.appendChild(ut),Ke.setAttribute("aria-label",B(r,"scheduler.workload.overCell",{resource:Xe.name!=null?String(Xe.name):String(Je),period:ge(C,nt.start),percent:`${X(st,ot,tt.decimals)}%`}))}Ue.appendChild(Ke)}et.appendChild(Ue)}r.canvas.appendChild(et)}if(C.todayLine){const qe=v(new Date);if(qe>=Be.first&&qe<=Be.last){const we=ce.createElement("div");we.className=`${f}__today`,we.setAttribute("data-today","true"),we.style.left=`${me(r,qe)}px`,r.canvas.appendChild(we)}}}function m(r,C){const ce=r.canvas.querySelectorAll(`.${f}__bar`);for(const ye of ce)if(ye.dataset.key===String(C))return ye;return null}function b(r){const C=r.ctx,ce=F(C.resourceKey),ye=[];for(const re of r.displayRows||[]){if(re.type!=="resource")continue;const je=ce(re.resource),Me=r.placement.byResource.get(je)||[];Me.length&&ye.push({resourceKey:je,events:Me})}return ye}function g(r,C){const ce=F(r.ctx.resourceKey),ye=r.displayRows||[];for(let re=0;re<ye.length;re++){const je=ye[re];if(je.type==="resource"&&String(ce(je.resource))===String(C))return re}return-1}function D(r,C){r.focusKey=String(C.key);const ce=g(r,C.resourceKey);if(ce>=0&&r.timeline){const re=r.ctx.rowHeight,je=ce*re,Me=r.timeline.clientHeight;(je<r.timeline.scrollTop||je+re>r.timeline.scrollTop+Me)&&(r.timeline.scrollTop=Math.max(0,je-Me/2+re/2),I(r));const Ie=me(r,C.startDay),Ge=me(r,C.endDay),We=r.timeline.clientWidth;(Ge>r.timeline.scrollLeft+We||Ie<r.timeline.scrollLeft)&&(r.timeline.scrollLeft=Math.max(0,Ie-We/2),I(r))}const ye=m(r,C.key);if(ye){for(const re of r.canvas.querySelectorAll(`.${f}__bar`))re.setAttribute("tabindex","-1"),re.removeAttribute("data-focused");ye.setAttribute("tabindex","0"),ye.setAttribute("data-focused","true"),ye.focus()}}function V(r,C){const ce=b(r);if(!ce.length)return;const ye=r.focusKey==null?null:String(r.focusKey);let re=-1,je=-1;if(ye!=null)for(let He=0;He<ce.length;He++){const Be=ce[He].events.findIndex(Qe=>String(Qe.key)===ye);if(Be>=0){re=He,je=Be;break}}if(re<0){D(r,ce[0].events[0]);return}if(C==="left"||C==="right"){const He=ce[re].events,Be=C==="right"?je+1:je-1;D(r,He[Be>=0&&Be<He.length?Be:C==="right"?0:He.length-1]);return}const Me=ce[re+(C==="down"?1:-1)];if(!Me)return;const Ie=ce[re].events[je].startDay;let Ge=null,We=1/0;for(const He of Me.events){const Be=Math.abs(He.startDay-Ie);Be<We&&(We=Be,Ge=He)}Ge&&D(r,Ge)}function O(r,C){r.live&&(r.live.textContent=C)}function oe(r,C){O(r,B(r,"scheduler.eventActivated",{name:c(r.ctx,C.row,C.key)}));const ce=m(r,C.key);ce&&Ne(r,C,ce)}function de(r,C){if(C==null||C==="")return"";const ce=k(C);if(!ce)return String(C);const re={year:"numeric",month:"short",day:"numeric",...typeof C=="string"&&/(\d{1,2}:\d{2})/.test(C)?{hour:"2-digit",minute:"2-digit"}:{},...r.timeZone?{timeZone:r.timeZone}:{}};try{return new Intl.DateTimeFormat(r.locale,re).format(ce)}catch{return String(C)}}function De(r){const C=r*24;return Math.abs(C-Math.round(C))<.05?String(Math.round(C)):C.toFixed(1).replace(/\.0$/,"")}function Se(r,C){const ce=r.ctx,ye=[],re=de(ce,F(ce.fields.startDate)(C.row)),je=de(ce,F(ce.fields.endDate)(C.row));re&&ye.push({label:B(r,"scheduler.tip.start"),value:re}),je&&ye.push({label:B(r,"scheduler.tip.end"),value:je}),ye.push({label:B(r,"scheduler.tip.duration"),value:B(r,"scheduler.tip.durationValue",{hours:De(C.endDay-C.startDay)})});const Me=r.rows.get(C.resourceKey);return Me&&ye.push({label:B(r,"scheduler.tip.resource"),value:ve(r,Me,C.resourceKey)}),ye}function Pe(r,C,ce){return[c(r.ctx,C.row,C.key),...ce.map(ye=>B(r,"scheduler.tip.row",{label:ye.label,value:ye.value}))].join(", ")}function Ne(r,C,ce){if(!r.tip)return;const ye=Se(r,C),re=n(r.doc,f,{name:c(r.ctx,C.row,C.key)},ye);for(const je of[...r.tip.children])je!==r.tipArrow&&r.tip.removeChild(je);r.tip.appendChild(re),r.tip.removeAttribute("hidden"),ce.setAttribute("aria-description",Pe(r,C,ye)),ze(r,ce)}function _e(r){if(r.tip){r.tip.setAttribute("hidden","");for(const C of[...r.tip.children])C!==r.tipArrow&&r.tip.removeChild(C)}}function ze(r,C){if(!r.tip||!C||typeof C.getBoundingClientRect!="function")return;const ce=C.getBoundingClientRect(),ye=r.el.getBoundingClientRect(),re=r.doc.defaultView||globalThis,je=Number.isFinite(re.innerWidth)?re.innerWidth:1/0,Me=Number.isFinite(re.innerHeight)?re.innerHeight:1/0,Ie={left:Math.max(0,ye.left),top:Math.max(0,ye.top),right:Math.min(je,ye.right),bottom:Math.min(Me,ye.bottom)};o(r.tip,r.tipArrow,ce,Ie,ye)}function Le(r){if(!r.live)return;const C=r.workload;if(!C||!C.overAllocated.length){r.live.textContent="";return}const ce=C.overAllocated.map(ye=>B(r,"scheduler.workload.overItem",{resource:ye.name,periods:ye.periods.join(", ")})).join("; ");r.live.textContent=B(r,"scheduler.workload.overSummary",{list:ce})}function Fe(r){if(r._gridOff){try{r._gridOff()}catch{}r._gridOff=null}if(r._gridGroupOff){try{r._gridGroupOff()}catch{}r._gridGroupOff=null}const C=r.grid;if(!C||!z(C.on))return;const ce=()=>{if(r._syncing)return;r._syncing=!0;const re=Te(r),je=re?re.scrollTop:0;r.timeline.scrollTop!==je&&(r.timeline.scrollTop=je),r._syncing=!1,I(r)};C.on("scroll",ce),r._gridOff=()=>{z(C.off)&&C.off("scroll",ce)};const ye=()=>ae(r);C.on("group:toggled",ye),r._gridGroupOff=()=>{z(C.off)&&C.off("group:toggled",ye)}}function he(r){const C=[];r._listeners=C;const ce=(re,je)=>{r.el.addEventListener(re,je),C.push({type:re,fn:je})},ye=()=>{if(r._syncing)return;r._syncing=!0,r.headView&&r.headView.scrollLeft!==r.timeline.scrollLeft&&(r.headView.scrollLeft=r.timeline.scrollLeft);const re=Te(r);re&&re.scrollTop!==r.timeline.scrollTop&&(re.scrollTop=r.timeline.scrollTop),r._syncing=!1,I(r)};r.timeline.addEventListener("scroll",ye),r._timelineScroll={target:r.timeline,type:"scroll",fn:ye},ce("wheel",re=>{if(re.ctrlKey||re.metaKey){re.preventDefault&&re.preventDefault();const je=re.deltaY<0?1.25:.8;r.setZoom(xe(r,r.pxPerDay*je),"control")}}),ce("pointerover",re=>{const je=re.target&&re.target.closest?re.target.closest(`.${f}__bar`):null;if(je){const Me=r.placement.keys.get(je.dataset.key);Me&&Ne(r,Me,je)}}),ce("pointerout",re=>{re.target&&re.target.closest&&re.target.closest(`.${f}__bar`)&&_e(r)}),ce("focusin",re=>{const je=re.target&&re.target.closest?re.target.closest(`.${f}__bar`):null;if(je){const Me=r.placement.keys.get(je.dataset.key);Me&&Ne(r,Me,je)}}),ce("focusout",re=>{re.target&&re.target.closest&&re.target.closest(`.${f}__bar`)&&_e(r)}),ce("keydown",re=>{const je=r.doc.activeElement&&r.doc.activeElement.closest?r.doc.activeElement.closest(`.${f}__bar`):null;if(je&&r.ctx.editable===!1){const Me=r.placement.keys.get(je.dataset.key);if(re.key==="ArrowLeft"||re.key==="ArrowRight"||re.key==="ArrowUp"||re.key==="ArrowDown")re.preventDefault&&re.preventDefault(),V(r,re.key==="ArrowLeft"?"left":re.key==="ArrowRight"?"right":re.key==="ArrowUp"?"up":"down");else if(re.key==="Enter"||re.key===" ")re.preventDefault&&re.preventDefault(),Me&&oe(r,Me);else if(re.key==="Home"||re.key==="End"){re.preventDefault&&re.preventDefault();const Ie=b(r);for(const Ge of Ie)if(Ge.resourceKey===Me.resourceKey){D(r,Ge.events[re.key==="Home"?0:Ge.events.length-1]);break}}return}re.target&&re.target.closest&&re.target.closest(`.${f}__bar`)||(re.key==="+"||re.key==="="?(re.preventDefault&&re.preventDefault(),r.setZoom(xe(r,r.pxPerDay*1.25),"control")):re.key==="-"?(re.preventDefault&&re.preventDefault(),r.setZoom(xe(r,r.pxPerDay*.8),"control")):re.key==="ArrowLeft"||re.key==="ArrowRight"?(re.preventDefault&&re.preventDefault(),r.timeline.scrollLeft+=re.key==="ArrowRight"?80:-80,I(r)):(re.key==="ArrowUp"||re.key==="ArrowDown")&&(re.preventDefault&&re.preventDefault(),r.timeline.scrollTop+=re.key==="ArrowDown"?80:-80,I(r)))}),A(r),r._pinchOff&&r._pinchOff(),r._pinchOff=u(r)}function Te(r){return r.gridHost?r.gridHost.querySelector(".lat-body-viewport"):null}function xe(r,C){return Math.min(624,Math.max(1.8,C))}}),Re("packages/modules/charts/scale.js",function(s,te){"use strict";Object.defineProperty(s,"isNumber",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"toNumber",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"toTime",{enumerable:!0,get:function(){return E}}),Object.defineProperty(s,"extent",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"niceStep",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"niceDomain",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"measureDomain",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"linearTicks",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"timeStepFor",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"MONTH_STEPS",{enumerable:!0,get:function(){return H}}),Object.defineProperty(s,"timeTicks",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"linearScale",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"timeScale",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"key",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"bandScale",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"sqrtScale",{enumerable:!0,get:function(){return ee}});const $e=[1,2,2.5,5,10],z=6e4,N=36e5,ie=864e5,U=365.25*ie,R=[1,2,5,10,20,25,50,100],L=[1,5,10,25,50,100,250,500,1e3,5e3,15e3,3e4,z,5*z,15*z,30*z,N,3*N,6*N,12*N,ie,2*ie,7*ie,14*ie,30*ie,90*ie,180*ie,...R.map(A=>A*U)];function f(A){return typeof A=="number"&&Number.isFinite(A)}function $(A){if(A==null||A==="")return null;if(A instanceof Date){const Y=A.getTime();return Number.isFinite(Y)?Y:null}if(typeof A=="boolean")return A?1:0;const K=Number(A);return Number.isFinite(K)?K:null}function E(A){if(A==null||A==="")return null;if(A instanceof Date){const Y=A.getTime();return Number.isFinite(Y)?Y:null}if(typeof A=="number")return Number.isFinite(A)?A:null;const K=Date.parse(String(A));return Number.isFinite(K)?K:null}function F(A){let K=1/0,Y=-1/0;for(let u=0;u<A.length;u++){const j=A[u];f(j)&&(j<K&&(K=j),j>Y&&(Y=j))}return K===1/0?null:{min:K,max:Y}}function W(A){if(!(A>0))return 1;const K=10**Math.floor(Math.log10(A));for(const Y of $e)if(A<=Y*K)return Y*K;return 10*K}function P(A,K=5){const Y=W((A.max-A.min)/Math.max(1,K));return{min:Math.floor(A.min/Y)*Y,max:Math.ceil(A.max/Y)*Y,step:Y}}function q(A,K={}){const Y=F(A)||{min:0,max:1};let{min:u,max:j}=Y;if(K.zero&&(u>0&&(u=0),j<0&&(j=0)),u===j){const B=Math.abs(u)>0?Math.abs(u)/10:1;u-=B,j+=B}if(K.nice!==!1){const B=P({min:u,max:j},K.ticks||5);u=B.min,j=B.max}return f(K.min)&&(u=K.min),f(K.max)&&(j=K.max),u===j&&(j=u+1),{min:u,max:j}}function S(A,K=5){const Y=W((A.max-A.min)/Math.max(1,K)),u=Math.ceil(A.min/Y),j=Math.floor(A.max/Y),B=[];for(let Z=u;Z<=j;Z++){const le=Z*Y;B.push(Math.abs(le)<Y/1e6?0:Number(le.toPrecision(12)))}return B}function i(A,K=5){const Y=Math.max(1,K),u=A/Y;let j=L[L.length-1];for(const le of L)if(le>=u){j=le;break}if(j<U)return j;let B=j,Z=Math.abs(A/j-Y);for(const le of L){if(le<U)continue;const v=Math.abs(A/le-Y);v<Z&&(Z=v,B=le)}return B}const d=new Map;function c(A){let K=d.get(A);return K||(K=new Intl.DateTimeFormat("en-US",{timeZone:A,year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),d.set(A,K)),K}function k(A,K){const Y={year:0,month:0,day:1,hour:0,minute:0,second:0};for(const u of c(K).formatToParts(new Date(A)))switch(u.type){case"year":Y.year=Number(u.value);break;case"month":Y.month=Number(u.value)-1;break;case"day":Y.day=Number(u.value);break;case"hour":Y.hour=Number(u.value)%24;break;case"minute":Y.minute=Number(u.value);break;case"second":Y.second=Number(u.value);break;default:break}return Y}function Q(A,K,Y){const u=Date.UTC(A,K,1);let j=u;for(let B=0;B<2;B++){const Z=k(j,Y),le=Date.UTC(Z.year,Z.month,Z.day,Z.hour,Z.minute,Z.second),v=u-le;if(v===0)break;j+=v}return j}function J(A,K,Y){const u=Y?k(A.min,Y).year:new Date(A.min).getUTCFullYear();let j=Math.ceil(u/K)*K;const B=le=>Y?Q(le,0,Y):Date.UTC(le,0,1);B(j)<A.min&&(j+=K);const Z=[];for(;B(j)<=A.max;j+=K)Z.push(B(j));return Z}const H=new Map([[30*ie,1],[90*ie,3],[180*ie,6]]);function se(A,K,Y){const u=Y?k(A.min,Y):{year:new Date(A.min).getUTCFullYear(),month:new Date(A.min).getUTCMonth()};let j=u.year*12+u.month;const B=le=>{const v=Math.floor(le/12),e=le-v*12;return Y?Q(v,e,Y):Date.UTC(v,e,1)};B(j)<A.min&&(j+=1),j=Math.ceil(j/K)*K;const Z=[];for(;;j+=K){const le=B(j);if(le>A.max)break;Z.push(le)}return Z}function fe(A,K=5,Y){const u=i(A.max-A.min,K);if(u>=U)return J(A,Math.round(u/U),Y);const j=H.get(u);if(j)return se(A,j,Y);const B=[],Z=Math.ceil(A.min/u)*u;for(let le=Z;le<=A.max;le+=u)B.push(le);return B}function ke(A,K){const Y=A.max-A.min||1,[u,j]=K;return{kind:"linear",domain:A,range:K,of(B){return u+(B-A.min)/Y*(j-u)},invert(B){return A.min+(B-u)/(j-u||1)*Y},ticks(B=5){return S(A,B)}}}function ge(A,K){return{...ke(A,K),kind:"time",ticks(u=5,j){return fe(A,u,j)}}}function ue(A){if(A==null)return" null";if(A instanceof Date)return` date:${A.getTime()}`;if(typeof A=="object"){const K=A,Y=K.id??K.key??K.value;return Y!==void 0&&typeof Y!="object"?` obj:${String(Y)}`:` obj:${String(A)}`}return String(A)}function X(A,K,Y=.2){const u=Math.min(.9,Math.max(0,Y)),[j,B]=K,Z=new Map;for(let e=0;e<A.length;e++){const n=ue(A[e]);Z.has(n)||Z.set(n,e)}const le=A.length?(B-j)/A.length:B-j,v=Math.max(0,le*(1-u));return{kind:"band",domain:A,range:K,bandwidth:v,step:le,of(e){const n=Z.get(ue(e));return n===void 0?NaN:j+n*le+(le-v)/2},centre(e){const n=this.of(e);return Number.isNaN(n)?NaN:n+v/2},ticks(){return A}}}function ee(A,K){const[Y,u]=K,j=Math.max(Math.abs(A.max),Math.abs(A.min),0)||1;return{kind:"sqrt",domain:A,range:K,of(B){const Z=Math.sqrt(Math.abs(B)/j);return Y+Z*(u-Y)}}}}),Re("packages/modules/gantt/export.js",function(s,te){"use strict";Object.defineProperty(s,"PRINT_NS",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"PAPERS",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"PAGE_MARGIN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(s,"resolveVar",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"resolvePalette",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"resolveFontFamily",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"resolveFontSizes",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"PALETTE",{enumerable:!0,get:function(){return d}}),Object.defineProperty(s,"esc",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"paperPx",{enumerable:!0,get:function(){return k}}),Object.defineProperty(s,"resolveRange",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(s,"cellText",{enumerable:!0,get:function(){return J}}),Object.defineProperty(s,"barMarkup",{enumerable:!0,get:function(){return H}}),Object.defineProperty(s,"timeHeadMarkup",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"bandRowsMarkup",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"bandGridMarkup",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"dataBandMarkup",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"buildSplitSVG",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"inlineSvgStyles",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"rasterizePNG",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"buildPrintDocument",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"openPrintWindow",{enumerable:!0,get:function(){return v}});const z=te("packages/modules/charts/scale.js").linearScale,N=te("packages/modules/gantt/time.js"),ie=N.toISODate,U=N.toDayNumber,R="lat-gantt-print",L=Object.freeze({A4:{w:794,h:1123},Letter:{w:816,h:1056},A3:{w:1123,h:1587}}),f=36,$=26,E=20,F=24,W=28;function P(e,n,o){if(!e||!n||typeof e.getComputedStyle!="function")return"";const p=e.getComputedStyle(n);return!p||typeof p.getPropertyValue!="function"?"":String(p.getPropertyValue(o)||"").trim()}function q(e,n){const o=l=>P(e,n,l),p=l=>o(`--lattice-gantt-${l}`)||o(`--lattice-gantt-d-${l}`);return{text:o("--lattice-foreground"),muted:o("--lattice-foreground-muted"),border:o("--lattice-border-color"),surface:o("--lattice-surface"),bar:p("bar"),critical:p("critical"),summary:p("summary"),milestone:p("milestone"),progress:p("progress"),today:p("today"),workload:o("--lattice-scheduler-workload"),histogram:o("--lattice-scheduler-workload"),over:o("--lattice-scheduler-overalloc"),pageBg:o("--lattice-background")}}function S(e,n){return P(e,n,"--lattice-font-family")}function i(e,n){return{sm:P(e,n,"--lattice-font-size-sm"),body:P(e,n,"--lattice-font-size")}}const d=Object.freeze({text:"#1f2933",muted:"#57606a",border:"#d0d7de",surface:"#f1f3f5",bar:"#4a90d9",critical:"#e2513b",summary:"#2c3e50",milestone:"#33404d",progress:"rgba(0,0,0,0.28)",today:"#e2513b",workload:"#4a90d9",histogram:"#2c7a7b",over:"#e2513b",pageBg:"#ffffff"});function c(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function k(e,n){const o=L[e]||L.A4;return n==="portrait"?{w:o.w,h:o.h}:{w:o.h,h:o.w}}function Q(e,n){const o=n&&n.from!=null?U(n.from):e.domainMin,p=n&&n.to!=null?U(n.to):e.domainMax;return Number.isFinite(o)&&Number.isFinite(p)&&p>o?{from:o,to:p}:{from:e.domainMin,to:e.domainMax}}function J(e,n,o){if(n.unscheduled&&(e.kind==="start"||e.kind==="end"||e.kind==="duration"))return"";switch(e.kind){case"name":return n.name??"";case"start":return ie(n.es)??String(n.es);case"end":return ie(n.ef)??String(n.ef);case"duration":return String(Math.round(n.ef-n.es));case"assignee":{const p=o?o.assignee??o.assignees??o.owner:null;return(Array.isArray(p)?p:p==null?[]:[p]).map(String).filter(Boolean).join(", ")}case"progress":return n.percentComplete==null?"":`${Math.round(n.percentComplete)}%`;default:return o&&e.key?String(o[e.key]??""):""}}function H(e,n,o,p,l){if(!Number.isFinite(e.es)||!Number.isFinite(e.ef))return"";const _=Math.max(2,Math.round(p*.18)),a=o+_,y=Math.max(2,p-_*2);if(e.milestone){const pe=n(e.es),Oe=o+p/2,Ae=Math.max(4,Math.min(9,p*.3)),me=e.critical?l.critical:l.milestone;return`<path d="M ${pe} ${Oe-Ae} L ${pe+Ae} ${Oe} L ${pe} ${Oe+Ae} L ${pe-Ae} ${Oe} Z" fill="${me}"/>`}const w=n(e.es),x=n(e.ef),G=Math.max(1,x-w),ne=e.isSummary?l.summary:e.critical?l.critical:l.bar;let ve=`<rect x="${w}" y="${a}" width="${G}" height="${y}" rx="3" fill="${ne}"/>`;if(!e.isSummary&&e.percentComplete!=null&&e.percentComplete>0){const pe=Math.max(0,Math.min(100,e.percentComplete)),Oe=Math.round(G*pe/100);ve+=`<rect x="${w}" y="${a}" width="${Oe}" height="${y}" fill="${l.progress}"/>`}return ve}function se(e,n,o,p,l,_,a=d,y="11"){const w=_==="month"||_==="quarter"?30:7;let x=`<rect x="0" y="0" width="${p}" height="${l}" fill="${a.surface}"/>`,G=Math.floor(e/w)*w;for(;G<n;G+=w){const ne=o(G);x+=`<line x1="${ne}" y1="0" x2="${ne}" y2="${l}" stroke="${a.border}"/>`,x+=`<text x="${ne+4}" y="${Math.round(l*.68)}" font-size="${y}" font-weight="600" fill="${a.muted}">${c(ie(G)??String(G))}</text>`}return x+=`<line x1="0" y1="${l}" x2="${p}" y2="${l}" stroke="${a.border}"/>`,x}function fe(e,n,o,p,l,_,a,y,w){const x=Math.max(1,...e.flatMap(ne=>(ne.cells||[]).filter(ve=>ve!=null)));let G="";return(n.cells||[]).forEach((ne,ve)=>{if(ne==null)return;const pe=y[ve];if(!pe)return;const Oe=p+o(pe.start),Ae=Math.max(1,o(pe.end)-o(pe.start)-2),me=Math.max(1,Math.round(ne/x*(l-8))),Ee=_+l-4-me,M=n.over&&n.over[ve];G+=`<rect x="${Oe}" y="${Ee}" width="${Ae}" height="${me}" fill="${M?w:a}"/>`}),G}function ke(e,n,o,p,l,_,a,y){if(!e||!e.rows||!e.rows.length)return"";let w="";return e.rows.forEach((x,G)=>{const ne=l+G*p;w+=`<text x="4" y="${ne+p/2+4}" font-size="${y}" fill="${a.text}">${c(x.label)}</text>`,w+=`<line x1="0" y1="${ne+p}" x2="${o}" y2="${ne+p}" stroke="${a.border}"/>`,w+=fe(e.rows,x,n,o,p,ne,_,e.buckets,a.over)}),w}function ge(e,n,o,p,l,_,a){const y=e&&e.grid;if(!y||!y.rows||!y.rows.length)return"";const w=y.columns,x=y.columnWidths,G=x.reduce((pe,Oe)=>pe+Oe,0);let ne="",ve=0;for(let pe=0;pe<w.length;pe++)ne+=`<text x="${ve+6}" y="${p+Math.round(o*.65)}" font-size="${a}" font-weight="600" fill="${_.muted}">${c(w[pe].title||w[pe].id)}</text>`,ve+=x[pe];return ne+=`<line x1="0" y1="${p+o}" x2="${G}" y2="${p+o}" stroke="${_.border}"/>`,y.rows.forEach((pe,Oe)=>{const Ae=p+o+Oe*o;let me=0;for(let Ee=0;Ee<w.length;Ee++){const M=Ee===0&&pe.taskId!=null?14:6;ne+=`<text x="${me+M}" y="${Ae+o/2+4}" font-size="${a}" fill="${_.text}">${c(pe.texts?pe.texts[Ee]:"")}</text>`,me+=x[Ee]}ne+=`<line x1="0" y1="${Ae+o}" x2="${G}" y2="${Ae+o}" stroke="${_.border}"/>`,ne+=fe(y.rows,pe,n,G,o,Ae,l,e.buckets,_.over)}),ne}function ue(e,n,o,p,l,_,a){const y=e.rowHeight;let w=`<text x="6" y="${p+Math.round(y*.65)}" font-size="${a}" font-weight="600" fill="${_.muted}">${c(e.title)}</text>`;if(w+=`<line x1="0" y1="${p+y}" x2="${o+l}" y2="${p+y}" stroke="${_.border}"/>`,e.collapsed)return w;const x=e.totalsColumn?o-6:null;return e.rows.forEach((G,ne)=>{const ve=p+y+ne*y,pe=ve+y/2+4,Oe=G.isTotal||G.isSummary?600:400;w+=`<text x="${6+(G.depth||0)*14}" y="${pe}" font-size="${a}" font-weight="${Oe}" fill="${_.text}">${c(G.label)}</text>`,x!=null&&G.totalText&&(w+=`<text x="${x}" y="${pe}" font-size="${a}" font-weight="${Oe}" text-anchor="end" fill="${_.text}">${c(G.totalText)}</text>`),(G.texts||[]).forEach((Ae,me)=>{const Ee=e.buckets[me];if(!Ee||!Ae)return;const M=n(Ee.end);M<=0||n(Ee.start)>=l||(w+=`<text x="${o+Math.min(l,M)-4}" y="${pe}" font-size="${a}" font-weight="${Oe}" text-anchor="end" fill="${_.text}">${c(Ae)}</text>`)}),w+=`<line x1="0" y1="${ve+y}" x2="${o+l}" y2="${ve+y}" stroke="${_.border}"/>`}),w}function X(e,n={}){const o=q(n.view,n.el),p=S(n.view,n.el),l=i(n.view,n.el),_=Q(e,n.range),a=Math.max(1,Math.round(e.pxPerDay*(_.to-_.from))),y=z({min:_.from,max:_.to},[0,a]),w=h=>Math.round(y.of(h)),x=e.columnWidths.reduce((h,ae)=>h+ae,0),G=x+a,ne=Math.max(F,W),ve=ne;let pe=0;e.workload&&(pe+=e.workload.cfg.height),e.histogram&&(pe+=e.histogram.cfg.height);const Oe=Array.isArray(e.dataBands)?e.dataBands:[];for(const h of Oe)pe+=h.collapsed?h.rowHeight:(h.rows.length+1)*h.rowHeight;const Ae=ve+e.totalHeight+pe;let me="",Ee=0;for(let h=0;h<e.columns.length;h++){const ae=e.columnWidths[h];me+=`<text x="${Ee+6}" y="${Math.round(ne*.65)}" font-size="${l.sm}" font-weight="600" fill="${o.muted}">${c(e.columns[h].title||e.columns[h].id||e.columns[h].key)}</text>`,Ee+=ae}if(me+=`<line x1="0" y1="${ne}" x2="${x}" y2="${ne}" stroke="${o.border}"/>`,me+=`<g transform="translate(${x},0)">${se(_.from,_.to,w,a,ne,e.zoomLevel,o,l.sm)}</g>`,e.rows.forEach((h,ae)=>{const be=ve+h.top;let t=0;for(let T=0;T<e.columns.length;T++){const I=e.columns[T],m=e.columnWidths[T],b=e.cellTexts?e.cellTexts[ae][T]:J(I,h.rec,e.rawById.get(String(h.id))),g=I.kind==="name"?h.depth*14+6:6;me+=`<text x="${t+g}" y="${be+h.height/2+4}" font-size="${l.body}" font-weight="${h.rec.isSummary?600:400}" fill="${h.rec.isSummary?o.summary:o.text}">${c(b)}</text>`,t+=m}me+=`<line x1="0" y1="${be+h.height}" x2="${G}" y2="${be+h.height}" stroke="${o.border}"/>`,me+=`<g transform="translate(${x},${be})">${H(h.rec,w,0,h.height,o)}</g>`}),e.today!=null&&e.today>=_.from&&e.today<=_.to){const h=x+w(e.today);me+=`<line x1="${h}" y1="0" x2="${h}" y2="${ve+e.totalHeight}" stroke="${o.today}" stroke-width="1.5" stroke-dasharray="4 3"/>`}let M=ve+e.totalHeight;for(const[h,ae]of[[e.workload,o.workload],[e.histogram,o.histogram]])if(h){if(me+=`<rect x="0" y="${M}" width="${G}" height="${h.cfg.height}" fill="${o.pageBg}"/>`,h.data&&h.data.grid)me+=ge(h.data,w,h.cfg.rowHeight,M,ae,o,l.sm);else{const be=Math.max(40,x);me+=`<g transform="translate(${be},0)">${ke(h.data,w,0,h.cfg.rowHeight,M,ae,o,l.sm)}</g>`}me+=`<line x1="0" y1="${M}" x2="${G}" y2="${M}" stroke="${o.border}" stroke-width="2"/>`,M+=h.cfg.height}for(const h of Oe){const ae=h.collapsed?h.rowHeight:(h.rows.length+1)*h.rowHeight;me+=`<g data-band="${c(h.id)}">${ue(h,w,x,M,a,o,l.sm)}</g>`,me+=`<line x1="0" y1="${M}" x2="${G}" y2="${M}" stroke="${o.border}" stroke-width="2"/>`,M+=ae}return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${Ae}" viewBox="0 0 ${G} ${Ae}" font-family="${p}"><rect x="0" y="0" width="${G}" height="${Ae}" fill="${o.pageBg}"/>${me}</svg>`}function ee(e,n,o){const p=["fill","fill-opacity","stroke","stroke-width","stroke-opacity","stroke-dasharray","stroke-linejoin","stroke-linecap","font-size","font-family","font-weight","opacity","text-anchor","dominant-baseline","visibility"],l=[e,...e.querySelectorAll("*")],_=[n,...n.querySelectorAll("*")];for(let a=0;a<l.length&&a<_.length;a++){const y=o.getComputedStyle(l[a]),w=[];for(const x of p){const G=y.getPropertyValue(x);G&&w.push(`${x}:${G}`)}w.length&&_[a].setAttribute("style",w.join(";"))}}async function A(e,n,o,p,l,_){const a=e&&e.defaultView||globalThis;if(!a.Image||!e.createElement)return null;const y=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,w=new a.Image;await new Promise((ne,ve)=>{w.onload=ne,w.onerror=()=>ve(new Error("the plan could not be rasterised")),w.src=y});const x=e.createElement("canvas");x.width=Math.max(1,Math.round(o*l)),x.height=Math.max(1,Math.round(p*l));const G=x.getContext("2d");return _&&(G.fillStyle=_,G.fillRect(0,0,x.width,x.height)),G.drawImage(w,0,0,x.width,x.height),new Promise(ne=>x.toBlob(ne,"image/png"))}function K(e,n){const o=[];let p=[],l=0;for(const _ of e){const a=Math.max(1,_.height);p.length&&l+a>n&&(o.push(p),p=[],l=0),p.push(_),l+=a}return(p.length||!o.length)&&o.push(p),o}function Y(e,n,o,p){return`
|
|
228
228
|
@page { size: ${e.w}px ${e.h}px; margin: 0; }
|
|
229
229
|
*{box-sizing:border-box}
|
|
230
230
|
body{margin:0;font:${p.body}/1.4 ${o};color:${n.text};background:${n.pageBg}}
|
|
@@ -238,7 +238,7 @@ table.${R}__table{border-collapse:collapse;width:100%}
|
|
|
238
238
|
.${R}__table tr{break-inside:avoid;page-break-inside:avoid}
|
|
239
239
|
.${R}__bandtitle{font-size:${p.body};font-weight:600;margin:10px 0 4px 0}
|
|
240
240
|
svg{display:block}
|
|
241
|
-
`.trim()}function u(e,n,o,p,l,_,a,y){const w=e?`<p class="${R}__title">${c(e)}</p>`:"",P=se(p.from,p.to,o,_,W,n.zoomLevel,a,y),G=n.columns.map((re,Se)=>`<th style="width:${n.columnWidths[Se]}px">${c(re.title||re.id||re.key)}</th>`).join("");return`${w}<table class="${R}__table"><thead><tr>${G}<th style="width:${_}px;padding:0"><svg width="${_}" height="${W}" viewBox="0 0 ${_} ${W}">${P}</svg></th></tr></thead><tbody>`}function j(e,n,o,p,l){const _=e.columns.map((y,w)=>{const P=e.cellTexts?e.cellTexts[n.rowIndex][w]:J(y,n.rec,e.rawById.get(String(n.id)));return`<td style="padding-left:${6+(y.kind==="name"?n.depth*14:0)}px;font-weight:${n.rec.isSummary?600:400}">${c(P)}</td>`}).join(""),a=H(n.rec,o,0,n.height,l);return`<tr style="height:${n.height}px">${_}<td style="padding:0;width:${p}px"><svg width="${p}" height="${n.height}" viewBox="0 0 ${p} ${n.height}">${a}</svg></td></tr>`}function B(e,n,o,p){return e===!1?null:typeof e=="function"?String(e(n,o)):typeof e=="string"?e:p}function Z(e,n={}){const o=q(n.view,n.el),p=S(n.view,n.el),l=i(n.view,n.el),_=k(n.paper||"A4",n.orientation||"landscape"),a=_.w-f*2,y=_.h-f*2,w=Math.min(a-80,e.columnWidths.reduce((de,De)=>de+De,0)),P=Math.max(40,a-w),G=Math.max(1,e.domainMax-e.domainMin),re=n.fitToWidth!==!1?P/G:n.scale||e.pxPerDay,Se=z({min:e.domainMin,max:e.domainMax},[0,re*G]),be=de=>Math.round(Se.of(de)),Oe=n.fitToWidth!==!1?P:Math.round(re*G),Ae=typeof n.t=="function"?n.t:(de=>de),me=n.title===!1?null:n.title||e.title||null,Ee=n.locale||"en-GB",M=n.printDate instanceof Date?n.printDate:new Date;let h="";try{h=new Intl.DateTimeFormat(Ee).format(M)}catch{h=M.toISOString().slice(0,10)}const ae=W,ye=me?$:0,t=n.footer!==!1,T=t?E:0,I=Math.max(e.rowHeight||24,y-ye-ae-T-8),m=e.rowHeight||24,b=K(e.rows.map((de,De)=>({...de,height:Math.max(m,de.height),rowIndex:De})),I),g=[];for(const[de,De,ve]of[[e.workload,o.workload,"gantt.workload.title"],[e.histogram,o.histogram,"gantt.histogram.title"]]){if(!de||!de.data)continue;const Pe=de.data.grid?de.data.grid.rows:de.data.rows;if(!Pe.length)continue;const Ne=Pe.map(ze=>({...ze,height:de.cfg.rowHeight})),_e=K(Ne,I);g.push({title:Ae(ve),rows:_e,color:De,band:de,grid:!!de.data.grid})}const D=[];for(const de of Array.isArray(e.dataBands)?e.dataBands:[]){if(!de.rows.length)continue;const De=de.rows.map(ve=>({...ve,height:de.rowHeight}));D.push({band:de,rows:K(De,I)})}const V=b.length+g.reduce((de,De)=>de+De.rows.length,0)+D.reduce((de,De)=>de+De.rows.length,0);let O=0,oe="";for(const de of b)O+=1,oe+=le({title:me,header:u(me,e,be,{from:e.domainMin,to:e.domainMax},w,Oe,o,l.sm),body:de.map(De=>j(e,De,be,Oe,o)).join(""),pageIndex:O,totalPages:V,opts:n,t:Ae,locale:Ee,dateText:h,footerOn:t});for(const de of g)for(const De of de.rows){if(O+=1,de.grid){const ze=de.band.data.grid,Le=ze.columns,Fe=ze.columnWidths,he=Fe.reduce((ce,pe)=>ce+pe,0),Te=Math.max(40,a-he),xe=ce=>Math.round((ce-e.domainMin)/G*Te),r=Le.map((ce,pe)=>`<th style="width:${Fe[pe]}px">${c(ce.title||ce.id)}</th>`).join(""),C=De.map(ce=>{const pe=Le.map((je,Me)=>`<td style="padding-left:${6+(Me===0&&ce.taskId!=null?14:0)}px">${c(ce.texts?ce.texts[Me]:"")}</td>`).join(""),ne=fe(De,ce,xe,0,ce.height,0,de.color,de.band.data.buckets,o.over);return`<tr style="height:${ce.height}px">${pe}<td style="padding:0;width:${Te}px"><svg width="${Te}" height="${ce.height}" viewBox="0 0 ${Te} ${ce.height}">${ne}</svg></td></tr>`}).join("");oe+=le({title:me?`${me} — ${de.title}`:de.title,header:`<p class="${R}__title">${c(me?`${me} — ${de.title}`:de.title)}</p><table class="${R}__table"><thead><tr>${r}<th style="width:${Te}px"></th></tr></thead><tbody>`,body:C,pageIndex:O,totalPages:V,opts:n,t:Ae,locale:Ee,dateText:h,footerOn:t});continue}const ve=140,Pe=a-ve,Ne=ze=>Math.round((ze-e.domainMin)/G*Pe),_e=De.map(ze=>{const Le=ke({rows:[ze],buckets:de.band.data.buckets},Ne,0,ze.height,0,de.color,o,l.sm);return`<tr style="height:${ze.height}px"><td style="width:${ve}px"></td><td style="padding:0;width:${Pe}px"><svg width="${Pe}" height="${ze.height}" viewBox="0 0 ${Pe} ${ze.height}">${Le}</svg></td></tr>`}).join("");oe+=le({title:me?`${me} — ${de.title}`:de.title,header:`<p class="${R}__title">${c(me?`${me} — ${de.title}`:de.title)}</p><table class="${R}__table"><thead><tr><th style="width:${ve}px"></th><th style="width:${Pe}px"></th></tr></thead><tbody>`,body:_e,pageIndex:O,totalPages:V,opts:n,t:Ae,locale:Ee,dateText:h,footerOn:t})}for(const de of D){const De=de.band,ve=De.buckets.map((_e,ze)=>({b:_e,i:ze})).filter(({b:_e})=>_e.end>e.domainMin&&_e.start<e.domainMax),Pe=me?`${me} — ${De.title}`:De.title,Ne=`<th></th>${De.totalsColumn?"<th></th>":""}${ve.map(({b:_e})=>`<th>${c(ie(_e.start))}</th>`).join("")}`;for(const _e of de.rows){O+=1;const ze=_e.map(Le=>{const Fe=Le.isTotal||Le.isSummary?"font-weight:600;":"";return`<tr style="height:${Le.height}px;${Fe}"><td style="padding-left:${6+(Le.depth||0)*14}px">${c(Le.label)}</td>${De.totalsColumn?`<td style="text-align:right">${c(Le.totalText)}</td>`:""}${ve.map(({i:he})=>`<td style="text-align:right">${c(Le.texts[he]||"")}</td>`).join("")}</tr>`}).join("");oe+=le({title:Pe,header:`<p class="${R}__title">${c(Pe)}</p><table class="${R}__table" data-band="${c(De.id)}"><thead><tr>${Ne}</tr></thead><tbody>`,body:ze,pageIndex:O,totalPages:V,opts:n,t:Ae,locale:Ee,dateText:h,footerOn:t})}}return`<!DOCTYPE html><html><head><meta charset="utf-8"><title>${c(me||"Gantt")}</title><style>${Y(_,o,p,l)}</style></head><body>${oe}</body></html>`}function le(e){const n=e.footerOn?B(e.opts.footer,e.pageIndex,e.totalPages,`${e.t("gantt.print.page",{page:e.pageIndex,pages:e.totalPages})} · ${e.t("gantt.print.printed",{date:e.dateText})}`):null,o=e.opts.header===!1?null:typeof e.opts.header=="function"||typeof e.opts.header=="string"?B(e.opts.header,e.pageIndex,e.totalPages,null):null,p=o?`<p class="${R}__title">${c(o)}</p>`:"";return`<div class="${R}__page">${p}${e.header}${e.body}</tbody></table>`+(n?`<div class="${R}__foot"><span>${c(n)}</span></div>`:"")+"</div>"}function v(e,n){const o=e&&e.defaultView||globalThis;if(typeof o.open!="function")return!1;const p=o.open("","_blank");if(!p||!p.document)return!1;p.document.open(),p.document.write(n),p.document.close();const l=()=>{try{p.focus(),p.print()}catch{}};return p.document.readyState==="complete"?l():p.addEventListener("load",l,{once:!0}),!0}}),Re("packages/modules/scheduler/export.js",function(s,te){"use strict";Object.defineProperty(s,"exportModel",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"buildSchedulerSVG",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"buildSchedulerPrintDocument",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"toSVG",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"toPNG",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"print",{enumerable:!0,get:function(){return Y}});const z=te("packages/modules/charts/scale.js").linearScale,ie=te("packages/modules/gantt/time.js").toDayNumber,U=te("packages/modules/gantt/export.js"),R=U.PALETTE,L=U.esc,f=U.paperPx,$=U.PAGE_MARGIN,E=U.resolveRange,F=U.timeHeadMarkup,W=U.rasterizePNG,A=U.openPrintWindow,S=te("packages/modules/scheduler/model.js").accessorFor,d=te("packages/modules/scheduler/messages.js").t,c=28,k=26,Q=20,J="lat-sched-print";function H(u){const j=u&&u.doc,B=u&&u.el||j&&j.documentElement,Z=j&&(j.defaultView||j.ownerDocument&&j.ownerDocument.defaultView);if(!B||!Z||typeof Z.getComputedStyle!="function")return{fontFamily:"",fontSize:"",fontSizeSm:"",fontSizeLg:"",background:""};const le=Z.getComputedStyle(B),v=e=>{const n=j.createElement("span");n.style.cssText=`position:absolute;visibility:hidden;font-size:var(${e})`,B.appendChild(n);const o=Z.getComputedStyle(n).fontSize;return n.remove(),o||le.fontSize||""};return{fontFamily:le.fontFamily||"",fontSize:le.fontSize||"",fontSizeSm:v("--lattice-font-size-sm"),fontSizeLg:v("--lattice-font-size-lg"),background:le.getPropertyValue("--lattice-background").trim()}}function se(u){const j=u.ctx,B=(j.columns||[]).map((v,e)=>{const n=String(v&&(v.id||v.field)||`column-${e}`),o=String(v&&(v.title||v.id||v.field)||`Column ${e+1}`),p=v&&(v.field||v.id),l=v&&v.layout&&Number.isFinite(v.layout.width)&&v.layout.width>0?v.layout.width:100;return{id:n,title:o,field:p,width:l}}),Z=S(j.resourceKey),le=u.resources.map((v,e)=>{const n=Z(v),o=B.map(p=>{const l=p.field?S(p.field)(v):void 0;return l==null?"":String(l)});return{id:n,key:n,top:e*j.rowHeight,height:j.rowHeight,texts:o,events:u.placement.byResource.get(n)||[]}});return{columns:B,columnWidths:B.map(v=>v.width),rows:le,totalHeight:u.resources.length*j.rowHeight,domainMin:u.span?u.span.startDay:null,domainMax:u.span?u.span.endDay:null,pxPerDay:u.pxPerDay,zoomLevel:j.zoom.level,today:j.todayLine?ie(new Date):null,rowHeight:j.rowHeight,title:null,tokens:H(u)}}function fe(u,j,B){const Z=Math.max(1,...u.map(e=>e.lanes||1)),le=Math.max(4,(B-4)/Z);let v="";for(const e of u){if(!Number.isFinite(e.startDay)||!Number.isFinite(e.endDay))continue;const n=j(e.startDay),o=j(e.endDay),p=Math.max(2,o-n),l=e.color&&!String(e.color).startsWith("var(")?e.color:R.bar;v+=`<rect x="${n}" y="${2+(e.lane||0)*le}" width="${p}" height="${Math.max(2,le-3)}" rx="3" fill="${l}"/>`}return v}function ke(u,j={}){if(!u||!Number.isFinite(u.domainMin)||!Number.isFinite(u.domainMax))return"";const B=u.tokens||{},Z=E(u,j.range),le=Math.max(1,Math.round(u.pxPerDay*(Z.to-Z.from))),v=z({min:Z.from,max:Z.to},[0,le]),e=w=>Math.round(v.of(w)),n=u.columnWidths.reduce((w,P)=>w+P,0),o=n+le,p=c,l=p,_=l+u.totalHeight;let a="",y=0;for(let w=0;w<u.columns.length;w++)a+=`<text x="${y+6}" y="${Math.round(p*.65)}" font-size="${B.fontSizeSm}" font-weight="600" fill="${R.muted}">${L(u.columns[w].title)}</text>`,y+=u.columnWidths[w];a+=`<line x1="0" y1="${p}" x2="${n}" y2="${p}" stroke="${R.border}"/>`,a+=`<g transform="translate(${n},0)">${F(Z.from,Z.to,e,le,p,u.zoomLevel)}</g>`;for(const w of u.rows){const P=l+w.top;let G=0;for(let re=0;re<u.columns.length;re++)a+=`<text x="${G+6}" y="${P+w.height/2+4}" font-size="${B.fontSize}" fill="${R.text}">${L(w.texts[re]||"")}</text>`,G+=u.columnWidths[re];a+=`<line x1="0" y1="${P+w.height}" x2="${o}" y2="${P+w.height}" stroke="${R.border}"/>`,a+=`<g transform="translate(${n},${P})">${fe(w.events,e,w.height)}</g>`}if(u.today!=null&&u.today>=Z.from&&u.today<=Z.to){const w=n+e(u.today);a+=`<line x1="${w}" y1="0" x2="${w}" y2="${l+u.totalHeight}" stroke="${R.today}" stroke-width="1.5" stroke-dasharray="4 3"/>`}return`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${_}" viewBox="0 0 ${o} ${_}" font-family="${B.fontFamily}"><rect x="0" y="0" width="${o}" height="${_}" fill="${R.pageBg}"/>${a}</svg>`}function ge(u,j){const B=[];let Z=[],le=0;for(const v of u){const e=Math.max(1,v.height);Z.length&&le+e>j&&(B.push(Z),Z=[],le=0),Z.push(v),le+=e}return(Z.length||!B.length)&&B.push(Z),B}function ue(u,j,B,Z){const le=u.columns.map((e,n)=>`<td>${L(j.texts[n]||"")}</td>`).join(""),v=fe(j.events,B,j.height);return`<tr style="height:${j.height}px">${le}<td style="padding:0;width:${Z}px"><svg width="${Z}" height="${j.height}" viewBox="0 0 ${Z} ${j.height}">${v}</svg></td></tr>`}function X(u,j={}){const B=j.fontFamily||"system-ui,sans-serif",Z=j.fontSize||"12px",le=j.fontSizeLg||"14px",v=j.fontSizeSm||"10px";return`
|
|
241
|
+
`.trim()}function u(e,n,o,p,l,_,a,y){const w=e?`<p class="${R}__title">${c(e)}</p>`:"",x=se(p.from,p.to,o,_,W,n.zoomLevel,a,y),G=n.columns.map((ne,ve)=>`<th style="width:${n.columnWidths[ve]}px">${c(ne.title||ne.id||ne.key)}</th>`).join("");return`${w}<table class="${R}__table"><thead><tr>${G}<th style="width:${_}px;padding:0"><svg width="${_}" height="${W}" viewBox="0 0 ${_} ${W}">${x}</svg></th></tr></thead><tbody>`}function j(e,n,o,p,l){const _=e.columns.map((y,w)=>{const x=e.cellTexts?e.cellTexts[n.rowIndex][w]:J(y,n.rec,e.rawById.get(String(n.id)));return`<td style="padding-left:${6+(y.kind==="name"?n.depth*14:0)}px;font-weight:${n.rec.isSummary?600:400}">${c(x)}</td>`}).join(""),a=H(n.rec,o,0,n.height,l);return`<tr style="height:${n.height}px">${_}<td style="padding:0;width:${p}px"><svg width="${p}" height="${n.height}" viewBox="0 0 ${p} ${n.height}">${a}</svg></td></tr>`}function B(e,n,o,p){return e===!1?null:typeof e=="function"?String(e(n,o)):typeof e=="string"?e:p}function Z(e,n={}){const o=q(n.view,n.el),p=S(n.view,n.el),l=i(n.view,n.el),_=k(n.paper||"A4",n.orientation||"landscape"),a=_.w-f*2,y=_.h-f*2,w=Math.min(a-80,e.columnWidths.reduce((de,De)=>de+De,0)),x=Math.max(40,a-w),G=Math.max(1,e.domainMax-e.domainMin),ne=n.fitToWidth!==!1?x/G:n.scale||e.pxPerDay,ve=z({min:e.domainMin,max:e.domainMax},[0,ne*G]),pe=de=>Math.round(ve.of(de)),Oe=n.fitToWidth!==!1?x:Math.round(ne*G),Ae=typeof n.t=="function"?n.t:(de=>de),me=n.title===!1?null:n.title||e.title||null,Ee=n.locale||"en-GB",M=n.printDate instanceof Date?n.printDate:new Date;let h="";try{h=new Intl.DateTimeFormat(Ee).format(M)}catch{h=M.toISOString().slice(0,10)}const ae=W,be=me?$:0,t=n.footer!==!1,T=t?E:0,I=Math.max(e.rowHeight||24,y-be-ae-T-8),m=e.rowHeight||24,b=K(e.rows.map((de,De)=>({...de,height:Math.max(m,de.height),rowIndex:De})),I),g=[];for(const[de,De,Se]of[[e.workload,o.workload,"gantt.workload.title"],[e.histogram,o.histogram,"gantt.histogram.title"]]){if(!de||!de.data)continue;const Pe=de.data.grid?de.data.grid.rows:de.data.rows;if(!Pe.length)continue;const Ne=Pe.map(ze=>({...ze,height:de.cfg.rowHeight})),_e=K(Ne,I);g.push({title:Ae(Se),rows:_e,color:De,band:de,grid:!!de.data.grid})}const D=[];for(const de of Array.isArray(e.dataBands)?e.dataBands:[]){if(!de.rows.length)continue;const De=de.rows.map(Se=>({...Se,height:de.rowHeight}));D.push({band:de,rows:K(De,I)})}const V=b.length+g.reduce((de,De)=>de+De.rows.length,0)+D.reduce((de,De)=>de+De.rows.length,0);let O=0,oe="";for(const de of b)O+=1,oe+=le({title:me,header:u(me,e,pe,{from:e.domainMin,to:e.domainMax},w,Oe,o,l.sm),body:de.map(De=>j(e,De,pe,Oe,o)).join(""),pageIndex:O,totalPages:V,opts:n,t:Ae,locale:Ee,dateText:h,footerOn:t});for(const de of g)for(const De of de.rows){if(O+=1,de.grid){const ze=de.band.data.grid,Le=ze.columns,Fe=ze.columnWidths,he=Fe.reduce((ce,ye)=>ce+ye,0),Te=Math.max(40,a-he),xe=ce=>Math.round((ce-e.domainMin)/G*Te),r=Le.map((ce,ye)=>`<th style="width:${Fe[ye]}px">${c(ce.title||ce.id)}</th>`).join(""),C=De.map(ce=>{const ye=Le.map((je,Me)=>`<td style="padding-left:${6+(Me===0&&ce.taskId!=null?14:0)}px">${c(ce.texts?ce.texts[Me]:"")}</td>`).join(""),re=fe(De,ce,xe,0,ce.height,0,de.color,de.band.data.buckets,o.over);return`<tr style="height:${ce.height}px">${ye}<td style="padding:0;width:${Te}px"><svg width="${Te}" height="${ce.height}" viewBox="0 0 ${Te} ${ce.height}">${re}</svg></td></tr>`}).join("");oe+=le({title:me?`${me} — ${de.title}`:de.title,header:`<p class="${R}__title">${c(me?`${me} — ${de.title}`:de.title)}</p><table class="${R}__table"><thead><tr>${r}<th style="width:${Te}px"></th></tr></thead><tbody>`,body:C,pageIndex:O,totalPages:V,opts:n,t:Ae,locale:Ee,dateText:h,footerOn:t});continue}const Se=140,Pe=a-Se,Ne=ze=>Math.round((ze-e.domainMin)/G*Pe),_e=De.map(ze=>{const Le=ke({rows:[ze],buckets:de.band.data.buckets},Ne,0,ze.height,0,de.color,o,l.sm);return`<tr style="height:${ze.height}px"><td style="width:${Se}px"></td><td style="padding:0;width:${Pe}px"><svg width="${Pe}" height="${ze.height}" viewBox="0 0 ${Pe} ${ze.height}">${Le}</svg></td></tr>`}).join("");oe+=le({title:me?`${me} — ${de.title}`:de.title,header:`<p class="${R}__title">${c(me?`${me} — ${de.title}`:de.title)}</p><table class="${R}__table"><thead><tr><th style="width:${Se}px"></th><th style="width:${Pe}px"></th></tr></thead><tbody>`,body:_e,pageIndex:O,totalPages:V,opts:n,t:Ae,locale:Ee,dateText:h,footerOn:t})}for(const de of D){const De=de.band,Se=De.buckets.map((_e,ze)=>({b:_e,i:ze})).filter(({b:_e})=>_e.end>e.domainMin&&_e.start<e.domainMax),Pe=me?`${me} — ${De.title}`:De.title,Ne=`<th></th>${De.totalsColumn?"<th></th>":""}${Se.map(({b:_e})=>`<th>${c(ie(_e.start))}</th>`).join("")}`;for(const _e of de.rows){O+=1;const ze=_e.map(Le=>{const Fe=Le.isTotal||Le.isSummary?"font-weight:600;":"";return`<tr style="height:${Le.height}px;${Fe}"><td style="padding-left:${6+(Le.depth||0)*14}px">${c(Le.label)}</td>${De.totalsColumn?`<td style="text-align:right">${c(Le.totalText)}</td>`:""}${Se.map(({i:he})=>`<td style="text-align:right">${c(Le.texts[he]||"")}</td>`).join("")}</tr>`}).join("");oe+=le({title:Pe,header:`<p class="${R}__title">${c(Pe)}</p><table class="${R}__table" data-band="${c(De.id)}"><thead><tr>${Ne}</tr></thead><tbody>`,body:ze,pageIndex:O,totalPages:V,opts:n,t:Ae,locale:Ee,dateText:h,footerOn:t})}}return`<!DOCTYPE html><html><head><meta charset="utf-8"><title>${c(me||"Gantt")}</title><style>${Y(_,o,p,l)}</style></head><body>${oe}</body></html>`}function le(e){const n=e.footerOn?B(e.opts.footer,e.pageIndex,e.totalPages,`${e.t("gantt.print.page",{page:e.pageIndex,pages:e.totalPages})} · ${e.t("gantt.print.printed",{date:e.dateText})}`):null,o=e.opts.header===!1?null:typeof e.opts.header=="function"||typeof e.opts.header=="string"?B(e.opts.header,e.pageIndex,e.totalPages,null):null,p=o?`<p class="${R}__title">${c(o)}</p>`:"";return`<div class="${R}__page">${p}${e.header}${e.body}</tbody></table>`+(n?`<div class="${R}__foot"><span>${c(n)}</span></div>`:"")+"</div>"}function v(e,n){const o=e&&e.defaultView||globalThis;if(typeof o.open!="function")return!1;const p=o.open("","_blank");if(!p||!p.document)return!1;p.document.open(),p.document.write(n),p.document.close();const l=()=>{try{p.focus(),p.print()}catch{}};return p.document.readyState==="complete"?l():p.addEventListener("load",l,{once:!0}),!0}}),Re("packages/modules/scheduler/export.js",function(s,te){"use strict";Object.defineProperty(s,"exportModel",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"buildSchedulerSVG",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"buildSchedulerPrintDocument",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"toSVG",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"toPNG",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"print",{enumerable:!0,get:function(){return Y}});const z=te("packages/modules/charts/scale.js").linearScale,ie=te("packages/modules/gantt/time.js").toDayNumber,U=te("packages/modules/gantt/export.js"),R=U.PALETTE,L=U.esc,f=U.paperPx,$=U.PAGE_MARGIN,E=U.resolveRange,F=U.timeHeadMarkup,W=U.rasterizePNG,P=U.openPrintWindow,S=te("packages/modules/scheduler/model.js").accessorFor,d=te("packages/modules/scheduler/messages.js").t,c=28,k=26,Q=20,J="lat-sched-print";function H(u){const j=u&&u.doc,B=u&&u.el||j&&j.documentElement,Z=j&&(j.defaultView||j.ownerDocument&&j.ownerDocument.defaultView);if(!B||!Z||typeof Z.getComputedStyle!="function")return{fontFamily:"",fontSize:"",fontSizeSm:"",fontSizeLg:"",background:""};const le=Z.getComputedStyle(B),v=e=>{const n=j.createElement("span");n.style.cssText=`position:absolute;visibility:hidden;font-size:var(${e})`,B.appendChild(n);const o=Z.getComputedStyle(n).fontSize;return n.remove(),o||le.fontSize||""};return{fontFamily:le.fontFamily||"",fontSize:le.fontSize||"",fontSizeSm:v("--lattice-font-size-sm"),fontSizeLg:v("--lattice-font-size-lg"),background:le.getPropertyValue("--lattice-background").trim()}}function se(u){const j=u.ctx,B=(j.columns||[]).map((v,e)=>{const n=String(v&&(v.id||v.field)||`column-${e}`),o=String(v&&(v.title||v.id||v.field)||`Column ${e+1}`),p=v&&(v.field||v.id),l=v&&v.layout&&Number.isFinite(v.layout.width)&&v.layout.width>0?v.layout.width:100;return{id:n,title:o,field:p,width:l}}),Z=S(j.resourceKey),le=u.resources.map((v,e)=>{const n=Z(v),o=B.map(p=>{const l=p.field?S(p.field)(v):void 0;return l==null?"":String(l)});return{id:n,key:n,top:e*j.rowHeight,height:j.rowHeight,texts:o,events:u.placement.byResource.get(n)||[]}});return{columns:B,columnWidths:B.map(v=>v.width),rows:le,totalHeight:u.resources.length*j.rowHeight,domainMin:u.span?u.span.startDay:null,domainMax:u.span?u.span.endDay:null,pxPerDay:u.pxPerDay,zoomLevel:j.zoom.level,today:j.todayLine?ie(new Date):null,rowHeight:j.rowHeight,title:null,tokens:H(u)}}function fe(u,j,B){const Z=Math.max(1,...u.map(e=>e.lanes||1)),le=Math.max(4,(B-4)/Z);let v="";for(const e of u){if(!Number.isFinite(e.startDay)||!Number.isFinite(e.endDay))continue;const n=j(e.startDay),o=j(e.endDay),p=Math.max(2,o-n),l=e.color&&!String(e.color).startsWith("var(")?e.color:R.bar;v+=`<rect x="${n}" y="${2+(e.lane||0)*le}" width="${p}" height="${Math.max(2,le-3)}" rx="3" fill="${l}"/>`}return v}function ke(u,j={}){if(!u||!Number.isFinite(u.domainMin)||!Number.isFinite(u.domainMax))return"";const B=u.tokens||{},Z=E(u,j.range),le=Math.max(1,Math.round(u.pxPerDay*(Z.to-Z.from))),v=z({min:Z.from,max:Z.to},[0,le]),e=w=>Math.round(v.of(w)),n=u.columnWidths.reduce((w,x)=>w+x,0),o=n+le,p=c,l=p,_=l+u.totalHeight;let a="",y=0;for(let w=0;w<u.columns.length;w++)a+=`<text x="${y+6}" y="${Math.round(p*.65)}" font-size="${B.fontSizeSm}" font-weight="600" fill="${R.muted}">${L(u.columns[w].title)}</text>`,y+=u.columnWidths[w];a+=`<line x1="0" y1="${p}" x2="${n}" y2="${p}" stroke="${R.border}"/>`,a+=`<g transform="translate(${n},0)">${F(Z.from,Z.to,e,le,p,u.zoomLevel)}</g>`;for(const w of u.rows){const x=l+w.top;let G=0;for(let ne=0;ne<u.columns.length;ne++)a+=`<text x="${G+6}" y="${x+w.height/2+4}" font-size="${B.fontSize}" fill="${R.text}">${L(w.texts[ne]||"")}</text>`,G+=u.columnWidths[ne];a+=`<line x1="0" y1="${x+w.height}" x2="${o}" y2="${x+w.height}" stroke="${R.border}"/>`,a+=`<g transform="translate(${n},${x})">${fe(w.events,e,w.height)}</g>`}if(u.today!=null&&u.today>=Z.from&&u.today<=Z.to){const w=n+e(u.today);a+=`<line x1="${w}" y1="0" x2="${w}" y2="${l+u.totalHeight}" stroke="${R.today}" stroke-width="1.5" stroke-dasharray="4 3"/>`}return`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${_}" viewBox="0 0 ${o} ${_}" font-family="${B.fontFamily}"><rect x="0" y="0" width="${o}" height="${_}" fill="${R.pageBg}"/>${a}</svg>`}function ge(u,j){const B=[];let Z=[],le=0;for(const v of u){const e=Math.max(1,v.height);Z.length&&le+e>j&&(B.push(Z),Z=[],le=0),Z.push(v),le+=e}return(Z.length||!B.length)&&B.push(Z),B}function ue(u,j,B,Z){const le=u.columns.map((e,n)=>`<td>${L(j.texts[n]||"")}</td>`).join(""),v=fe(j.events,B,j.height);return`<tr style="height:${j.height}px">${le}<td style="padding:0;width:${Z}px"><svg width="${Z}" height="${j.height}" viewBox="0 0 ${Z} ${j.height}">${v}</svg></td></tr>`}function X(u,j={}){const B=j.fontFamily||"system-ui,sans-serif",Z=j.fontSize||"12px",le=j.fontSizeLg||"14px",v=j.fontSizeSm||"10px";return`
|
|
242
242
|
@page { size: ${u.w}px ${u.h}px; margin: 0; }
|
|
243
243
|
*{box-sizing:border-box}
|
|
244
244
|
body{margin:0;font:${Z}/1.4 ${B};color:${R.text};background:${R.pageBg}}
|
|
@@ -251,7 +251,7 @@ table.${J}__table{border-collapse:collapse;width:100%}
|
|
|
251
251
|
.${J}__table thead th{background:${R.surface};color:${R.muted};font-weight:600;font-size:${v}}
|
|
252
252
|
.${J}__table tr{break-inside:avoid;page-break-inside:avoid}
|
|
253
253
|
svg{display:block}
|
|
254
|
-
`.trim()}function ee(u,j={}){const B=f(j.paper||"A4",j.orientation||"landscape"),Z=B.w-$*2,le=B.h-$*2,v=Math.min(Z-80,u.columnWidths.reduce((ye,t)=>ye+t,0)),e=Math.max(40,Z-v),n=Math.max(1,u.domainMax-u.domainMin),o=j.fitToWidth!==!1?e/n:j.scale||u.pxPerDay,p=z({min:u.domainMin,max:u.domainMax},[0,o*n]),l=ye=>Math.round(p.of(ye)),_=j.fitToWidth!==!1?e:Math.round(o*n),a=typeof j.t=="function"?j.t:(ye=>ye),y=j.title===!1?null:j.title||u.title||null,w=j.locale||"en-GB",P=j.printDate instanceof Date?j.printDate:new Date;let G="";try{G=new Intl.DateTimeFormat(w).format(P)}catch{G=P.toISOString().slice(0,10)}const re=c,Se=y?k:0,be=j.footer!==!1,Oe=be?Q:0,Ae=Math.max(u.rowHeight||34,le-Se-re-Oe-8),me=ge(u.rows,Ae),Ee=me.length,M=u.columns.map((ye,t)=>`<th style="width:${u.columnWidths[t]}px">${L(ye.title)}</th>`).join("");let h="",ae=0;for(const ye of me){ae+=1;const t=y?`<p class="${J}__title">${L(y)}</p>`:"",T=F(u.domainMin,u.domainMax,l,_,re,u.zoomLevel),I=`${t}<table class="${J}__table"><thead><tr>${M}<th style="width:${_}px;padding:0"><svg width="${_}" height="${re}" viewBox="0 0 ${_} ${re}">${T}</svg></th></tr></thead><tbody>`,m=ye.map(g=>ue(u,g,l,_)).join(""),b=be?`${a("scheduler.print.page",{page:ae,pages:Ee})} · ${a("scheduler.print.printed",{date:G})}`:null;h+=`<div class="${J}__page">${I}${m}</tbody></table>`+(b?`<div class="${J}__foot"><span>${L(b)}</span></div>`:"")+"</div>"}return`<!DOCTYPE html><html><head><meta charset="utf-8"><title>${L(y||"Scheduler")}</title><style>${X(B,u.tokens||{})}</style></head><body>${h}</body></html>`}function x(u,j={}){return ke(se(u),j)}async function K(u,j={}){const B=x(u,j);if(!B)return null;const Z=/width="(\d+)" height="(\d+)"/.exec(B),le=Z?Number(Z[1]):0,v=Z?Number(Z[2]):0;if(!le||!v)return null;const e=u.doc;if(!e||typeof e.createElement!="function")return null;const n=e&&e.defaultView||globalThis,o=j.scale||n.devicePixelRatio||1,p="background"in j?j.background:H(u).background||R.pageBg;return W(e,B,le,v,o,p)}function Y(u,j={}){if(!u.span)return!1;const B=se(u),Z=ee(B,{...j,title:j.title===!1?!1:j.title||B.title||null,t:j.t||((le,v)=>d(u,le,v))});return A(u.doc,Z)}}),Re("packages/modules/scheduler/edit.js",function(s,te){"use strict";Object.defineProperty(s,"createSchedulerEdit",{enumerable:!0,get:function(){return A}});const z=te("packages/core/src/internal/warn.js").warnOnce,ie=te("packages/core/src/internal/predicates.js").isFunction,U=te("packages/modules/scheduler/model.js"),R=U.accessorFor,L=U.eventSpan,f=U.formatFieldDate,$=U.formatFieldDateLike,E=U.snapToStep,F=U.isEventReadOnly,W=U.isResourceReadOnly;function A(q){const S=q.ctx,i=S.fields.resourceId,d=S.fields.startDate,c=S.fields.endDate,k=R(i),Q=R(d),J=R(c),H=R(S.eventKey),se=[],fe=[];let ke=!1;const ge=a=>a==null?null:q.rows.get(a)||null,ue=a=>a==null?null:q.events.get(a)||null,X=a=>(z("scheduler:read-only-refused",`scheduler: refused an edit to a read-only ${a}; nothing changed.`),{ok:!1,refused:a}),ee=a=>({[d]:Q(a),[c]:J(a),[i]:k(a)}),x=(a,y)=>{q.events.apply({update:[{[S.eventKey]:a,...y}]})},K=a=>{if(!Object.keys(a.changes).length&&a.type!=="create"&&a.type!=="delete")return{ok:!1};const y={id:a.id,action:a.type,changes:a.changes,oldValues:a.oldValues,newValues:a.newValues,event:a.event||null},w=q.emitter.emitBefore("beforeEventChange",y,a.origin);return w===!1?(q.emitter.emit("eventChange:cancelled",{...y,reason:y.reason||"prevented"}),{ok:!1,cancelled:!0}):w&&ie(w.then)?w.then(P=>P?Y(a):(q.emitter.emit("eventChange:cancelled",{...y,reason:y.reason||"prevented"}),{ok:!1,cancelled:!0})):Y(a)},Y=a=>(a.apply(),ke||(se.push({...a}),fe.length=0),q.fire("event:change",{id:a.id,action:a.type,changes:a.changes,oldValues:a.oldValues,newValues:a.newValues,event:a.event||null}),{ok:!0,change:a}),u=(a,y)=>{ke=!0;try{(y==="undo"?a.undo:a.apply)()}finally{ke=!1}q.fire("event:change",{id:a.id,action:a.type,changes:a.changes,oldValues:y==="undo"?a.newValues:a.oldValues,newValues:y==="undo"?a.oldValues:a.newValues,event:a.event||null,undo:y==="undo"})},j=(a,y,w={})=>{if(!S.editable)return{ok:!1};const P=ue(a);if(!P)return{ok:!1};if(F(S,P))return X("event");const G=k(P);if(W(S,ge(G)))return X("resource");const re=L(S,P);if(!re.start||!re.end)return{ok:!1};const Se=E(S.zoom.step,y),be=re.start.day+re.start.frac+Se,Oe=re.end.day+re.end.frac+Se,Ae=Q(P),me=J(P),Ee=$(Ae,be),M=$(me,Oe),h={};return Ee!==Ae&&(h[d]={from:Ae,to:Ee}),M!==me&&(h[c]={from:me,to:M}),K({type:"move",id:a,changes:h,oldValues:ee(P),newValues:{...ee(P),[d]:Ee,[c]:M},apply:()=>x(a,{[d]:Ee,[c]:M}),undo:()=>x(a,{[d]:Ae,[c]:me}),origin:w.origin||"user",event:w.event||null})},B=(a,y,w={})=>{if(!S.editable)return{ok:!1};const P=ue(a);if(!P)return{ok:!1};if(F(S,P))return X("event");if(W(S,ge(y)))return X("resource");const G=k(P),re=String(G)===String(y)?{}:{[i]:{from:G,to:y}};return K({type:"reassign",id:a,changes:re,oldValues:ee(P),newValues:{...ee(P),[i]:y},apply:()=>x(a,{[i]:y}),undo:()=>x(a,{[i]:G}),origin:w.origin||"user",event:w.event||null})},Z=(a,y,w,P={})=>{if(!S.editable)return{ok:!1};const G=ue(a);if(!G)return{ok:!1};if(F(S,G))return X("event");const re=k(G);if(W(S,ge(re)))return X("resource");const Se=L(S,G);if(!Se.start||!Se.end)return{ok:!1};const be=E(S.zoom.step,w),Oe=Q(G),Ae=J(G),me={};let Ee=Oe,M=Ae;return y==="start"?(Ee=$(Oe,be),Ee!==Oe&&(me[d]={from:Oe,to:Ee})):(M=$(Ae,be),M!==Ae&&(me[c]={from:Ae,to:M})),K({type:"resize",id:a,changes:me,oldValues:ee(G),newValues:{...ee(G),[d]:Ee,[c]:M},apply:()=>x(a,{[d]:Ee,[c]:M}),undo:()=>x(a,{[d]:Oe,[c]:Ae}),origin:P.origin||"user",event:P.event||null})},le=(a,y,w,P={})=>{if(!S.editable)return{ok:!1};if(W(S,ge(a)))return X("resource");const G=E(S.zoom.step,y),re=E(S.zoom.step,w),Se=f(G),be=f(Math.max(re,G+S.zoom.step)),Oe=e(),Ae={[S.eventKey]:Oe,[i]:a,[d]:Se,[c]:be};return K({type:"create",id:Oe,changes:{},oldValues:null,newValues:{[d]:Se,[c]:be,[i]:a},apply:()=>q.events.apply({add:[Ae]}),undo:()=>q.events.apply({remove:[Oe]}),origin:P.origin||"user",event:P.event||null})},v=(a,y={})=>{if(!S.editable)return{ok:!1};const w=ue(a);if(!w)return{ok:!1};if(F(S,w))return X("event");const P=k(w);return W(S,ge(P))?X("resource"):K({type:"delete",id:a,changes:{},oldValues:ee(w),newValues:null,apply:()=>q.events.apply({remove:[a]}),undo:()=>q.events.apply({add:[w]}),origin:y.origin||"user",event:y.event||null})},e=()=>{let a=q.events.count+1;for(;q.events.get(String(a))!=null;)a+=1;return String(a)};return{move:j,reassign:B,resize:Z,create:le,remove:v,undo:(a={})=>{const y=se.pop();return y?(u(y,"undo"),fe.push(y),!0):!1},redo:(a={})=>{const y=fe.pop();return y?(u(y,"redo"),se.push(y),!0):!1},canUndo:()=>se.length>0,canRedo:()=>fe.length>0,clearHistory:()=>{se.length=0,fe.length=0},get undoSize(){return se.length},get redoSize(){return fe.length}}}}),Re("packages/modules/scheduler/data.js",function(s,te){"use strict";Object.defineProperty(s,"ganttAssignments",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"calendarAssignments",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"makeSchedulerData",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return S}});const $e=te("packages/core/src/internal/predicates.js"),z=$e.isObject,N=$e.isFunction,U=te("packages/modules/gantt/assignments.js").parseAssignments,L=te("packages/modules/gantt/time.js").fromDayNumber,f=864e5;function $(i){return L(i)?new Date(Math.round(i)*f).toISOString().slice(0,10):""}function E(i,d,c,k){const Q=d[c],J=d[k];if(Q!=null&&Q!=="")return{start:Q,end:J};const H=i&&i.schedule,se=H&&H.ok&&H.tasks?H.tasks.get(String(d.id)):null;return se&&se.es!=null?{start:$(se.es),end:$(se.ef)}:{start:null,end:null}}function F(i){return i&&typeof i.id=="string"?i.id:"id"}function W(i,d={}){const c=z(d.fields)?d.fields:{},k=F(c),Q=typeof c.start=="string"?c.start:"start",J=typeof c.end=="string"?c.end:"end",H=typeof c.name=="string"?c.name:"name",se=i&&Array.isArray(i.tasks)?i.tasks:[],fe=i&&i.resourceSpecs instanceof Map?i.resourceSpecs:new Map,ke=new Map,ge=[];for(const ue of se){const X=String(ue[k]),ee=U(ue),x=E(i,ue,Q,J);for(const K of ee){if(!ke.has(K.resource)){const Y=fe.get(K.resource)||{};ke.set(K.resource,{id:K.resource,name:Y.name||K.resource,...Y})}ge.push({id:`${X}::${K.resource}`,taskId:X,resourceId:K.resource,name:ue[H]??ue.name??X,start:x.start,end:x.end})}}return{resources:[...ke.values()],events:ge,fields:{resourceId:"resourceId",startDate:"start",endDate:"end",name:"name"}}}function A(i,d={}){const c=z(d)?d:{},k=typeof c.resourceId=="string"?c.resourceId:"resource",Q=typeof c.startDate=="string"?c.startDate:"start",J=typeof c.endDate=="string"?c.endDate:"end",H=typeof c.name=="string"?c.name:"name",se=new Map,fe=[];return(i&&i.rows&&N(i.rows.forEach)?ge=>i.rows.forEach(ge):()=>{})((ge,ue)=>{const X=ge&&ge[k]!=null?ge[k]:"Calendar";se.has(String(X))||se.set(String(X),{id:String(X),name:String(X)}),fe.push({id:ue,resourceId:X,name:ge&&ge[H]!=null?ge[H]:String(ue),start:ge&&ge[Q],end:ge&&ge[J]})}),{resources:[...se.values()],events:fe}}function q(i){function d(Q,J,H={}){const se=z(H)?H:{},{resources:fe,events:ke,fields:ge}=W(J,se),ue=i(Q,{...se,resources:Array.isArray(se.resources)&&se.resources.length?se.resources:fe,events:Array.isArray(se.events)?se.events:ke,fields:{...ge,...z(se.fields)?se.fields:{}}});if(J&&N(J.applyEdit)){const X=ee=>{if(ee.kind!=="reassign"||!ee.row||!ee.row.taskId)return;const x=N(J.taskById)?J.taskById(ee.row.taskId):null;if(!x)return;const K=U(x).map(Y=>String(Y.resource)===String(ee.resource.from)?{resource:ee.resource.to,units:Y.units}:Y);K.some(Y=>String(Y.resource)===String(ee.resource.to))||K.push({resource:ee.resource.to,units:1}),J.applyEdit({id:ee.row.taskId,assignments:K})};ue.on("change",X)}return ue}function c(Q,J,H={}){return i(Q,{...z(H)?H:{},events:Array.isArray(J)?J:[]})}function k(Q,J,H={}){const se=z(H)?H:{},{resources:fe,events:ke}=A(J,se.fields);return i(Q,{...se,resources:Array.isArray(se.resources)&&se.resources.length?se.resources:fe,events:ke,fields:{resourceId:"resourceId",startDate:"start",endDate:"end",name:"name",...z(se.fields)?se.fields:{}}})}return{schedulerFromGantt:d,schedulerFromRows:c,schedulerFromCalendar:k}}const S=q}),Re("packages/core/src/registry/free-tier-notice.js",function(s,te){"use strict";Object.defineProperty(s,"FREE_TIER_NOTICE",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"WATERMARK_TEXT",{enumerable:!0,get:function(){return z}});const $e="Free for non-commercial use: latticegrid.dev/free",z="Unlicensed: Lattice Grid trial"}),Re("packages/core/src/registry/licence.js",function(s,te){"use strict";Object.defineProperty(s,"PRODUCT",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"LICENCE_VERSION",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"PUBLIC_KEY",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"fromBase64Url",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"toBase64Url",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"asciiBytes",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"parseLicence",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"hasEd25519",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"verifyLicence",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"isLocalHost",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"currentHost",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"matchesDomain",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"LicenceHolder",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"setLicence",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"licenceInfo",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"watermark",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"licenceState",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"sharedLicence",{enumerable:!0,get:function(){return v}});const z=te("packages/core/src/internal/warn.js").warnOnce,N=te("packages/core/src/registry/free-tier-notice.js"),ie=N.FREE_TIER_NOTICE;Object.defineProperty(s,"FREE_TIER_NOTICE",{enumerable:!0,get:function(){return N.FREE_TIER_NOTICE}});const U="lattice-grid",R=1,L="LG1",f=64,$="GwmaCOkGedHulqsa-DOV1TU8On1rsalWv519c_dW4j4",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",F=(()=>{const e=new Int16Array(128).fill(-1);for(let n=0;n<E.length;n++)e[E.charCodeAt(n)]=n;return e[43]=62,e[47]=63,e})();function W(e){if(typeof e!="string")return null;let n="";for(let y=0;y<e.length;y++){const w=e.charCodeAt(y);if(w!==61){if(w>127||F[w]<0)return null;n+=e[y]}}const o=n.length;if(o%4===1)return null;const p=new Uint8Array(Math.floor(o*3/4));let l=0,_=0,a=0;for(let y=0;y<o;y++)l=l<<6|F[n.charCodeAt(y)],_+=6,_>=8&&(_-=8,p[a++]=l>>_&255);return a===p.length?p:p.subarray(0,a)}function A(e){let n="",o=0;for(;o+2<e.length;o+=3){const l=e[o]<<16|e[o+1]<<8|e[o+2];n+=E[l>>18&63]+E[l>>12&63]+E[l>>6&63]+E[l&63]}const p=e.length-o;if(p===1){const l=e[o]<<16;n+=E[l>>18&63]+E[l>>12&63]}else if(p===2){const l=e[o]<<16|e[o+1]<<8;n+=E[l>>18&63]+E[l>>12&63]+E[l>>6&63]}return n}function q(e){const n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o)&127;return n}function S(e){if(typeof TextDecoder=="function")return new TextDecoder().decode(e);let n="";for(let o=0;o<e.length;o++)n+=String.fromCharCode(e[o]);return n}function i(e){const n={ok:!1,reason:"malformed",product:null,issuedTo:null,expires:null,terms:null,features:[],deployments:[],version:0,message:null,signature:null,raw:typeof e=="string"?e:""};if(typeof e!="string"||e.length===0)return{...n,reason:"missing"};const o=e.trim(),p=o.split(".");if(p.length!==3)return n;const[l,_,a]=p;if(l!==L)return{...n,reason:"prefix"};const y=W(_),w=W(a);if(!y||!w)return n;let P;try{P=JSON.parse(S(y))}catch{return n}return P===null||typeof P!="object"?n:{ok:!0,reason:null,product:typeof P.p=="string"?P.p:null,issuedTo:typeof P.t=="string"?P.t:null,expires:typeof P.e=="string"?P.e:null,terms:typeof P.terms=="string"?P.terms:null,features:Array.isArray(P.f)?P.f.slice():[],deployments:Array.isArray(P.d)?P.d.slice():[],version:typeof P.v=="number"?P.v:0,message:q(_),signature:w,raw:o}}function d(e,n){if(!e)return!1;const o=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T23:59:59.999Z`:e);return Number.isNaN(o)?!0:n>o}function c(e){return e==="non-commercial"?"non-commercial":"commercial"}let k=null,Q=null,J=null;function H(){const e=globalThis.crypto;return e&&e.subtle?e.subtle:null}async function se(e){if(k&&Q===e)return k;const n=H();if(!n)return null;const o=W(e);if(!o)return null;try{const p=await n.importKey("raw",o,{name:"Ed25519"},!1,["verify"]);return k=p,Q=e,p}catch{return null}}async function fe(){return J!==null||(J=await se($)!==null),J}async function ke(e,n={}){const o=n.warn!==!1,p=n.product||U,l=n.publicKey||$,_=n.now??Date.now(),a=n.host??ue(),y=ge(a)?"":` ${ie}`,w=i(e);if(!w.ok){const be=w.reason==="missing"?"missing":"malformed";return o&&z(`licence.${be}`,be==="missing"?`no licence key supplied. The grid renders in full and carries a trial watermark on any host other than localhost. Get a key at latticegrid.dev.${y}`:`licence key could not be read. The grid will render with a watermark.${y}`),{valid:!1,reason:be,terms:"commercial"}}const P={product:w.product||void 0,issuedTo:w.issuedTo||void 0,expires:w.expires||void 0,terms:c(w.terms)};if(w.product!==p)return o&&z("licence.product",`licence key is for '${w.product}', not '${p}'. The grid will render with a watermark.`),{valid:!1,...P,reason:"product"};if(d(w.expires,_))return o&&z("licence.expired",`licence expired on ${w.expires}. The grid will render with a watermark. Renew at latticegrid.dev.`),{valid:!1,...P,reason:"expired"};const G=w.deployments||[];if(G.length&&a&&!ge(a)&&!X(a,G))return o&&z("licence.domain",`licence key is not valid for ${a}; it covers ${G.join(", ")}. The grid will render with a watermark.`),{valid:!1,...P,reason:"domain"};const re=await se(l);if(!re){const be=!!w.signature&&w.signature.length===f;return o&&z("licence.algorithm","this host does not provide crypto.subtle Ed25519, so the licence signature could not be verified. A structural check was used instead."),be?{valid:!0,...P,reason:"unverified"}:{valid:!1,...P,reason:"signature"}}let Se=!1;try{Se=await H().verify({name:"Ed25519"},re,w.signature,w.message)}catch{Se=!1}return Se?{valid:!0,...P}:(o&&z("licence.signature","licence signature is not valid. The grid will render with a watermark."),{valid:!1,...P,reason:"signature"})}function ge(e){const n=String(e??ue()??"").trim().toLowerCase().replace(/^\[/,"").replace(/\]$/,"");return!n||n==="localhost"||n.endsWith(".localhost")||n==="::1"||n==="0:0:0:0:0:0:0:1"?!0:/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)}function ue(){const e=globalThis.location;return e&&typeof e.hostname=="string"?e.hostname:null}function X(e,n){const o=ee(e);return!o||!Array.isArray(n)?!1:n.some(p=>{const l=ee(p);if(!l)return!1;if(l==="*")return!0;if(l.startsWith("*.")){const _=l.slice(2);return o===_||o.endsWith(`.${_}`)}return o===l})}function ee(e){return String(e??"").trim().toLowerCase().replace(/\.$/,"")}class x{#e="";#t={valid:!1,reason:"missing",terms:"commercial"};#n=null;#r=null;#a;#o=new Set;constructor(n={}){this.#a=n}set(n){this.#e=typeof n=="string"?n.trim():"";const o=i(this.#e);return this.#t=o.ok?{valid:!d(o.expires,Date.now())&&o.product===(this.#a.product||U),product:o.product||void 0,issuedTo:o.issuedTo||void 0,expires:o.expires||void 0,terms:c(o.terms),reason:"pending"}:{valid:!1,reason:o.reason||"malformed",terms:"commercial"},this.#n=null,this.#e&&this.verify(),this.#t}verify(){if(this.#n)return this.#n;const n=this.#e;return this.#n=ke(n,this.#a).then(o=>{if(this.#e===n){this.#t=o;for(const p of this.#o)p(o)}return o}),this.#n}onSettled(n){return this.#o.add(n),()=>this.#o.delete(n)}info(){return{...this.#t}}watermark(){return this.#t.valid?!1:!ge(this.#r)}setHost(n){this.#r=n}state(){return this.#t.valid?"licensed":ge(this.#r)?"localhost":"trial"}reset(){this.#e="",this.#t={valid:!1,reason:"missing",terms:"commercial"},this.#n=null,this.#o.clear()}}const K=Symbol.for("lattice-grid/licence/holder");function Y(){const e=globalThis,n=e&&e[K];if(n&&typeof n.set=="function"&&typeof n.watermark=="function")return n;const o=new x;if(e)try{e[K]=o}catch{}return o}const u=Y();function j(e){return u.set(e)}function B(){return u.info()}function Z(){return u.watermark()}function le(){return u.state()}function v(){return u}}),Re("packages/dom/src/watermark.js",function(s,te){"use strict";Object.defineProperty(s,"WATERMARK_CLASS",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"WATERMARK_LAYER_CLASS",{enumerable:!0,get:function(){return k}}),Object.defineProperty(s,"Watermark",{enumerable:!0,get:function(){return H}}),Object.defineProperty(s,"viewLicenceHost",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"mountViewWatermark",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return ge}});const z=te("packages/core/src/internal/predicates.js").isFunction,N=te("packages/core/src/registry/free-tier-notice.js"),ie=N.FREE_TIER_NOTICE,U=N.WATERMARK_TEXT,R=te("packages/core/src/registry/licence.js"),L=R.watermark,f=R.setLicence,$=Object.freeze({t:ue=>ue==="licence.watermark.free"?ie:U});function E(ue,X,ee={}){const x=ue.createElement(X);if(ee.class)for(const K of ee.class.split(/\s+/))K&&x.classList.add(K);if(ee.text!==void 0&&(x.textContent=ee.text),ee.attrs)for(const[K,Y]of Object.entries(ee.attrs))x.setAttribute(K,Y);if(ee.children)for(const K of ee.children)x.appendChild(K);return x}function F(ue,X,ee){return ue.addEventListener(X,ee),()=>ue.removeEventListener(X,ee)}const W="lat-watermark",A="https://www.latticegrid.dev",q=["br","bl","tl","tr"],S=4e3,i={header:"lat-header",stickyTop:"lat-sticky-top",stickyBottom:"lat-sticky-bottom",statusBar:"lat-status-bar"},d=Symbol.for("lattice-grid/licence/holder"),c="data-lat-watermark-owner",k="lat-watermark-layer",Q="lat-watermark-style",J=`
|
|
254
|
+
`.trim()}function ee(u,j={}){const B=f(j.paper||"A4",j.orientation||"landscape"),Z=B.w-$*2,le=B.h-$*2,v=Math.min(Z-80,u.columnWidths.reduce((be,t)=>be+t,0)),e=Math.max(40,Z-v),n=Math.max(1,u.domainMax-u.domainMin),o=j.fitToWidth!==!1?e/n:j.scale||u.pxPerDay,p=z({min:u.domainMin,max:u.domainMax},[0,o*n]),l=be=>Math.round(p.of(be)),_=j.fitToWidth!==!1?e:Math.round(o*n),a=typeof j.t=="function"?j.t:(be=>be),y=j.title===!1?null:j.title||u.title||null,w=j.locale||"en-GB",x=j.printDate instanceof Date?j.printDate:new Date;let G="";try{G=new Intl.DateTimeFormat(w).format(x)}catch{G=x.toISOString().slice(0,10)}const ne=c,ve=y?k:0,pe=j.footer!==!1,Oe=pe?Q:0,Ae=Math.max(u.rowHeight||34,le-ve-ne-Oe-8),me=ge(u.rows,Ae),Ee=me.length,M=u.columns.map((be,t)=>`<th style="width:${u.columnWidths[t]}px">${L(be.title)}</th>`).join("");let h="",ae=0;for(const be of me){ae+=1;const t=y?`<p class="${J}__title">${L(y)}</p>`:"",T=F(u.domainMin,u.domainMax,l,_,ne,u.zoomLevel),I=`${t}<table class="${J}__table"><thead><tr>${M}<th style="width:${_}px;padding:0"><svg width="${_}" height="${ne}" viewBox="0 0 ${_} ${ne}">${T}</svg></th></tr></thead><tbody>`,m=be.map(g=>ue(u,g,l,_)).join(""),b=pe?`${a("scheduler.print.page",{page:ae,pages:Ee})} · ${a("scheduler.print.printed",{date:G})}`:null;h+=`<div class="${J}__page">${I}${m}</tbody></table>`+(b?`<div class="${J}__foot"><span>${L(b)}</span></div>`:"")+"</div>"}return`<!DOCTYPE html><html><head><meta charset="utf-8"><title>${L(y||"Scheduler")}</title><style>${X(B,u.tokens||{})}</style></head><body>${h}</body></html>`}function A(u,j={}){return ke(se(u),j)}async function K(u,j={}){const B=A(u,j);if(!B)return null;const Z=/width="(\d+)" height="(\d+)"/.exec(B),le=Z?Number(Z[1]):0,v=Z?Number(Z[2]):0;if(!le||!v)return null;const e=u.doc;if(!e||typeof e.createElement!="function")return null;const n=e&&e.defaultView||globalThis,o=j.scale||n.devicePixelRatio||1,p="background"in j?j.background:H(u).background||R.pageBg;return W(e,B,le,v,o,p)}function Y(u,j={}){if(!u.span)return!1;const B=se(u),Z=ee(B,{...j,title:j.title===!1?!1:j.title||B.title||null,t:j.t||((le,v)=>d(u,le,v))});return P(u.doc,Z)}}),Re("packages/modules/scheduler/edit.js",function(s,te){"use strict";Object.defineProperty(s,"createSchedulerEdit",{enumerable:!0,get:function(){return P}});const z=te("packages/core/src/internal/warn.js").warnOnce,ie=te("packages/core/src/internal/predicates.js").isFunction,U=te("packages/modules/scheduler/model.js"),R=U.accessorFor,L=U.eventSpan,f=U.formatFieldDate,$=U.formatFieldDateLike,E=U.snapToStep,F=U.isEventReadOnly,W=U.isResourceReadOnly;function P(q){const S=q.ctx,i=S.fields.resourceId,d=S.fields.startDate,c=S.fields.endDate,k=R(i),Q=R(d),J=R(c),H=R(S.eventKey),se=[],fe=[];let ke=!1;const ge=a=>a==null?null:q.rows.get(a)||null,ue=a=>a==null?null:q.events.get(a)||null,X=a=>(z("scheduler:read-only-refused",`scheduler: refused an edit to a read-only ${a}; nothing changed.`),{ok:!1,refused:a}),ee=a=>({[d]:Q(a),[c]:J(a),[i]:k(a)}),A=(a,y)=>{q.events.apply({update:[{[S.eventKey]:a,...y}]})},K=a=>{if(!Object.keys(a.changes).length&&a.type!=="create"&&a.type!=="delete")return{ok:!1};const y={id:a.id,action:a.type,changes:a.changes,oldValues:a.oldValues,newValues:a.newValues,event:a.event||null},w=q.emitter.emitBefore("beforeEventChange",y,a.origin);return w===!1?(q.emitter.emit("eventChange:cancelled",{...y,reason:y.reason||"prevented"}),{ok:!1,cancelled:!0}):w&&ie(w.then)?w.then(x=>x?Y(a):(q.emitter.emit("eventChange:cancelled",{...y,reason:y.reason||"prevented"}),{ok:!1,cancelled:!0})):Y(a)},Y=a=>(a.apply(),ke||(se.push({...a}),fe.length=0),q.fire("event:change",{id:a.id,action:a.type,changes:a.changes,oldValues:a.oldValues,newValues:a.newValues,event:a.event||null}),{ok:!0,change:a}),u=(a,y)=>{ke=!0;try{(y==="undo"?a.undo:a.apply)()}finally{ke=!1}q.fire("event:change",{id:a.id,action:a.type,changes:a.changes,oldValues:y==="undo"?a.newValues:a.oldValues,newValues:y==="undo"?a.oldValues:a.newValues,event:a.event||null,undo:y==="undo"})},j=(a,y,w={})=>{if(!S.editable)return{ok:!1};const x=ue(a);if(!x)return{ok:!1};if(F(S,x))return X("event");const G=k(x);if(W(S,ge(G)))return X("resource");const ne=L(S,x);if(!ne.start||!ne.end)return{ok:!1};const ve=E(S.zoom.step,y),pe=ne.start.day+ne.start.frac+ve,Oe=ne.end.day+ne.end.frac+ve,Ae=Q(x),me=J(x),Ee=$(Ae,pe),M=$(me,Oe),h={};return Ee!==Ae&&(h[d]={from:Ae,to:Ee}),M!==me&&(h[c]={from:me,to:M}),K({type:"move",id:a,changes:h,oldValues:ee(x),newValues:{...ee(x),[d]:Ee,[c]:M},apply:()=>A(a,{[d]:Ee,[c]:M}),undo:()=>A(a,{[d]:Ae,[c]:me}),origin:w.origin||"user",event:w.event||null})},B=(a,y,w={})=>{if(!S.editable)return{ok:!1};const x=ue(a);if(!x)return{ok:!1};if(F(S,x))return X("event");if(W(S,ge(y)))return X("resource");const G=k(x),ne=String(G)===String(y)?{}:{[i]:{from:G,to:y}};return K({type:"reassign",id:a,changes:ne,oldValues:ee(x),newValues:{...ee(x),[i]:y},apply:()=>A(a,{[i]:y}),undo:()=>A(a,{[i]:G}),origin:w.origin||"user",event:w.event||null})},Z=(a,y,w,x={})=>{if(!S.editable)return{ok:!1};const G=ue(a);if(!G)return{ok:!1};if(F(S,G))return X("event");const ne=k(G);if(W(S,ge(ne)))return X("resource");const ve=L(S,G);if(!ve.start||!ve.end)return{ok:!1};const pe=E(S.zoom.step,w),Oe=Q(G),Ae=J(G),me={};let Ee=Oe,M=Ae;return y==="start"?(Ee=$(Oe,pe),Ee!==Oe&&(me[d]={from:Oe,to:Ee})):(M=$(Ae,pe),M!==Ae&&(me[c]={from:Ae,to:M})),K({type:"resize",id:a,changes:me,oldValues:ee(G),newValues:{...ee(G),[d]:Ee,[c]:M},apply:()=>A(a,{[d]:Ee,[c]:M}),undo:()=>A(a,{[d]:Oe,[c]:Ae}),origin:x.origin||"user",event:x.event||null})},le=(a,y,w,x={})=>{if(!S.editable)return{ok:!1};if(W(S,ge(a)))return X("resource");const G=E(S.zoom.step,y),ne=E(S.zoom.step,w),ve=f(G),pe=f(Math.max(ne,G+S.zoom.step)),Oe=e(),Ae={[S.eventKey]:Oe,[i]:a,[d]:ve,[c]:pe};return K({type:"create",id:Oe,changes:{},oldValues:null,newValues:{[d]:ve,[c]:pe,[i]:a},apply:()=>q.events.apply({add:[Ae]}),undo:()=>q.events.apply({remove:[Oe]}),origin:x.origin||"user",event:x.event||null})},v=(a,y={})=>{if(!S.editable)return{ok:!1};const w=ue(a);if(!w)return{ok:!1};if(F(S,w))return X("event");const x=k(w);return W(S,ge(x))?X("resource"):K({type:"delete",id:a,changes:{},oldValues:ee(w),newValues:null,apply:()=>q.events.apply({remove:[a]}),undo:()=>q.events.apply({add:[w]}),origin:y.origin||"user",event:y.event||null})},e=()=>{let a=q.events.count+1;for(;q.events.get(String(a))!=null;)a+=1;return String(a)};return{move:j,reassign:B,resize:Z,create:le,remove:v,undo:(a={})=>{const y=se.pop();return y?(u(y,"undo"),fe.push(y),!0):!1},redo:(a={})=>{const y=fe.pop();return y?(u(y,"redo"),se.push(y),!0):!1},canUndo:()=>se.length>0,canRedo:()=>fe.length>0,clearHistory:()=>{se.length=0,fe.length=0},get undoSize(){return se.length},get redoSize(){return fe.length}}}}),Re("packages/modules/scheduler/data.js",function(s,te){"use strict";Object.defineProperty(s,"ganttAssignments",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"calendarAssignments",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"makeSchedulerData",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return S}});const $e=te("packages/core/src/internal/predicates.js"),z=$e.isObject,N=$e.isFunction,U=te("packages/modules/gantt/assignments.js").parseAssignments,L=te("packages/modules/gantt/time.js").fromDayNumber,f=864e5;function $(i){return L(i)?new Date(Math.round(i)*f).toISOString().slice(0,10):""}function E(i,d,c,k){const Q=d[c],J=d[k];if(Q!=null&&Q!=="")return{start:Q,end:J};const H=i&&i.schedule,se=H&&H.ok&&H.tasks?H.tasks.get(String(d.id)):null;return se&&se.es!=null?{start:$(se.es),end:$(se.ef)}:{start:null,end:null}}function F(i){return i&&typeof i.id=="string"?i.id:"id"}function W(i,d={}){const c=z(d.fields)?d.fields:{},k=F(c),Q=typeof c.start=="string"?c.start:"start",J=typeof c.end=="string"?c.end:"end",H=typeof c.name=="string"?c.name:"name",se=i&&Array.isArray(i.tasks)?i.tasks:[],fe=i&&i.resourceSpecs instanceof Map?i.resourceSpecs:new Map,ke=new Map,ge=[];for(const ue of se){const X=String(ue[k]),ee=U(ue),A=E(i,ue,Q,J);for(const K of ee){if(!ke.has(K.resource)){const Y=fe.get(K.resource)||{};ke.set(K.resource,{id:K.resource,name:Y.name||K.resource,...Y})}ge.push({id:`${X}::${K.resource}`,taskId:X,resourceId:K.resource,name:ue[H]??ue.name??X,start:A.start,end:A.end})}}return{resources:[...ke.values()],events:ge,fields:{resourceId:"resourceId",startDate:"start",endDate:"end",name:"name"}}}function P(i,d={}){const c=z(d)?d:{},k=typeof c.resourceId=="string"?c.resourceId:"resource",Q=typeof c.startDate=="string"?c.startDate:"start",J=typeof c.endDate=="string"?c.endDate:"end",H=typeof c.name=="string"?c.name:"name",se=new Map,fe=[];return(i&&i.rows&&N(i.rows.forEach)?ge=>i.rows.forEach(ge):()=>{})((ge,ue)=>{const X=ge&&ge[k]!=null?ge[k]:"Calendar";se.has(String(X))||se.set(String(X),{id:String(X),name:String(X)}),fe.push({id:ue,resourceId:X,name:ge&&ge[H]!=null?ge[H]:String(ue),start:ge&&ge[Q],end:ge&&ge[J]})}),{resources:[...se.values()],events:fe}}function q(i){function d(Q,J,H={}){const se=z(H)?H:{},{resources:fe,events:ke,fields:ge}=W(J,se),ue=i(Q,{...se,resources:Array.isArray(se.resources)&&se.resources.length?se.resources:fe,events:Array.isArray(se.events)?se.events:ke,fields:{...ge,...z(se.fields)?se.fields:{}}});if(J&&N(J.applyEdit)){const X=ee=>{if(ee.kind!=="reassign"||!ee.row||!ee.row.taskId)return;const A=N(J.taskById)?J.taskById(ee.row.taskId):null;if(!A)return;const K=U(A).map(Y=>String(Y.resource)===String(ee.resource.from)?{resource:ee.resource.to,units:Y.units}:Y);K.some(Y=>String(Y.resource)===String(ee.resource.to))||K.push({resource:ee.resource.to,units:1}),J.applyEdit({id:ee.row.taskId,assignments:K})};ue.on("change",X)}return ue}function c(Q,J,H={}){return i(Q,{...z(H)?H:{},events:Array.isArray(J)?J:[]})}function k(Q,J,H={}){const se=z(H)?H:{},{resources:fe,events:ke}=P(J,se.fields);return i(Q,{...se,resources:Array.isArray(se.resources)&&se.resources.length?se.resources:fe,events:ke,fields:{resourceId:"resourceId",startDate:"start",endDate:"end",name:"name",...z(se.fields)?se.fields:{}}})}return{schedulerFromGantt:d,schedulerFromRows:c,schedulerFromCalendar:k}}const S=q}),Re("packages/core/src/registry/free-tier-notice.js",function(s,te){"use strict";Object.defineProperty(s,"FREE_TIER_NOTICE",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(s,"WATERMARK_TEXT",{enumerable:!0,get:function(){return z}});const $e="Free for non-commercial use: latticegrid.dev/free",z="Unlicensed: Lattice Grid trial"}),Re("packages/core/src/registry/licence.js",function(s,te){"use strict";Object.defineProperty(s,"PRODUCT",{enumerable:!0,get:function(){return U}}),Object.defineProperty(s,"LICENCE_VERSION",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"PUBLIC_KEY",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"fromBase64Url",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"toBase64Url",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"asciiBytes",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"parseLicence",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"hasEd25519",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"verifyLicence",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"isLocalHost",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(s,"currentHost",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"matchesDomain",{enumerable:!0,get:function(){return X}}),Object.defineProperty(s,"LicenceHolder",{enumerable:!0,get:function(){return A}}),Object.defineProperty(s,"setLicence",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"licenceInfo",{enumerable:!0,get:function(){return B}}),Object.defineProperty(s,"watermark",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(s,"licenceState",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"sharedLicence",{enumerable:!0,get:function(){return v}});const z=te("packages/core/src/internal/warn.js").warnOnce,N=te("packages/core/src/registry/free-tier-notice.js"),ie=N.FREE_TIER_NOTICE;Object.defineProperty(s,"FREE_TIER_NOTICE",{enumerable:!0,get:function(){return N.FREE_TIER_NOTICE}});const U="lattice-grid",R=1,L="LG1",f=64,$="GwmaCOkGedHulqsa-DOV1TU8On1rsalWv519c_dW4j4",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",F=(()=>{const e=new Int16Array(128).fill(-1);for(let n=0;n<E.length;n++)e[E.charCodeAt(n)]=n;return e[43]=62,e[47]=63,e})();function W(e){if(typeof e!="string")return null;let n="";for(let y=0;y<e.length;y++){const w=e.charCodeAt(y);if(w!==61){if(w>127||F[w]<0)return null;n+=e[y]}}const o=n.length;if(o%4===1)return null;const p=new Uint8Array(Math.floor(o*3/4));let l=0,_=0,a=0;for(let y=0;y<o;y++)l=l<<6|F[n.charCodeAt(y)],_+=6,_>=8&&(_-=8,p[a++]=l>>_&255);return a===p.length?p:p.subarray(0,a)}function P(e){let n="",o=0;for(;o+2<e.length;o+=3){const l=e[o]<<16|e[o+1]<<8|e[o+2];n+=E[l>>18&63]+E[l>>12&63]+E[l>>6&63]+E[l&63]}const p=e.length-o;if(p===1){const l=e[o]<<16;n+=E[l>>18&63]+E[l>>12&63]}else if(p===2){const l=e[o]<<16|e[o+1]<<8;n+=E[l>>18&63]+E[l>>12&63]+E[l>>6&63]}return n}function q(e){const n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o)&127;return n}function S(e){if(typeof TextDecoder=="function")return new TextDecoder().decode(e);let n="";for(let o=0;o<e.length;o++)n+=String.fromCharCode(e[o]);return n}function i(e){const n={ok:!1,reason:"malformed",product:null,issuedTo:null,expires:null,terms:null,features:[],deployments:[],version:0,message:null,signature:null,raw:typeof e=="string"?e:""};if(typeof e!="string"||e.length===0)return{...n,reason:"missing"};const o=e.trim(),p=o.split(".");if(p.length!==3)return n;const[l,_,a]=p;if(l!==L)return{...n,reason:"prefix"};const y=W(_),w=W(a);if(!y||!w)return n;let x;try{x=JSON.parse(S(y))}catch{return n}return x===null||typeof x!="object"?n:{ok:!0,reason:null,product:typeof x.p=="string"?x.p:null,issuedTo:typeof x.t=="string"?x.t:null,expires:typeof x.e=="string"?x.e:null,terms:typeof x.terms=="string"?x.terms:null,features:Array.isArray(x.f)?x.f.slice():[],deployments:Array.isArray(x.d)?x.d.slice():[],version:typeof x.v=="number"?x.v:0,message:q(_),signature:w,raw:o}}function d(e,n){if(!e)return!1;const o=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T23:59:59.999Z`:e);return Number.isNaN(o)?!0:n>o}function c(e){return e==="non-commercial"?"non-commercial":"commercial"}let k=null,Q=null,J=null;function H(){const e=globalThis.crypto;return e&&e.subtle?e.subtle:null}async function se(e){if(k&&Q===e)return k;const n=H();if(!n)return null;const o=W(e);if(!o)return null;try{const p=await n.importKey("raw",o,{name:"Ed25519"},!1,["verify"]);return k=p,Q=e,p}catch{return null}}async function fe(){return J!==null||(J=await se($)!==null),J}async function ke(e,n={}){const o=n.warn!==!1,p=n.product||U,l=n.publicKey||$,_=n.now??Date.now(),a=n.host??ue(),y=ge(a)?"":` ${ie}`,w=i(e);if(!w.ok){const pe=w.reason==="missing"?"missing":"malformed";return o&&z(`licence.${pe}`,pe==="missing"?`no licence key supplied. The grid renders in full and carries a trial watermark on any host other than localhost. Get a key at latticegrid.dev.${y}`:`licence key could not be read. The grid will render with a watermark.${y}`),{valid:!1,reason:pe,terms:"commercial"}}const x={product:w.product||void 0,issuedTo:w.issuedTo||void 0,expires:w.expires||void 0,terms:c(w.terms)};if(w.product!==p)return o&&z("licence.product",`licence key is for '${w.product}', not '${p}'. The grid will render with a watermark.`),{valid:!1,...x,reason:"product"};if(d(w.expires,_))return o&&z("licence.expired",`licence expired on ${w.expires}. The grid will render with a watermark. Renew at latticegrid.dev.`),{valid:!1,...x,reason:"expired"};const G=w.deployments||[];if(G.length&&a&&!ge(a)&&!X(a,G))return o&&z("licence.domain",`licence key is not valid for ${a}; it covers ${G.join(", ")}. The grid will render with a watermark.`),{valid:!1,...x,reason:"domain"};const ne=await se(l);if(!ne){const pe=!!w.signature&&w.signature.length===f;return o&&z("licence.algorithm","this host does not provide crypto.subtle Ed25519, so the licence signature could not be verified. A structural check was used instead."),pe?{valid:!0,...x,reason:"unverified"}:{valid:!1,...x,reason:"signature"}}let ve=!1;try{ve=await H().verify({name:"Ed25519"},ne,w.signature,w.message)}catch{ve=!1}return ve?{valid:!0,...x}:(o&&z("licence.signature","licence signature is not valid. The grid will render with a watermark."),{valid:!1,...x,reason:"signature"})}function ge(e){const n=String(e??ue()??"").trim().toLowerCase().replace(/^\[/,"").replace(/\]$/,"");return!n||n==="localhost"||n.endsWith(".localhost")||n==="::1"||n==="0:0:0:0:0:0:0:1"?!0:/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)}function ue(){const e=globalThis.location;return e&&typeof e.hostname=="string"?e.hostname:null}function X(e,n){const o=ee(e);return!o||!Array.isArray(n)?!1:n.some(p=>{const l=ee(p);if(!l)return!1;if(l==="*")return!0;if(l.startsWith("*.")){const _=l.slice(2);return o===_||o.endsWith(`.${_}`)}return o===l})}function ee(e){return String(e??"").trim().toLowerCase().replace(/\.$/,"")}class A{#e="";#t={valid:!1,reason:"missing",terms:"commercial"};#n=null;#r=null;#a;#o=new Set;constructor(n={}){this.#a=n}set(n){this.#e=typeof n=="string"?n.trim():"";const o=i(this.#e);return this.#t=o.ok?{valid:!d(o.expires,Date.now())&&o.product===(this.#a.product||U),product:o.product||void 0,issuedTo:o.issuedTo||void 0,expires:o.expires||void 0,terms:c(o.terms),reason:"pending"}:{valid:!1,reason:o.reason||"malformed",terms:"commercial"},this.#n=null,this.#e&&this.verify(),this.#t}verify(){if(this.#n)return this.#n;const n=this.#e;return this.#n=ke(n,this.#a).then(o=>{if(this.#e===n){this.#t=o;for(const p of this.#o)p(o)}return o}),this.#n}onSettled(n){return this.#o.add(n),()=>this.#o.delete(n)}info(){return{...this.#t}}watermark(){return this.#t.valid?!1:!ge(this.#r)}setHost(n){this.#r=n}state(){return this.#t.valid?"licensed":ge(this.#r)?"localhost":"trial"}reset(){this.#e="",this.#t={valid:!1,reason:"missing",terms:"commercial"},this.#n=null,this.#o.clear()}}const K=Symbol.for("lattice-grid/licence/holder");function Y(){const e=globalThis,n=e&&e[K];if(n&&typeof n.set=="function"&&typeof n.watermark=="function")return n;const o=new A;if(e)try{e[K]=o}catch{}return o}const u=Y();function j(e){return u.set(e)}function B(){return u.info()}function Z(){return u.watermark()}function le(){return u.state()}function v(){return u}}),Re("packages/dom/src/watermark.js",function(s,te){"use strict";Object.defineProperty(s,"WATERMARK_CLASS",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"WATERMARK_LAYER_CLASS",{enumerable:!0,get:function(){return k}}),Object.defineProperty(s,"Watermark",{enumerable:!0,get:function(){return H}}),Object.defineProperty(s,"viewLicenceHost",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"mountViewWatermark",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return ge}});const z=te("packages/core/src/internal/predicates.js").isFunction,N=te("packages/core/src/registry/free-tier-notice.js"),ie=N.FREE_TIER_NOTICE,U=N.WATERMARK_TEXT,R=te("packages/core/src/registry/licence.js"),L=R.watermark,f=R.setLicence,$=Object.freeze({t:ue=>ue==="licence.watermark.free"?ie:U});function E(ue,X,ee={}){const A=ue.createElement(X);if(ee.class)for(const K of ee.class.split(/\s+/))K&&A.classList.add(K);if(ee.text!==void 0&&(A.textContent=ee.text),ee.attrs)for(const[K,Y]of Object.entries(ee.attrs))A.setAttribute(K,Y);if(ee.children)for(const K of ee.children)A.appendChild(K);return A}function F(ue,X,ee){return ue.addEventListener(X,ee),()=>ue.removeEventListener(X,ee)}const W="lat-watermark",P="https://www.latticegrid.dev",q=["br","bl","tl","tr"],S=4e3,i={header:"lat-header",stickyTop:"lat-sticky-top",stickyBottom:"lat-sticky-bottom",statusBar:"lat-status-bar"},d=Symbol.for("lattice-grid/licence/holder"),c="data-lat-watermark-owner",k="lat-watermark-layer",Q="lat-watermark-style",J=`
|
|
255
255
|
.${k}{position:absolute;inset:0;pointer-events:none;z-index:2147483000;overflow:hidden}
|
|
256
256
|
.${k} .${W}{position:absolute;z-index:6;padding:10px 18px;border-radius:var(--lattice-radius-sm,4px);background:var(--lattice-accent,#2563eb);box-shadow:0 2px 10px rgb(0 0 0 / 25%);color:var(--lattice-accent-contrast,#fff);font:700 15px/1.3 system-ui,sans-serif;letter-spacing:.02em;white-space:nowrap;pointer-events:none;opacity:.94}
|
|
257
257
|
.${k} .${W}--br{inset-inline-end:0;bottom:0}
|
|
@@ -261,6 +261,6 @@ svg{display:block}
|
|
|
261
261
|
.${k} .${W}__link{color:inherit;pointer-events:auto;text-decoration:underline;text-underline-offset:2px}
|
|
262
262
|
.${k} .${W}__free{display:block;margin-top:2px;font-size:12px;font-weight:500;letter-spacing:0;opacity:.92}
|
|
263
263
|
@media print{.${k} .${W}{opacity:1}}
|
|
264
|
-
`;class H{#e;#t;#n;#r=null;#a=[];#o;#l=0;#c=null;#s=null;#h=!1;#i=null;#g=null;#d=null;constructor(X){this.#s=X.owner||null;const ee=X.area;ee&&!z(ee)&&z(ee.getBoundingClientRect)&&(this.#g=ee),z(ee)?this.#d=ee:ee&&z(ee.getBoundingClientRect)&&(this.#d=()=>ee.getBoundingClientRect()),this.#s&&z(this.#s.setAttribute)&&this.#s.setAttribute(c,""),this.#e=X.grid,this.#t=X.document,this.#n=X.element,this.#o=X.window||(typeof globalThis>"u"?{}:globalThis)}mount(){this.refresh(),z(this.#e.on)&&this.#a.push(this.#e.on("licence:changed",()=>this.refresh()));const X=this.#e.licence&&this.#e.licence.ready;X&&z(X.then)&&X.then(()=>this.refresh(),()=>this.refresh())}refresh(){const X=this.#y()&&!this.#m();X&&!this.#r?(this.#k(),this.#p()):!X&&this.#r&&(this.#u(),this.#f())}#m(){const X=this.#n;let ee=X&&X.parentNode;for(this.#s&&ee===this.#s&&(ee=ee.parentNode);ee&&ee.nodeType===1;){if(z(ee.hasAttribute)&&ee.hasAttribute(c))return!0;ee=ee.parentNode}return!1}#w(){const X=this.#o;if(!X||!z(X.matchMedia))return!1;try{return!!X.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}#p(){this.#f(),z(this.#o.setTimeout)&&(this.#w()||(this.#c=this.#o.setTimeout(()=>{if(this.#c=null,!this.#y()||this.#m()){this.#u();return}this.#l=(this.#l+1)%q.length,this.#u(),this.#k(),this.#p()},S)))}#f(){this.#c!==null&&z(this.#o.clearTimeout)&&this.#o.clearTimeout(this.#c),this.#c=null}#y(){const X=this.#e.licence;return!!(X&&z(X.watermark)&&X.watermark())}#v(){const X=this.#n;if(!X||!z(X.getBoundingClientRect)||!X.parentNode||!X.parentNode.children)return null;const ee=X.parentNode,x=X.getBoundingClientRect();if(this.#d){const v=this.#d();if(v&&(v.width>0||v.height>0)){const e=Math.max(x.top,v.top);return{top:e,bottom:Math.max(e,Math.min(x.bottom,v.bottom)),layerTop:x.top,layerBottom:x.bottom}}return null}const K=v=>{const e=Array.from(ee.children).find(o=>o.classList&&z(o.classList.contains)&&o.classList.contains(v));if(!e||!z(e.getBoundingClientRect))return null;const n=e.getBoundingClientRect();return n.width>0||n.height>0?n:null},Y=K(i.header),u=K(i.stickyTop),j=K(i.stickyBottom),B=K(i.statusBar),Z=Math.max(x.top,Y?Y.bottom:-1/0,u?u.bottom:-1/0),le=Math.min(x.bottom,j?j.top:1/0,B?B.top:1/0);return{top:Z,bottom:Math.max(Z,le),layerTop:x.top,layerBottom:x.bottom}}#b(){const X=this.#r;if(!X||!z(X.getBoundingClientRect))return;const ee=this.#v();if(!ee)return;const x=q[this.#l],K=X.getBoundingClientRect().height,Y=ee.bottom-ee.top,B=(x==="tl"||x==="tr")&&Y<K*2?x==="tl"?"bl":"br":x;B!==x&&(X.classList.remove(`${W}--${x}`),X.classList.add(`${W}--${B}`)),B==="tl"||B==="tr"?(X.style.top=`${Math.max(0,ee.top-ee.layerTop)}px`,X.style.bottom=""):(X.style.bottom=`${Math.max(0,ee.layerBottom-ee.bottom)}px`,X.style.top="")}#k(){const X=this.#e.messages&&z(this.#e.messages.t)?this.#e.messages:$,ee=E(this.#t,"a",{class:`${W}__link`,text:X.t("licence.watermark"),attrs:{href:A,target:"_blank",rel:"noopener noreferrer"}}),x=E(this.#t,"span",{class:`${W}__free`,text:X.t("licence.watermark.free")});this.#r=E(this.#t,"div",{class:`${W} ${W}--${q[this.#l]}`,attrs:{role:"note",title:"This grid is unlicensed for this domain. Visit latticegrid.dev for a licence."},children:[ee,x]}),this.#a.push(F(this.#r,"pointerdown",Y=>{z(Y.stopPropagation)&&Y.stopPropagation()})),this.#n&&z(this.#n.appendChild)&&this.#n.appendChild(this.#r),this.#b();const K=this.#o&&this.#o.ResizeObserver;if(z(K)){this.#i=new K(()=>{this.#r&&this.#b()}),z(this.#i.observe)&&this.#n&&this.#i.observe(this.#n);const Y=this.#g;Y&&z(this.#i.observe)&&this.#i.observe(Y)}typeof queueMicrotask=="function"&&!this.#h&&(this.#h=!0,queueMicrotask(()=>{this.#h=!1,this.#r&&this.#m()&&(this.#u(),this.#f())}))}#u(){this.#i&&(z(this.#i.disconnect)&&this.#i.disconnect(),this.#i=null),this.#r&&z(this.#r.remove)&&this.#r.remove(),this.#r=null}destroy(){this.#f(),this.#s&&z(this.#s.removeAttribute)&&this.#s.removeAttribute(c);for(const X of this.#a)X();this.#a=[],this.#u()}}function se(ue={},X=void 0){const ee=globalThis[d],x=!ue.licence&&X&&z(X.querySelector)?X.querySelector('meta[name="lattice-license"]')?.getAttribute("content"):null,K=ue.licence||x;return K&&f(K),{licence:{watermark:()=>L(),get ready(){return ee?ee.verify():Promise.resolve()}},on:(Y,u)=>Y==="licence:changed"&&ee?ee.onSettled(()=>u()):()=>{}}}function fe(ue,X){return()=>{let ee=1/0,x=-1/0,K=0;for(const Y of ue.querySelectorAll(X)){const u=Y.getBoundingClientRect();u.width===0&&u.height===0||(ee=Math.min(ee,u.top),x=Math.max(x,u.bottom),K=Math.max(K,u.width))}return ee===1/0?null:{top:ee,bottom:x,width:K,height:x-ee}}}function ke(ue,X={},ee=null){const x=ue&&ue.ownerDocument;if(!x||!z(x.createElement))return{destroy(){},refresh(){}};const K=x.defaultView||void 0,Y=se(X,x),u=typeof ee=="string"?fe(ue,ee):ee;let j=null,B=null,Z=null,le=!1;const v=()=>{if(!x.getElementById(Q)&&x.head){const o=x.createElement("style");o.id=Q,o.textContent=J,x.head.appendChild(o)}K&&z(K.getComputedStyle)&&K.getComputedStyle(ue).position==="static"&&(ue.style.position="relative"),j=x.createElement("div"),j.className=k,ue.appendChild(j),B=new H({grid:Y,document:x,element:j,window:K,owner:ue,area:u}),B.mount(),K&&z(K.MutationObserver)&&(Z=new K.MutationObserver(()=>{!le&&j&&j.parentNode!==ue&&ue.appendChild(j)}),Z.observe(ue,{childList:!0}))},e=()=>{le||(B?B.refresh():Y.licence.watermark()&&v())};e();const n=Y.on("licence:changed",e);return Y.licence.ready,{refresh:e,destroy(){le||(le=!0,n(),Z&&Z.disconnect(),B&&B.destroy(),j&&j.parentNode&&j.parentNode.removeChild(j))}}}const ge=H}),Re("packages/modules/scheduler/index.js",function(s,te){"use strict";Object.defineProperty(s,"SCHEDULER_EVENTS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(s,"createScheduler",{enumerable:!0,get:function(){return o}}),Object.defineProperty(s,"schedulerFromGantt",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"schedulerFromRows",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"schedulerFromCalendar",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return a}});const $e=te("packages/core/src/internal/predicates.js"),z=$e.isObject,N=$e.isFunction,U=te("packages/core/src/internal/warn.js").warnOnce,L=te("packages/core/src/internal/merge.js").mergeRow,$=te("packages/core/src/internal/paths.js").setPath,E=te("packages/modules/scheduler/model.js"),F=E.resolveContext,W=E.accessorFor,q=te("packages/modules/gantt/zoom.js").resolveZoomPreset,i=te("packages/modules/gantt/workload-groups.js").normalizeGroupBy,c=te("packages/modules/shared/emitter.js").Emitter,Q=te("packages/modules/scheduler/styles.js").NS,J=te("packages/modules/scheduler/view.js"),H=J.render,se=J.layout,fe=J.syncGrid,ke=J.mountGrid,ge=J.toggleGroup,ue=J.renderTimeline,X=te("packages/modules/scheduler/export.js"),ee=X.toSVG,x=X.toPNG,K=X.print,u=te("packages/modules/scheduler/edit.js").createSchedulerEdit,B=te("packages/modules/scheduler/data.js").makeSchedulerData,le=te("packages/modules/scheduler/divider.js").applyResourceWidth,e=te("packages/dom/src/watermark.js").mountViewWatermark,n=Object.freeze(["zoom:change","change","beforeEventChange","eventChange:cancelled","event:change"]);function o(y,w={}){const P=z(w)?w:{},G=F(P),re=new c("scheduler"),Se=y&&y.ownerDocument||typeof globalThis<"u"&&globalThis.document||null,be=new Map,Oe=new Map;let Ae=!1,me=!1;const Ee=W(G.resourceKey),M=W(G.eventKey),h=W(G.fields.resourceId),ae=()=>{be.clear();for(const m of G.resources)be.set(Ee(m),m)},ye=()=>{Oe.clear();for(const m of G.events)Oe.set(M(m),m)},t={el:y||null,doc:Se,ctx:G,config:P,emitter:re,wired:!1,rowKey:G.resourceKey,eventKey:G.eventKey,resources:[],placement:{byResource:new Map,unscheduled:[],keys:new Map},span:null,ticks:[],totalWidth:0,totalHeight:0,pxPerDay:G.zoom.px,anchorDay:null,workload:null,grid:null,gridHost:null,timeline:null,canvas:null,headView:null,headInner:null,live:null,_listeners:null,_timelineScroll:null,_gridOff:null,_gridKeys:null,_gridGroupOff:null,_syncing:!1,groupColId:null,displayRows:null,collapsedGroups:new Set,focusKey:null,tip:null,tipArrow:null,model:{startDay:null,endDay:null,pxPerDay:G.zoom.px,ticks:[],unscheduled:[]},fire(m,b){re.emit(m,b)}},T=()=>{if(t.resources=[...be.values()],t.resources.length===0&&G.events.length){const m=new Set;for(const b of G.events){const g=h(b);if(g==null||g===""||m.has(g))continue;m.add(g);const D={[G.resourceKey]:g,name:g};be.set(g,D),t.resources.push(D)}}return G.resources=t.resources,G.events=[...Oe.values()],fe(t),se(t),t.model.startDay=t.span?t.span.startDay:null,t.model.endDay=t.span?t.span.endDay:null,t.model.pxPerDay=t.pxPerDay,t.model.ticks=t.ticks,t.model.unscheduled=t.placement.unscheduled,t};t.rows={apply(m={}){Ae=!0;for(const b of m.add||[])be.set(Ee(b),b);for(const b of m.update||[]){const g=Ee(b);be.set(g,L(be.get(g),b))}for(const b of m.remove||[])be.delete(b);T()},forEach(m){for(const[b,g]of be)m(g,b)},get(m){return be.get(m)},get count(){return be.size}},t.events={apply(m={}){me=!0;for(const b of m.add||[])Oe.set(M(b),b);for(const b of m.update||[]){const g=M(b);Oe.set(g,L(Oe.get(g),b))}for(const b of m.remove||[])Oe.delete(b);T()},forEach(m){for(const[b,g]of Oe)m(g,b)},get(m){return Oe.get(m)},get count(){return Oe.size}},t.edit=u(t),t.undo=m=>t.edit.undo(m),t.redo=m=>t.edit.redo(m),t.canUndo=()=>t.edit.canUndo(),t.canRedo=()=>t.edit.canRedo(),t.refresh=()=>(Ae||ae(),me||ye(),T()),t.setEvents=m=>{me=!0,Oe.clear();for(const b of Array.isArray(m)?m:[])Oe.set(M(b),b);return T()},t.setZoom=m=>{const b=t.span&&t.timeline?t.span.startDay+t.timeline.scrollLeft/t.pxPerDay:null;return G.fit=m==="fit",G.zoom=q(G.fit?"day":m,G.zoom.level||"day"),G.zoomName=G.fit?"fit":G.zoom.level,se(t),b!=null&&t.timeline&&(t.timeline.scrollLeft=Math.max(0,(b-t.span.startDay)*t.pxPerDay)),t.model.startDay=t.span?t.span.startDay:null,t.model.endDay=t.span?t.span.endDay:null,t.model.pxPerDay=t.pxPerDay,t.model.ticks=t.ticks,t.fire("zoom:change",{level:G.fit?"fit":G.zoom.level,px:G.zoom.px}),t},t.getZoom=()=>({level:t.ctx.fit?"fit":t.ctx.zoom.level,px:t.ctx.zoom.px}),t.toSVG=m=>ee(t,m||{}),t.toPNG=m=>x(t,m||{}),t.print=m=>K(t,m||{}),t.reassign=(m,b)=>{const g=Oe.get(m);if(!g)return!1;const D=h(g);if(String(D)===String(b))return!1;const V={...g};return $(V,G.fields.resourceId,b),Oe.set(m,V),T(),t.fire("change",{id:m,kind:"reassign",resource:{from:D,to:b},row:V}),!0},t.getState=()=>({version:1,zoom:t.ctx.fit?"fit":t.ctx.zoom.level,scroll:{left:t.timeline?t.timeline.scrollLeft:0,top:t.timeline?t.timeline.scrollTop:0},resourceWidth:t.ctx.resourceWidth}),t.setState=m=>{const b=z(m)?m:{};return(typeof b.zoom=="string"||typeof b.zoom=="number")&&t.setZoom(b.zoom),b.scroll&&t.timeline&&(Number.isFinite(b.scroll.left)&&(t.timeline.scrollLeft=b.scroll.left),Number.isFinite(b.scroll.top)&&(t.timeline.scrollTop=b.scroll.top),ue(t)),typeof b.resourceWidth=="number"&&Number.isFinite(b.resourceWidth)&&b.resourceWidth>0&&le(t,b.resourceWidth),t},t.setResourceWidth=m=>(typeof m!="number"||!Number.isFinite(m)||m<=0||le(t,m),t),t.setGroupBy=m=>{if(G.groupBy=i(m),t.collapsedGroups.clear(),t.el){if(t.grid&&N(t.grid.destroy))try{t.grid.destroy()}catch{}t.grid=null,t.groupColId=null,ke(t)}return T()},t.setSearch=m=>(G.search=String(m||"").trim(),T()),t.setResourceFilter=m=>(G.resourceFilter=N(m)?m:null,T()),t.setEventFilter=m=>(G.eventFilter=N(m)?m:null,T()),t.toggleGroup=m=>{const b=(t.displayRows||[]).find(g=>g.type==="group"&&g.value===m);return b&&ge(t,b),t},t.on=(m,b)=>(n.includes(m)||U(`scheduler:event:${m}`,`"${m}" is not a scheduler event; expected one of ${n.join(", ")}.`),re.on(m,b)),t.off=(m,b)=>re.off(m,b);let I=null;return t.destroy=()=>{if(I&&(I(),I=null),t._pinchOff){try{t._pinchOff()}catch{}t._pinchOff=null}if(t._editDetach){try{t._editDetach()}catch{}t._editDetach=null}if(t._gridOff){try{t._gridOff()}catch{}t._gridOff=null}if(t._gridGroupOff){try{t._gridGroupOff()}catch{}t._gridGroupOff=null}if(t._dividerOff){try{t._dividerOff()}catch{}t._dividerOff=null}if(t.divider=null,t.grid&&N(t.grid.destroy))try{t.grid.destroy()}catch{}t.grid=null,t._timelineScroll&&t._timelineScroll.target&&(t._timelineScroll.target.removeEventListener("scroll",t._timelineScroll.fn),t._timelineScroll=null);const m=t.el;if(m){for(;m.firstChild;)m.removeChild(m.firstChild);if(m.classList.remove(Q),m.classList.remove("lattice-tokens"),m.removeAttribute("role"),m.removeAttribute("aria-label"),m.__latticeScheduler===t&&(m.__latticeScheduler=null),t._listeners){for(const b of t._listeners)m.removeEventListener(b.type,b.fn);t._listeners=null}}t.wired=!1,t.edit&&t.edit.clearHistory(),be.clear(),Oe.clear(),t.resources=[],G.resources=[],G.events=[],t.placement={byResource:new Map,unscheduled:[],keys:new Map},t.span=null,t.ticks=[],t.totalWidth=0,t.totalHeight=0,t.displayRows=null,t.groupColId=null,t.collapsedGroups.clear(),t.focusKey=null,t.tip=null,t.tipArrow=null,t.workload=null,t.model={startDay:null,endDay:null,pxPerDay:G.zoom.px,ticks:[],unscheduled:[]},re.clear()},y&&(y.__latticeScheduler=t),ae(),ye(),T(),y&&H(t),y&&(I=e(y,P,`.${Q}__body`).destroy),t}const{schedulerFromGantt:p,schedulerFromRows:l,schedulerFromCalendar:_}=B(o),a=o});var lt=ht("packages/modules/scheduler/index.js");typeof module=="object"&&module.exports?module.exports=lt:typeof define=="function"&&define.amd?define(function(){return lt}):yt.LatticeGridScheduler=lt})(typeof globalThis<"u"?globalThis:this);
|
|
264
|
+
`;class H{#e;#t;#n;#r=null;#a=[];#o;#l=0;#c=null;#s=null;#h=!1;#i=null;#g=null;#d=null;constructor(X){this.#s=X.owner||null;const ee=X.area;ee&&!z(ee)&&z(ee.getBoundingClientRect)&&(this.#g=ee),z(ee)?this.#d=ee:ee&&z(ee.getBoundingClientRect)&&(this.#d=()=>ee.getBoundingClientRect()),this.#s&&z(this.#s.setAttribute)&&this.#s.setAttribute(c,""),this.#e=X.grid,this.#t=X.document,this.#n=X.element,this.#o=X.window||(typeof globalThis>"u"?{}:globalThis)}mount(){this.refresh(),z(this.#e.on)&&this.#a.push(this.#e.on("licence:changed",()=>this.refresh()));const X=this.#e.licence&&this.#e.licence.ready;X&&z(X.then)&&X.then(()=>this.refresh(),()=>this.refresh())}refresh(){const X=this.#y()&&!this.#m();X&&!this.#r?(this.#k(),this.#p()):!X&&this.#r&&(this.#u(),this.#f())}#m(){const X=this.#n;let ee=X&&X.parentNode;for(this.#s&&ee===this.#s&&(ee=ee.parentNode);ee&&ee.nodeType===1;){if(z(ee.hasAttribute)&&ee.hasAttribute(c))return!0;ee=ee.parentNode}return!1}#w(){const X=this.#o;if(!X||!z(X.matchMedia))return!1;try{return!!X.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}#p(){this.#f(),z(this.#o.setTimeout)&&(this.#w()||(this.#c=this.#o.setTimeout(()=>{if(this.#c=null,!this.#y()||this.#m()){this.#u();return}this.#l=(this.#l+1)%q.length,this.#u(),this.#k(),this.#p()},S)))}#f(){this.#c!==null&&z(this.#o.clearTimeout)&&this.#o.clearTimeout(this.#c),this.#c=null}#y(){const X=this.#e.licence;return!!(X&&z(X.watermark)&&X.watermark())}#v(){const X=this.#n;if(!X||!z(X.getBoundingClientRect)||!X.parentNode||!X.parentNode.children)return null;const ee=X.parentNode,A=X.getBoundingClientRect();if(this.#d){const v=this.#d();if(v&&(v.width>0||v.height>0)){const e=Math.max(A.top,v.top);return{top:e,bottom:Math.max(e,Math.min(A.bottom,v.bottom)),layerTop:A.top,layerBottom:A.bottom}}return null}const K=v=>{const e=Array.from(ee.children).find(o=>o.classList&&z(o.classList.contains)&&o.classList.contains(v));if(!e||!z(e.getBoundingClientRect))return null;const n=e.getBoundingClientRect();return n.width>0||n.height>0?n:null},Y=K(i.header),u=K(i.stickyTop),j=K(i.stickyBottom),B=K(i.statusBar),Z=Math.max(A.top,Y?Y.bottom:-1/0,u?u.bottom:-1/0),le=Math.min(A.bottom,j?j.top:1/0,B?B.top:1/0);return{top:Z,bottom:Math.max(Z,le),layerTop:A.top,layerBottom:A.bottom}}#b(){const X=this.#r;if(!X||!z(X.getBoundingClientRect))return;const ee=this.#v();if(!ee)return;const A=q[this.#l],K=X.getBoundingClientRect().height,Y=ee.bottom-ee.top,B=(A==="tl"||A==="tr")&&Y<K*2?A==="tl"?"bl":"br":A;B!==A&&(X.classList.remove(`${W}--${A}`),X.classList.add(`${W}--${B}`)),B==="tl"||B==="tr"?(X.style.top=`${Math.max(0,ee.top-ee.layerTop)}px`,X.style.bottom=""):(X.style.bottom=`${Math.max(0,ee.layerBottom-ee.bottom)}px`,X.style.top="")}#k(){const X=this.#e.messages&&z(this.#e.messages.t)?this.#e.messages:$,ee=E(this.#t,"a",{class:`${W}__link`,text:X.t("licence.watermark"),attrs:{href:P,target:"_blank",rel:"noopener noreferrer"}}),A=E(this.#t,"span",{class:`${W}__free`,text:X.t("licence.watermark.free")});this.#r=E(this.#t,"div",{class:`${W} ${W}--${q[this.#l]}`,attrs:{role:"note",title:"This grid is unlicensed for this domain. Visit latticegrid.dev for a licence."},children:[ee,A]}),this.#a.push(F(this.#r,"pointerdown",Y=>{z(Y.stopPropagation)&&Y.stopPropagation()})),this.#n&&z(this.#n.appendChild)&&this.#n.appendChild(this.#r),this.#b();const K=this.#o&&this.#o.ResizeObserver;if(z(K)){this.#i=new K(()=>{this.#r&&this.#b()}),z(this.#i.observe)&&this.#n&&this.#i.observe(this.#n);const Y=this.#g;Y&&z(this.#i.observe)&&this.#i.observe(Y)}typeof queueMicrotask=="function"&&!this.#h&&(this.#h=!0,queueMicrotask(()=>{this.#h=!1,this.#r&&this.#m()&&(this.#u(),this.#f())}))}#u(){this.#i&&(z(this.#i.disconnect)&&this.#i.disconnect(),this.#i=null),this.#r&&z(this.#r.remove)&&this.#r.remove(),this.#r=null}destroy(){this.#f(),this.#s&&z(this.#s.removeAttribute)&&this.#s.removeAttribute(c);for(const X of this.#a)X();this.#a=[],this.#u()}}function se(ue={},X=void 0){const ee=globalThis[d],A=!ue.licence&&X&&z(X.querySelector)?X.querySelector('meta[name="lattice-license"]')?.getAttribute("content"):null,K=ue.licence||A;return K&&f(K),{licence:{watermark:()=>L(),get ready(){return ee?ee.verify():Promise.resolve()}},on:(Y,u)=>Y==="licence:changed"&&ee?ee.onSettled(()=>u()):()=>{}}}function fe(ue,X){return()=>{let ee=1/0,A=-1/0,K=0;for(const Y of ue.querySelectorAll(X)){const u=Y.getBoundingClientRect();u.width===0&&u.height===0||(ee=Math.min(ee,u.top),A=Math.max(A,u.bottom),K=Math.max(K,u.width))}return ee===1/0?null:{top:ee,bottom:A,width:K,height:A-ee}}}function ke(ue,X={},ee=null){const A=ue&&ue.ownerDocument;if(!A||!z(A.createElement))return{destroy(){},refresh(){}};const K=A.defaultView||void 0,Y=se(X,A),u=typeof ee=="string"?fe(ue,ee):ee;let j=null,B=null,Z=null,le=!1;const v=()=>{if(!A.getElementById(Q)&&A.head){const o=A.createElement("style");o.id=Q,o.textContent=J,A.head.appendChild(o)}K&&z(K.getComputedStyle)&&K.getComputedStyle(ue).position==="static"&&(ue.style.position="relative"),j=A.createElement("div"),j.className=k,ue.appendChild(j),B=new H({grid:Y,document:A,element:j,window:K,owner:ue,area:u}),B.mount(),K&&z(K.MutationObserver)&&(Z=new K.MutationObserver(()=>{!le&&j&&j.parentNode!==ue&&ue.appendChild(j)}),Z.observe(ue,{childList:!0}))},e=()=>{le||(B?B.refresh():Y.licence.watermark()&&v())};e();const n=Y.on("licence:changed",e);return Y.licence.ready,{refresh:e,destroy(){le||(le=!0,n(),Z&&Z.disconnect(),B&&B.destroy(),j&&j.parentNode&&j.parentNode.removeChild(j))}}}const ge=H}),Re("packages/modules/scheduler/index.js",function(s,te){"use strict";Object.defineProperty(s,"SCHEDULER_EVENTS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(s,"createScheduler",{enumerable:!0,get:function(){return o}}),Object.defineProperty(s,"schedulerFromGantt",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"schedulerFromRows",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"schedulerFromCalendar",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return a}});const $e=te("packages/core/src/internal/predicates.js"),z=$e.isObject,N=$e.isFunction,U=te("packages/core/src/internal/warn.js").warnOnce,L=te("packages/core/src/internal/merge.js").mergeRow,$=te("packages/core/src/internal/paths.js").setPath,E=te("packages/modules/scheduler/model.js"),F=E.resolveContext,W=E.accessorFor,q=te("packages/modules/gantt/zoom.js").resolveZoomPreset,i=te("packages/modules/gantt/workload-groups.js").normalizeGroupBy,c=te("packages/modules/shared/emitter.js").Emitter,Q=te("packages/modules/scheduler/styles.js").NS,J=te("packages/modules/scheduler/view.js"),H=J.render,se=J.layout,fe=J.syncGrid,ke=J.mountGrid,ge=J.toggleGroup,ue=J.renderTimeline,X=te("packages/modules/scheduler/export.js"),ee=X.toSVG,A=X.toPNG,K=X.print,u=te("packages/modules/scheduler/edit.js").createSchedulerEdit,B=te("packages/modules/scheduler/data.js").makeSchedulerData,le=te("packages/modules/scheduler/divider.js").applyResourceWidth,e=te("packages/dom/src/watermark.js").mountViewWatermark,n=Object.freeze(["zoom:change","change","beforeEventChange","eventChange:cancelled","event:change"]);function o(y,w={}){const x=z(w)?w:{},G=F(x),ne=new c("scheduler"),ve=y&&y.ownerDocument||typeof globalThis<"u"&&globalThis.document||null,pe=new Map,Oe=new Map;let Ae=!1,me=!1;const Ee=W(G.resourceKey),M=W(G.eventKey),h=W(G.fields.resourceId),ae=()=>{pe.clear();for(const m of G.resources)pe.set(Ee(m),m)},be=()=>{Oe.clear();for(const m of G.events)Oe.set(M(m),m)},t={el:y||null,doc:ve,ctx:G,config:x,emitter:ne,wired:!1,rowKey:G.resourceKey,eventKey:G.eventKey,resources:[],placement:{byResource:new Map,unscheduled:[],keys:new Map},span:null,ticks:[],totalWidth:0,totalHeight:0,pxPerDay:G.zoom.px,anchorDay:null,workload:null,grid:null,gridHost:null,timeline:null,canvas:null,headView:null,headInner:null,live:null,_listeners:null,_timelineScroll:null,_gridOff:null,_gridKeys:null,_gridGroupOff:null,_syncing:!1,groupColId:null,displayRows:null,collapsedGroups:new Set,focusKey:null,tip:null,tipArrow:null,model:{startDay:null,endDay:null,pxPerDay:G.zoom.px,ticks:[],unscheduled:[]},fire(m,b){ne.emit(m,b)}},T=()=>{if(t.resources=[...pe.values()],t.resources.length===0&&G.events.length){const m=new Set;for(const b of G.events){const g=h(b);if(g==null||g===""||m.has(g))continue;m.add(g);const D={[G.resourceKey]:g,name:g};pe.set(g,D),t.resources.push(D)}}return G.resources=t.resources,G.events=[...Oe.values()],fe(t),se(t),t.model.startDay=t.span?t.span.startDay:null,t.model.endDay=t.span?t.span.endDay:null,t.model.pxPerDay=t.pxPerDay,t.model.ticks=t.ticks,t.model.unscheduled=t.placement.unscheduled,t};t.rows={apply(m={}){Ae=!0;for(const b of m.add||[])pe.set(Ee(b),b);for(const b of m.update||[]){const g=Ee(b);pe.set(g,L(pe.get(g),b))}for(const b of m.remove||[])pe.delete(b);T()},forEach(m){for(const[b,g]of pe)m(g,b)},get(m){return pe.get(m)},get count(){return pe.size}},t.events={apply(m={}){me=!0;for(const b of m.add||[])Oe.set(M(b),b);for(const b of m.update||[]){const g=M(b);Oe.set(g,L(Oe.get(g),b))}for(const b of m.remove||[])Oe.delete(b);T()},forEach(m){for(const[b,g]of Oe)m(g,b)},get(m){return Oe.get(m)},get count(){return Oe.size}},t.edit=u(t),t.undo=m=>t.edit.undo(m),t.redo=m=>t.edit.redo(m),t.canUndo=()=>t.edit.canUndo(),t.canRedo=()=>t.edit.canRedo(),t.refresh=()=>(Ae||ae(),me||be(),T()),t.setEvents=m=>{me=!0,Oe.clear();for(const b of Array.isArray(m)?m:[])Oe.set(M(b),b);return T()},t.setZoom=m=>{const b=t.span&&t.timeline?t.span.startDay+t.timeline.scrollLeft/t.pxPerDay:null;return G.fit=m==="fit",G.zoom=q(G.fit?"day":m,G.zoom.level||"day"),G.zoomName=G.fit?"fit":G.zoom.level,se(t),b!=null&&t.timeline&&(t.timeline.scrollLeft=Math.max(0,(b-t.span.startDay)*t.pxPerDay)),t.model.startDay=t.span?t.span.startDay:null,t.model.endDay=t.span?t.span.endDay:null,t.model.pxPerDay=t.pxPerDay,t.model.ticks=t.ticks,t.fire("zoom:change",{level:G.fit?"fit":G.zoom.level,px:G.zoom.px}),t},t.getZoom=()=>({level:t.ctx.fit?"fit":t.ctx.zoom.level,px:t.ctx.zoom.px}),t.toSVG=m=>ee(t,m||{}),t.toPNG=m=>A(t,m||{}),t.print=m=>K(t,m||{}),t.reassign=(m,b)=>{const g=Oe.get(m);if(!g)return!1;const D=h(g);if(String(D)===String(b))return!1;const V={...g};return $(V,G.fields.resourceId,b),Oe.set(m,V),T(),t.fire("change",{id:m,kind:"reassign",resource:{from:D,to:b},row:V}),!0},t.getState=()=>({version:1,zoom:t.ctx.fit?"fit":t.ctx.zoom.level,scroll:{left:t.timeline?t.timeline.scrollLeft:0,top:t.timeline?t.timeline.scrollTop:0},resourceWidth:t.ctx.resourceWidth}),t.setState=m=>{const b=z(m)?m:{};return(typeof b.zoom=="string"||typeof b.zoom=="number")&&t.setZoom(b.zoom),b.scroll&&t.timeline&&(Number.isFinite(b.scroll.left)&&(t.timeline.scrollLeft=b.scroll.left),Number.isFinite(b.scroll.top)&&(t.timeline.scrollTop=b.scroll.top),ue(t)),typeof b.resourceWidth=="number"&&Number.isFinite(b.resourceWidth)&&b.resourceWidth>0&&le(t,b.resourceWidth),t},t.setResourceWidth=m=>(typeof m!="number"||!Number.isFinite(m)||m<=0||le(t,m),t),t.setGroupBy=m=>{if(G.groupBy=i(m),t.collapsedGroups.clear(),t.el){if(t.grid&&N(t.grid.destroy))try{t.grid.destroy()}catch{}t.grid=null,t.groupColId=null,ke(t)}return T()},t.setSearch=m=>(G.search=String(m||"").trim(),T()),t.setResourceFilter=m=>(G.resourceFilter=N(m)?m:null,T()),t.setEventFilter=m=>(G.eventFilter=N(m)?m:null,T()),t.toggleGroup=m=>{const b=(t.displayRows||[]).find(g=>g.type==="group"&&g.value===m);return b&&ge(t,b),t},t.on=(m,b)=>(n.includes(m)||U(`scheduler:event:${m}`,`"${m}" is not a scheduler event; expected one of ${n.join(", ")}.`),ne.on(m,b)),t.off=(m,b)=>ne.off(m,b);let I=null;return t.destroy=()=>{if(I&&(I(),I=null),t._pinchOff){try{t._pinchOff()}catch{}t._pinchOff=null}if(t._editDetach){try{t._editDetach()}catch{}t._editDetach=null}if(t._gridOff){try{t._gridOff()}catch{}t._gridOff=null}if(t._gridGroupOff){try{t._gridGroupOff()}catch{}t._gridGroupOff=null}if(t._dividerOff){try{t._dividerOff()}catch{}t._dividerOff=null}if(t.divider=null,t.grid&&N(t.grid.destroy))try{t.grid.destroy()}catch{}t.grid=null,t._timelineScroll&&t._timelineScroll.target&&(t._timelineScroll.target.removeEventListener("scroll",t._timelineScroll.fn),t._timelineScroll=null);const m=t.el;if(m){for(;m.firstChild;)m.removeChild(m.firstChild);if(m.classList.remove(Q),m.classList.remove("lattice-tokens"),m.removeAttribute("role"),m.removeAttribute("aria-label"),m.__latticeScheduler===t&&(m.__latticeScheduler=null),t._listeners){for(const b of t._listeners)m.removeEventListener(b.type,b.fn);t._listeners=null}}t.wired=!1,t.edit&&t.edit.clearHistory(),pe.clear(),Oe.clear(),t.resources=[],G.resources=[],G.events=[],t.placement={byResource:new Map,unscheduled:[],keys:new Map},t.span=null,t.ticks=[],t.totalWidth=0,t.totalHeight=0,t.displayRows=null,t.groupColId=null,t.collapsedGroups.clear(),t.focusKey=null,t.tip=null,t.tipArrow=null,t.workload=null,t.model={startDay:null,endDay:null,pxPerDay:G.zoom.px,ticks:[],unscheduled:[]},ne.clear()},y&&(y.__latticeScheduler=t),ae(),be(),T(),y&&H(t),y&&(I=e(y,x,`.${Q}__body`).destroy),t}const{schedulerFromGantt:p,schedulerFromRows:l,schedulerFromCalendar:_}=B(o),a=o});var lt=ht("packages/modules/scheduler/index.js");typeof module=="object"&&module.exports?module.exports=lt:typeof define=="function"&&define.amd?define(function(){return lt}):yt.LatticeGridScheduler=lt})(typeof globalThis<"u"?globalThis:this);
|
|
265
265
|
|
|
266
266
|
//# sourceMappingURL=scheduler.min.js.map
|