@bino-bi/bn-template-engine 1.0.0-next.28 → 1.0.0-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-132ad556.entry.js +1 -0
- package/dist/bn-template-engine/p-17d71782.entry.js +1 -0
- package/dist/bn-template-engine/p-40ba7f43.entry.js +1 -0
- package/dist/bn-template-engine/p-467871f3.entry.js +1 -0
- package/dist/bn-template-engine/p-64803a42.entry.js +1 -0
- package/dist/bn-template-engine/p-B8AjeKja.js +1 -0
- package/dist/bn-template-engine/p-CCZcKl0Q.js +2 -0
- package/dist/bn-template-engine/p-CrT83eO4.js +1 -0
- package/dist/bn-template-engine/p-D_DzKxRV.js +1 -0
- package/dist/bn-template-engine/p-Z2rUaSh_.js +1 -0
- package/dist/bn-template-engine/p-c41c0a1b.entry.js +1 -0
- package/dist/bn-template-engine/p-yc69rwuH.js +1 -0
- package/dist/cjs/{bn-asset_28.cjs.entry.js → bn-annotation-layer_30.cjs.entry.js} +27566 -26774
- package/dist/cjs/bn-grid.cjs.entry.js +11 -63
- package/dist/cjs/bn-image.cjs.entry.js +5 -6
- package/dist/cjs/bn-internationalization.cjs.entry.js +11 -7
- package/dist/cjs/bn-ruleset.cjs.entry.js +7 -8
- package/dist/cjs/bn-template-engine.cjs.js +2 -2
- package/dist/cjs/bn-text.cjs.entry.js +18 -18
- package/dist/cjs/{diagnostics-Cq-qDtXq.js → diagnostics-C4Ggts3w.js} +50 -2
- package/dist/cjs/{index-C1Z9vO7z.js → index-DGis1BzT.js} +0 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{withBodyObserver-CaPUjuC5.js → withBodyObserver-BK4idxqG.js} +2 -2
- package/dist/cjs/{context-protocol-C0rKepqu.js → withHasError-CqvcS23z.js} +462 -14
- package/dist/cjs/{withStyled-vSfogp9J.js → withStyled-70D4Isgt.js} +22 -35
- package/dist/cjs/{sanitizeHtml-Yx1xn6i_.js → withTranslation-C6Pye2CM.js} +148 -129
- package/dist/collection/collection-manifest.json +11 -11
- package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.css +24 -0
- package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.js +430 -0
- package/dist/collection/components/bn-annotation-layer/utils/marks.js +161 -0
- package/dist/collection/components/bn-annotation-layer/utils/matchPoint.js +25 -0
- package/dist/collection/components/bn-annotation-list/bn-annotation-list.css +46 -0
- package/dist/collection/components/bn-annotation-list/bn-annotation-list.js +112 -0
- package/dist/collection/components/bn-asset/bn-asset.js +1 -1
- package/dist/collection/components/bn-body/bn-body.js +24 -1
- package/dist/collection/components/bn-card/bn-card.js +24 -1
- package/dist/collection/components/bn-chart-bubble/{ibcs-chart-bubble.js → bn-chart-bubble-renderer/bn-chart-bubble-renderer.js} +153 -59
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +70 -13
- package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +29 -21
- package/dist/collection/components/bn-chart-bullet/{ibcs-chart-bullet.js → bn-chart-bullet-renderer/bn-chart-bullet-renderer.js} +127 -53
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +83 -20
- package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +26 -17
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +4 -4
- package/dist/collection/components/bn-chart-scatter/{ibcs-chart-scatter.js → bn-chart-scatter-renderer/bn-chart-scatter-renderer.js} +132 -53
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +69 -12
- package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +26 -14
- package/dist/collection/components/bn-chart-structure/{ibcs-chart-structure.js → bn-chart-structure-renderer/bn-chart-structure-renderer.js} +159 -66
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +115 -95
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +44 -15
- package/dist/collection/components/bn-chart-structure/utils/elements/Axis.js +1 -1
- package/dist/collection/components/bn-chart-structure/utils/elements/Bar.js +6 -2
- package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +11 -0
- package/dist/collection/components/bn-chart-structure/utils/elements/Marker.js +5 -1
- package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +4 -1
- package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +6 -2
- package/dist/collection/components/bn-chart-time/{ibcs-chart-time.js → bn-chart-time-renderer/bn-chart-time-renderer.js} +188 -150
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +140 -405
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +55 -15
- package/dist/collection/components/bn-chart-time/utils/elements/Column.js +5 -1
- package/dist/collection/components/bn-chart-time/utils/elements/Label.js +14 -0
- package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +18 -12
- package/dist/collection/components/bn-chart-time/utils/elements/Marker.js +5 -1
- package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +4 -1
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +6 -2
- package/dist/collection/components/bn-chart-time/utils/factories/ScenarioFactory.js +2 -2
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +2 -18
- package/dist/collection/components/bn-component-style/bn-component-style.js +3 -3
- package/dist/collection/components/bn-context/bn-context.js +24 -5
- package/dist/collection/components/bn-dataset/bn-dataset.js +8 -8
- package/dist/collection/components/bn-datasource/bn-datasource.js +8 -8
- package/dist/collection/components/bn-footer/bn-footer.css +1 -15
- package/dist/collection/components/bn-footer/bn-footer.js +17 -34
- package/dist/collection/components/bn-grid/bn-grid.js +38 -71
- package/dist/collection/components/bn-image/bn-image.js +21 -2
- package/dist/collection/components/bn-internationalization/bn-internationalization.js +7 -1
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +3 -32
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +3 -32
- package/dist/collection/components/bn-message/bn-message.js +20 -2
- package/dist/collection/components/bn-page/bn-page.js +22 -3
- package/dist/collection/components/bn-ruleset/bn-ruleset.js +3 -3
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +9 -9
- package/dist/collection/components/bn-table/{ibcs-table.js → bn-table-renderer/bn-table-renderer.js} +230 -83
- package/dist/collection/components/bn-table/bn-table.js +134 -157
- package/dist/collection/components/bn-table/utils/Table.js +3 -3
- package/dist/collection/components/bn-table/utils/elements/TableRow.js +1 -1
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +38 -4
- package/dist/collection/components/bn-table/utils/helper/DataQuery.js +3 -1
- package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +2 -2
- package/dist/collection/components/bn-text/bn-text.js +66 -8
- package/dist/collection/components/bn-title/{ibcs-title/ibcs-title.js → bn-title-renderer/bn-title-renderer.js} +59 -83
- package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/Title.js +2 -2
- package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/TitleDataSetFactory.js +1 -1
- package/dist/collection/components/bn-title/bn-title.js +58 -14
- package/dist/collection/components/bn-tree/bn-tree.js +30 -28
- package/dist/collection/index.js +0 -1
- package/dist/collection/schemas.js +1 -0
- package/dist/collection/stores/componentStyles.js +10 -6
- package/dist/collection/stores/createScopedStores.js +3 -1
- package/dist/collection/stores/internationalization.js +10 -6
- package/dist/collection/utils/annotations.js +66 -0
- package/dist/collection/utils/autoFit.js +2 -2
- package/dist/collection/utils/emptyState.js +1 -1
- package/dist/collection/utils/ibcsRuleSet.js +42 -0
- package/dist/collection/utils/layoutState/dataPoint.js +59 -0
- package/dist/collection/utils/layoutState/geometry.js +46 -0
- package/dist/collection/utils/layoutState/index.js +1 -0
- package/dist/collection/utils/layoutState/svgChartElements.js +113 -11
- package/dist/collection/utils/layoutTemplate.js +0 -2
- package/dist/collection/utils/scaling.js +9 -0
- package/dist/collection/utils/validate.js +0 -7
- package/dist/collection/utils/withComponentStyle.js +14 -18
- package/dist/collection/utils/withDataset.js +22 -11
- package/dist/collection/utils/withHasError.js +17 -2
- package/dist/collection/utils/withRuleSet.js +7 -7
- package/dist/collection/utils/withTranslation.js +14 -14
- package/dist/collection/utils/xy/XYFrame.js +13 -3
- package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +8 -9
- package/dist/collection/utils/xy/pointKey.js +10 -0
- package/dist/components/{ibcs-chart-bullet.d.ts → bn-annotation-layer.d.ts} +4 -4
- package/dist/components/bn-annotation-layer.js +1 -0
- package/dist/components/{ibcs-chart-scatter.d.ts → bn-annotation-list.d.ts} +4 -4
- package/dist/components/bn-annotation-list.js +1 -0
- package/dist/components/bn-asset.js +1 -1
- package/dist/components/bn-body.js +1 -1
- package/dist/components/bn-card.js +1 -1
- package/dist/components/bn-chart-bubble-renderer.d.ts +11 -0
- package/dist/components/bn-chart-bubble-renderer.js +1 -0
- package/dist/components/bn-chart-bubble.js +1 -1
- package/dist/components/bn-chart-bullet-renderer.d.ts +11 -0
- package/dist/components/bn-chart-bullet-renderer.js +1 -0
- package/dist/components/bn-chart-bullet.js +1 -1
- package/dist/components/bn-chart-scatter-renderer.d.ts +11 -0
- package/dist/components/bn-chart-scatter-renderer.js +1 -0
- package/dist/components/bn-chart-scatter.js +1 -1
- package/dist/components/bn-chart-structure-renderer.d.ts +11 -0
- package/dist/components/bn-chart-structure-renderer.js +1 -0
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/{bn-template.d.ts → bn-chart-time-renderer.d.ts} +4 -4
- package/dist/components/bn-chart-time-renderer.js +1 -0
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-component-style.js +1 -1
- package/dist/components/bn-context.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-footer.js +1 -1
- package/dist/components/bn-grid.js +1 -1
- package/dist/components/bn-image.js +1 -1
- package/dist/components/bn-internationalization.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-message.js +1 -1
- package/dist/components/bn-page.js +1 -1
- package/dist/components/bn-ruleset.js +1 -1
- package/dist/components/bn-scaling-group.js +1 -1
- package/dist/components/{ibcs-chart-bubble.d.ts → bn-table-renderer.d.ts} +4 -4
- package/dist/components/bn-table-renderer.js +1 -0
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/{editor-companion.d.ts → bn-title-renderer.d.ts} +4 -4
- package/dist/components/bn-title-renderer.js +1 -0
- package/dist/components/bn-title.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-B1nL0yOa.js +1 -0
- package/dist/components/p-B7uwck1J.js +1 -0
- package/dist/components/p-BDS_jiow.js +1 -0
- package/dist/components/p-BIIDTtcR.js +1 -0
- package/dist/components/p-BQMKgvEC.js +1 -0
- package/dist/components/p-BSV_vyqs.js +1 -0
- package/dist/components/p-BVKLCz2k.js +1 -0
- package/dist/components/p-BWBHlztH.js +1 -0
- package/dist/components/p-BXrPfAvP.js +1 -0
- package/dist/components/p-Ba9PUiBp.js +1 -0
- package/dist/components/p-BpCL2bfw.js +1 -0
- package/dist/components/p-BpsXOtoW.js +1 -0
- package/dist/components/p-Bs-YxJEt.js +1 -0
- package/dist/components/p-CGI6XIaK.js +1 -0
- package/dist/components/p-CMM8vtHW.js +1 -0
- package/dist/components/p-COqIkH1M.js +1 -0
- package/dist/components/p-CYwd_ZNM.js +1 -0
- package/dist/components/p-CkW23yp2.js +1 -0
- package/dist/components/p-CtBM3KFY.js +1 -0
- package/dist/{bn-template-engine/p-DFmSrSnf.js → components/p-CurWSJkH.js} +1 -1
- package/dist/components/p-CxPSvrcF.js +1 -0
- package/dist/components/p-D2Epww9R.js +1 -0
- package/dist/components/p-D5-dYgK_.js +1 -0
- package/dist/components/p-D6YGOYV1.js +2 -0
- package/dist/components/p-DEHnizot.js +1 -0
- package/dist/components/p-DIyUaSBg.js +1 -0
- package/dist/components/p-DPLcGhVt.js +1 -0
- package/dist/components/p-DUHp_9X-.js +1 -0
- package/dist/components/p-DYG9FH_u.js +1 -0
- package/dist/components/p-DdGnuNtc.js +1 -0
- package/dist/components/p-Dlb4ncGF.js +1 -0
- package/dist/components/p-Dm55bMs2.js +1 -0
- package/dist/components/p-Dq1AzGKX.js +1 -0
- package/dist/components/p-Dq4KMCDU.js +1 -0
- package/dist/components/p-DsOaqeTN.js +1 -0
- package/dist/components/p-Ds_BSK8v.js +1 -0
- package/dist/components/p-LZ9lAY8T.js +1 -0
- package/dist/components/p-U3zkcEJZ.js +1 -0
- package/dist/components/p-WzaayhTX.js +1 -0
- package/dist/components/p-X9hpquOX.js +1 -0
- package/dist/components/p-Xb6Ilq8u.js +1 -0
- package/dist/components/p-ey23VlID.js +1 -0
- package/dist/components/p-jbp6YiHf.js +1 -0
- package/dist/components/p-oJjMz8JF.js +1 -0
- package/dist/components/p-xhiPDAZa.js +1 -0
- package/dist/components/p-xpguaboj.js +1 -0
- package/dist/esm/{bn-asset_28.entry.js → bn-annotation-layer_30.entry.js} +24689 -23899
- package/dist/esm/bn-grid.entry.js +11 -63
- package/dist/esm/bn-image.entry.js +4 -5
- package/dist/esm/bn-internationalization.entry.js +9 -5
- package/dist/esm/bn-ruleset.entry.js +6 -7
- package/dist/esm/bn-template-engine.js +3 -3
- package/dist/esm/bn-text.entry.js +12 -12
- package/dist/esm/{diagnostics-vw6TKMiT.js → diagnostics-Cyqy1zDT.js} +48 -2
- package/dist/esm/{index-C5UYpZUU.js → index-CCZcKl0Q.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{withBodyObserver-DD_-r04o.js → withBodyObserver-JcRB9OPQ.js} +2 -2
- package/dist/esm/{context-protocol-CdTp19uA.js → withHasError-l3cMN-oP.js} +458 -14
- package/dist/esm/{withStyled-BDEyKd_H.js → withStyled-DGOiR00Q.js} +17 -29
- package/dist/esm/{sanitizeHtml-C5bFtARM.js → withTranslation-BpO8BC5B.js} +144 -126
- package/dist/schemas/axis.schema.json +52 -0
- package/dist/schemas/i18n.schema.json +31 -0
- package/dist/schemas/partof.schema.json +33 -0
- package/dist/schemas/ruleset.schema.json +59 -0
- package/dist/schemas/stack.schema.json +51 -0
- package/dist/schemas/theme.schema.json +604 -0
- package/dist/schemas/thereof.schema.json +34 -0
- package/dist/types/components/bn-annotation-layer/bn-annotation-layer.d.ts +81 -0
- package/dist/types/components/bn-annotation-layer/utils/marks.d.ts +69 -0
- package/dist/types/components/bn-annotation-layer/utils/matchPoint.d.ts +17 -0
- package/dist/types/components/bn-annotation-list/bn-annotation-list.d.ts +35 -0
- package/dist/types/components/bn-body/bn-body.d.ts +5 -0
- package/dist/types/components/bn-card/bn-card.d.ts +5 -0
- package/dist/types/components/bn-chart-bubble/bn-chart-bubble-renderer/bn-chart-bubble-renderer.d.ts +97 -0
- package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +20 -2
- package/dist/types/components/bn-chart-bullet/bn-chart-bullet-renderer/bn-chart-bullet-renderer.d.ts +81 -0
- package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +21 -3
- package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +2 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +2 -2
- package/dist/types/components/bn-chart-scatter/bn-chart-scatter-renderer/bn-chart-scatter-renderer.d.ts +85 -0
- package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +20 -2
- package/dist/types/components/bn-chart-structure/{ibcs-chart-structure.d.ts → bn-chart-structure-renderer/bn-chart-structure-renderer.d.ts} +43 -13
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +29 -17
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +7 -0
- package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +5 -0
- package/dist/types/components/bn-chart-structure/utils/elements/Marker.d.ts +1 -0
- package/dist/types/components/bn-chart-structure/utils/elements/StackedBar.d.ts +2 -1
- package/dist/types/components/bn-chart-structure/utils/model/DataPoint.d.ts +3 -0
- package/dist/types/components/bn-chart-time/{ibcs-chart-time.d.ts → bn-chart-time-renderer/bn-chart-time-renderer.d.ts} +50 -17
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +36 -66
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +7 -0
- package/dist/types/components/bn-chart-time/utils/elements/Label.d.ts +5 -0
- package/dist/types/components/bn-chart-time/utils/elements/LineSeries.d.ts +5 -1
- package/dist/types/components/bn-chart-time/utils/elements/Marker.d.ts +1 -0
- package/dist/types/components/bn-chart-time/utils/elements/StackedColumn.d.ts +2 -1
- package/dist/types/components/bn-chart-time/utils/factories/ScenarioFactory.d.ts +1 -1
- package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +3 -0
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +2 -8
- package/dist/types/components/bn-context/bn-context.d.ts +7 -1
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +2 -2
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +2 -2
- package/dist/types/components/bn-footer/bn-footer.d.ts +5 -7
- package/dist/types/components/bn-grid/bn-grid.d.ts +8 -6
- package/dist/types/components/bn-image/bn-image.d.ts +4 -0
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +0 -1
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +0 -1
- package/dist/types/components/bn-message/bn-message.d.ts +5 -0
- package/dist/types/components/bn-page/bn-page.d.ts +5 -0
- package/dist/types/components/bn-table/{ibcs-table.d.ts → bn-table-renderer/bn-table-renderer.d.ts} +49 -12
- package/dist/types/components/bn-table/bn-table.d.ts +48 -49
- package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +2 -1
- package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +3 -0
- package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +9 -2
- package/dist/types/components/bn-text/bn-text.d.ts +19 -1
- package/dist/types/components/bn-title/{ibcs-title/ibcs-title.d.ts → bn-title-renderer/bn-title-renderer.d.ts} +15 -4
- package/dist/types/components/bn-title/bn-title.d.ts +15 -3
- package/dist/types/components/bn-tree/bn-tree.d.ts +6 -2
- package/dist/types/components.d.ts +2070 -2406
- package/dist/types/context/context-protocol.d.ts +2 -0
- package/dist/types/context/scopedDb.d.ts +9 -12
- package/dist/types/index.d.ts +0 -1
- package/dist/types/schemas.d.ts +50 -0
- package/dist/types/stores/componentStyles.d.ts +8 -0
- package/dist/types/stores/createScopedStores.d.ts +1 -0
- package/dist/types/stores/internationalization.d.ts +3 -2
- package/dist/types/stores/ruleSets.d.ts +15 -3
- package/dist/types/utils/annotations.d.ts +45 -0
- package/dist/types/utils/autoFit.d.ts +2 -2
- package/dist/types/utils/emptyState.d.ts +1 -1
- package/dist/types/utils/ibcsRuleSet.d.ts +16 -0
- package/dist/types/utils/layoutState/dataPoint.d.ts +13 -0
- package/dist/types/utils/layoutState/geometry.d.ts +12 -0
- package/dist/types/utils/layoutState/index.d.ts +1 -0
- package/dist/types/utils/layoutState/svgChartElements.d.ts +9 -6
- package/dist/types/utils/layoutState/types.d.ts +29 -0
- package/dist/types/utils/model/ChartStyles.d.ts +2 -1
- package/dist/types/utils/scaling.d.ts +2 -0
- package/dist/types/utils/validate.d.ts +0 -1
- package/dist/types/utils/withComponentStyle.d.ts +4 -4
- package/dist/types/utils/withDataset.d.ts +3 -3
- package/dist/types/utils/withHasError.d.ts +22 -1
- package/dist/types/utils/withRuleSet.d.ts +3 -2
- package/dist/types/utils/withTranslation.d.ts +1 -2
- package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +6 -7
- package/dist/types/utils/xy/pointKey.d.ts +9 -0
- package/package.json +24 -8
- package/readme.md +14 -8
- package/dist/bn-template-engine/assets/bar.png +0 -0
- package/dist/bn-template-engine/assets/matrix.png +0 -0
- package/dist/bn-template-engine/p-5075771a.entry.js +0 -1
- package/dist/bn-template-engine/p-5d516435.entry.js +0 -1
- package/dist/bn-template-engine/p-5e90e728.entry.js +0 -1
- package/dist/bn-template-engine/p-9ef7e132.entry.js +0 -1
- package/dist/bn-template-engine/p-9f7a1980.entry.js +0 -1
- package/dist/bn-template-engine/p-BeXgxHkW.js +0 -1
- package/dist/bn-template-engine/p-C5UYpZUU.js +0 -2
- package/dist/bn-template-engine/p-CH0bpt_k.js +0 -1
- package/dist/bn-template-engine/p-DI3efDSV.js +0 -1
- package/dist/bn-template-engine/p-DXLTTILG.js +0 -1
- package/dist/bn-template-engine/p-DtP4jqG5.js +0 -1
- package/dist/bn-template-engine/p-a8281b71.entry.js +0 -1
- package/dist/bn-template-engine/p-b31277e7.entry.js +0 -1
- package/dist/bn-template-engine/p-b396ac84.entry.js +0 -1
- package/dist/cjs/bn-template.cjs.entry.js +0 -18
- package/dist/cjs/editor-companion.cjs.entry.js +0 -56
- package/dist/cjs/withHasError-qGW_yqIv.js +0 -426
- package/dist/collection/components/bn-footer/assets/bar.png +0 -0
- package/dist/collection/components/bn-footer/assets/matrix.png +0 -0
- package/dist/collection/components/bn-message/assets/bar.png +0 -0
- package/dist/collection/components/bn-message/assets/matrix.png +0 -0
- package/dist/collection/components/bn-template/bn-template.js +0 -38
- package/dist/collection/components/editor-companion/editor-companion.css +0 -3
- package/dist/collection/components/editor-companion/editor-companion.js +0 -137
- package/dist/collection/utils/templateId.js +0 -12
- package/dist/collection/utils/testing/fakeGroup.js +0 -21
- package/dist/collection/utils/testing/hostFont.js +0 -20
- package/dist/collection/utils/testing/mutationObserver.js +0 -44
- package/dist/collection/utils/testing/structureChart.js +0 -26
- package/dist/collection/utils/testing/timeChart.js +0 -28
- package/dist/components/AxisConfig.js +0 -1
- package/dist/components/CompareUtil.js +0 -1
- package/dist/components/DataFormatDigits.js +0 -1
- package/dist/components/DateStringFactory.js +0 -1
- package/dist/components/LabelCollisionManager.js +0 -1
- package/dist/components/Order.js +0 -1
- package/dist/components/SVGStyle.js +0 -1
- package/dist/components/SVGVariancesStyleGroup.js +0 -1
- package/dist/components/StringAdapter.js +0 -1
- package/dist/components/VarianceMeasure.js +0 -1
- package/dist/components/XYChartDataRow.js +0 -1
- package/dist/components/bn-body2.js +0 -1
- package/dist/components/bn-card2.js +0 -1
- package/dist/components/bn-footer2.js +0 -1
- package/dist/components/bn-message2.js +0 -1
- package/dist/components/bn-page2.js +0 -1
- package/dist/components/bn-template.js +0 -1
- package/dist/components/bn-title2.js +0 -1
- package/dist/components/checkXYOverflow.js +0 -1
- package/dist/components/contentDecoder.js +0 -1
- package/dist/components/context-protocol.js +0 -1
- package/dist/components/editor-companion.js +0 -1
- package/dist/components/formatter.js +0 -1
- package/dist/components/geometry.js +0 -1
- package/dist/components/ibcs-chart-bubble.js +0 -1
- package/dist/components/ibcs-chart-bubble2.js +0 -1
- package/dist/components/ibcs-chart-bullet.js +0 -1
- package/dist/components/ibcs-chart-bullet2.js +0 -1
- package/dist/components/ibcs-chart-scatter.js +0 -1
- package/dist/components/ibcs-chart-scatter2.js +0 -1
- package/dist/components/ibcs-chart-structure.d.ts +0 -11
- package/dist/components/ibcs-chart-structure.js +0 -1
- package/dist/components/ibcs-chart-structure2.js +0 -1
- package/dist/components/ibcs-chart-time.d.ts +0 -11
- package/dist/components/ibcs-chart-time.js +0 -1
- package/dist/components/ibcs-chart-time2.js +0 -1
- package/dist/components/ibcs-table.d.ts +0 -11
- package/dist/components/ibcs-table.js +0 -1
- package/dist/components/ibcs-table2.js +0 -1
- package/dist/components/ibcs-title.d.ts +0 -11
- package/dist/components/ibcs-title.js +0 -1
- package/dist/components/ibcs-title2.js +0 -1
- package/dist/components/layoutTemplate.js +0 -1
- package/dist/components/luxon.js +0 -1
- package/dist/components/scaling.js +0 -1
- package/dist/components/svg.esm.js +0 -1
- package/dist/components/svgChartElements.js +0 -1
- package/dist/components/types.js +0 -1
- package/dist/components/validate.js +0 -1
- package/dist/components/withBodyObserver.js +0 -1
- package/dist/components/withComponentStatus.js +0 -1
- package/dist/components/withComponentStyle.js +0 -1
- package/dist/components/withDataset.js +0 -1
- package/dist/components/withHasError.js +0 -1
- package/dist/components/withRuleSet.js +0 -1
- package/dist/components/withScalingGroup.js +0 -1
- package/dist/components/withStyled.js +0 -1
- package/dist/components/withTranslation.js +0 -1
- package/dist/esm/bn-template.entry.js +0 -16
- package/dist/esm/editor-companion.entry.js +0 -54
- package/dist/esm/withHasError-73WV2SP5.js +0 -422
- package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +0 -59
- package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +0 -53
- package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +0 -54
- package/dist/types/components/bn-template/bn-template.d.ts +0 -10
- package/dist/types/components/editor-companion/editor-companion.d.ts +0 -20
- package/dist/types/utils/templateId.d.ts +0 -9
- package/dist/types/utils/testing/fakeGroup.d.ts +0 -8
- package/dist/types/utils/testing/hostFont.d.ts +0 -16
- package/dist/types/utils/testing/mutationObserver.d.ts +0 -5
- package/dist/types/utils/testing/structureChart.d.ts +0 -5
- package/dist/types/utils/testing/timeChart.d.ts +0 -5
- /package/dist/collection/components/bn-chart-bubble/{ibcs-chart-bubble.css → bn-chart-bubble-renderer/bn-chart-bubble-renderer.css} +0 -0
- /package/dist/collection/components/bn-chart-bullet/{ibcs-chart-bullet.css → bn-chart-bullet-renderer/bn-chart-bullet-renderer.css} +0 -0
- /package/dist/collection/components/bn-chart-scatter/{ibcs-chart-scatter.css → bn-chart-scatter-renderer/bn-chart-scatter-renderer.css} +0 -0
- /package/dist/collection/components/bn-chart-time/{ibcs-chart-time.css → bn-chart-time-renderer/bn-chart-time-renderer.css} +0 -0
- /package/dist/collection/components/bn-table/{ibcs-table.css → bn-table-renderer/bn-table-renderer.css} +0 -0
- /package/dist/collection/components/bn-title/{ibcs-title/ibcs-title.css → bn-title-renderer/bn-title-renderer.css} +0 -0
- /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/index.js +0 -0
- /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/MeasureEntriy.js +0 -0
- /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TimePeriod.js +0 -0
- /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TitleConfig.js +0 -0
- /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/index.js +0 -0
- /package/dist/components/{stackColors.js → p-4q8nRcWC.js} +0 -0
- /package/dist/components/{merge.js → p-B2NXsfMz.js} +0 -0
- /package/dist/components/{layoutObserver.js → p-B6kka9sT.js} +0 -0
- /package/dist/components/{NumericScale.js → p-BJmwHV0a.js} +0 -0
- /package/dist/components/{stackLayout.js → p-BTnRaHPb.js} +0 -0
- /package/dist/components/{emotion-hash.esm.js → p-BYBpC0EO.js} +0 -0
- /package/dist/components/{diagnostics.js → p-CckAR27O.js} +0 -0
- /package/dist/components/{SiPrefix.js → p-CeE4_3wQ.js} +0 -0
- /package/dist/components/{queryError.js → p-ClruFZD_.js} +0 -0
- /package/dist/components/{sanitizeHtml.js → p-CyUmrWfW.js} +0 -0
- /package/dist/components/{TableAttribute.js → p-DCPLGEs_.js} +0 -0
- /package/dist/components/{parentDimensions.js → p-DD1zlev_.js} +0 -0
- /package/dist/components/{pageFormats.js → p-DM7fwmH4.js} +0 -0
- /package/dist/components/{emptyState.js → p-DakXa7Dp.js} +0 -0
- /package/dist/components/{relativeVariance.js → p-fCjsrD7I.js} +0 -0
- /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/Title.d.ts +0 -0
- /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/TitleDataSetFactory.d.ts +0 -0
- /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/index.d.ts +0 -0
- /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/MeasureEntriy.d.ts +0 -0
- /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TimePeriod.d.ts +0 -0
- /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TitleConfig.d.ts +0 -0
- /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,H as i,h as s,a as h,t as e}from"./p-D6YGOYV1.js";import{S as n,F as r,a as o,P as a}from"./p-D5-dYgK_.js";import{C as l,g as c,b as u,h as d,e as f,R as p}from"./p-BQMKgvEC.js";import{C as v,F as m,I as b,a as w,V as g,s as y}from"./p-xpguaboj.js";import{a as S,H as P,b as L,L as k,S as x}from"./p-DPLcGhVt.js";import{S as M}from"./p-CeE4_3wQ.js";import{d as C,p as O,S as A}from"./p-COqIkH1M.js";import{N as T,r as D}from"./p-fCjsrD7I.js";import{D as $,w as E}from"./p-DEHnizot.js";import{d as N,g as _}from"./p-BVKLCz2k.js";import{e as Y,r as j}from"./p-ClruFZD_.js";import{D as R,b as F}from"./p-xhiPDAZa.js";import{a as H,I as V}from"./p-4q8nRcWC.js";import{s as z,c as B,a as G,b as W,l as I,d as X,M as U}from"./p-BTnRaHPb.js";import{D as K,b as q}from"./p-Dlb4ncGF.js";import{A as Z}from"./p-CMM8vtHW.js";import{S as Q}from"./p-oJjMz8JF.js";import{S as J}from"./p-CtBM3KFY.js";class tt{constructor(){this.scenarioOffset=.3,this.scenarioLabelToColumn=.3,this.labelToColumn=.3,this.labelToAxis=.3,this.needleWidth=.3,this.needleHeadWidth=.6,this.columnWidth=2,this.varianceAxisLineWidth=.3,this.axisLineWidth=.1,this.auxiliaryLineWidth=.1,this.scenarioLineWidth=.2,this.markerWidth=.7,this.markerOffset=0,this.categoryWidth=3,this.axisTickLength=.3}}class it{adapt(t){const i=new tt;return l.isNumber(t.scenarioOffset)&&(i.scenarioOffset=t.scenarioOffset),l.isNumber(t.scenarioLabelToColumn)&&(i.scenarioLabelToColumn=t.scenarioLabelToColumn),l.isNumber(t.labelToColumn)&&(i.labelToColumn=t.labelToColumn),l.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),l.isNumber(t.needleWidth)&&(i.needleWidth=t.needleWidth),l.isNumber(t.needleHeadWidth)&&(i.needleHeadWidth=t.needleHeadWidth),l.isNumber(t.columnWidth)&&(i.columnWidth=t.columnWidth),l.isNumber(t.varianceAxisLineWidth)&&(i.varianceAxisLineWidth=t.varianceAxisLineWidth),l.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),l.isNumber(t.auxiliaryLineWidth)&&(i.auxiliaryLineWidth=t.auxiliaryLineWidth),l.isNumber(t.scenarioLineWidth)&&(i.scenarioLineWidth=t.scenarioLineWidth),l.isNumber(t.markerWidth)&&(i.markerWidth=t.markerWidth),l.isNumber(t.markerOffset)&&(i.markerOffset=t.markerOffset),l.isNumber(t.categoryWidth)&&(i.categoryWidth=t.categoryWidth),l.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),i}default(){return new tt}}class st{constructor(t,i,s,h,e,n,r){this.categoryPosition={x:0,y:0},this.spacings=new tt,this.categoriesBoxOffset={width:0,height:0},this.padding=t,this.scaleFactors=i,this.fontStlye=s,this.dataLabelHeight=this.caluculateDataLabelHeight(),this.axisPosition={x:0,y:0},this.columnValue={min:h,max:e},this.numberOfColumns=n,this.leftSideLabelLength=r,this.calculateSpacings(),this.calculateCategoryPosition(),this.calculateAxisPosition()}caluculateDataLabelHeight(){return 1.1*v("123456789",{font:this.fontStlye.font,fontSize:this.fontStlye.size+"px"}).height}getColumnCenterPositionX(t){return this.categoryPosition.y+this.spacings.scenarioOffset+t*this.spacings.categoryWidth+this.leftSideLabelLength+.5*this.spacings.columnWidth}getAxisPositionY(t){let i=this.columnValue.max.getScaledUnit();return t&&(i=this.columnValue.max.getScaledPercentUnit()+this.getNeedleWidth()),i+this.dataLabelHeight+this.spacings.labelToAxis+this.padding.top}getAxisPositionX(){return this.padding.left+this.leftSideLabelLength}getColumnPositionX(t,i){return i?this.getColumnCenterPositionX(t):this.getColumnCenterPositionX(t)-this.spacings.scenarioOffset}getColumnPositionY(){return this.columnValue.max.getScaledUnit()+this.dataLabelHeight+this.spacings.labelToColumn+this.padding.top}getNeedlePositionY(){return this.columnValue.max.getScaledPercentUnit()+this.dataLabelHeight+this.spacings.labelToColumn+this.getNeedleWidth()+this.padding.top}getMarkerPositionX(t,i){return i?this.getColumnCenterPositionX(t)-this.spacings.markerOffset-.5*this.getColumnWidth():this.getColumnCenterPositionX(t)+this.spacings.markerOffset+.5*this.getColumnWidth()}getMarkerPositionY(){return this.getColumnPositionY()}getAxisTitlePositionX(t){const i=t.width();return this.axisPosition.x-i}getAxisTitlePositionY(t,i){let s=this.columnValue.max.getScaledUnit();return i&&(s=this.columnValue.max.getScaledPercentUnit()),t?s+this.dataLabelHeight+this.spacings.labelToAxis:s}getColumnDataLabelPositionY(t){const i=this.spacings.labelToColumn;return t<0?this.getColumnPositionY()+Math.abs(t)+i:this.getColumnPositionY()-t-i}getNeedleDataLabelPositionY(t){const i=this.spacings.labelToColumn;return t<0?this.getNeedlePositionY()+Math.abs(t)+i+2*this.getNeedleWidth():this.getNeedlePositionY()-t-i-2*this.getNeedleWidth()}getAxisEndPositionX(){return this.getAxisPositionX()+(this.numberOfColumns+.5)*this.spacings.categoryWidth}getColumnWidth(){return this.spacings.columnWidth}getNeedleWidth(){return this.spacings.needleWidth}getNeedleHeadWidth(){return this.spacings.needleHeadWidth}getScenarioLabelPositionOffsetX(t){return t?.5*this.getColumnWidth()+this.spacings.scenarioLabelToColumn:-(.5*this.getColumnWidth()+this.spacings.scenarioLabelToColumn)}calculateSpacings(){this.spacings={scenarioOffset:this.fontStlye.size*this.scaleFactors.scenarioOffset,scenarioLabelToColumn:this.fontStlye.size*this.scaleFactors.scenarioLabelToColumn,markerOffset:this.fontStlye.size*this.scaleFactors.markerOffset,labelToColumn:this.fontStlye.size*this.scaleFactors.labelToColumn,labelToAxis:this.fontStlye.size*this.scaleFactors.labelToAxis,needleWidth:this.fontStlye.size*this.scaleFactors.needleWidth,needleHeadWidth:this.fontStlye.size*this.scaleFactors.needleHeadWidth,columnWidth:this.fontStlye.size*this.scaleFactors.columnWidth,varianceAxisLineWidth:this.fontStlye.size*this.scaleFactors.varianceAxisLineWidth,axisLineWidth:this.fontStlye.size*this.scaleFactors.axisLineWidth,auxiliaryLineWidth:this.fontStlye.size*this.scaleFactors.auxiliaryLineWidth,scenarioLineWidth:this.fontStlye.size*this.scaleFactors.scenarioLineWidth,markerWidth:this.fontStlye.size*this.scaleFactors.markerWidth,categoryWidth:this.fontStlye.size*this.scaleFactors.categoryWidth,axisTickLength:this.fontStlye.size*this.scaleFactors.axisTickLength}}calculateCategoryPosition(){this.categoryPosition={x:this.padding.left+.5*this.spacings.columnWidth,y:this.padding.top}}calculateAxisPosition(){this.axisPosition={x:this.getAxisPositionX(),y:this.getAxisPositionY(!1)}}getMarkerScenarioLabelPositionOffsetX(t){return t?this.spacings.labelToColumn-this.fontStlye.size:this.spacings.labelToColumn+.5*this.spacings.markerWidth}}class ht{constructor(t){this.top=t.top,this.bottom=t.bottom,this.left=t.left,this.right=t.right}addBoxTopLeft(t){return this.top+=t.height|this.top,this.left+=t.width|this.top,this}}class et{constructor(t){const i=1*t,s=.7*t;this.bgOffset=(i-s)/2,this.markerUp={top:s/2+",0",left:"0,"+s,right:s+","+s},this.markerUpBackground={top:i/2+",0",left:"0,"+i,right:i+","+i},this.markerDown={bottom:s/2+","+s,left:"0,0",right:s+",0"},this.markerDownBackground={bottom:i/2+","+i,left:"0,0",right:i+",0"},this.markerRight={bottom:"0,"+s,top:"0,0",right:s+","+s/2},this.markerRightBackground={bottom:"0,"+i,top:"0,0",right:i+","+i/2},this.markerLeft={bottom:s+","+s,top:s+",0",left:"0,"+s/2},this.markerLeftBackground={bottom:i+","+i,top:i+",0",Left:"0,"+i/2}}upMarkerPatternStrings(){return{background:this.markerUpBackground.left+" "+this.markerUpBackground.right+" "+this.markerUpBackground.top+" "+this.markerUpBackground.left,foreground:this.markerUp.left+" "+this.markerUp.right+" "+this.markerUp.top+" "+this.markerUp.left,bgOffset:this.bgOffset}}downMarkerPatternStrings(){return{background:this.markerDownBackground.left+" "+this.markerDownBackground.right+" "+this.markerDownBackground.bottom+" "+this.markerDownBackground.left,foreground:this.markerDown.left+" "+this.markerDown.right+" "+this.markerDown.bottom+" "+this.markerDown.left,bgOffset:this.bgOffset}}rightMarkerPatternStrings(){return{background:this.markerRightBackground.top+" "+this.markerRightBackground.right+" "+this.markerRightBackground.bottom+" "+this.markerRightBackground.top,foreground:this.markerRight.top+" "+this.markerRight.right+" "+this.markerRight.bottom+" "+this.markerRight.top,bgOffset:this.bgOffset}}leftMarkerPatternStrings(){return{background:this.markerLeftBackground.top+" "+this.markerLeftBackground.Left+" "+this.markerLeftBackground.bottom+" "+this.markerLeftBackground.top,foreground:this.markerLeft.top+" "+this.markerLeft.left+" "+this.markerLeft.bottom+" "+this.markerLeft.top,bgOffset:this.bgOffset}}createPatternMapForStructureBar(){const t=new Map;return t.set("marker-up",this.upMarkerPatternStrings()),t.set("marker-down",this.downMarkerPatternStrings()),t.set("marker-right",this.rightMarkerPatternStrings()),t.set("marker-left",this.leftMarkerPatternStrings()),t}}class nt{constructor(t){this.container=new n,this.pattern=this.createFCPattern(this.container.group(),t),this.styles=t;let i=10;null!=t&&null!=t.fontStyles&&t.fontStyles.size&&(i=t.fontStyles.size),this.bgOffset=(1*i-.7*i)/2}createFCPattern(t,i){const s=i;return t.pattern(10,10,(function(t){t.rect(10,10).fill(s.barStyles.fc.fill),t.line(0,5,5,0).stroke({width:s.barStyles.fc.width,color:s.barStyles.fc.stroke,linecap:"square"}),t.line(5,10,10,5).stroke({width:s.barStyles.fc.width,color:s.barStyles.fc.stroke,linecap:"square"})})).id("pattern-time-fc")}getFCPolygonPattern(){return{background:"",foreground:"",bgOffset:0,pattern:this.pattern}}toString(){return this.container.svg()}}class rt{constructor(t,i,s,h){this.value=t,this.scenario=i,this.pixelPerUnit=s||1,this.variance="neg"===h||h===ut.NEG?ut.NEG:"pos"===h||h===ut.POS?ut.POS:ut.NEU}isEmpty(){return void 0===this.value||null==this.scenario}getScaledUnit(){return null==this.value?0:this.value*this.pixelPerUnit}getScaledPercentUnit(){return null==this.value?0:this.value>1.45?1.45*this.pixelPerUnit:this.value<-1.45?-1.45*this.pixelPerUnit:this.value*this.pixelPerUnit}getVarianceStyle(){return null==this.value||this.value>=0?this.variance:ut.NEU===this.variance?ut.NEU:ut.POS===this.variance?ut.NEG:ut.POS}isClipped(){return null!=this.value&&Math.abs(this.value)>1.45}getClippedValue(){return 145}getScenario(){var t;return null===(t=this.scenario)||void 0===t?void 0:t.slice(0,2)}}class ot{constructor(){this.operation="+"}addRowGroup(t,i){this.rowGroup=t,this.rowGroupIndex=i}addCategory(t,i){this.category=t,this.categoryIndex=i}addSubCategory(t,i){this.subCategory=t,this.subCategoryIndex=i}addColumnGroup(t,i){this.columnGroup=t,this.columnGroupIndex=i}addSubColumnGroup(t,i){this.columnSubGroup=t,this.columnSubGroupIndex=i}}class at{constructor(){}adapt(t){const i=new ot;return l.isString(t.date)&&(i.date=this.parseDateString(t.date)),l.isOperator(t.operation)&&(i.operation=t.operation),l.isNumber(t.rowGroupIndex)&&l.isString(t.rowGroup)&&i.addRowGroup(t.rowGroup,t.rowGroupIndex),l.isNumber(t.categoryIndex)&&l.isString(t.category)&&i.addCategory(t.category,t.categoryIndex),l.isNumber(t.subCategoryIndex)&&l.isString(t.subCategory)&&i.addSubCategory(t.subCategory,t.subCategoryIndex),l.isNumber(t.columnGroupIndex)&&l.isString(t.columnGroup)&&i.addColumnGroup(t.columnGroup,t.columnGroupIndex),l.isNumber(t.columnSubGroupIndex)&&l.isString(t.columnSubGroup)&&i.addSubColumnGroup(t.columnSubGroup,t.columnSubGroupIndex),this.setActualValues(t,i),this.setPlanValues(t,i),this.setPreviousPeriodValues(t,i),this.setForecastValues(t,i),i}parseDateString(t){if("string"!=typeof t)return;const i=$.fromISO(t,{zone:"utc"});if(i.isValid)return i;console.warn(`TimeChartDataRow: invalid date value '${t}' - skipping row`)}default(){return new ot}setActualValues(t,i){l.isNumber(t.ac1)&&(i.ac1=t.ac1),l.isNumber(t.ac2)&&(i.ac2=t.ac2),l.isNumber(t.ac3)&&(i.ac3=t.ac3),l.isNumber(t.ac4)&&(i.ac4=t.ac4)}setPlanValues(t,i){l.isNumber(t.pl1)&&(i.pl1=t.pl1),l.isNumber(t.pl2)&&(i.pl2=t.pl2),l.isNumber(t.pl3)&&(i.pl3=t.pl3),l.isNumber(t.pl4)&&(i.pl4=t.pl4)}setPreviousPeriodValues(t,i){l.isNumber(t.pp1)&&(i.pp1=t.pp1),l.isNumber(t.pp2)&&(i.pp2=t.pp2),l.isNumber(t.pp3)&&(i.pp3=t.pp3),l.isNumber(t.pp4)&&(i.pp4=t.pp4)}setForecastValues(t,i){l.isNumber(t.fc1)&&(i.fc1=t.fc1),l.isNumber(t.fc2)&&(i.fc2=t.fc2),l.isNumber(t.fc3)&&(i.fc3=t.fc3),l.isNumber(t.fc4)&&(i.fc4=t.fc4)}}class lt{constructor(t,i,s,h,e,n){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=s,this.barStyles=h,this.varianceStyles=e,this.padding=n,this.pattern=new Map,this.stackColors=["#000000","#c0c0c0","#808080"],this.locale="de"}}class ct{constructor(t,i,s,h,e){this.scaleFactorsStructureChartAdapter=t,this.fontStyleAdapter=i,this.svgStyleGroupAdapter=s,this.svgVariancesStyleGroupAdapter=h,this.paddingadapter=e}adapt(t){const i=new lt(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default());return l.isExisting(t)&&(l.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsStructureChartAdapter.adapt(t.scaleFactors)),l.isExisting(t.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(t.fontStyles)),l.isExisting(t.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(t.axisStyles)),l.isExisting(t.barStyles)&&(i.barStyles=this.svgStyleGroupAdapter.adapt(t.barStyles)),l.isExisting(t.varianceStyles)&&(i.varianceStyles=this.svgVariancesStyleGroupAdapter.adapt(t.varianceStyles)),l.isExisting(t.padding)&&(i.padding=this.paddingadapter.adapt(t.padding)),Array.isArray(t.stackColors)&&t.stackColors.length>0&&(i.stackColors=t.stackColors),i.pattern=new et(i.fontStyles.size).createPatternMapForStructureBar()),i}default(){return new lt(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default())}}var ut,dt;!function(t){t.AC1="ac1",t.PP1="pp1",t.FC1="fc1",t.PL1="pl1",t.AC2="ac2",t.PP2="pp2",t.FC2="fc2",t.PL2="pl2",t.AC3="ac3",t.PP3="pp3",t.FC3="fc3",t.PL3="pl3",t.AC4="ac4",t.PP4="pp4",t.FC4="fc4",t.PL4="pl4",t.POS="pos",t.NEG="neg",t.NEU="neu"}(ut||(ut={})),function(t){t.LIST="LIST",t.SUM="SUM",t.OPT="OPT"}(dt||(dt={}));class ft{constructor(t,i,s){this.ID_AXIS="axis",this.CSS_AXIS_TITLE="categories",this.scenarioType=t.scenarioType,this.labelText=t.labelText||null,this.isRelative=t.isRelative||!1,this.position=i,this.svgGroup=s.group().id(this.ID_AXIS)}drawAxisTitle(t,i){null==i&&(i=""),t.text(i).addClass(this.CSS_AXIS_TITLE).attr("text-anchor","middle").move(this.position.getAxisTitlePositionX(t),this.position.getAxisTitlePositionY(!0,this.isRelative))}draw(){return this.labelText&&this.drawAxisTitle(this.svgGroup,this.labelText),this.svgGroup.line(this.position.getAxisPositionX(),this.position.getAxisPositionY(this.isRelative),this.position.getAxisEndPositionX(),this.position.getAxisPositionY(this.isRelative)).addClass(this.ID_AXIS+"-"+this.convertScenarioType()),this}convertScenarioType(){return void 0===this.scenarioType||null==this.scenarioType?"default":`${this.scenarioType}`.slice(0,2)}}class pt{constructor(t,i,s,h,e,n,r,o=null){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.label=null,this.scenarioLabel=null,this.isVarianceColumn=!1,this.overflowConfig=null,this.isOverflowing=!1,this.overdriveHeight=0,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=h,this.isPrimaryColumn=e,this.position=t,this.columnBarStyles=i.barStyles,this.overflowConfig=o,this.scenarioGroup=n,this.styles=i,this.columnGroup=n.group().id(n.toString()+"_"+this.ID_RECT),!0!==(null==s?void 0:s.isEmpty())&&(this.hasData=!0,this.dimensions=this.createDimensions(s,h,e),this.label=this.getDataLabel(s),this.scenarioLabel=this.getScenarioLabel(r))}setAsVariance(){var t;return this.isVarianceColumn=!0,null===(t=this.label)||void 0===t||t.setToVarianceLabel(),this}updateLabelGroup(t){var i;return this.isEmpty()||null===(i=this.label)||void 0===i||i.updateGroup(t),this}draw(t={percent:2,decimal:1},i=new M){var s;if(this.isEmpty())return this;const h=this.getScenarioStyle(),e=this.convertToSVGStyle(h,"stroke"),n=this.getFillStyle(h);this.scenarioGroup.attr(C(this.dataPoint.key)),null===(s=this.columnGroup)||void 0===s||s.attr(C(this.dataPoint.key,"element")),null!=this.columnGroup&&(this.isOverflowing&&this.overflowConfig?this.drawOverdriveBar(n,e):this.columnGroup.rect(this.position.getColumnWidth(),this.dimensions.columnLength).fill(n).stroke(e).y(this.dimensions.yPos).cx(this.dimensions.xPos)),this.drawColumnDataLabel(t,i),this.drawScenarioLabel()}drawOverdriveBar(t,i){if(!this.columnGroup||!this.overflowConfig)return;const s=this.position.getColumnPositionY(),h=this.position.getColumnWidth(),e=this.dimensions.columnLength,{breakGap:n}=this.overflowConfig,r=s-e;this.columnGroup.rect(h,e).fill(t).stroke(i).y(r).cx(this.dimensions.xPos);const o=r-n-this.overdriveHeight;this.columnGroup.rect(h,this.overdriveHeight).fill(t).stroke(i).y(o).cx(this.dimensions.xPos),this.drawBreakIndicator(r,n)}drawBreakIndicator(t,i){if(!this.columnGroup)return;const s=this.position.getColumnWidth(),h=this.dimensions.xPos-s/2,e=t-i/2,n=.35*i,r=s/3;let o=`M ${h} ${e-n}`;for(let t=0;t<3;t++)o+=` L ${h+r*(t+.5)} ${e-n-.3*i} L ${h+r*(t+1)} ${e-n}`;let a=`M ${h} ${e+n}`;for(let t=0;t<3;t++)a+=` L ${h+r*(t+.5)} ${e+n+.3*i} L ${h+r*(t+1)} ${e+n}`;this.columnGroup.rect(s+2,i).fill("#ffffff").stroke("none").y(t-i).cx(this.dimensions.xPos),this.columnGroup.path(o).fill("none").stroke({color:"#000000",width:1}),this.columnGroup.path(a).fill("none").stroke({color:"#000000",width:1})}createDimensions(t,i,s){const h=t.getScaledUnit();if(this.overflowConfig&&h>0){const e="ac"===t.getScenario()?this.overflowConfig.cutHeight:this.overflowConfig.cutHeight-this.overflowConfig.scenarioCutOffset;if(h>e){this.isOverflowing=!0;const{breakGap:t,overdriveZoneHeight:n,maxOverflow:r}=this.overflowConfig;this.overdriveHeight=r>0?(h-e)/r*n:0;const o=e+t+this.overdriveHeight,a=this.position.getColumnPositionY();return{clipped:!1,columnLength:e,xPos:this.position.getColumnPositionX(i,s),yPos:a-e,labelYPos:a-o-this.position.spacings.labelToColumn,scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:a-.5*e}}}return h<0?{clipped:!1,columnLength:Math.abs(h),xPos:this.position.getColumnPositionX(i,s),yPos:this.position.getColumnPositionY(),labelYPos:this.position.getColumnDataLabelPositionY(h),scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getColumnPositionY()+.5*Math.abs(h)}:{clipped:!1,columnLength:h,xPos:this.position.getColumnPositionX(i,s),yPos:this.position.getColumnPositionY()-h,labelYPos:this.position.getColumnDataLabelPositionY(h),scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getColumnPositionY()-.5*Math.abs(h)}}getDataLabel(t){let i=P.Bottom;null!=t.value&&t.value<0&&(i=P.Top);const s=this.isOverflowing?this.dimensions.labelYPos:this.position.getColumnDataLabelPositionY(this.dataPoint.getScaledUnit());return new S(this.scenarioGroup,this.position.getColumnCenterPositionX(this.index),s,this.ID_DATA_PREFIX,t.value,this.styles,i,P.Center).setPoint(t.key)}getScenarioLabel(t){return new S(this.scenarioGroup,-1,-1,this.ID_SCENARIO_PREFIX,t,this.styles,P.Center,this.isPrimaryColumn?P.Left:P.Right)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}drawScenarioLabel(){null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.isVarianceColumn||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(!0)}drawColumnDataLabel(t,i=new M){var s;null===(s=this.label)||void 0===s||s.draw(this.isPrimaryColumn,t,i)}getFillStyle(t){var i,s,h,e;const n=this.columnBarStyles[this.dataPoint.getScenario()];return(null==n?void 0:n.fillpattern)&&(null===(i=this.styles.pattern.get(n.fillpattern))||void 0===i?void 0:i.pattern)?null===(e=null===(h=null===(s=this.styles)||void 0===s?void 0:s.pattern)||void 0===h?void 0:h.get(n.fillpattern))||void 0===e?void 0:e.pattern:this.convertToSVGStyle(t,"fill")}getScenarioStyle(){var t;return this.isVarianceColumn?null===(t=this.styles)||void 0===t?void 0:t.varianceStyles.getSVGStyle(this.dataPoint.getVarianceStyle()):this.columnBarStyles[this.dataPoint.getScenario()]}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}}class vt{constructor(t,i,s,h,e,n,r,o,a){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.FALLBACK_COLOUR="#000000",this.scenarioLabel=null,this._defaultMarkerPattern=null,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.position=t,this.markerGroup=i||null,this.markerPattern=s||this._defaultMarkerPattern,this.styles=e,this.barStyles=e?e.barStyles:null,this.scenario=h,!0!==(null==n?void 0:n.isEmpty())&&(this.hasData=!0,this.pointKey=n.key,this.dimensions=this.createMarkerDimensions(n,r,a),this.scenarioLabel=this.getScenarioLabel(o,e,a))}draw(){if(this.isEmpty())return this;const t=this.convertToSVGStyle(this.barStyles[this.getScenario()],"stroke");let i=this.convertToSVGStyle(this.barStyles[this.getScenario()],"fill");const s=this.barStyles[this.getScenario()];if(null!=s&&s.fillpattern){const t=this.styles.pattern.get(s.fillpattern);null!=t&&(i=t.pattern)}return this.markerGroup.attr(C(this.pointKey)),this.markerGroup.polygon(this.markerPattern.background).fill("#ffffff").cy(this.dimensions.yPos-this.dimensions.columnLength).cx(this.dimensions.xPos),this.markerGroup.polygon(this.markerPattern.foreground).fill(i).stroke(t).cy(this.dimensions.yPos-this.dimensions.columnLength).cx(this.dimensions.xPos).attr(C(this.pointKey,"element")),null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(),this}createMarkerDimensions(t,i,s){return t.getScaledUnit()<0?{clipped:!1,labelYPos:0,columnLength:t.getScaledUnit(),xPos:this.position.getMarkerPositionX(i,s),yPos:this.position.getMarkerPositionY(),scenarioLabelXPos:this.position.getMarkerPositionX(i,s)+this.position.getMarkerScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getMarkerPositionY()+Math.abs(t.getScaledUnit())}:{clipped:!1,labelYPos:0,columnLength:t.getScaledUnit(),xPos:this.position.getMarkerPositionX(i,s),yPos:this.position.getMarkerPositionY(),scenarioLabelXPos:this.position.getMarkerPositionX(i,s)+this.position.getMarkerScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getMarkerPositionY()-Math.abs(t.getScaledUnit())}}getScenarioLabel(t,i,s){return null==this.markerGroup?null:new S(this.markerGroup,-1,-1,this.ID_DATA_PREFIX,t,i,P.Center,s?P.Right:P.Left)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}isEmpty(){return!1===this.hasData}getScenario(){var t;return null===(t=this.scenario)||void 0===t?void 0:t.slice(0,2)}}class mt{constructor(t,i,s,h,e){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.dataLabel=null,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=h,this.position=t,this.barStyles=i.barStyles,this.scenarioGroup=e,this.styles=i,this.barGroup=e.group().id(e.toString()+"_"+this.ID_RECT);const n=void 0===(null==s?void 0:s.value)&&null!=(null==s?void 0:s.scenario);(!0!==(null==s?void 0:s.isEmpty())||n)&&(this.hasData=!0,this.dimensions=this.createDimensions(t,s,h),this.dataLabel=new S(this.scenarioGroup,this.position.getColumnCenterPositionX(this.index),this.position.getNeedleDataLabelPositionY(this.dataPoint.getScaledPercentUnit()),this.ID_DATA_PREFIX,n?T:s.value,this.styles,P.Center,P.Center),this.dataLabel.setToRelativeVarianceLabel().setPoint(s.key))}updateLabelGroup(t){var i;return this.isEmpty()||null===(i=this.dataLabel)||void 0===i||i.updateGroup(t),this}draw(){var t,i,s;if(void 0===(null===(t=this.dataPoint)||void 0===t?void 0:t.value))return null===(i=this.dataLabel)||void 0===i||i.draw(),this;if(this.isEmpty())return this;this.scenarioGroup.attr(C(this.dataPoint.key)),this.barGroup.attr(C(this.dataPoint.key,"element"));const h=this.styles.varianceStyles[this.dataPoint.getVarianceStyle()],e=this.convertToSVGStyle(h,"stroke");let n=this.convertToSVGStyle(h,"fill");const r=this.convertToSVGStyle(this.styles.varianceStyles.ac,"stroke"),o=this.convertToSVGStyle(this.styles.varianceStyles.ac,"fill"),a=this.barStyles[this.dataPoint.getScenario()];if(null!=a&&a.fillpattern){const t=this.styles.pattern.get(a.fillpattern);null!=t&&(n=t.pattern)}this.dimensions.clipped?this.createClippedNeedleHead(n,e):this.createNeedleHead(r,o),this.barGroup.rect(this.position.getNeedleWidth(),this.dimensions.columnLength).cx(this.dimensions.xPos).y(this.dimensions.yPos).fill(n).stroke(e),null===(s=this.dataLabel)||void 0===s||s.draw()}createDimensions(t,i,s){return i.getScaledPercentUnit()<0?{labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,columnLength:Math.abs(i.getScaledPercentUnit()),xPos:t.getColumnCenterPositionX(s),yPos:t.getNeedlePositionY(),clipped:i.isClipped()}:{columnLength:i.getScaledPercentUnit(),xPos:t.getColumnCenterPositionX(s),yPos:t.getNeedlePositionY()-i.getScaledPercentUnit(),labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:i.isClipped()}}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}createClippedNeedleHead(t,i){const s=this.barGroup.polygon("0,0 5,9 -5,9 0,0 0,5 5,13 -5,13 0,5").fill(t).cx(this.dimensions.xPos).cy(this.getHeadYPosition()).fill(t).stroke(i);null!=this.dataPoint.value&&this.dataPoint.value<0&&s.flip("y")}createNeedleHead(t,i){this.barGroup.rect(2*this.position.getNeedleWidth(),this.position.getNeedleHeadWidth()).cx(this.dimensions.xPos).cy(this.getHeadYPosition()).fill(t).stroke(i)}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}getHeadYPosition(){let t=this.dimensions.yPos;return null!=this.dataPoint.value&&this.dataPoint.value<0&&(t+=this.dimensions.columnLength),t}}const bt={ac:{markerFill:"#000000",markerStroke:"#000000",lineColor:"#000000"},pp:{markerFill:"#999999",markerStroke:"#999999",lineColor:"#999999"},fc:{markerFill:"#ffffff",markerStroke:"#000000",lineColor:"#000000",lineDashArray:"4,4"},pl:{markerFill:"#ffffff",markerStroke:"#000000",lineColor:"#000000"}};class wt{constructor(t,i,s,h,e,n,r,o,a=null,l){this.lineSlot=l,this.MARKER_SIZE=8,this.LINE_WIDTH=2,this.ID_LINE_PREFIX="LINE",this.ID_MARKER_PREFIX="MARKER",this.ID_LABEL_PREFIX="LABEL",this.ESTIMATED_LABEL_WIDTH=56,this.ESTIMATED_LABEL_HEIGHT=24,this.position=t,this.styles=i,this.dataPoints=s,this.scenarioGroup=h,this.labelGroup=e,this.scenarioName=n,this.scenarioLabel=r,this.collisionManager=a}draw(t={percent:2,decimal:1},i=new M){return this.drawGeometry(),this.drawLabels(t,i),this}drawGeometry(){if(0===this.dataPoints.length)return this;const t=this.getLineStyle();return this.drawLines(t),this.drawMarkers(t),this}drawLabels(t={percent:2,decimal:1},i=new M){return 0===this.dataPoints.length||(this.drawScenarioLabel(),this.drawValueLabels(t,i)),this}getLineStyle(){var t,i,s;const h=null!==(t=this.lineSlot)&&void 0!==t?t:(null===(s=null===(i=this.scenarioName)||void 0===i?void 0:i.slice(0,2))||void 0===s?void 0:s.toLowerCase())||"ac";return bt[h]||bt.ac}getScenarioVariant(){var t;const i=parseInt((null===(t=this.scenarioName)||void 0===t?void 0:t.slice(-1))||"1",10);return isNaN(i)?1:Math.min(Math.max(i,1),4)}drawSquareMarker(t,i,s,h){const e=this.MARKER_SIZE/2;return t.rect(this.MARKER_SIZE,this.MARKER_SIZE).fill(h.markerFill).stroke({color:h.markerStroke,width:1}).move(i-e,s-e)}drawCircleMarker(t,i,s,h){return t.circle(this.MARKER_SIZE).fill(h.markerFill).stroke({color:h.markerStroke,width:1}).center(i,s)}drawTriangleMarker(t,i,s,h){const e=this.MARKER_SIZE/2;return t.polygon(`${i},${s-e} ${i-e},${s+e} ${i+e},${s+e}`).fill(h.markerFill).stroke({color:h.markerStroke,width:1})}drawDiamondMarker(t,i,s,h){const e=this.MARKER_SIZE/2;return t.polygon(`${i},${s-e} ${i+e},${s} ${i},${s+e} ${i-e},${s}`).fill(h.markerFill).stroke({color:h.markerStroke,width:1})}drawLines(t){const i=this.scenarioGroup.group().id(this.ID_LINE_PREFIX);for(let s=1;s<this.dataPoints.length;s++){const h=this.dataPoints[s-1],e=this.dataPoints[s];if(h.dataPoint.isEmpty()||e.dataPoint.isEmpty())continue;const n=this.position.getColumnCenterPositionX(h.index),r=this.position.getColumnPositionY()-h.dataPoint.getScaledUnit(),o=this.position.getColumnCenterPositionX(e.index),a=this.position.getColumnPositionY()-e.dataPoint.getScaledUnit(),l=i.line([[n,r],[o,a]]).stroke({color:t.lineColor,width:this.LINE_WIDTH,linecap:"round"}).fill("none");t.lineDashArray&&l.attr("stroke-dasharray",t.lineDashArray)}}drawMarkers(t){const i=this.scenarioGroup.group().id(this.ID_MARKER_PREFIX),s=this.getScenarioVariant();for(const h of this.dataPoints){if(h.dataPoint.isEmpty())continue;const e=this.position.getColumnCenterPositionX(h.index),n=this.position.getColumnPositionY()-h.dataPoint.getScaledUnit();let r;switch(s){case 2:r=this.drawCircleMarker(i,e,n,t);break;case 3:r=this.drawTriangleMarker(i,e,n,t);break;case 4:r=this.drawDiamondMarker(i,e,n,t);break;default:r=this.drawSquareMarker(i,e,n,t)}r.attr(C(h.dataPoint.key,"element")).attr("data-bn-index",String(h.index))}}getLabelPositionPriority(t){const i=this.dataPoints[t];let s=null;for(let i=t+1;i<this.dataPoints.length;i++)if(!this.dataPoints[i].dataPoint.isEmpty()){s=this.dataPoints[i];break}let h=null;for(let i=t-1;i>=0;i--)if(!this.dataPoints[i].dataPoint.isEmpty()){h=this.dataPoints[i];break}const e=i.dataPoint.getScaledUnit();return h&&s&&h.dataPoint.getScaledUnit()>e&&s.dataPoint.getScaledUnit()>e?[L.Below,L.Left,L.Right,L.Above]:[L.Above,L.Left,L.Right,L.Below]}getScenarioType(){var t,i;return(null===(i=null===(t=this.scenarioName)||void 0===t?void 0:t.slice(0,2))||void 0===i?void 0:i.toLowerCase())||"ac"}drawValueLabels(t,i){const s=this.getScenarioType();for(let h=0;h<this.dataPoints.length;h++){const e=this.dataPoints[h];if(e.dataPoint.isEmpty()||null===e.dataPoint.value)continue;const n=this.position.getColumnCenterPositionX(e.index),r=this.position.getColumnPositionY()-e.dataPoint.getScaledUnit();let o=n,a=r-this.MARKER_SIZE/2-2,l=P.Bottom,c=P.Center;if(this.collisionManager){const t=this.getLabelPositionPriority(h),i=this.collisionManager.getOptimalPlacement(n,r,this.ESTIMATED_LABEL_WIDTH,this.ESTIMATED_LABEL_HEIGHT,e.index,this.MARKER_SIZE,s,t);if(null===i)continue;o=i.labelX,a=i.labelY,l=i.verticalHook,c=i.horizontalHook;const u=Object.assign(Object.assign({},i.bounds),{scenarioType:s});this.collisionManager.register(u)}new S(this.labelGroup,o,a,this.ID_LABEL_PREFIX,e.dataPoint.value,this.styles,l,c).setPoint(e.dataPoint.key).draw(!0,t,i)}}drawScenarioLabel(){if(!this.scenarioLabel)return;let t=null;for(let i=this.dataPoints.length-1;i>=0;i--)if(!this.dataPoints[i].dataPoint.isEmpty()){t=this.dataPoints[i];break}if(!t)return;const i=this.position.getColumnCenterPositionX(t.index)+this.MARKER_SIZE+4,s=this.position.getColumnPositionY()-t.dataPoint.getScaledUnit(),h=this.getScenarioType();if(this.collisionManager){if(this.collisionManager.shouldHideScenarioLabel(i,s,h))return;this.collisionManager.registerScenarioLabel(i,s,h)}new S(this.labelGroup,i,s,"SCENARIO_LABEL",this.scenarioLabel,this.styles,P.Center,P.Left).forceStringTypeDraw()}}class gt{constructor(t,i,s,h,e,n,r,o,a,l,c){this.hasData=!1,this.position=t,this.styles=i,this.dataPoint=s,this.index=h,this.segment=e,this.segmentIndex=r,this.stackMode=o,this.stack=a,this.group=c,this.columnGroup=c.group().id(`stacked_col_${h}_seg_${r}`),!0!==(null==s?void 0:s.isEmpty())&&null!=s.value&&(this.hasData=!0)}draw(t={percent:2,decimal:1},i=new M){if(!this.hasData||!Number.isFinite(this.dataPoint.value))return;const s=this.dataPoint.value,h=this.dataPoint.pixelPerUnit,e=this.position.getColumnPositionY(),n=Math.abs(this.segment.end-this.segment.start)*h,r=e-Math.max(this.segment.start,this.segment.end)*h,o=this.position.getColumnCenterPositionX(this.index),a=this.position.getColumnWidth(),l=this.styles.stackColors,u=l[this.segmentIndex%l.length],d={color:u},f={color:u,width:.5};if(this.columnGroup.attr(C(this.dataPoint.key,"element")),this.columnGroup.rect(a,Math.max(n,.5)).fill(d).stroke(f).y(r).cx(o),n>=18){const h=r+n/2;if(this.stackMode===c.RELATIVE||this.stackMode===c.ABSOLUTE_RELATIVE){const i=m.number(this.segment.share,"percent",t.percent,t.percent,1,this.styles.locale);new S(this.group,o,h,"STACK_SEG",i,this.styles,P.Center,P.Center).setSegmentFill(u).setPoint(this.dataPoint.key).forceStringTypeDraw()}else new S(this.group,o,h,"STACK_SEG",s,this.styles,P.Center,P.Center).setSegmentFill(u).setPoint(this.dataPoint.key).draw(!0,t,i)}}drawTotalLabel(t={percent:2,decimal:1},i=new M,s){if(this.stackMode===c.RELATIVE)return;const h=this.stack.total<0,e=h?0-this.stack.negative:this.stack.positive,n=this.position.getColumnCenterPositionX(this.index),r=this.position.getColumnDataLabelPositionY(e*this.dataPoint.pixelPerUnit);new S(this.group,n,r,"STACK_TOTAL",this.stack.total,this.styles,h?P.Top:P.Bottom,P.Center).setPoint(s,"total").draw(!0,t,i)}}const yt={ac:{fill:"#000000",opacity:.3,lineColor:"#000000"},pp:{fill:"#999999",opacity:.3,lineColor:"#999999"},fc:{fill:"#000000",opacity:.2,lineColor:"#000000",dashArray:"4,4"},pl:{fill:"#000000",opacity:.1,lineColor:"#000000"}},St=[{fill:"#000000",opacity:.3},{fill:"#555555",opacity:.25},{fill:"#999999",opacity:.2},{fill:"#bbbbbb",opacity:.15},{fill:"#dddddd",opacity:.1}];class Pt{constructor(t,i,s,h,e,n){this.group=t.group().id(`area_fill_${e}`),this.upperPoints=i,this.lowerPoints=s,this.scenarioType=h,this.segmentIndex=e,this.isScenarioStack=n}draw(){if(this.upperPoints.length<2||this.lowerPoints.length<2)return;let t,i,s=`M ${this.upperPoints[0].x},${this.upperPoints[0].y}`;for(let t=1;t<this.upperPoints.length;t++)s+=` L ${this.upperPoints[t].x},${this.upperPoints[t].y}`;for(let t=this.lowerPoints.length-1;t>=0;t--)s+=` L ${this.lowerPoints[t].x},${this.lowerPoints[t].y}`;if(s+=" Z",this.isScenarioStack&&this.scenarioType){const s=this.scenarioType.slice(0,2).toLowerCase(),h=yt[s]||yt.ac;t=h.fill,i=h.opacity}else{const s=Math.min(this.segmentIndex,St.length-1);t=St[s].fill,i=St[s].opacity}this.group.path(s).fill(t).opacity(i).stroke("none")}drawBoundaryLine(){if(this.upperPoints.length<2)return;let t,i="#000000";if(this.isScenarioStack&&this.scenarioType){const s=this.scenarioType.slice(0,2).toLowerCase(),h=yt[s]||yt.ac;i=h.lineColor,t=h.dashArray}const s=this.group.polyline(this.upperPoints.map((t=>[t.x,t.y]))).fill("none").stroke({color:i,width:1.5});t&&s.attr("stroke-dasharray",t)}}class Lt{constructor(t,i,s,h,e,n,r,o){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.label=null,this.scenarioLabel=null,this.isVarianceLine=!1,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.previousDimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=e,this.isPrimaryLine=n,this.position=t,this.LineBarStyles=i.barStyles,this.scenarioGroup=r,this.styles=i,this.LineGroup=r.group().id(r.toString()+"_"+this.ID_RECT),!0!==(null==s?void 0:s.isEmpty())&&(this.hasData=!0,this.dimensions=this.createDimensions(s,e,n),this.label=this.getDataLabel(s),this.scenarioLabel=this.getScenarioLabel(o)),this.previousDimensions=this.createDimensions(h,e-1,n)}setAsVariance(){var t;return this.isVarianceLine=!0,null===(t=this.label)||void 0===t||t.setToVarianceLabel(),this}updateLabelGroup(t){var i;return this.isEmpty()||null===(i=this.label)||void 0===i||i.updateGroup(t),this}draw(t={percent:2,decimal:1},i=new M){if(this.isEmpty())return this;const s=this.getScenarioStyle(),h=this.getFillStyle(s);null!=this.LineGroup&&this.LineGroup.line([[this.previousDimensions.xPos,this.previousDimensions.yPos],[this.dimensions.xPos,this.dimensions.yPos]]).fill(h).stroke({color:"#f06",width:3,linecap:"round"}),this.drawLineDataLabel(t,i),this.drawScenarioLabel()}createDimensions(t,i,s){return{clipped:!1,columnLength:t.getScaledUnit(),xPos:this.position.getColumnPositionX(i,s),yPos:this.position.getColumnPositionY()-t.getScaledUnit(),labelYPos:this.position.getColumnDataLabelPositionY(t.getScaledUnit()),scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getColumnPositionY()-t.getScaledUnit()}}getDataLabel(t){let i=P.Bottom;return null!=t.value&&t.value<0&&(i=P.Top),new S(this.scenarioGroup,this.position.getColumnCenterPositionX(this.index),this.position.getColumnDataLabelPositionY(this.dataPoint.getScaledUnit()),this.ID_DATA_PREFIX,t.value,this.styles,i,P.Center)}getScenarioLabel(t){return new S(this.scenarioGroup,0,0,this.ID_SCENARIO_PREFIX,t,this.styles,P.Bottom,P.Left)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}drawScenarioLabel(){null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.isVarianceLine||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(!0)}drawLineDataLabel(t,i=new M){var s;null===(s=this.label)||void 0===s||s.draw(this.isPrimaryLine,t,i)}getFillStyle(t){var i,s,h,e;const n=this.LineBarStyles[this.dataPoint.getScenario()];return(null==n?void 0:n.fillpattern)&&(null===(i=this.styles.pattern.get(n.fillpattern))||void 0===i?void 0:i.pattern)?null===(e=null===(h=null===(s=this.styles)||void 0===s?void 0:s.pattern)||void 0===h?void 0:h.get(n.fillpattern))||void 0===e?void 0:e.pattern:this.convertToSVGStyle(t,"fill")}getScenarioStyle(){var t;return this.isVarianceLine?null===(t=this.styles)||void 0===t?void 0:t.varianceStyles.getSVGStyle(this.dataPoint.getVarianceStyle()):this.LineBarStyles[this.dataPoint.getScenario()]}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}}class kt{constructor(t,i,s,h,e){this.pixelPerUnit=1,this.collisionManager=null,this.overflowConfig=null,this.i18n=e;const n=i.group().id("Scenario1"),r=i.group().id("Scenario2").insertBefore(n);this.svgGroups={parent:i,scenario1:n,scenario2:r,scenario3:i.group().id("Scenario3"),scenario4:i.group().id("Scenario4"),scenario1Label:i.group().id("label")},this.styles=s,this.position=t,this.elementCnt=h}setOverflowConfig(t){this.overflowConfig=t}createLine(t,i,s,h){const e=this.svgGroups.scenario1.group().id(""+h),n=this.svgGroups.scenario1Label.group().id(""+h);let r=null;return this.isLastDataPoint(h-1)&&(r=t),new Lt(this.position,this.styles,i,s,h,!1,e,r).updateLabelGroup(n)}createPrimaryBar(t,i){const s=this.svgGroups.scenario1.group().id(""+i),h=this.svgGroups.scenario1Label.group().id(""+i);let e=null;return this.isLastDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new pt(this.position,this.styles,t,i,!0,s,e,this.overflowConfig).updateLabelGroup(h)}createVarianceBar(t,i){const s=this.svgGroups.scenario1.group().id(""+i),h=this.svgGroups.scenario1Label.group().id(""+i);let e=null;return this.isLastDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new pt(this.position,this.styles,t,i,!0,s,e,this.overflowConfig).updateLabelGroup(h).setAsVariance()}createRelativeVarianceBar(t,i){const s=this.svgGroups.scenario1.group().id(""+i),h=this.svgGroups.scenario1Label.group().id(""+i);return new mt(this.position,this.styles,t,i,s).updateLabelGroup(h)}createSecondaryBar(t,i){const s=this.svgGroups.scenario2.group().id(""+i);let h=null;return this.isFirstDataPoint(i)&&(h=`${this.i18n.get(t.scenario)||t.scenario}`),new pt(this.position,this.styles,t,i,!1,s,h,this.overflowConfig)}createPrimaryMarker(t,i){const s=this.svgGroups.scenario3.group().id(""+i),h=this.styles.pattern.get("marker-right")||{foreground:"#000000",background:"#ffffff",bgOffset:0};let e=null;return this.isFirstDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new vt(this.position,s,h,t.scenario,this.styles,t,i,e,!0)}createSecondaryMarker(t,i){const s=this.svgGroups.scenario4.group().id(""+i),h=this.styles.pattern.get("marker-left")||{foreground:"#000000",background:"#ffffff",bgOffset:0};let e=null;return this.isLastDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new vt(this.position,s,h,t.scenario,this.styles,t,i,e,!1)}isLastDataPoint(t){return this.elementCnt-1===t}isFirstDataPoint(t){return 0===t}setCollisionManager(t){this.collisionManager=t}moveLabelsToFront(){this.svgGroups.scenario1Label.front()}createLineSeries(t,i,s){const h=this.svgGroups.parent.group().id("LineSeries_"+i),e=this.svgGroups.scenario1Label.group().id("LineSeries_Label_"+i),n=`${this.i18n.get(i)||i}`;return new wt(this.position,this.styles,t,h,e,i,n,this.i18n,this.collisionManager,s)}}const xt="bn-measurement-host";function Mt(t,i){const s=function(){if("undefined"==typeof document||!document.body)return null;let t=document.getElementById(xt);return t||(t=document.createElement("div"),t.id=xt,t.style.cssText="opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden",t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),t}();if(s){s.appendChild(t.node);try{i()}finally{t.node.parentNode===s&&s.removeChild(t.node)}}else i()}var Ct,Ot;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(Ct||(Ct={})),function(t){t.RELATIVE="dr",t.ABSOLUTE="d",t.NONE=""}(Ot||(Ot={}));class At{constructor(t,i,s,h,e,n=0){this.CSS_CATEGORIES="categories",this.dataModel=[],this.variancesDataModel=[],this.title="",this.configTitle="",this.configVariances=[],this.smallestDataPointValue=new rt(0,ut.AC1,1,ut.NEU),this.highestDataPointValue=new rt(0,ut.AC1,1,ut.NEU),this.smallestVarianceDataPointValue=new rt(0,ut.AC1,1,ut.NEU),this.highestVarianceDataPointValue=new rt(0,ut.AC1,1,ut.NEU),this.pixelPerUnit=1,this.pixelPerPercentage=1,this.hideAxisLabels=!1,this.axisScenario=ut.AC1,this.fromExpr="",this.rowCount=0,this.axisCategoryArea={width:0,height:0},this.scenariosArea={width:0,height:0},this.state=Ct.DIRTY,this.i18n=new Map,this.leftSideOffsetForHorizontalSync=-1,this.dateInterval=R.DAY,this.locale="de",this.axisLabelsMode=u.SMART,this.intervalSpanLimit=32,this.measureScale=new M,this.measureUnit="",this.dataFormatDigits={percent:2,decimal:1},this.showOverlayMedian=!1,this.showOverlayAvg=!1,this.chartMode=d.BAR,this.maxBars=28,this.stackConfig=null,this.scenarioPropOrder=[],this.lineFullWidth=!0,this.availableWidth=0,this.overflowConfig=null,this.lastScenarios=[],this.db=i,this.tableName=s,this.ruleSet=t||new b,this.i18n=this.createI18n(new Map),this.styles=e,this.availableWidth=n,this.setConfig(h),this.position=this.createElementPosition(this.lastScenarios)}updatePosition(t){this.position=this.createElementPosition(t)}setStyles(t){this.styles=t}setRuleSet(t){this.ruleSet=t||new b}setAvailableWidth(t){this.availableWidth=t}setAvailableHeight(t){this.pixelPerUnit<=0||t<=0?this.overflowConfig=null:null==this.stackConfig&&this.determineEffectiveChartMode()===d.BAR?(this.overflowConfig=this.calculateOverflowConfig(t),this.overflowConfig&&this.updatePosition(this.lastScenarios)):this.overflowConfig=null}calculateOverflowConfig(t){const i=(this.isVarianceChart()?this.highestVarianceDataPointValue:this.highestDataPointValue).getScaledUnit();if(i<=0)return null;const s=this.styles.fontStyles.size,h=1.5*s,e=.3*s,n=t-(this.position.dataLabelHeight+this.position.spacings.labelToColumn+this.position.padding.top+this.position.padding.bottom+this.position.spacings.labelToAxis+s)-h-e,r=.8*s;if(n<=r)return null;const o=n-r;return i<=o?null:{cutHeight:n,overdriveZoneHeight:h,breakGap:e,maxOverflow:i-o,scenarioCutOffset:r}}setConfig(t){var i;this.state=Ct.DIRTY,this.locale=t.locale,this.scenarioPropOrder=[...t.scenarios];const s=this.sortScenariosbyVisualisationRules(t.scenarios);if(this.setSource(t.filter),this.hideAxisLabels=t.hideAxisLabels||!1,this.pixelPerUnit=t.pixelPerUnit,this.pixelPerPercentage=t.pixelPerPercentage,this.axisLabelsMode=t.axisLabelsMode,this.intervalSpanLimit=t.intervalSpanLimit,this.dateInterval=this.findDateInterval(t.dateInterval),this.dataModel=this.populateModel(s,this.dateInterval),this.variancesDataModel=this.populateVarianceModel(t.variances,this.dataModel),this.configTitle=t.title,this.configVariances=null!==(i=null==t?void 0:t.variances)&&void 0!==i?i:[],this.updateTitle(),this.smallestDataPointValue=this.findSmallestDataPointValue(this.dataModel),this.smallestVarianceDataPointValue=this.findSmallestDataPointValue(this.variancesDataModel),this.highestDataPointValue=this.findHighestDataPointValue(this.dataModel),this.highestVarianceDataPointValue=this.findHighestDataPointValue(this.variancesDataModel),this.axisScenario=this.setAxisScenario(t.variances),this.leftSideOffsetForHorizontalSync=t.leftSideOffsetForHorizontalSync,this.measureScale=t.measureScale,this.measureUnit=t.measureUnit,this.dataFormatDigits=t.dataFormatDigits,this.showOverlayMedian=t.showOverlayMedian,this.showOverlayAvg=t.showOverlayAvg,this.chartMode=t.chartMode,this.maxBars=t.maxBars,this.stackConfig=t.stackConfig,this.lineFullWidth=t.lineFullWidth,this.lastScenarios=s,null!=this.stackConfig){const t=[];for(const i of this.dataModel)t.push(...this.stackGroups(i).map((t=>t.layout)));const i=z(t),{scenario:s,variance:h}=this.highestDataPointValue;this.highestDataPointValue=new rt(i.positive,s,this.pixelPerUnit,h),this.smallestDataPointValue=new rt(0-i.negative,s,this.pixelPerUnit,h)}this.updatePosition(s)}getFooter(){return 1===this.measureScale.value&&""===this.measureUnit?" ":m.translateScenarioLabel("in",this.i18n)+" "+this.measureScale.prefix+this.measureUnit}sortScenariosbyVisualisationRules(t){const i=this;return[...t].sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))).reverse()}setI18n(t){this.i18n=this.createI18n(t),this.updateTitle()}updateTitle(){var t;this.title=this.configTitle||m.translateScenarioLabel(null===(t=this.configVariances)||void 0===t?void 0:t.toString(),this.i18n)}setSource(t){var i,s;if(this.state=Ct.DIRTY,this.queryError=void 0,this.fromExpr=N(this.db,this.tableName,t),this.fromExpr)try{const t=this.db.exec(`SELECT COUNT(*) AS cnt FROM ${this.fromExpr}`);this.rowCount=null!==(s=null===(i=t[0])||void 0===i?void 0:i.cnt)&&void 0!==s?s:0}catch(t){this.rowCount=0,this.failQuery(t)}else this.rowCount=0}getQueryError(){return this.queryError}failQuery(t){var i;null!==(i=this.queryError)&&void 0!==i||(this.queryError=Y(t))}getAllocatedCanvasWidth(){const t=this.position.getAxisEndPositionX(),i=3*this.styles.fontStyles.size,s=Math.max(this.axisCategoryArea.width,this.scenariosArea.width);return Math.max(t+i,s>0?s+this.position.leftSideLabelLength:0)}getAllocatedCanvasHeight(){if(null==this.smallestVarianceDataPointValue.value||null==this.highestVarianceDataPointValue.value||null==this.smallestDataPointValue.value||null==this.highestDataPointValue.value)return 0;const t=this.isVarianceChart()&&this.variancesDataModel.some((t=>t.type===Ot.RELATIVE)),i=this.position.getAxisPositionY(t),s=this.position.spacings.labelToAxis+this.position.dataLabelHeight+this.styles.padding.bottom;let h;if(this.isOnSameAxisSide())h=i+s;else{const t=this.isVarianceChart()?this.smallestVarianceDataPointValue:this.smallestDataPointValue;h=i+Math.abs(t.getScaledUnit())+this.position.spacings.labelToColumn+this.position.dataLabelHeight+s}const e=this.isOnSameAxisSide();return Math.max(h,e?this.axisCategoryArea.height+this.scenariosArea.height:this.scenariosArea.height)}getUnitBarExtent(){var t,i;const s=this.isVarianceChart()&&this.variancesDataModel.some((t=>t.type===Ot.RELATIVE)),h=this.isVarianceChart(),e=h?this.highestVarianceDataPointValue:this.highestDataPointValue,n=h?this.smallestVarianceDataPointValue:this.smallestDataPointValue;return B({relativeVariance:s,maxPositive:null!==(t=null==e?void 0:e.value)&&void 0!==t?t:0,minNegative:this.isOnSameAxisSide()?0:null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0})}getPercentBarExtent(){var t,i,s,h;const e=this.isVarianceChart()&&this.variancesDataModel.some((t=>t.type===Ot.RELATIVE));return G({relativeVariance:e,maxPositive:null!==(i=null===(t=this.highestVarianceDataPointValue)||void 0===t?void 0:t.value)&&void 0!==i?i:0,minNegative:this.isOnSameAxisSide()?0:null!==(h=null===(s=this.smallestVarianceDataPointValue)||void 0===s?void 0:s.value)&&void 0!==h?h:0})}layout(){const t=new n;Mt(t,(()=>this.draw(t)))}toString(){const t=new n;return Mt(t,(()=>this.draw(t))),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}applyFontToContainer(t){t.attr({"font-size":this.styles.fontStyles.size,"font-family":this.styles.fontStyles.family})}draw(t){this.cleanSVGforRedraw(t),this.applyFontToContainer(t),this.state===Ct.DIRTY&&(this.state=Ct.UP_TO_DATE),this.isVarianceChart()?(this.drawVarianceScenario(this.variancesDataModel,t),this.drawAxisAndLabels(this.variancesDataModel,t)):null!=this.stackConfig?this.determineEffectiveChartMode()===d.LINE?(this.drawStackedAreaScenarios(this.dataModel,t),this.drawAxisAndLabelsForLineChart(this.dataModel,t)):(this.drawStackedScenarios(this.dataModel,t),this.drawStackedHeaders(this.dataModel,t),this.drawAxisAndLabels(this.dataModel,t)):this.determineEffectiveChartMode()===d.LINE?(this.drawLineScenarios(this.dataModel,t),this.drawAxisAndLabelsForLineChart(this.dataModel,t)):(this.drawScenarios(this.dataModel,t),this.drawOverlayLayer(this.dataModel,t),this.drawAxisAndLabels(this.dataModel,t))}determineEffectiveChartMode(){return this.chartMode===d.LINE||this.chartMode===d.AUTO&&this.dataModel.length>this.maxBars?d.LINE:d.BAR}setPattern(t,i){this.styles.pattern.set(t,i)}hasNoData(){return 0===this.dataModel.length}isOnSameAxisSide(){return null!=this.smallestVarianceDataPointValue.value&&null!=this.highestVarianceDataPointValue.value&&null!=this.smallestDataPointValue.value&&null!=this.highestDataPointValue.value&&(this.isVarianceChart()?Math.sign(this.smallestVarianceDataPointValue.value)===Math.sign(this.highestVarianceDataPointValue.value)||0===this.smallestDataPointValue.value&&1===Math.sign(this.highestDataPointValue.value):Math.sign(this.smallestDataPointValue.value)===Math.sign(this.highestDataPointValue.value)||0===this.smallestDataPointValue.value&&1===Math.sign(this.highestDataPointValue.value))}createI18n(t){this.state=Ct.DIRTY;const i=new Map([["SEPARATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["ac1","AC"],["pp1","PY"],["fc1","FC"],["pl1","PL"],["ac2","AC2"],["pp2","PY2"],["fc2","FC2"],["pl2","PL2"],["ac3","AC3"],["pp3","PY3"],["fc3","FC3"],["pl3","PL3"],["ac4","AC4"],["pp4","PY4"],["fc4","FC4"],["pl4","PL4"],["category"," "],["operation"," "],["thereof","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"]]);return new Map([...i,...t])}createElementPosition(t){let i;const s=v(t.filter(((t,i)=>1===i||2===i)).map((t=>m.translateScenarioLabel(t,this.i18n))).reduce(((t,i)=>t.length<i.length?i:t),""),{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width,h=this.calculateTitleLength(this.leftSideOffsetForHorizontalSync);let e,n;if(i=s>h?s:h,null!=this.position&&(i+=this.position.spacings.labelToColumn),this.leftSideOffsetForHorizontalSync>-1&&(i=this.leftSideOffsetForHorizontalSync),this.isVarianceChart()?(e=this.smallestVarianceDataPointValue,n=this.highestVarianceDataPointValue):(e=this.smallestDataPointValue,n=this.highestDataPointValue),this.overflowConfig){const{cutHeight:t,overdriveZoneHeight:i,breakGap:s}=this.overflowConfig;n=new rt(t+i+s,n.scenario,1,n.variance)}let r=this.styles.scaleFactors;const o=this.determineEffectiveChartMode();if(this.lineFullWidth&&this.availableWidth>0&&this.dataModel.length>0&&!this.isVarianceChart()&&o===d.LINE){const t=this.styles.fontStyles.size,s=this.styles.padding,h=this.styles.scaleFactors,e=this.availableWidth-(s.left+s.right+t*h.scenarioOffset+i+t*h.columnWidth);if(e>0){const i=Math.max(e/this.dataModel.length/t,1.2*h.columnWidth),s=new tt;Object.assign(s,h),s.categoryWidth=i,r=s}}return new st(new ht(this.styles.padding),r,this.styles.fontStyles,e,n,this.dataModel.length,i)}calculateTitleLength(t){let i="_______";i.length<this.title.length&&(i=this.title);const s=v(i,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width;return s<t?t:s}scenarioStyles(){const t=w(this.styles.barStyles,this.ruleSet);return t===this.styles.barStyles?this.styles:Object.assign(Object.create(Object.getPrototypeOf(this.styles)),this.styles,{barStyles:t})}setAxisScenario(t){let i=ut.AC1;if(null!=t&&t.length>0){const s=new g(t.toString());s.isValid&&(i=y(this.ruleSet.getScenarioColorIndex(s.delta))+s.delta.slice(2))}return null===i&&(i=ut.AC1),i}populateModel(t,i){if(0===this.rowCount||!this.fromExpr)return[];let s=this.queryDataSet(i,"","");return this.detectNaNCells(t,s),s=this.leftOuterJoinDates(s,i),this.createDataRows(s,t)}detectNaNCells(t,i){i.forEach((i=>(t.forEach((t=>{const s=new g(t);!0===s.isValid?0!==i[s.base+"_cnt"]&&0!==i[s.delta+"_cnt"]||(i[t]=Number.NaN):0===i[t+"_cnt"]&&(i[t]=Number.NaN)})),i)))}findDateInterval(t){if(t!==R.AUTO)return t;const i=this.queryDates();if(0===i.length)return R.DAY;let s=i[0],h=i[0];for(const t of i)t<s&&(s=t),t>h&&(h=t);return(new F).calculateDistanceType(s,h,this.intervalSpanLimit)}queryDates(){if(0===this.rowCount)return[];let t;try{t=this.db.exec(`SELECT DISTINCT [date] FROM ${this.fromExpr}`)}catch(t){return this.failQuery(t),[]}return t.map((t=>At.coerceDateTime(t.date))).filter((t=>null!=t))}static coerceDateTime(t){if(null!=t){if("string"==typeof t){const i=$.fromISO(t,{zone:"utc"});return i.isValid?i:void 0}if("number"==typeof t){const i=$.fromMillis(t,{zone:"utc"});return i.isValid?i:void 0}return"boolean"==typeof t.isValid?t:void 0}}queryDataSet(t,i,s){const h=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"],e=`normalizeDate([date], '${t}' , '${this.locale}') as calcdate`;let n;try{n=this.db.exec(`SELECT p.calcdate ${i},\n ${h.map((t=>`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`)).join(",")}\n\n FROM (SELECT ${e} ${i},\n ac1,\n ac2,\n ac3,\n ac4,\n pp1,\n pp2,\n pp3,\n pp4,\n fc1,\n fc2,\n fc3,\n fc4,\n pl1,\n pl2,\n pl3,\n pl4\n FROM ${this.fromExpr}) as p\n GROUP BY calcdate ${s}\n ORDER BY calcdate asc`)}catch(t){return this.failQuery(t),[]}return n}createDataRows(t,i){var s;const h=[];t.forEach(((t,s)=>{h.push({id:s,category:t.category,type:Ot.NONE,date:t.calcdate,scenario1:new rt(t[i[0]],i[0],this.pixelPerUnit,ut.NEU),scenario2:new rt(t[i[1]],i[1],this.pixelPerUnit,ut.NEU),scenario3:new rt(t[i[2]],i[2],this.pixelPerUnit,ut.NEU),scenario4:new rt(t[i[3]],i[3],this.pixelPerUnit,ut.NEU)})}));for(const t of h)for(const i of[t.scenario1,t.scenario2,t.scenario3,t.scenario4])null==i.value||Number.isNaN(i.value)||(i.key={date:At.pointDate(t.date),scenario:null!==(s=i.scenario)&&void 0!==s?s:void 0});return h}static pointDate(t){var i;return O(null===(i=null==t?void 0:t.toISO)||void 0===i?void 0:i.call(t))}findSmallestDataPointValue(t){const i=this.isVarianceChart()?this.pixelPerPercentage:this.pixelPerUnit;let s=new rt(0,"default",i,ut.NEU);for(const i of t)for(const t of[i.scenario1,i.scenario2,i.scenario3,i.scenario4])t&&null!=t.value&&t.value<Number(s.value)&&(s=t);return s}findHighestDataPointValue(t){const i=this.isVarianceChart()?this.pixelPerPercentage:this.pixelPerUnit;let s=new rt(0,"default",i,ut.NEU);for(const i of t)for(const t of[i.scenario1,i.scenario2,i.scenario3,i.scenario4])null!=t&&t.value>Number(s.value)&&(s=t);return s}populateVarianceModel(t,i){const s=[];if(null==t||0===t.length)return s;let h=null;null!=i&&i.length>0&&(h=i[0]);for(const e in t){const n=new g(t[e]);if(n.isValid){const r=this.mapScenarios(n,h),o=n.direction,a="dr"===n.type?this.pixelPerPercentage:this.pixelPerUnit;for(const h in i){const l=new rt(this.calculateVariance(n,i[h],r),n.delta,a,o);null===l.value||Number.isNaN(l.value)||(l.key={date:At.pointDate(i[h].date),scenario:t[e]}),s.push({id:Number(h),category:i[h].category,type:"dr"===n.type?Ot.RELATIVE:Ot.ABSOLUTE,date:i[h].date,scenario1:l,scenario2:new rt(null,null,null,null),scenario3:new rt(null,null,null,null),scenario4:new rt(null,null,null,null)})}}}return s}calculateVariance(t,i,s){const h=s.get(t.base),e=s.get(t.delta);return null==h||null==e||null==i[h].value||null==i[e].value?null:t.type===Ot.RELATIVE?D(i[h].value-i[e].value,i[e].value):i[h].value-i[e].value}mapScenarios(t,i){const s=new Map;return null==i||["scenario1","scenario2","scenario3","scenario4"].forEach((h=>{i[h].scenario===t.delta?s.set(t.delta,h):i[h].scenario===t.base&&s.set(t.base,h)})),s}cleanSVGforRedraw(t){t.clear()}isVarianceChart(){return this.variancesDataModel&&this.variancesDataModel.length>0}createDateFactory(){const t=new F;return t.setLocale(this.locale),t}dateLabelPlace(t){let i=t.scenario1.value<0,s=this.position.spacings.labelToAxis;if(null!=this.stackConfig&&!this.isVarianceChart()){const h=this.stackConfig.mode!==c.RELATIVE&&this.determineEffectiveChartMode()!==d.LINE?(this.position.spacings.labelToColumn+this.position.dataLabelHeight)/this.pixelPerUnit:0,e=this.stackGroups(t).filter((t=>t.hasValue)).map((t=>t.layout));let n=W(e,(()=>h));n.flipped&&h>0&&e.some((t=>t.total>=0))&&(n={flipped:!1,clearance:Math.max(...e.map((t=>t.negative+(t.total<0?h:0))))}),i=n.flipped,s+=n.clearance*this.pixelPerUnit}return i?{hookLocation:P.Bottom,offset:-s}:{hookLocation:P.Top,offset:s}}drawAxisAndLabels(t,i){const s=this.createDateFactory(),h=i.group().id("AxisAndDateLables");let e=!1;if(!1===this.hideAxisLabels)t.forEach(((t,i)=>{const{hookLocation:n,offset:r}=this.dateLabelPlace(t);t.type===Ot.RELATIVE&&(e=!0);let o=s.getDateString(t.date,this.dateInterval);this.axisLabelsMode===u.SMART?(o=s.getSmartDateString(t.date,this.dateInterval),0===i&&this.dateInterval!==R.YEAR&&(o=s.getShortDateString(t.date,this.dateInterval))):this.axisLabelsMode===u.SHORT&&(o=s.getShortDateString(t.date,this.dateInterval)),new S(h,this.position.getColumnCenterPositionX(i),this.position.getAxisPositionY(e)+r,"",o,this.styles,n,P.Center).forceStringTypeDraw()}));else{const i=null==t?void 0:t[0];i&&i.type===Ot.RELATIVE&&(e=!0)}new ft({scenarioType:this.axisScenario,labelText:this.title,isRelative:e},this.position,h).draw();const n=h.bbox();this.axisCategoryArea={height:n.height,width:n.width}}drawScenarios(t,i){const s=i.group().id("Scenarios"),h=new kt(this.position,s,this.scenarioStyles(),t.length,this.i18n);h.setOverflowConfig(this.overflowConfig);let e=!1;t.forEach(((t,i)=>{h.createPrimaryBar(t.scenario1,i).draw(this.dataFormatDigits,this.measureScale),h.createSecondaryBar(t.scenario2,i).draw(),h.createPrimaryMarker(t.scenario3,i).draw(),h.createSecondaryMarker(t.scenario4,i).draw(),!1===t.scenario1.isEmpty()&&(e=!0)}));let n=0;!1===e&&(n=this.isOnSameAxisSide()?this.position.dataLabelHeight:2*this.position.dataLabelHeight);const r=s.bbox();this.scenariosArea={height:r.height+this.styles.padding.top+this.styles.padding.bottom+n,width:r.width+this.position.spacings.columnWidth}}drawLineScenarios(t,i){var s,h;const e=i.group().id("LineScenarios"),n=new k,r=new kt(this.position,e,this.scenarioStyles(),t.length,this.i18n);r.setCollisionManager(n);const o=["ac1","pp1","fc1","pl1"],a=[[],[],[],[]];t.forEach(((t,i)=>{["scenario1","scenario2","scenario3","scenario4"].forEach(((s,h)=>{t[s]&&a[h].push({dataPoint:t[s],index:i})}))}));const l=[];for(let t=0;t<a.length;t++){const i=a[t];if(i.length>0&&i.some((t=>!t.dataPoint.isEmpty()))){const e=(null===(h=null===(s=i[0])||void 0===s?void 0:s.dataPoint)||void 0===h?void 0:h.scenario)||o[t],n=e.slice(0,2).toLowerCase();l.push({points:i,scenarioName:e,scenarioType:n})}}l.sort(((t,i)=>(x[i.scenarioType]||99)-(x[t.scenarioType]||99)));const c=[];for(const t of l){const i=r.createLineSeries(t.points,t.scenarioName,y(this.ruleSet.getScenarioColorIndex(t.scenarioName)));c.push({series:i,scenarioType:t.scenarioType})}for(const t of c)t.series.drawGeometry();r.moveLabelsToFront();const u=[...c].sort(((t,i)=>(x[t.scenarioType]||99)-(x[i.scenarioType]||99)));for(const t of u)t.series.drawLabels(this.dataFormatDigits,this.measureScale);const d=this.position.getColumnPositionY(),f=e.bbox();this.scenariosArea={height:Math.max(f.height+this.styles.padding.top,d)+this.styles.padding.bottom,width:f.width+this.position.spacings.columnWidth}}drawAxisAndLabelsForLineChart(t,i){const s=this.createDateFactory(),h=i.group().id("AxisAndDateLabelsLine"),e=!1,n=t.length-1;!1===this.hideAxisLabels&&t.forEach(((i,r)=>{if(!this.shouldShowLineChartAxisLabel(t,r))return;const{hookLocation:o,offset:a}=this.dateLabelPlace(i);let l;this.lineFullWidth&&this.availableWidth>0?this.axisLabelsMode===u.SMART?(l=s.getSmartDateString(i.date,this.dateInterval),0===r&&this.dateInterval!==R.YEAR&&(l=s.getShortDateString(i.date,this.dateInterval))):l=this.axisLabelsMode===u.SHORT?s.getShortDateString(i.date,this.dateInterval):s.getDateString(i.date,this.dateInterval):l=s.getShortDateString(i.date,this.dateInterval),new S(h,this.position.getColumnCenterPositionX(r),this.position.getAxisPositionY(e)+a,"",l,this.styles,o,P.Center).forceStringTypeDraw(),r>0&&r<n&&this.isYearChange(t,r)&&this.drawYearSeparatorLine(h,r,e)})),new ft({scenarioType:this.axisScenario,labelText:this.title,isRelative:e},this.position,h).draw();const r=h.bbox();this.axisCategoryArea={height:r.height,width:r.width}}shouldShowLineChartAxisLabel(t,i){return!!(this.lineFullWidth&&this.availableWidth>0)||(0===i||i===t.length-1||this.isYearChange(t,i))}isYearChange(t,i){var s,h;if(0===i)return!1;const e=null===(s=t[i])||void 0===s?void 0:s.date,n=null===(h=t[i-1])||void 0===h?void 0:h.date;return!(!e||!n)&&(this.dateInterval===R.WEEK?e.weekYear!==n.weekYear:e.year!==n.year)}drawYearSeparatorLine(t,i,s){const h=this.position.getColumnCenterPositionX(i)-this.position.spacings.columnWidth/2,e=this.position.columnValue.max.getScaledUnit()+this.position.dataLabelHeight,n=this.position.getAxisPositionY(s)-e,r=this.position.getAxisPositionY(s);t.line([[h,n],[h,r]]).stroke({color:"#999999",width:1,dasharray:"4,4"}).attr("stroke-dasharray","4,4")}drawVarianceScenario(t,i){const s=i.group().id("Scenarios"),h=new kt(this.position,s,this.scenarioStyles(),t.length,this.i18n);h.setOverflowConfig(this.overflowConfig),t.forEach(((t,i)=>{t.type===Ot.RELATIVE?h.createRelativeVarianceBar(t.scenario1,i).draw():h.createVarianceBar(t.scenario1,i).draw(this.dataFormatDigits,this.measureScale)}));const e=s.bbox();return this.scenariosArea={height:e.height+this.styles.padding.top+this.styles.padding.bottom,width:e.width+this.position.spacings.columnWidth},s}sortSegmentsByPropOrder(t){if(0===this.scenarioPropOrder.length)return;const i=this.scenarioPropOrder;t.sort(((t,s)=>{const h=i.indexOf(t.scenario),e=i.indexOf(s.scenario);return(-1===h?i.length:h)-(-1===e?i.length:e)}))}stackGroups(t){if(!this.stackConfig)return[];const i=this.stackConfig.by===f.SCENARIOS,s=this.determineEffectiveChartMode()===d.LINE,h=[];for(const e of i||s?["scenario1","scenario2","scenario3","scenario4"]:["scenario1"]){const i=t[e];i&&!i.isEmpty()&&null!=i.value&&h.push({value:i.value,scenario:i.scenario,dataPoint:i})}if(0===h.length)return[];const e=this.stackConfig.mode===c.RELATIVE?p:0,n=(t,i)=>({prefix:t,segments:i,layout:I(i.map((t=>t.value)),e),hasValue:i.some((t=>Number.isFinite(t.value)))});if(i&&this.sortSegmentsByPropOrder(h),s)return[n("",h)];if(i){const t=new Map;for(const i of h){const s=H(i.scenario);t.has(s)||t.set(s,[]),t.get(s).push(i)}if(t.size>1){const i=[];for(const s of V)t.has(s)&&(i.push(n(s,t.get(s))),t.delete(s));for(const[s,h]of t)i.push(n(s,h));return i}}const r=t=>Number.isFinite(t.value)?t.value:0;return"asc"===this.stackConfig.order?h.sort(((t,i)=>r(t)-r(i))):"desc"===this.stackConfig.order&&h.sort(((t,i)=>r(i)-r(t))),[n("",h)]}drawStackedScenarios(t,i){if(!this.stackConfig)return;const s=i.group().id("StackedScenarios"),h=this.stackConfig.by===f.SCENARIOS;t.forEach(((t,i)=>{const e=this.stackGroups(t);e.forEach(((n,r)=>{let o=null;n.segments.forEach(((t,a)=>{const l=new gt(this.position,this.styles,t.dataPoint,i,n.layout.segments[a],t.scenario,e.length>1?e.length-1-r:a,this.stackConfig.mode,n.layout,h,s);l.draw(this.dataFormatDigits,this.measureScale),o=l})),o&&n.hasValue&&o.drawTotalLabel(this.dataFormatDigits,this.measureScale,{date:At.pointDate(t.date),scenario:e.length>1?n.prefix:void 0})}))}));const e=s.bbox();this.scenariosArea={height:e.height+this.styles.padding.top+this.styles.padding.bottom,width:e.width+this.position.spacings.columnWidth}}drawStackedHeaders(t,i){if(!this.stackConfig||0===t.length)return;if(this.stackConfig.by!==f.SCENARIOS)return;const s=i.group().id("StackedHeaders"),h=this.stackGroups(t[0]);if(0===h.length)return;const e=this.position.getColumnPositionY(),n=this.position.getColumnCenterPositionX(0)-this.position.getColumnWidth()/2-this.position.spacings.labelToColumn,r=(t,i)=>{new S(s,n,t,"STACK_HEADER",i,this.styles,P.Center,P.Right).forceStringTypeDraw()};if(h.length>1)return void h.forEach(((t,i)=>{const{positive:s,negative:n,total:o}=t.layout;r(e-(i===h.length-1?(s-n)/2:o<0?0-n:s)*t.segments[0].dataPoint.pixelPerUnit,this.i18n.get(t.prefix+"1")||t.prefix.toUpperCase())}));const[o]=h;o.segments.forEach(((t,i)=>{const{start:s,end:h}=o.layout.segments[i];r(e-(s+h)/2*t.dataPoint.pixelPerUnit,this.i18n.get(t.scenario)||t.scenario)}))}drawStackedAreaScenarios(t,i){if(!this.stackConfig)return;const s=i.group().id("StackedAreaScenarios"),h=this.stackConfig.by===f.SCENARIOS,e=this.stackConfig.mode,n=["scenario1","scenario2","scenario3","scenario4"];if(0===(h?n.filter((i=>t.some((t=>t[i]&&!t[i].isEmpty())))).length:1))return;const r=[],o=[];for(const i of n)t.some((t=>t[i]&&!t[i].isEmpty()))&&o.push(i);if(h&&this.scenarioPropOrder.length>0){const i=this.scenarioPropOrder;o.sort(((s,h)=>{var e,n,r,o;const a=i.indexOf(null!==(n=null===(e=t[0][s])||void 0===e?void 0:e.scenario)&&void 0!==n?n:""),l=i.indexOf(null!==(o=null===(r=t[0][h])||void 0===r?void 0:r.scenario)&&void 0!==o?o:"");return(-1===a?i.length:a)-(-1===l?i.length:l)}))}for(const i of o){const s=t[0][i];r.push((null==s?void 0:s.scenario)||"ac1")}const a=(t,i)=>{const s=t[i];return s&&!s.isEmpty()&&Number.isFinite(s.value)?s.value:0},l=o.map((i=>t.reduce(((t,s)=>t+a(s,i)),0)<0?-0:0)),u=e===c.RELATIVE?p:0,d=t.map((t=>I(o.map(((i,s)=>a(t,i)||l[s])),u))),v=this.position.getColumnPositionY(),m=this.pixelPerUnit,b=(t,i)=>d.map(((s,h)=>({x:this.position.getColumnCenterPositionX(h),y:v-s.segments[t][i]*m})));for(let t=0;t<o.length;t++){const i=b(t,"end"),e=b(t,"start"),n=h?y(this.ruleSet.getScenarioColorIndex(r[t])):null,o=new Pt(s,i,e,n,t,h);o.draw(),o.drawBoundaryLine()}const w=s.bbox();this.scenariosArea={height:w.height+this.styles.padding.top+this.styles.padding.bottom,width:w.width+this.position.spacings.columnWidth}}drawOverlayLayer(t,i){if(0===t.length)return;const s=i.group().id("Overlay"),h=new kt(this.position,s,this.scenarioStyles(),t.length,this.i18n);if(!0===this.showOverlayAvg){let i=null;const s=function(t){const i=Tt(t),s=i.length>0?i.reduce(((t,i)=>t+i),0)/i.length:NaN,h=Object.assign(Object.assign({},t[0]),{scenario1:new rt(s,t[0].scenario1.scenario,t[0].scenario1.pixelPerUnit,t[0].scenario1.variance)}),e=Object.assign(Object.assign({},t[t.length-1]),{scenario1:new rt(s,t[t.length-1].scenario1.scenario,t[t.length-1].scenario1.pixelPerUnit,t[t.length-1].scenario1.variance)});return[h,...t.map((t=>Object.assign(Object.assign({},t),{scenario1:new rt(s,t.scenario1.scenario,t.scenario1.pixelPerUnit,t.scenario1.variance)}))),e]}(t);s.forEach(((t,s)=>{null!=i&&h.createLine(`Ø ${this.i18n.get(t.scenario1.scenario)||t.scenario1.scenario}`,t.scenario1,i,s-1).draw(this.dataFormatDigits,this.measureScale),i=t.scenario1}))}if(!0===this.showOverlayMedian){let i=null;const s=function(t){const i=Tt(t).sort(((t,i)=>t-i)),s=i.length%2==0?(i[i.length/2-1]+i[i.length/2])/2:i[Math.floor(i.length/2)],h=Object.assign(Object.assign({},t[0]),{scenario1:new rt(s,t[0].scenario1.scenario,t[0].scenario1.pixelPerUnit,t[0].scenario1.variance)}),e=Object.assign(Object.assign({},t[t.length-1]),{scenario1:new rt(s,t[t.length-1].scenario1.scenario,t[t.length-1].scenario1.pixelPerUnit,t[t.length-1].scenario1.variance)});return[h,...t.map((t=>Object.assign(Object.assign({},t),{scenario1:new rt(s,t.scenario1.scenario,t.scenario1.pixelPerUnit,t.scenario1.variance)}))),e]}(t);s.forEach(((t,s)=>{null!=i&&h.createLine(`Mdn ${this.i18n.get(t.scenario1.scenario)||t.scenario1.scenario}`,t.scenario1,i,s-1).draw(this.dataFormatDigits,this.measureScale),i=t.scenario1}))}}leftOuterJoinDates(t,i){const s=t.map((t=>t.calcdate)).filter((t=>null!=t&&"boolean"==typeof t.isValid&&t.isValid));if(0===s.length)return t;const h=$.max(...s),e=$.min(...s),n=new F;if(n.countBetween(e,h,i)>1e4)return t;const r=n.datesBetween(e,h,i),o=new Map;return r.forEach(((t,i)=>{o.set(t.toISO(),{id:i,calcdate:t,category:null,ac1:null,ac2:null,ac3:null,ac4:null,pp1:null,pp2:null,pp3:null,pp4:null,fc1:null,fc2:null,fc3:null,fc4:null,pl1:null,pl2:null,pl3:null,pl4:null,isEmpty:!0})})),t.forEach((t=>{const i=t.calcdate.toISO(),s=o.get(i);s&&s.isEmpty&&o.set(i,{id:s.id,calcdate:t.calcdate,category:t.category,ac1:t.ac1,ac2:t.ac2,ac3:t.ac3,ac4:t.ac4,pp1:t.pp1,pp2:t.pp2,pp3:t.pp3,pp4:t.pp4,fc1:t.fc1,fc2:t.fc2,fc3:t.fc3,fc4:t.fc4,pl1:t.pl1,pl2:t.pl2,pl3:t.pl3,pl4:t.pl4,isEmpty:!1})})),Array.from(o.values())}}function Tt(t){return t.map((t=>{var i;return null===(i=t.scenario1)||void 0===i?void 0:i.value})).filter((t=>Number.isFinite(t)))}class Dt{constructor(t,i){this.data=t,this.scenarios=i,this.variances=[],this.title="",this.hideAxisLabels=!1,this.pixelPerUnit=10,this.pixelPerPercentage=50,this.leftSideOffsetForHorizontalSync=-1,this.dateInterval=R.AUTO,this.axisLabelsMode=u.SMART,this.intervalSpanLimit=28,this.filter="",this.measureScale=new M,this.measureUnit="",this.showMeasureScale=!0,this.dataFormatDigits={decimal:1,percent:2},this.showOverlayMedian=!0,this.showOverlayAvg=!0,this.chartMode=d.BAR,this.maxBars=28,this.stackConfig=null,this.lineFullWidth=!0,this.locale="de"}}class $t{constructor(t,i,s,h,e,n){this.dataRowAdapter=t,this.stringAdapter=i,this.dataFormatDigitsAdapter=s,this.db=h,this.fromExpr=e,this.onQueryError=n}adapt(t){const i=Z.adaptArray(t.data,this.dataRowAdapter),s=Z.adaptArray(t.scenarios,this.stringAdapter),h=new Dt(i,s);return l.isArray(t.variances)&&(h.variances=Z.adaptArray(t.variances,this.stringAdapter)),l.isString(t.title)&&(h.title=t.title),l.isBoolean(t.hideAxisLabels)&&(h.hideAxisLabels=t.hideAxisLabels),l.isNumber(t.pixelPerUnit)&&(h.pixelPerUnit=t.pixelPerUnit),l.isNumber(t.pixelPerPercentage)&&(h.pixelPerPercentage=t.pixelPerPercentage),l.isExisting(t.dateInterval)&&(h.dateInterval=t.dateInterval),l.isExisting(t.axisLabelsMode)&&(h.axisLabelsMode=t.axisLabelsMode),l.isNumber(t.leftSideOffsetForHorizontalSync)&&(h.leftSideOffsetForHorizontalSync=t.leftSideOffsetForHorizontalSync),l.isNumber(t.intervalSpanLimit)&&(h.intervalSpanLimit=t.intervalSpanLimit),l.isString(t.filter)&&(h.filter=t.filter),l.isExisting(t.measureScale)&&(h.measureScale=K.calculateMeasureScale(this.db,this.fromExpr,h.scenarios,t.measureScale,this.onQueryError)),l.isString(t.measureUnit)&&(h.measureUnit=t.measureUnit),l.isBoolean(t.showMeasureScale)&&(h.showMeasureScale=t.showMeasureScale),l.isExisting(t.dataFormatDigits)&&(h.dataFormatDigits=this.dataFormatDigitsAdapter.adapt(t.dataFormatDigits)),l.isBoolean(t.showOverlayAvg)&&(h.showOverlayAvg=t.showOverlayAvg),l.isBoolean(t.showOverlayMedian)&&(h.showOverlayMedian=t.showOverlayMedian),l.isExisting(t.chartMode)&&(h.chartMode=t.chartMode),l.isNumber(t.maxBars)&&(h.maxBars=t.maxBars),l.isExisting(t.stackConfig)&&(h.stackConfig=t.stackConfig),l.isBoolean(t.lineFullWidth)&&(h.lineFullWidth=t.lineFullWidth),l.isString(t.locale)&&(h.locale=t.locale),h}default(){return new Dt([],[])}}const Et=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.scenarios=[],this.variances=[],this.hideAxisLabels=!1,this.pixelPerUnit=2,this.pixelPerPercentage=50,this.leftSideOffsetForHorizontalSync=-1,this.i18n=new Map,this.dateInterval=R.AUTO,this.intervalSpanLimit=28,this.axisLabelsMode=u.SMART,this.filter="",this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.showOverlayMedian=!1,this.showOverlayAvg=!1,this.chartMode=d.BAR,this.maxBars=28,this.stackConfig=null,this.lineFullWidth=!0,this.containerWidth=0,this.dataFormatDigits={percent:2,decimal:1},this.parentDimensions={width:0,height:0},E(this)}getDb(){return this.stores||(this.stores=_(this.element)),this.stores.db.db}render(){var t,i,e,n;if(void 0===this.chart||void 0!==this.queryError)return s(h,null);if(this.chart.hasNoData()){const i=null!==(t=this.i18n.get("no-data"))&&void 0!==t?t:"No Data";return s(h,{class:"no-data"},s("div",{class:"empty-state"},i))}return s(h,null,s("div",{innerHTML:null===(i=this.pattern)||void 0===i?void 0:i.toString(),class:"hidePatternContainer"}),s("div",{class:this.showMeasureScale?"footer":"footer-hide"},null===(e=this.chart)||void 0===e?void 0:e.getFooter()),s("div",{innerHTML:null===(n=this.chart)||void 0===n?void 0:n.toString()}))}syncQueryError(){var t,i;this.queryError=null!==(t=this.measureScaleError)&&void 0!==t?t:null===(i=this.chart)||void 0===i?void 0:i.getQueryError(),j(this.errors,this.queryError)}async componentWillLoad(){var t;const i=this.prepareConfig(),s=this.prepareStyle(),h=this.containerWidth||0;this.chart=new At(new b(this.ruleSetConfig),this.getDb(),this.tableName,i,s,h),this.chart.setI18n(this.i18n);const e=i.pixelPerUnit<=0;this.autoFitScaling(i,s),this.chart.setAvailableHeight(e?0:(null===(t=this.parentDimensions)||void 0===t?void 0:t.height)||0),this.pattern=new nt(this.chart.styles),this.chart.setPattern("hatched",this.pattern.getFCPolygonPattern()),this.syncQueryError()}async componentWillUpdate(){var t;if(null==this.chart)return;const i=this.prepareConfig(),s=this.prepareStyle();this.chart.setI18n(this.i18n),this.chart.setStyles(s),this.chart.setAvailableWidth(this.containerWidth||0),this.chart.setRuleSet(new b(this.ruleSetConfig)),this.chart.setConfig(i);const h=i.pixelPerUnit<=0;this.autoFitScaling(i,s),this.chart.setAvailableHeight(h?0:(null===(t=this.parentDimensions)||void 0===t?void 0:t.height)||0),this.pattern=new nt(this.chart.styles),this.chart.setPattern("hatched",this.pattern.getFCPolygonPattern()),this.syncQueryError()}autoFitScaling(t,i){var s;const h=t.pixelPerUnit<=0,e=t.pixelPerPercentage<=0;if(!h&&!e)return;const n=()=>{var i;null===(i=this.reportAutoScaling)||void 0===i||i.call(this,{unit:h?t.pixelPerUnit:void 0,percentage:e?t.pixelPerPercentage:void 0})},r=null===(s=this.parentDimensions)||void 0===s?void 0:s.height,o=this.containerWidth||0,a=()=>{this.chart=new At(new b(this.ruleSetConfig),this.getDb(),this.tableName,t,i,o),this.chart.setI18n(this.i18n)},l=()=>(this.chart.layout(),this.chart.getAllocatedCanvasHeight());if(!r||r<=0)return h&&(t.pixelPerUnit=1),e&&(t.pixelPerPercentage=50),a(),void n();h&&(t.pixelPerUnit=1),e&&(t.pixelPerPercentage=1),a();let c=l();if(c<=0)return void n();const u=Math.max(U,.9*r/c);let d=!1,f=!1,p=null;for(let i=0;i<=3;i++){const i=X({target:r,measured:c,unitExtent:h?this.chart.getUnitBarExtent():0,pctExtent:e?this.chart.getPercentBarExtent():0,currentPpu:t.pixelPerUnit,currentPpp:t.pixelPerPercentage});if(void 0===i.ppu&&void 0===i.ppp)break;if(h&&void 0!==i.ppu&&(t.pixelPerUnit=i.ppu,d=!0),e&&void 0!==i.ppp&&(t.pixelPerPercentage=i.ppp,f=!0),a(),c=l(),c<=r+.5&&(p={ppu:t.pixelPerUnit,ppp:t.pixelPerPercentage},c>=.98*r))break}let v=!1;if(h&&!d&&(t.pixelPerUnit=u,v=!0),e&&!f&&(t.pixelPerPercentage=u,v=!0),c>r+.5){if(p)d&&(t.pixelPerUnit=p.ppu),f&&(t.pixelPerPercentage=p.ppp);else{const i=r/c;h&&(t.pixelPerUnit=Math.max(U,t.pixelPerUnit*i)),e&&(t.pixelPerPercentage=Math.max(U,t.pixelPerPercentage*i))}v=!0}v&&a(),n()}async componentWillRender(){}componentDidLoad(){}componentDidUpdate(){}prepareConfig(){var t,i,s;const h=this.getDb(),e=N(h,this.tableName,this.filter);return this.measureScaleError=void 0,new $t(new at,new Q,new q,h,e,(t=>{this.measureScaleError=Y(t)})).adapt({scenarios:this.scenarios,variances:this.variances,title:this.chartTitle,hideAxisLabels:this.hideAxisLabels,pixelPerUnit:this.pixelPerUnit,pixelPerPercentage:this.pixelPerPercentage,dateInterval:this.dateInterval,axisLabelsMode:this.axisLabelsMode,leftSideOffsetForHorizontalSync:this.leftSideOffsetForHorizontalSync,intervalSpanLimit:this.intervalSpanLimit,filter:this.filter,measureScale:this.measureScale,measureUnit:this.measureUnit,showMeasureScale:this.showMeasureScale,dataFormatDigits:this.dataFormatDigits,showOverlayMedian:this.showOverlayMedian,showOverlayAvg:this.showOverlayAvg,chartMode:this.chartMode,maxBars:this.maxBars,stackConfig:this.stackConfig,lineFullWidth:this.lineFullWidth,locale:(null===(s=null===(i=null===(t=this.stores)||void 0===t?void 0:t.context)||void 0===i?void 0:i.state)||void 0===s?void 0:s.locale)||"de"})}prepareStyle(){var t,i;const s=new ct(new it,new r,new o(new A),new J(new A),new a).adapt(this.styles);return s.locale=(null===(i=null===(t=_(this.element).context)||void 0===t?void 0:t.state)||void 0===i?void 0:i.locale)||"de",s}get element(){return this}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-default{stroke:black;stroke-width:0.1em}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}.hide{opacity:0}.footer{margin:0.2em;font-size:0.6em}.footer-hide{display:none}svg#drawCanvas{display:block}'}},[1,"bn-chart-time-renderer",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],chartTitle:[1,"chart-title"],scenarios:[16],variances:[16],hideAxisLabels:[4,"hide-axis-labels"],pixelPerUnit:[2,"pixel-per-unit"],pixelPerPercentage:[2,"pixel-per-percentage"],reportAutoScaling:[16],errors:[16],leftSideOffsetForHorizontalSync:[2,"left-side-offset-for-horizontal-sync"],styles:[1040],i18n:[1040],dateInterval:[1,"date-interval"],intervalSpanLimit:[2,"interval-span-limit"],axisLabelsMode:[1,"axis-labels-mode"],filter:[1],measureScale:[1,"measure-scale"],measureUnit:[1,"measure-unit"],showMeasureScale:[4,"show-measure-scale"],showOverlayMedian:[4,"show-overlay-median"],showOverlayAvg:[4,"show-overlay-avg"],chartMode:[1,"chart-mode"],maxBars:[2,"max-bars"],stackConfig:[16],lineFullWidth:[4,"line-full-width"],containerWidth:[2,"container-width"],dataFormatDigits:[16],parentDimensions:[16],ruleSetConfig:[16]}]);function Nt(){"undefined"!=typeof customElements&&["bn-chart-time-renderer"].forEach((t=>{"bn-chart-time-renderer"===t&&(customElements.get(e(t))||customElements.define(e(t),Et))}))}export{Et as B,Nt as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as t}from"./p-BQMKgvEC.js";import{X as s}from"./p-BVKLCz2k.js";import{L as i,H as n}from"./p-DPLcGhVt.js";import{F as o,C as e}from"./p-xpguaboj.js";import{N as r}from"./p-BJmwHV0a.js";import{s as h}from"./p-Xb6Ilq8u.js";import{D as l}from"./p-DEHnizot.js";import{b as a}from"./p-BpsXOtoW.js";class c{constructor(t,i,n,o){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=n,this.padding=o,this.seriesColors=[...s],this.locale="de"}}class u{constructor(t,s,i,n){this.scaleFactorsXYChartAdapter=t,this.fontStyleAdapter=s,this.svgStyleGroupAdapter=i,this.paddingAdapter=n}adapt(s){const i=this.default();return t.isExisting(s)&&(t.isExisting(s.scaleFactors)&&(i.scaleFactors=this.scaleFactorsXYChartAdapter.adapt(s.scaleFactors)),t.isExisting(s.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(s.fontStyles)),t.isExisting(s.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(s.axisStyles)),t.isExisting(s.padding)&&(i.padding=this.paddingAdapter.adapt(s.padding)),Array.isArray(s.seriesColors)&&s.seriesColors.length>0&&(i.seriesColors=s.seriesColors)),i}default(){return new c(this.scaleFactorsXYChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.paddingAdapter.default())}}class f{constructor(){this.pointRadius=.4,this.bubbleMaxRadius=3.2,this.bubbleMinRadius=.35,this.axisTickLength=.35,this.labelToMark=.3,this.legendSwatch=.9,this.panelGap=1.6,this.refLineWidth=.075,this.gridLineWidth=.075}}class d{adapt(s){const i=new f;return t.isNumber(s.pointRadius)&&(i.pointRadius=s.pointRadius),t.isNumber(s.bubbleMaxRadius)&&(i.bubbleMaxRadius=s.bubbleMaxRadius),t.isNumber(s.bubbleMinRadius)&&(i.bubbleMinRadius=s.bubbleMinRadius),t.isNumber(s.axisTickLength)&&(i.axisTickLength=s.axisTickLength),t.isNumber(s.labelToMark)&&(i.labelToMark=s.labelToMark),t.isNumber(s.legendSwatch)&&(i.legendSwatch=s.legendSwatch),t.isNumber(s.panelGap)&&(i.panelGap=s.panelGap),t.isNumber(s.refLineWidth)&&(i.refLineWidth=s.refLineWidth),t.isNumber(s.gridLineWidth)&&(i.gridLineWidth=s.gridLineWidth),i}default(){return new f}}function v(t,s,i){const n={[i.pointLevel]:t.name};return null!==i.seriesLevel&&""!==t.seriesKey&&(n[i.seriesLevel]=t.seriesKey),null!==i.facet&&""!==s&&(n["rowgroup"===i.facet.level?"rowGroup":"category"]=s),n}class p{constructor(t,s,i,n){this.count=t,this.drawingRect=i,this.panelGapPx=n,this.columns=Math.max(1,Math.min(null!=s?s:t,t)),this.rows=Math.max(1,Math.ceil(t/this.columns))}panelRect(t){const s=t%this.columns,i=Math.floor(t/this.columns),n=(this.drawingRect.width-(this.columns-1)*this.panelGapPx)/this.columns,o=(this.drawingRect.height-(this.rows-1)*this.panelGapPx)/this.rows;return{x:this.drawingRect.x+s*(n+this.panelGapPx),y:this.drawingRect.y+i*(o+this.panelGapPx),width:n,height:o}}isOuterLeft(t){return t%this.columns==0}isOuterBottom(t){return t+this.columns>=this.count}}function m(t,s,i,n=!1){return o.number(t,n?"percent":"decimal",s,s,1,i)}function w(t,s){return r.tickDecimals(s?t.map((t=>100*t)):t)}const x=["n","ne","e","se","s","sw","w","nw"],y=Math.SQRT1_2;class b{constructor(t,s,n=new i){this.frame=t,this.gapPx=s,this.manager=n}registerMark(t,s,i){this.manager.register(this.bounds(t-i,s-i,2*i,2*i))}selectCandidates(t,s,i,n){if("none"===s)return{selected:[],unknownNames:[]};if("all"===s)return{selected:[...t],unknownNames:[]};if("auto"===s)return{selected:t.slice(0,i),unknownNames:[]};const o=new Set(s),e=t.filter((t=>o.has(n(t)))),r=new Set(e.map((t=>n(t))));return{selected:e,unknownNames:s.filter((t=>!r.has(t)))}}place(t){const s=[];for(const i of t)for(const t of x){const n=this.anchorBox(i,t);if(!this.insideFrame(n.x,n.y,i.width,i.height))continue;const o=this.bounds(n.x,n.y,i.width,i.height);if(!this.manager.hasCollision(o)){this.manager.register(o),s.push({candidate:i,x:n.x,y:n.y,anchor:t});break}}return s}anchorBox(t,s){const i=t.r+this.gapPx,n=t.r*y+.5*this.gapPx;switch(s){case"n":return{x:t.cx-t.width/2,y:t.cy-i-t.height};case"ne":return{x:t.cx+n,y:t.cy-n-t.height};case"e":return{x:t.cx+i,y:t.cy-t.height/2};case"se":return{x:t.cx+n,y:t.cy+n};case"s":return{x:t.cx-t.width/2,y:t.cy+i};case"sw":return{x:t.cx-n-t.width,y:t.cy+n};case"w":return{x:t.cx-i-t.width,y:t.cy-t.height/2};case"nw":return{x:t.cx-n-t.width,y:t.cy-n-t.height}}}insideFrame(t,s,i,n){return t>=this.frame.x&&s>=this.frame.y&&t+i<=this.frame.x+this.frame.width&&s+n<=this.frame.y+this.frame.height}bounds(t,s,i,o){return{x:t,y:s,width:i,height:o,pointIndex:0,preferredHook:n.Center}}}class g{constructor(t,s,i,n){this.xScale=t,this.yScale=s,this.rect=i,this.styles=n}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}drawBands(t,s,i){var n,o,e,r;const h=this.styles.axisStyles.pl.fill;if(void 0!==s&&(void 0!==s.from||void 0!==s.to)){const i=this.xScale.scale(null!==(n=s.from)&&void 0!==n?n:this.xScale.domainMin),e=this.xScale.scale(null!==(o=s.to)&&void 0!==o?o:this.xScale.domainMax);t.rect(Math.abs(e-i),this.rect.height).move(Math.min(i,e),this.rect.y).fill(h)}if(void 0!==i&&(void 0!==i.from||void 0!==i.to)){const s=this.yScale.scale(null!==(e=i.from)&&void 0!==e?e:this.yScale.domainMin),n=this.yScale.scale(null!==(r=i.to)&&void 0!==r?r:this.yScale.domainMax);t.rect(this.rect.width,Math.abs(s-n)).move(this.rect.x,Math.min(s,n)).fill(h)}}drawGrid(t,s,i){const n={color:this.styles.axisStyles.pp.stroke,width:h(this.styles.scaleFactors.gridLineWidth,this.em)};for(const i of s){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}if(void 0!==i)for(const s of i){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}}drawRefLines(t,s,i){const n={color:this.styles.axisStyles.fc.stroke,width:h(this.styles.scaleFactors.refLineWidth,this.em)};if(void 0!==s){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}if(void 0!==i){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}}drawFrame(t){t.rect(this.rect.width,this.rect.height).move(this.rect.x,this.rect.y).fill("none").stroke({color:this.styles.axisStyles.ac.stroke,width:h(this.styles.scaleFactors.gridLineWidth,this.em)})}drawTickLabels(t,s){const i=this.styles.scaleFactors.axisTickLength*this.em,n={size:this.styles.fontStyles.size,anchor:"start"},o=this.fontFamily(),e=this.styles.fontStyles.color;if(s.showXLabels)for(const r of s.ticksX){const h=this.xScale.scale(r);t.text(m(r,s.xDecimals,this.styles.locale,s.xPercent)).font(Object.assign(Object.assign({},n),{anchor:"middle"})).fill(e).attr({x:h,y:this.rect.y+this.rect.height+i+.8*this.em,"font-family":o})}if(s.showYLabels)for(const r of s.ticksY){const h=this.yScale.scale(r);t.text(m(r,s.yDecimals,this.styles.locale,s.yPercent)).font(Object.assign(Object.assign({},n),{anchor:"end"})).fill(e).attr({x:this.rect.x-i,y:h+.35*this.em,"font-family":o})}}drawPanelTitle(t,s){""!==s&&t.text(s).font({size:this.styles.fontStyles.size,weight:"bold",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:this.rect.x+.5*this.em,y:this.rect.y+1.2*this.em,"font-family":this.fontFamily()})}}class M{constructor(t){this.styles=t}get em(){return this.styles.fontStyles.size}get rowHeight(){return 1.5*this.em}get swatchSize(){return this.styles.scaleFactors.legendSwatch*this.em}textWidth(t,s=!1){const i=e(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:s?"bold":"normal"}).width;return Number.isFinite(i)&&i>0?i:.6*t.length*this.em}rows(t){const s=[];t.sizeCaption.forEach(((t,i)=>{s.push({text:t,bold:0===i,treatment:null})})),null!==t.title&&""!==t.title&&s.push({text:t.title,bold:!0,treatment:null});for(const i of[...t.compareEntries,...t.entries])s.push({text:i.label,bold:!1,treatment:i.treatment,fill:i.fill});return s}measure(t,s){const i=this.rows(t);if(0===i.length)return{width:0,height:0};const n=this.swatchSize+.4*this.em;if("bottom"===s){let t=0;for(const s of i)t+=(null!==s.treatment?n:0)+this.textWidth(s.text,s.bold)+1.5*this.em;return{width:t,height:this.rowHeight}}let o=0;for(const t of i)o=Math.max(o,(null!==t.treatment?n:0)+this.textWidth(t.text,t.bold));return{width:o,height:i.length*this.rowHeight}}draw(t,s,i,n,o){var e;const r=this.rows(s),h=this.swatchSize+.4*this.em;let l=i,a=n;for(const s of r){let i=l;if(null!==s.treatment){const n=t.circle(this.swatchSize).move(l,a+(this.rowHeight-this.swatchSize)/2).fill(null!==(e=s.fill)&&void 0!==e?e:s.treatment.hatch?"#ffffff":s.treatment.fill).stroke({color:"#ffffff"===s.treatment.stroke?s.treatment.fill:s.treatment.stroke,width:s.treatment.strokeWidth});void 0!==s.treatment.dasharray&&n.attr("stroke-dasharray",s.treatment.dasharray),i+=h}t.text(s.text).font({size:this.styles.fontStyles.size,weight:s.bold?"bold":"normal",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:i,y:a+this.rowHeight/2+.35*this.em,"font-family":this.fontFamily()}),"bottom"===o?l=i+this.textWidth(s.text,s.bold)+1.5*this.em:a+=this.rowHeight}}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}}class N{constructor(){this.operation="+",this.custom={},this.counts={}}slotValue(s){const i=this[s];return t.isNumber(i)?i:null}slotHasNoData(t){return 0===this.counts[t]}}const j=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"];class S{adapt(s){const i=new N;if(t.isOperator(s.operation)&&(i.operation=s.operation),t.isString(s.date)){const t=l.fromISO(s.date);i.date=t.isValid?t:void 0}t.isString(s.rowGroup)&&t.isNumber(s.rowGroupIndex)&&(i.rowGroup=s.rowGroup,i.rowGroupIndex=s.rowGroupIndex),t.isString(s.category)&&t.isNumber(s.categoryIndex)&&(i.category=s.category,i.categoryIndex=s.categoryIndex),t.isString(s.subCategory)&&t.isNumber(s.subCategoryIndex)&&(i.subCategory=s.subCategory,i.subCategoryIndex=s.subCategoryIndex),t.isString(s.columnGroup)&&t.isNumber(s.columnGroupIndex)&&(i.columnGroup=s.columnGroup,i.columnGroupIndex=s.columnGroupIndex),t.isString(s.columnSubGroup)&&t.isNumber(s.columnSubGroupIndex)&&(i.columnSubGroup=s.columnSubGroup,i.columnSubGroupIndex=s.columnSubGroupIndex);for(const n of j){t.isNumber(s[n])&&(i[n]=s[n]);const o=s[`${n}_cnt`];t.isNumber(o)&&(i.counts[n]=o)}for(const t of Object.keys(s))t.startsWith("_")&&(i.custom[t]=s[t]);return i}default(){return new N}}const k={rowGroup:"rowGroupIndex",category:"categoryIndex",subCategory:"subCategoryIndex"};function z(t,s){if("scenario"===s.kind)return{value:t.slotValue(s.slot),varianceNoData:!1};if(t.slotHasNoData(s.measure.base)||t.slotHasNoData(s.measure.delta))return{value:null,varianceNoData:!0};const i=s.measure.compute(t.slotValue(s.measure.base),t.slotValue(s.measure.delta));return{value:i,varianceNoData:null===i}}function O(t,s){return void 0!==s&&(void 0!==s.min&&t<s.min||void 0!==s.max&&t>s.max)}function B(t,s){return"scenario"!==t.kind?null:s+a(t.slot)}function C(t,s){var i,n,o,e,r,h,l,a,c;const u=[],f=new Set,d=[];let v=0,p=0,m=0,w=0,x=0;const y=new Map,b=new Map,g=new Map,M=null!==(i=s.compareFamily)&&void 0!==i?i:null,N=null!==M?B(s.measures.x,M):null,j=null!==M?B(s.measures.y,M):null,S=null!==M&&void 0!==s.measures.size?B(s.measures.size,M):null;for(const i of t){const t=i[s.pointLevel];if(null==t||""===t)continue;const u=null!==(n=null!==s.facetLevel?i[s.facetLevel]:"")&&void 0!==n?n:"",M=null!==(o=null!==s.seriesLevel?i[s.seriesLevel]:"")&&void 0!==o?o:"",B=`${u}\0${M}\0${t}`;if(f.has(B)){v++,d.length<5&&!d.includes(t)&&d.push(t);continue}const C=z(i,s.measures.x),D=z(i,s.measures.y);if(null===C.value||null===D.value){(C.varianceNoData||D.varianceNoData)&&p++;continue}if(O(C.value,null===(e=s.domains)||void 0===e?void 0:e.x)||O(D.value,null===(r=s.domains)||void 0===r?void 0:r.y)){m++;continue}const F={name:t,seriesKey:M,facetKey:u,x:C.value,y:D.value,row:i};if(void 0!==s.measures.size){const t=z(i,s.measures.size).value;if(null===t)continue;if(t<0){w++;continue}F.size=t}if(void 0!==s.measures.share){const t=z(i,s.measures.share).value;null!==t&&(t<0||t>1?(x++,F.share=Math.min(1,Math.max(0,t))):F.share=t)}if(null!==N&&null!==j){const t=i.slotValue(N),n=i.slotValue(j),o=null!==S?i.slotValue(S):null;null===t||null===n||null!==S&&null===o?F.compare=null:O(t,null===(h=s.domains)||void 0===h?void 0:h.x)||O(n,null===(l=s.domains)||void 0===l?void 0:l.y)?(m++,F.compare=null):(F.compare={x:t,y:n},null!==o&&(F.compare.size=o))}if(f.add(B),g.has(u)||g.set(u,[]),g.get(u).push(F),null!==s.facetLevel){const t=i[k[s.facetLevel]];null!=t&&t<(null!==(a=y.get(u))&&void 0!==a?a:Number.POSITIVE_INFINITY)&&y.set(u,t)}if(null!==s.seriesLevel){const t=i[k[s.seriesLevel]];null!=t&&t<(null!==(c=b.get(M))&&void 0!==c?c:Number.POSITIVE_INFINITY)&&b.set(M,t)}}const C=[...g.keys()].sort(((t,s)=>{var i,n;return(null!==(i=y.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=y.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})),D=C.map((t=>{let i=g.get(t);return s.limit>0&&i.length>s.limit&&(i="size"===s.limitBy?[...i].sort(((t,s)=>{var i,n;return(null!==(i=s.size)&&void 0!==i?i:0)-(null!==(n=t.size)&&void 0!==n?n:0)})).slice(0,s.limit):i.slice(0,s.limit)),{key:t,points:i}})),F=new Set;for(const t of D)for(const s of t.points)F.add(s.seriesKey);const H=[...F].sort(((t,s)=>{var i,n;return(null!==(i=b.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=b.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})).map(((t,s)=>({key:t,index:s})));let L=null,I=0;for(const t of D)for(const s of t.points){I++;const t=[s.x],i=[s.y],n=void 0!==s.size?[s.size]:[];null!=s.compare&&(t.push(s.compare.x),i.push(s.compare.y),void 0!==s.compare.size&&n.push(s.compare.size)),null===L&&(L={xMin:t[0],xMax:t[0],yMin:i[0],yMax:i[0],sizeMax:0});for(const s of t)L.xMin=Math.min(L.xMin,s),L.xMax=Math.max(L.xMax,s);for(const t of i)L.yMin=Math.min(L.yMin,t),L.yMax=Math.max(L.yMax,t);for(const t of n)L.sizeMax=Math.max(L.sizeMax,t)}return v>0&&u.push({code:"xy-duplicate-point",data:{count:String(v),names:d.join(", ")}}),p>0&&u.push({code:"xy-variance-nodata",data:{count:String(p)}}),m>0&&u.push({code:"xy-point-clipped",data:{count:String(m)}}),w>0&&u.push({code:"bubble-size-negative",data:{count:String(w)}}),x>0&&u.push({code:"bubble-share-range",data:{count:String(x)}}),I>5e3&&u.push({code:"xy-point-budget",data:{count:String(I)}}),{facets:D,series:H,extents:L,warnings:u,totalPoints:I}}export{p as F,b as P,d as S,S as X,M as a,g as b,v as c,u as d,m as f,C as r,w as x}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=new Map([["split-vertical",'"a b"'],["split-horizontal",'"a" "b"'],["2x2",'"a b" "c d"'],["3x3",'"a b c" "d e f" "g h i"'],["4x4",'"a b c d" "e f g h" "i j k l" "m n o p"'],["1-over-2",'"a a" "b c"'],["2-over-1",'"a b" "c c"'],["1-over-3",'"a a a " "b c d"'],["3-over-1",'"a b c" "d d d"']]),o="custom-template",n=/"[\w\d\s.]+"|'[\w\d\s.]+'/g,a=/"[^"]*"|'[^']*'/g;function r(e){var o;return(null!==(o=null==e?void 0:e.match(n))&&void 0!==o?o:[]).map((e=>e.slice(1,-1).split(/\s+/).filter((e=>""!==e)))).filter((e=>e.length>0))}function t(n){return n===o||e.has(n)}function i(n,a){var t;return n===o?r(a).length>0?a:'"a"':null!==(t=e.get(n))&&void 0!==t?t:'"a"'}function l(e){var o;const n=(null===(o=r(e)[0])||void 0===o?void 0:o.length)||1;return Array(n).fill("minmax(0, 1fr)").join(" ")}function s(e){var o;return Array.from(new Set(null!==(o=null==e?void 0:e.match(/\b\w+\b/g))&&void 0!==o?o:[]))}function d(e){var o;const n=r(e);if(0===n.length)return'no row found, the layout is drawn as a single cell. Write one quoted row per grid row, e.g. \'"a a" "b c"\'.';const t=null!==(o=null==e?void 0:e.match(a))&&void 0!==o?o:[];return t.some((e=>""===e.slice(1,-1).trim()))?"a pair of quotes holds no cell, so the browser ignores the template.":t.length!==n.length?"a row cannot be read. Use only letters, digits, '_' and '.' in a cell name, and open and close every row with the same kind of quote.":n.some((e=>e.length!==n[0].length))?"the rows have different numbers of cells, so the browser ignores the template.":void 0}export{o as C,r as a,s as b,i as c,d,t as i,l as t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as n,c as o,R as t}from"./p-BVKLCz2k.js";import{f as e,g as i}from"./p-D6YGOYV1.js";import{r}from"./p-DEHnizot.js";import{i as s}from"./p-DYG9FH_u.js";const l="inherited-page",u="bn-layout-page";function a(n){return"inherited-closest"===n||n===l}function c(n,o){const t=[];let e=n.parentNode;for(;e;){const n=e.nodeName.toLowerCase();if(n===u){t.push(e);break}if("bn-layout-card"===n&&o!==l&&t.push(e),e.parentNode)e=e.parentNode;else{if(!(e instanceof ShadowRoot))break;e=e.host}}return t}function d(n,o){var t;const e=n=>{const t=n.getAttribute(o),e=null==t?void 0:t.trim();return s(e)||a(e)?void 0:t};for(const i of n){if((null===(t=i.getAttribute(o))||void 0===t?void 0:t.trim())===l){const o=n.find((n=>n.nodeName.toLowerCase()===u)),t=o&&e(o);if(void 0!==t)return t;continue}const r=e(i);if(void 0!==r)return r}}const v=(n,o,t)=>{const s=new Map,u=new Map;let v=null;const f=()=>{var t;const r=i(n);s.clear(),u.clear(),v&&(v.disconnect(),v=null);const l=new Map;for(const e of o){const o=n[e.propName];if("string"!=typeof o||!a(o))continue;u.set(e.propName,o);const i=c(r,o),v=d(i,e.ancestorAttr);void 0!==v&&s.set(e.propName,v);for(const n of i)l.set(n,[...null!==(t=l.get(n))&&void 0!==t?t:[],e.ancestorAttr])}if(l.size>0){v=new MutationObserver((()=>{f(),e(n)}));for(const[n,o]of l)v.observe(n,{attributes:!0,attributeFilter:o})}},p=n.connectedCallback;n.connectedCallback=()=>{f(),r(p,n)};const m=n.disconnectedCallback;n.disconnectedCallback=()=>{v&&(v.disconnect(),v=null),s.clear(),u.clear(),r(m,n)};const b=n=>{var t;return null===(t=o.find((o=>o.propName===n)))||void 0===t?void 0:t.ancestorAttr.replace(/-(\w)/g,((n,o)=>o.toUpperCase()))};return(n,o,e)=>{const i=`WARN_inherited_${n}`,r=a(o);r&&u.get(n)!==o&&f();const c=r?s.get(n):void 0;return r&&void 0===c?(null==t||t.addOrReplace({id:i,type:"warning",message:`${n}: '${o}' could not be resolved, no surrounding ${o===l?"page":"card or page"} sets ${b(n)}`}),{value:e,inherited:!1,unresolved:!0}):(null==t||t.remove(i),{value:null!=c?c:o,inherited:void 0!==c,unresolved:!1})}},f=s=>{let l,u,a,c,d=null;const v=()=>{const n=i(s);if(d&&(d.disconnect(),d=null),a=s.i18nNamespace,u=a,null!=u)return;const o=function(n){let o=n.parentNode;for(;o;){if(o instanceof HTMLElement&&o.hasAttribute("i18n-namespace"))return o;if(o.parentNode)o=o.parentNode;else{if(!(o instanceof ShadowRoot))break;o=o.host}}}(n);o&&(u=o.getAttribute("i18n-namespace"),d=new MutationObserver((()=>{v(),e(s)})),d.observe(o,{attributes:!0,attributeFilter:["i18n-namespace"]}))},f=s.connectedCallback;s.connectedCallback=()=>{const o=i(s);c=n(o),v(),l=c.internationalization.on("set",(n=>{n!==u&&"_system"!==n||e(s)})),r(f,s)};const p=s.disconnectedCallback;return s.disconnectedCallback=()=>{d&&(d.disconnect(),d=null),r(l),o(i(s)),r(p,s)},{t:(n,o)=>{var e,r,l,d,f;void 0!==c&&s.i18nNamespace!==a&&v(),n.startsWith(".")&&(n=i(s).localName+n),Object.prototype.hasOwnProperty.call(t,n)&&(n=t[n]);const p=c.internationalization.state,m=c.context.state.locale,b=null!==(l=null===(r=null===(e=p[u])||void 0===e?void 0:e[m])||void 0===r?void 0:r[n])&&void 0!==l?l:null===(f=null===(d=p._system)||void 0===d?void 0:d[m])||void 0===f?void 0:f[n];return null==b?n:b.replace(/{{([\s\S]+?)}}/g,((n,t)=>{var e;return null!==(e=null==o?void 0:o[t.trim()])&&void 0!==e?e:""}))}}};export{v as a,c as f,a as i,d as r,f as w}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,H as t,h as s,a as i,t as n}from"./p-D6YGOYV1.js";import{w as o}from"./p-DEHnizot.js";import{w as a}from"./p-jbp6YiHf.js";import{g as r}from"./p-BVKLCz2k.js";import{w as l}from"./p-CGI6XIaK.js";import{s as d}from"./p-CyUmrWfW.js";const f=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),o(this),this.errors=l(this),this.componentStyle=a(this)}connectedCallback(){this.stores=r(this.element)}getFontStyles(){return this.componentStyle((e=>{var t,s,i,n;return{"--bn-font-family":(null===(t=e.global)||void 0===t?void 0:t.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(s=e.global)||void 0===s?void 0:s.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(i=e.global)||void 0===i?void 0:i.fontColor)||"#000000","--bn-font-background":(null===(n=e.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}prepareAssetUrl(e){if(null==e||""===e)return"";const t=this.stores.assets.state;return e.startsWith("asset:")?t[e.substring(6)]:t[e]||e}render(){return s(i,{key:"4de8953156b05196149fe7a89e2b6a2d9f831695",id:this.text||this.image?"container-page-message":"container",style:this.getFontStyles()},s("div",{key:"ca005a6c2c06b59facea40c0aab4e146d51be557",id:"message-text"},null!=this.text&&""!==this.text?s("span",{class:"note",innerHTML:d(this.text)}):""),s("div",{key:"8fbdc7014401f0f02ef5c79b37bcc57b29a18a59",id:"page-image"},null!=this.image&&""!==this.image?s("img",{class:"image",src:this.prepareAssetUrl(this.image)}):""))}get element(){return this}static get style(){return':host{padding:0.2em 0.5em;display:flex;flex-direction:row;justify-content:space-between;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}:host(#container-page-message){min-height:4.55em;box-sizing:border-box;-webkit-box-sizing:border-box;border-bottom:0.1em solid #ddd}div#message-text{font-size:1.4em;overflow:clip;display:inline}span.note p{margin:0}.image{z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:block}'}},[1,"bn-message",{selectedStyle:[513,"selected-style"],text:[1025],image:[1]}]);function m(){"undefined"!=typeof customElements&&["bn-message"].forEach((e=>{"bn-message"===e&&(customElements.get(n(e))||customElements.define(n(e),f))}))}export{f as F,m as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as n}from"./p-BQMKgvEC.js";function i(n,i){var o;const e=null!==(o=null==n?void 0:n.trim())&&void 0!==o?o:"";if(""===e||"null"===e)return{data:null,parseError:!1};if(e.startsWith("{")||e.startsWith("["))try{const n=JSON.parse(e);return"object"!=typeof n||null===n||Array.isArray(n)?{data:null,parseError:!0}:{data:n,parseError:!1}}catch(n){return{data:null,parseError:!0}}return null!==i?{data:{[i]:e},parseError:!1}:{data:null,parseError:!0}}function o(n,i){return Object.keys(n).filter((n=>!i.includes(n)))}function e(i,o,e){if(n.isExisting(i[o]))return n.isString(i[o])?i[o]:void e.push(o)}function r(i,o,e){if(n.isExisting(i[o]))return n.isNumber(i[o])?i[o]:void e.push(o)}const t=["measure","label","unit","min","max","refLine","highlight"];function u(i){const u=[],l=e(i,"measure",u);if(void 0===l||""===l.trim())return u.push("measure"),{config:null,unknownKeys:o(i,t),invalidFields:u};const s={measure:l.trim()};return s.label=e(i,"label",u),s.unit=e(i,"unit",u),s.min=r(i,"min",u),s.max=r(i,"max",u),s.refLine=r(i,"refLine",u),s.highlight=function(i,o){if(!n.isExisting(i.highlight))return;if(!n.isObject(i.highlight)||Array.isArray(i.highlight))return void o.push("highlight");const e=i.highlight,t={},u=r(e,"from",o),l=r(e,"to",o);return void 0!==u&&(t.from=u),void 0!==l&&(t.to=l),t}(i,u),{config:s,unknownKeys:o(i,t),invalidFields:u}}const l=["measure","label","unit","group"];function s(n){const i=[],r=e(n,"measure",i);if(void 0===r||""===r.trim())return i.push("measure"),{config:null,unknownKeys:o(n,l),invalidFields:i};const t={measure:r.trim()};return t.label=e(n,"label",i),t.unit=e(n,"unit",i),t.group=e(n,"group",i),{config:t,unknownKeys:o(n,l),invalidFields:i}}const a=["measure"];function c(n){const i=[],r=e(n,"measure",i);return void 0===r||""===r.trim()?(i.push("measure"),{config:null,unknownKeys:o(n,a),invalidFields:i}):{config:{measure:r.trim()},unknownKeys:o(n,a),invalidFields:i}}const f=["values","label","unit","highlight"];function d(i){const t=[];let u=null;if("auto"===i.values?u="auto":n.isArray(i.values)&&i.values.every((i=>n.isNumber(i)))?u=i.values:t.push("values"),null===u)return{config:null,unknownKeys:o(i,f),invalidFields:t};const l={values:u};if(l.label=e(i,"label",t),l.unit=e(i,"unit",t),n.isExisting(i.highlight))if(n.isObject(i.highlight)&&!Array.isArray(i.highlight)){const n=r(i.highlight,"from",t);void 0!==n&&(l.highlight={from:n})}else t.push("highlight");return{config:l,unknownKeys:o(i,f),invalidFields:t}}const v=["points","values","max"];function g(i,e){const r=[],t={points:e.points,values:e.values,max:e.max};return n.isExisting(i.points)&&("auto"===i.points||"none"===i.points||"all"===i.points||n.isArray(i.points)&&i.points.every((i=>n.isString(i)))?t.points=i.points:r.push("points")),n.isExisting(i.values)&&(n.isBoolean(i.values)?t.values=i.values:r.push("values")),n.isExisting(i.max)&&(n.isNumber(i.max)&&i.max>0?t.max=Math.floor(i.max):r.push("max")),{config:t,unknownKeys:o(i,v),invalidFields:r}}const m=["level","columns"];function h(i){const e=[],r=n.isString(i.level)?i.level.toLowerCase():null;if("rowgroup"!==r&&"category"!==r)return e.push("level"),{config:null,unknownKeys:o(i,m),invalidFields:e};const t={level:r};return n.isExisting(i.columns)&&(n.isNumber(i.columns)&&i.columns>=1?t.columns=Math.floor(i.columns):e.push("columns")),{config:t,unknownKeys:o(i,m),invalidFields:e}}const p=["show","position"];function y(i){const e=[],r={show:!0,position:"right"};return n.isExisting(i.show)&&(n.isBoolean(i.show)?r.show=i.show:e.push("show")),n.isExisting(i.position)&&("right"===i.position||"bottom"===i.position?r.position=i.position:e.push("position")),{config:r,unknownKeys:o(i,p),invalidFields:e}}export{s as a,c as b,h as c,g as d,y as e,d as f,i as p,u as t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,H as e,h as i,a,t as s}from"./p-D6YGOYV1.js";import{v as r,a as n,b as o,c as d,d as l,e as h,i as u,f as v,g as p}from"./p-DYG9FH_u.js";import{w as c,D as m}from"./p-DEHnizot.js";import{w as f}from"./p-DsOaqeTN.js";import{a as b,g}from"./p-BVKLCz2k.js";import{w as D}from"./p-DdGnuNtc.js";import{w as y}from"./p-jbp6YiHf.js";import{r as w}from"./p-xpguaboj.js";import{w as S}from"./p-CkW23yp2.js";import{w as k}from"./p-CGI6XIaK.js";import{I as N}from"./p-BQMKgvEC.js";import{a as j}from"./p-CxPSvrcF.js";import{a as E,D as O}from"./p-xhiPDAZa.js";import{d as R}from"./p-BpCL2bfw.js";const W=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.businessUnit="",this.order="category",this.orderDirection="asc",this.dateFormat="none",this.dateLink="none",D(this),c(this),this.t=f(this).t,this.errors=k(this),this.componentStyle=y(this),this.ruleSetConfig=S(this)}validateScenario(t){const e="WARN_scenarios",i=r(t);i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"scenarios: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."}):this.errors.remove(e)}validateVariances(t){const e="WARN_variances",i=n(t);i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"variances: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."}):this.errors.remove(e)}validateOrder(t){const e=o(t),i="WARN_order";e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+(null==e?void 0:e.toString())+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const e="WARN_orderDirection";d(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateMeasures(t){const e="WARN_measures",i=l(t);i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"measures: invalid value(s) '"+(null==i?void 0:i.toString())+'\' are not supported. Valid format example: [{"name": "Bruttoumsatz", "unit": "mEUR"}]'}):this.errors.remove(e)}validateDateStart(t){const e="WARN_dateStart";h(t)||u(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateEnd(t){const e="WARN_dateEnd";h(t)||u(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateFormat(t){const e="WARN_dateFormat";v(t)||u(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:"dateFormat: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateLink(t){const e="WARN_dateLink";p(t)||u(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:"dateLink: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateMeasures(this.measures),this.validateDateStart(this.dateStart),this.validateDateEnd(this.dateEnd),this.validateDateFormat(this.dateFormat),this.validateDateLink(this.dateLink),this.validateOrderDirection(this.orderDirection),this.validateOrder(this.order)}prepareI18n(){const t=b,e=new Map(["SEPARATOR_WS","in","CONNECTOR_WS"].map((t=>[t,this.t(".".concat(t))]))),i=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...i.entries(),...e.entries(),...w(this.ruleSetConfig("user"))])}prepareI18nMode(){return N.META}prepareLocale(){return g(this.element).context.state.locale||"de"}prepareTitleOrder(){var t;return u(this.order)||u(this.orderDirection)?null:{hierarchy:this.order.split(",").map((t=>t.trim())),direction:j[null===(t=this.orderDirection)||void 0===t?void 0:t.toUpperCase()]}}prepareTitleTimePeriod(){var t,e;return u(this.dateStart)&&u(this.dateEnd)||u(this.dateLink)?null:{start:m.fromISO(this.dateStart,{zone:"utc"}),end:m.fromISO(this.dateEnd,{zone:"utc"}),format:O[null===(t=this.dateFormat)||void 0===t?void 0:t.toUpperCase()],link:E[null===(e=this.dateLink)||void 0===e?void 0:e.toUpperCase()]}}prepareMeasures(){if(u(this.measures))return[];try{return JSON.parse(this.measures)}catch(t){return[]}}prepareScenarios(){var t,e,i,a;if(u(this.scenarios)&&u(this.variances))return[];let s=[];return(null===(t=this.scenarios)||void 0===t?void 0:t.trim().length)>0&&(s=s.concat(null===(e=this.scenarios)||void 0===e?void 0:e.split(","))),(null===(i=this.variances)||void 0===i?void 0:i.trim().length)>0&&(s=s.concat(null===(a=this.variances)||void 0===a?void 0:a.split(","))),s.map((t=>t.trim()))}prepareBusinessUnit(){return u(this.businessUnit)||"null"===this.businessUnit?null:this.businessUnit}getFontStyles(){return this.componentStyle((t=>{var e,i,a,s;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(a=t.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(s=t.global)||void 0===s?void 0:s.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return i(a,{key:"f7509ed1e738bade4d252ae05b14e2531f118cb4",style:t},i("bn-title-renderer",{key:"fb9dcca5c06a11c4d3d6237ce4ade4d42a62396b",businessUnit:this.prepareBusinessUnit(),scenarios:this.prepareScenarios(),measures:this.prepareMeasures(),timeperiod:this.prepareTitleTimePeriod(),order:this.prepareTitleOrder(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode(),locale:this.prepareLocale(),ruleSetConfig:this.ruleSetConfig()}))}get element(){return this}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],measures:[{validateMeasures:0}],dateStart:[{validateDateStart:0}],dateEnd:[{validateDateEnd:0}],dateFormat:[{validateDateFormat:0}],dateLink:[{validateDateLink:0}]}}static get style(){return':host{padding:0.5em;margin-bottom:0.5em;box-sizing:border-box;-webkit-box-sizing:border-box;width:100%;display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-title",{selectedStyle:[513,"selected-style"],i18nNamespace:[513,"i18n-namespace"],ruleset:[513],businessUnit:[1,"business-unit"],scenarios:[1],variances:[1],order:[1],orderDirection:[1,"order-direction"],measures:[1],dateStart:[1,"date-start"],dateEnd:[1,"date-end"],dateFormat:[1,"date-format"],dateLink:[1,"date-link"]},void 0,{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],measures:[{validateMeasures:0}],dateStart:[{validateDateStart:0}],dateEnd:[{validateDateEnd:0}],dateFormat:[{validateDateFormat:0}],dateLink:[{validateDateLink:0}]}]);function x(){"undefined"!=typeof customElements&&["bn-title","bn-title-renderer"].forEach((t=>{switch(t){case"bn-title":customElements.get(s(t))||customElements.define(s(t),W);break;case"bn-title-renderer":customElements.get(s(t))||R()}}))}export{W as T,x as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,H as o,h as s,a as e,t as n}from"./p-D6YGOYV1.js";import{w as i}from"./p-DEHnizot.js";import{w as r}from"./p-jbp6YiHf.js";import{w as f}from"./p-CGI6XIaK.js";const a=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),i(this),this.errors=f(this),this.componentStyle=r(this)}getFontStyles(){return this.componentStyle((t=>{var o,s,e,n;return{"--bn-font-family":(null===(o=t.global)||void 0===o?void 0:o.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(e=t.global)||void 0===e?void 0:e.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){return s(e,{key:"fb9799f1ea3fadbf10dbc88aa668cad9d3e63853",style:this.getFontStyles()},s("slot",{key:"e08e29cdcac02cdd5caab034b0398b78de8951bf"}))}get element(){return this}static get style(){return':host{flex:1;min-height:0;position:relative;overflow:hidden;display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[257,"bn-body",{selectedStyle:[513,"selected-style"]}]);function l(){"undefined"!=typeof customElements&&["bn-body"].forEach((t=>{"bn-body"===t&&(customElements.get(n(t))||customElements.define(n(t),a))}))}export{a as B,l as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,H as i,h as s,a as e,t as h}from"./p-D6YGOYV1.js";import{r as n,m as o,s as r,g as a,d as l}from"./p-BVKLCz2k.js";import{C as d,I as c}from"./p-xpguaboj.js";import{w as u}from"./p-DEHnizot.js";import{e as v,r as m}from"./p-ClruFZD_.js";import{S as f,F as b,a as p,P as w}from"./p-D5-dYgK_.js";import{d as g,S as y}from"./p-COqIkH1M.js";import{X as x,r as M,a as $,x as z,f as L,b as S,P as j,c as k,F as C,d as P,S as D}from"./p-Dq1AzGKX.js";import{g as W}from"./p-4q8nRcWC.js";import{N}from"./p-BJmwHV0a.js";import{a as E,r as F,i as A}from"./p-BpsXOtoW.js";class T{constructor(t,i,s,e,h){this.mode=t,this.vMax=i,this.rMaxPx=s,this.rMinPx=e,this.areaPerUnitPx2=h}static local(t,i,s){return new T("local",t,i,s,0)}static grouped(t){return new T("grouped",0,0,0,t)}radius(t){return"grouped"===this.mode?t<=0?0:Math.sqrt(this.areaPerUnitPx2*t/Math.PI):this.vMax<=0||t<=0?this.rMinPx:Math.max(this.rMinPx,this.rMaxPx*Math.sqrt(t/this.vMax))}}class H{constructor(t,i,s,e,h,n){var o,r,a,l;this.ruleSet=t,this.config=e,this.styles=h,this.availableWidth=n,this.warnings=[],this.canvasHeight=0,this.i18nMap=new Map,this.hatchPatterns=new Set,this.scaleOverflowCount=0,this.svgRoot=null,this.config=Object.assign(Object.assign({},e),{x:E(e.x),y:E(e.y)});const d=new x;let c=[];try{""!==s&&(c=i.exec(`SELECT * FROM ${s}`))}catch(t){this.queryError=v(t)}const u=(null!=c?c:[]).map((t=>d.adapt(t)));this.data=M(u,{pointLevel:e.pointLevel,seriesLevel:e.seriesLevel,facetLevel:null!==e.facet?"rowgroup"===e.facet.level?"rowGroup":"category":null,measures:{x:null!==(o=F(e.x.measure))&&void 0!==o?o:{kind:"scenario",slot:"ac1"},y:null!==(r=F(e.y.measure))&&void 0!==r?r:{kind:"scenario",slot:"ac2"},size:null!==(a=F(e.size.measure))&&void 0!==a?a:{kind:"scenario",slot:"ac3"},share:null!==e.share&&null!==(l=F(e.share.measure))&&void 0!==l?l:void 0},compareFamily:e.compareFamily,domains:{x:{min:this.config.x.min,max:this.config.x.max},y:{min:this.config.y.min,max:this.config.y.max}},limit:e.limit,limitBy:"size"}),this.warnings.push(...this.data.warnings)}get em(){return this.styles.fontStyles.size}get xPercent(){return A(this.config.x.measure)}get yPercent(){return A(this.config.y.measure)}get sizePercent(){return A(this.config.size.measure)}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=d(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,e,h={}){var n,o;return t.text(i).font({size:this.styles.fontStyles.size,weight:h.bold?"bold":"normal",anchor:null!==(n=h.anchor)&&void 0!==n?n:"start"}).fill(null!==(o=h.color)&&void 0!==o?o:this.styles.fontStyles.color).attr({x:s,y:e,"font-family":this.fontFamily()})}hasNoData(){return 0===this.data.totalPoints}getWarnings(){return this.warnings}getQueryError(){return this.queryError}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.canvasHeight}setI18n(t){this.i18nMap=t}addWarningOnce(t,i){this.warnings.some((i=>i.code===t))||this.warnings.push({code:t,data:i})}primaryColorIndex(){const t=F(this.config.size.measure);return null===t||"variance"===t.kind?10:this.ruleSet.getScenarioColorIndex(t.slot)}compareColorIndex(){return this.ruleSet.getScenarioColorIndex(`${this.config.compareFamily}1`)}seriesHue(t){const{color:i,overflowed:s}=n(t,this.styles.seriesColors);return s&&this.addWarningOnce("xy-series-overflow",{}),i}familyDisplayName(t){return this.ruleSet.getScenario(`${t}1`).group}legendModel(){var t,i;const s=[],e=null!==(i=null!==(t=this.config.size.label)&&void 0!==t?t:this.i18nMap.get("legend.size"))&&void 0!==i?i:"";""!==e&&(s.push(e),void 0!==this.config.size.unit&&""!==this.config.size.unit&&s.push(`${this.i18nMap.get("axis.in")||"in"} ${this.config.size.unit}`));const h=[];if(null!==this.config.compareFamily){const t=F(this.config.size.measure),i=null!==t&&"scenario"===t.kind?t.slot.replace(/\d+$/,""):"ac";h.push(this.legendEntry(this.familyDisplayName(this.config.compareFamily),this.compareColorIndex(),0)),h.push(this.legendEntry(this.familyDisplayName(i),this.primaryColorIndex(),0))}const n=this.data.series.map((t=>{var i;return this.legendEntry(""===t.key?null!==(i=this.ruleSet.getScenario("").name)&&void 0!==i?i:"Series":t.key,this.primaryColorIndex(),t.index)}));return{sizeCaption:s,title:this.i18nMap.get("legend.title")||null,compareEntries:h,entries:n}}legendEntry(t,i,s){const e=this.seriesHue(s),h=o(i,e,"bubble");return{label:t,treatment:h,fill:this.treatmentFill(h,s,e)}}toString(){const t=new f;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}axisTitle(t,i){var s;const e=null!==(s=t.label)&&void 0!==s?s:"";return""===e?"":void 0===t.unit||""===t.unit?e:`${e} ${i} ${t.unit}`}draw(t){var i,s,e,h,n,o,r,a,l,d,c;this.warnings=this.data.warnings.slice(),this.hatchPatterns.clear(),this.scaleOverflowCount=0,this.svgRoot=t;const u=this.em,v=this.styles.padding,m=this.i18nMap.get("axis.in")||"in",f=t.group(),b=new $(this.styles),p=this.legendModel(),w=this.config.legend.show&&(p.entries.length>0||p.sizeCaption.length>0),g=w?b.measure(p,this.config.legend.position):{width:0,height:0},y="right"===this.config.legend.position&&w?g.width+u:0,x=""!==this.config.chartTitle?1.6*u:0,M=this.axisTitle(this.config.y,m),S=this.axisTitle(this.config.x,m),j=""!==M?1.4*u:.4*u,k=1.4*u+(""!==S?1.3*u:0);let P,D=3*u,W={x:0,y:0,width:0,height:0},E=[];const F=Math.max(1,this.data.facets.length),A=null===(i=this.config.facet)||void 0===i?void 0:i.columns,H=N.domain(null!==(e=null===(s=this.data.extents)||void 0===s?void 0:s.xMin)&&void 0!==e?e:0,null!==(n=null===(h=this.data.extents)||void 0===h?void 0:h.xMax)&&void 0!==n?n:1,{min:this.config.x.min,max:this.config.x.max}),O=N.domain(null!==(r=null===(o=this.data.extents)||void 0===o?void 0:o.yMin)&&void 0!==r?r:0,null!==(l=null===(a=this.data.extents)||void 0===a?void 0:a.yMax)&&void 0!==l?l:1,{min:this.config.y.min,max:this.config.y.max});for(let t=0;t<2;t++){const t=Math.max(10,this.availableWidth-v.left-v.right-D-y);W={x:v.left+D,y:v.top+x+j,width:t,height:t/this.config.aspect},P=new C(F,A,W,this.styles.scaleFactors.panelGap*u);const i=P.panelRect(0).height,s=Math.max(4,Math.min(8,Math.round(i/(4*u)))),e=new N(O[0],O[1],i,0);E=e.ticks(s);const h=z(E,this.yPercent);D=Math.max(...E.map((t=>this.textWidth(L(t,h,this.styles.locale,this.yPercent)))),u)+this.styles.scaleFactors.axisTickLength*u+.4*u}this.canvasHeight=W.y+W.height+k+("bottom"===this.config.legend.position&&w?g.height+u:0)+v.bottom,""!==this.config.chartTitle&&this.drawText(f,this.config.chartTitle,v.left,v.top+u,{bold:!0}),""!==M&&this.drawAxisTitleText(f,this.config.y,m,v.left,W.y-.6*u,"start");const B=this.buildPanels(P,H,O),I=B[0].xScale.ticks(Math.max(3,Math.min(8,Math.round(B[0].rect.width/(7*u))))),V=z(I,this.xPercent),X=z(E,this.yPercent),Y=this.config.sizeAreaPerUnit>0?T.grouped(this.config.sizeAreaPerUnit):T.local(null!==(c=null===(d=this.data.extents)||void 0===d?void 0:d.sizeMax)&&void 0!==c?c:0,this.styles.scaleFactors.bubbleMaxRadius*u,this.styles.scaleFactors.bubbleMinRadius*u);0===this.data.facets.length?this.drawPanel(f,B[0],{key:"",points:[]},Y,I,E,V,X,!0,!0):this.data.facets.forEach(((t,i)=>{this.drawPanel(f,B[i],t,Y,I,E,V,X,P.isOuterLeft(i),P.isOuterBottom(i),this.data.facets.length>1?t.key:"")})),""!==S&&this.drawAxisTitleText(f,this.config.x,m,W.x+W.width,W.y+W.height+2.6*u,"end"),w&&("right"===this.config.legend.position?b.draw(f,p,W.x+W.width+u,W.y,"right"):b.draw(f,p,W.x,W.y+W.height+k,"bottom")),this.scaleOverflowCount>0&&this.addWarningOnce("bubble-scale-overflow",{count:String(this.scaleOverflowCount)}),t.group().addClass("annotations")}drawAxisTitleText(t,i,s,e,h,n){var o;const r=null!==(o=i.label)&&void 0!==o?o:"",a=void 0!==i.unit&&""!==i.unit?`${s} ${i.unit}`:"",l=.3*this.em;"start"===n?(this.drawText(t,r,e,h,{bold:!0}),""!==a&&this.drawText(t,a,e+this.textWidth(r,!0)+l,h,{})):""!==a?(this.drawText(t,a,e,h,{anchor:"end"}),this.drawText(t,r,e-this.textWidth(a)-l,h,{anchor:"end",bold:!0})):this.drawText(t,r,e,h,{anchor:"end",bold:!0})}buildPanels(t,i,s){const e=[];for(let h=0;h<t.count;h++){const n=t.panelRect(h),o=new N(i[0],i[1],n.x,n.x+n.width),r=new N(s[0],s[1],n.y+n.height,n.y);e.push({rect:n,xScale:o,yScale:r,frame:new S(o,r,n,this.styles)})}return e}treatmentFill(t,i,s){return!0!==t.hatch?t.fill:(this.ensureHatchPattern(i,s),`url(#xy-fc-${i})`)}ensureHatchPattern(t,i){this.hatchPatterns.has(t)||null===this.svgRoot||(this.hatchPatterns.add(t),this.svgRoot.defs().pattern(10,10,(t=>{t.rect(10,10).fill("#ffffff"),t.line(0,10,10,0).stroke({color:i,width:2}),t.line(-2.5,2.5,2.5,-2.5).stroke({color:i,width:2}),t.line(7.5,12.5,12.5,7.5).stroke({color:i,width:2})})).id(`xy-fc-${t}`))}drawPanel(t,i,s,e,h,n,a,l,d,c,u=""){var v,m,f,b,p,w;const y=t.group(),x=this.em;i.frame.drawBands(y,this.config.x.highlight,this.config.y.highlight),i.frame.drawGrid(y,n,void 0===this.config.x.refLine&&void 0===this.config.y.refLine&&i.rect.width>30*x?h:void 0),i.frame.drawRefLines(y,this.config.x.refLine,this.config.y.refLine),i.frame.drawFrame(y);const M=y.group().id("compare"),$=y.group().id("primary"),z=new j(i.rect,this.styles.scaleFactors.labelToMark*x),L=[...s.points].sort(((t,i)=>{var s,e;return(null!==(s=i.size)&&void 0!==s?s:0)-(null!==(e=t.size)&&void 0!==e?e:0)})),S=[];for(const t of L){const h=null!==(m=null===(v=this.data.series.find((i=>i.key===t.seriesKey)))||void 0===v?void 0:v.index)&&void 0!==m?m:0,n=this.seriesHue(h),a=o(this.primaryColorIndex(),n,"bubble"),l=i.xScale.scale(t.x),d=i.yScale.scale(t.y),c=e.radius(null!==(f=t.size)&&void 0!==f?f:0);if(this.config.sizeAreaPerUnit>0&&this.bubbleExceedsPanel(i.rect,l,d,c)&&this.scaleOverflowCount++,null!=t.compare){const s=o(this.compareColorIndex(),n,"bubble"),r=i.xScale.scale(t.compare.x),a=i.yScale.scale(t.compare.y),l=e.radius(null!==(b=t.compare.size)&&void 0!==b?b:0);this.drawBubble(M,r,a,l,s,h,n),z.registerMark(r,a,l),this.config.labels.values&&void 0!==t.compare.size&&l>=1.2*x&&this.drawValueLabel(M,r,a,l,t.compare.size,s.fill)}const u=k(t,s.key,this.config);null===(p=this.drawBubble($,l,d,c,a,h,n))||void 0===p||p.attr(g(u,"element")),z.registerMark(l,d,c),void 0!==t.share&&c>0&&(null===(w=this.drawShareSlice($,l,d,c,t.share,r(n)))||void 0===w||w.attr(g(u))),this.config.labels.values&&void 0!==t.size&&this.drawValueLabel($,l,d,c,t.size,!0===a.hatch?"#ffffff":a.fill),S.push({point:t,cx:l,cy:d,r:c,seriesIndex:h,hue:n,treatment:a})}this.drawNameLabels(y,z,S,s.key),i.frame.drawTickLabels(y,{ticksX:h,ticksY:n,xDecimals:a,yDecimals:l,xPercent:this.xPercent,yPercent:this.yPercent,showXLabels:c,showYLabels:d}),""!==u&&i.frame.drawPanelTitle(y,u)}bubbleExceedsPanel(t,i,s,e){return i-e<t.x||i+e>t.x+t.width||s-e<t.y||s+e>t.y+t.height}drawBubble(t,i,s,e,h,n,o){if(!(e<=0))return t.circle(2*e).center(i,s).fill(this.treatmentFill(h,n,o)).stroke({color:h.stroke,width:h.strokeWidth})}drawShareSlice(t,i,s,e,h,n){if(h<=0)return;if(h>=1)return t.circle(2*e).center(i,s).fill(n);const o=2*h*Math.PI,r=i+e*Math.sin(o),a=s-e*Math.cos(o),l=o>Math.PI?1:0;return t.path(`M ${i} ${s} L ${i} ${s-e} A ${e} ${e} 0 ${l} 1 ${r} ${a} Z`).fill(n).stroke("none")}drawValueLabel(t,i,s,e,h,n){const o=L(h,this.valueDecimals(),this.styles.locale,this.sizePercent);this.textWidth(o)+.4*this.em>2*e||this.drawText(t,o,i,s+.35*this.em,{anchor:"middle",color:W(n)})}drawNameLabels(t,i,s,e){const h=[...s].sort(((t,i)=>{var s,e;return(null!==(s=i.point.size)&&void 0!==s?s:0)-(null!==(e=t.point.size)&&void 0!==e?e:0)})),{selected:n,unknownNames:o}=i.selectCandidates(h,this.config.labels.points,this.config.labels.max,(t=>t.point.name));o.length>0&&this.addWarningOnce("xy-label-unknown",{names:o.join(", ")});const r=new Map,a=n.map((t=>{const i={name:t.point.name,cx:t.cx,cy:t.cy,r:t.r,width:this.textWidth(t.point.name),height:1.1*this.em};return r.set(i,t.point),i}));for(const s of i.place(a))this.drawText(t,s.candidate.name,s.x,s.y+.9*s.candidate.height,{}).attr(g(k(r.get(s.candidate),e,this.config),"label"))}valueDecimals(){var t,i,s;let e=0;for(const h of this.data.facets)for(const n of h.points)e=Math.max(e,Math.abs(null!==(t=n.size)&&void 0!==t?t:0),Math.abs(null!==(s=null===(i=n.compare)||void 0===i?void 0:i.size)&&void 0!==s?s:0));return e>0&&Number.isFinite(e)?(this.sizePercent&&(e*=100),N.stepDecimals(Math.pow(10,Math.floor(Math.log10(e))-2))):1}}const O=["xy-duplicate-point","xy-point-clipped","xy-variance-nodata","xy-label-unknown","xy-series-overflow","xy-point-budget","bubble-size-negative","bubble-share-range","bubble-scale-overflow"],B=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.chartTitle="",this.share=null,this.compareFamily=null,this.facet=null,this.pointLevel="category",this.seriesLevel=null,this.aspect=16/9,this.limit=0,this.filter="",this.sizeAreaPerUnit=0,this.i18n=new Map,this.containerWidth=0,this.svgMarkup="",u(this)}getDb(){return this.stores||(this.stores=a(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=l(this.getDb(),this.tableName,this.filter);this.chart=new H(new c(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,x:this.x,y:this.y,size:this.size,share:this.share,compareFamily:this.compareFamily,labels:this.labels,legend:this.legend,facet:this.facet,pointLevel:this.pointLevel,seriesLevel:this.seriesLevel,aspect:this.aspect,limit:this.limit,sizeAreaPerUnit:this.sizeAreaPerUnit},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings()),m(this.errors,this.chart.getQueryError())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of O){const s=`WARN_${t.replace(/-/g,"_")}`;if(i.has(t)){const e=void 0!==this.translator?this.translator(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:e})}else this.errors.remove(s)}}prepareStyle(){var t,i;const s=new P(new D,new b,new p(new y),new w).adapt(this.styles);return s.locale=(null===(i=null===(t=a(this.element).context)||void 0===t?void 0:t.state)||void 0===i?void 0:i.locale)||"de",s}render(){var t;if(void 0===this.chart||void 0!==this.chart.getQueryError())return s(e,null);if(this.chart.hasNoData()){const i=null!==(t=this.i18n.get("no-data"))&&void 0!==t?t:"No Data";return s(e,{class:"no-data"},s("div",{class:"empty-state"},i))}return s(e,null,s("div",{innerHTML:this.svgMarkup}))}get element(){return this}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}'}},[1,"bn-chart-bubble-renderer",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],chartTitle:[1,"chart-title"],x:[16],y:[16],size:[16],share:[16],compareFamily:[1,"compare-family"],labels:[16],legend:[16],facet:[16],pointLevel:[1,"point-level"],seriesLevel:[1,"series-level"],aspect:[2],limit:[2],filter:[1],sizeAreaPerUnit:[2,"size-area-per-unit"],styles:[16],i18n:[16],containerWidth:[2,"container-width"],ruleSetConfig:[16],errors:[16],translator:[16]}]);function I(){"undefined"!=typeof customElements&&["bn-chart-bubble-renderer"].forEach((t=>{"bn-chart-bubble-renderer"===t&&(customElements.get(h(t))||customElements.define(h(t),B))}))}export{B,I as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=(n,e)=>Math.round(n*e*100)/100;function e(n){if(null==n||""===n)return{mode:"empty"};if("none"===n)return{mode:"none"};if("auto"===n)return{mode:"auto"};const e=Number(n);return!isNaN(e)&&e>0?{mode:"factor",factor:e}:{mode:"empty"}}const r={k:1e3,K:1e3,M:1e6,G:1e9,T:1e12},t=/^(\d+(?:\.\d+)?|\.\d+)\s*([kKMGT])?$/;function u(n){var e;if("number"==typeof n)return Number.isFinite(n)&&n>0?{kind:"number",value:n}:{kind:"invalid",raw:String(n)};const u=null!==(e=null==n?void 0:n.toString().trim())&&void 0!==e?e:"";if("auto"===u.toLowerCase())return{kind:"auto"};const i=t.exec(u);if(i){const n=Number(i[1])*(i[2]?r[i[2]]:1);if(Number.isFinite(n)&&n>0)return{kind:"number",value:n}}return{kind:"invalid",raw:u}}function i(n,e){const r=u(n);if("auto"===r.kind)return{kind:"auto"};if("string"==typeof n){const r=n.trim();if(e.has(r))return{kind:"value",value:e.get(r)}}return"number"===r.kind?{kind:"value",value:r.value}:{kind:"invalid",raw:r.raw}}const o=[[1e12,"T"],[1e9,"G"],[1e6,"M"],[1e3,"k"]];function a(n){if(!Number.isFinite(n)||n<=0)return String(n);const e=n=>String(Number(n.toPrecision(3)));for(const[r,t]of o)if(n>=r)return`${e(n/r)}${t}`;return e(n)}export{u as a,a as f,e as p,i as r,n as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,H as s,h as i,a as n,t as e}from"./p-D6YGOYV1.js";import{r as h,m as o,g as r,d as a}from"./p-BVKLCz2k.js";import{C as l,I as d}from"./p-xpguaboj.js";import{w as c}from"./p-DEHnizot.js";import{e as u,r as m}from"./p-ClruFZD_.js";import{S as v,F as f,a as p,P as w}from"./p-D5-dYgK_.js";import{d as g,S as x}from"./p-COqIkH1M.js";import{X as y,r as b,a as M,x as $,f as L,b as j,c as k,P as S,F as P,d as C,S as D}from"./p-Dq1AzGKX.js";import{N as W}from"./p-BJmwHV0a.js";import{a as z,r as T,i as E}from"./p-BpsXOtoW.js";import{s as N}from"./p-Xb6Ilq8u.js";class O{constructor(t,s){this.xScale=t,this.yScale=s}isPositiveDomain(){return this.xScale.domainMin>0&&this.yScale.domainMin>0}static autoK(t){const s=t.filter((t=>t>0)).sort(((t,s)=>t-s));if(0===s.length)return[];const i=t=>s[Math.min(s.length-1,Math.floor(t*s.length))];let n=O.ladderValues(i(.25),i(.75));if(n.length<2&&(n=O.ladderValues(s[0],s[s.length-1])),0===n.length)return[];if(1===n.length)return n;if(n.length<=4)return n;const e=[];for(let t=0;t<4;t++)e.push(n[Math.round(t*(n.length-1)/3)]);return[...new Set(e)]}static ladderValues(t,s){if(t<=0||s<t)return[];const i=[];for(let n=Math.floor(Math.log10(t))-1;n<=Math.ceil(Math.log10(s));n++)for(const e of[1,2,5]){const h=e*Math.pow(10,n);h>=t&&h<=s&&i.push(h)}return i}visibleRange(t){if(!this.isPositiveDomain()||t<=0)return null;const s=Math.max(this.xScale.domainMin,t/this.yScale.domainMax),i=Math.min(this.xScale.domainMax,t/this.yScale.domainMin);return s>=i?null:[s,i]}samples(t){const s=this.visibleRange(t);if(null===s)return null;const[i,n]=s,e=[];for(let s=0;s<64;s++){const h=i*Math.pow(n/i,s/63);e.push({x:this.xScale.scale(h),y:this.yScale.scale(t/h)})}return e}path(t){const s=this.samples(t);return null===s?null:s.map(((t,s)=>`${0===s?"M":"L"} ${t.x} ${t.y}`)).join(" ")}exitPoint(t){const s=this.visibleRange(t);if(null===s)return null;const i=s[1],n=i>=this.xScale.domainMax-1e-9*Math.abs(this.xScale.domainMax);return{x:this.xScale.scale(i),y:this.yScale.scale(t/i),edge:n?"right":"bottom"}}regionPath(t){if(!this.isPositiveDomain()||t<=0)return null;const s=this.xScale.domainMin,i=this.xScale.domainMax,n=this.yScale.domainMin,e=this.yScale.domainMax,h=this.xScale.scale(s),o=this.xScale.scale(i),r=this.yScale.scale(e),a=this.yScale.scale(n);if(t>=i*e)return null;if(t<=s*n)return`M ${h} ${r} L ${o} ${r} L ${o} ${a} L ${h} ${a} Z`;const l=this.samples(t),[d,c]=this.visibleRange(t),u=d>s,m=c>=i-1e-9*Math.abs(i),v=l.map(((t,s)=>`${0===s?"M":"L"} ${t.x} ${t.y}`));return m||v.push(`L ${o} ${a}`),v.push(`L ${o} ${r}`),u||v.push(`L ${h} ${r}`),v.push("Z"),v.join(" ")}}class V{constructor(t,s,i,n,e,h){var o,r;this.ruleSet=t,this.config=n,this.styles=e,this.availableWidth=h,this.warnings=[],this.canvasHeight=0,this.i18nMap=new Map,this.config=Object.assign(Object.assign({},n),{x:z(n.x),y:z(n.y)});const a=new y;let l=[];try{""!==i&&(l=s.exec(`SELECT * FROM ${i}`))}catch(t){this.queryError=u(t)}const d=(null!=l?l:[]).map((t=>a.adapt(t)));this.data=b(d,{pointLevel:n.pointLevel,seriesLevel:n.seriesLevel,facetLevel:null!==n.facet?"rowgroup"===n.facet.level?"rowGroup":"category":null,measures:{x:null!==(o=T(n.x.measure))&&void 0!==o?o:{kind:"scenario",slot:"ac1"},y:null!==(r=T(n.y.measure))&&void 0!==r?r:{kind:"scenario",slot:"ac2"}},domains:{x:{min:this.config.x.min,max:this.config.x.max},y:{min:this.config.y.min,max:this.config.y.max}},limit:n.limit,limitBy:"order"}),this.warnings.push(...this.data.warnings)}get em(){return this.styles.fontStyles.size}get xPercent(){return E(this.config.x.measure)}get yPercent(){return E(this.config.y.measure)}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,s=!1){const i=l(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:s?"bold":"normal"}).width;return Number.isFinite(i)&&i>0?i:.6*t.length*this.em}drawText(t,s,i,n,e={}){var h,o,r;return t.text(s).font({size:null!==(h=e.size)&&void 0!==h?h:this.styles.fontStyles.size,weight:e.bold?"bold":"normal",anchor:null!==(o=e.anchor)&&void 0!==o?o:"start"}).fill(null!==(r=e.color)&&void 0!==r?r:this.styles.fontStyles.color).attr({x:i,y:n,"font-family":this.fontFamily()})}hasNoData(){return 0===this.data.totalPoints}getWarnings(){return this.warnings}getQueryError(){return this.queryError}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.canvasHeight}axisTitle(t,s){var i;const n=null!==(i=t.label)&&void 0!==i?i:"";return""===n?"":void 0===t.unit||""===t.unit?n:`${n} ${s} ${t.unit}`}setI18n(t){this.i18nMap=t}legendModel(){const t=this.data.series.map((t=>{var s;return{label:""===t.key?null!==(s=this.ruleSet.getScenario("").name)&&void 0!==s?s:"Series":t.key,treatment:this.seriesTreatment(t.index)}}));return{sizeCaption:[],title:this.i18nMap.get("legend.title")||null,compareEntries:[],entries:t}}primaryColorIndex(){const t=T(this.config.x.measure);return null===t||"variance"===t.kind?10:this.ruleSet.getScenarioColorIndex(t.slot)}seriesTreatment(t){const{color:s,overflowed:i}=h(t,this.styles.seriesColors);return i&&this.addWarningOnce("xy-series-overflow",{}),o(this.primaryColorIndex(),s,"dot")}addWarningOnce(t,s){this.warnings.some((s=>s.code===t))||this.warnings.push({code:t,data:s})}toString(){const t=new v;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}draw(t){var s,i,n,e,h,o,r,a,l,d;this.warnings=this.data.warnings.slice();const c=this.em,u=this.styles.padding,m=this.i18nMap.get("axis.in")||"in",v=t.group(),f=new M(this.styles),p=this.legendModel(),w=this.config.legend.show&&p.entries.length>0,g=w?f.measure(p,this.config.legend.position):{width:0,height:0},x=null!==this.config.iso,y=x?Math.max(3*c,...this.isoValueLabels().map((t=>this.textWidth(t)+c)),this.textWidth(null!==(s=this.config.iso.label)&&void 0!==s?s:"",!0)+c,this.textWidth(void 0!==this.config.iso.unit&&""!==this.config.iso.unit?`${m} ${this.config.iso.unit}`:"")+c):0,b="right"===this.config.legend.position?Math.max(w?g.width+c:0,y):y,j=""!==this.config.chartTitle?1.6*c:0,k=this.axisTitle(this.config.y,m),S=this.axisTitle(this.config.x,m),C=""!==k?1.4*c:.4*c,D=1.4*c+(""!==S?1.3*c:0);let z,T=3*c,E={x:0,y:0,width:0,height:0},N=[];const O=Math.max(1,this.data.facets.length),V=null===(i=this.config.facet)||void 0===i?void 0:i.columns,I=W.domain(null!==(e=null===(n=this.data.extents)||void 0===n?void 0:n.xMin)&&void 0!==e?e:0,null!==(o=null===(h=this.data.extents)||void 0===h?void 0:h.xMax)&&void 0!==o?o:1,{min:this.config.x.min,max:this.config.x.max}),X=W.domain(null!==(a=null===(r=this.data.extents)||void 0===r?void 0:r.yMin)&&void 0!==a?a:0,null!==(d=null===(l=this.data.extents)||void 0===l?void 0:l.yMax)&&void 0!==d?d:1,{min:this.config.y.min,max:this.config.y.max});for(let t=0;t<2;t++){const t=Math.max(10,this.availableWidth-u.left-u.right-T-b);E={x:u.left+T,y:u.top+j+C,width:t,height:t/this.config.aspect},z=new P(O,V,E,this.styles.scaleFactors.panelGap*c);const s=z.panelRect(0).height,i=Math.max(4,Math.min(8,Math.round(s/(4*c)))),n=new W(X[0],X[1],s,0);N=n.ticks(i);const e=$(N,this.yPercent);T=Math.max(...N.map((t=>this.textWidth(L(t,e,this.styles.locale,this.yPercent)))),c)+this.styles.scaleFactors.axisTickLength*c+.4*c}this.canvasHeight=E.y+E.height+D+("bottom"===this.config.legend.position&&w?g.height+c:0)+u.bottom,""!==this.config.chartTitle&&this.drawText(v,this.config.chartTitle,u.left,u.top+c,{bold:!0}),""!==k&&this.drawAxisTitleText(v,this.config.y,m,u.left,E.y-.6*c,"start");const A=this.buildPanels(z,I,X),B=A[0].xScale.ticks(Math.max(3,Math.min(8,Math.round(A[0].rect.width/(7*c))))),F=$(B,this.xPercent),H=$(N,this.yPercent);let Y=!1;x&&(I[0]>0&&X[0]>0?Y=!0:this.addWarningOnce("xy-iso-domain",{})),0===this.data.facets.length?this.drawPanel(v,A[0],{key:"",points:[]},B,N,F,H,!0,!0,Y):this.data.facets.forEach(((t,s)=>{this.drawPanel(v,A[s],t,B,N,F,H,z.isOuterLeft(s),z.isOuterBottom(s),Y,this.data.facets.length>1?t.key:"")})),""!==S&&this.drawAxisTitleText(v,this.config.x,m,E.x+E.width,E.y+E.height+2.6*c,"end"),w&&("right"===this.config.legend.position?f.draw(v,p,E.x+E.width+c,E.y,"right"):f.draw(v,p,E.x,E.y+E.height+D,"bottom")),t.group().addClass("annotations")}drawAxisTitleText(t,s,i,n,e,h){var o;const r=null!==(o=s.label)&&void 0!==o?o:"",a=void 0!==s.unit&&""!==s.unit?`${i} ${s.unit}`:"",l=.3*this.em;"start"===h?(this.drawText(t,r,n,e,{bold:!0}),""!==a&&this.drawText(t,a,n+this.textWidth(r,!0)+l,e,{})):""!==a?(this.drawText(t,a,n,e,{anchor:"end"}),this.drawText(t,r,n-this.textWidth(a)-l,e,{anchor:"end",bold:!0})):this.drawText(t,r,n,e,{anchor:"end",bold:!0})}buildPanels(t,s,i){const n=[];for(let e=0;e<t.count;e++){const h=t.panelRect(e),o=new W(s[0],s[1],h.x,h.x+h.width),r=new W(i[0],i[1],h.y+h.height,h.y);n.push({rect:h,xScale:o,yScale:r,frame:new j(o,r,h,this.styles)})}return n}drawPanel(t,s,i,n,e,h,o,r,a,l,d=""){var c,u;const m=t.group(),v=this.em;s.frame.drawBands(m,this.config.x.highlight,this.config.y.highlight),s.frame.drawGrid(m,e,void 0===this.config.x.refLine&&void 0===this.config.y.refLine&&s.rect.width>30*v?n:void 0),l&&null!==this.config.iso&&this.drawIso(m,s),s.frame.drawRefLines(m,this.config.x.refLine,this.config.y.refLine),s.frame.drawFrame(m);const f=this.styles.scaleFactors.pointRadius*v,p=new S(s.rect,this.styles.scaleFactors.labelToMark*v),w=[];for(const t of i.points){const n=null!==(u=null===(c=this.data.series.find((s=>s.key===t.seriesKey)))||void 0===c?void 0:c.index)&&void 0!==u?u:0,e=this.seriesTreatment(n),h=s.xScale.scale(t.x),o=s.yScale.scale(t.y);w.push({point:t,cx:h,cy:o,treatment:e});const r=m.circle(2*f).center(h,o).fill(e.fill).stroke({color:e.stroke,width:e.strokeWidth}).attr(g(k(t,i.key,this.config),"element"));void 0!==e.dasharray&&r.attr("stroke-dasharray",e.dasharray),p.registerMark(h,o,f)}this.drawPointLabels(m,p,w,f,i.key),s.frame.drawTickLabels(m,{ticksX:n,ticksY:e,xDecimals:h,yDecimals:o,xPercent:this.xPercent,yPercent:this.yPercent,showXLabels:a,showYLabels:r}),""!==d&&s.frame.drawPanelTitle(m,d)}drawPointLabels(t,s,i,n,e){const h=i.reduce(((t,s)=>t+s.cx),0)/Math.max(1,i.length),o=i.reduce(((t,s)=>t+s.cy),0)/Math.max(1,i.length),r=[...i].sort(((t,s)=>Math.hypot(s.cx-h,s.cy-o)-Math.hypot(t.cx-h,t.cy-o))),{selected:a,unknownNames:l}=s.selectCandidates(r,this.config.labels.points,this.config.labels.max,(t=>t.point.name));l.length>0&&this.addWarningOnce("xy-label-unknown",{names:l.join(", ")});const d=new Map,c=a.map((t=>{const s={name:t.point.name,cx:t.cx,cy:t.cy,r:n,width:this.textWidth(t.point.name),height:1.1*this.em};return d.set(s,t.point),s}));for(const i of s.place(c))this.drawText(t,i.candidate.name,i.x,i.y+.9*i.candidate.height,{}).attr(g(k(d.get(i.candidate),e,this.config),"label"))}drawIso(t,s){const i=this.config.iso,n=new O(s.xScale,s.yScale),e=this.i18nMap.get("axis.in")||"in",h=this.isoValues(),o=this.isoValueLabels();if(void 0!==i.highlight){const s=n.regionPath(i.highlight.from);null!==s&&t.path(s).fill(this.styles.axisStyles.pl.fill).stroke("none")}const r={color:this.styles.axisStyles.fc.stroke,width:N(this.styles.scaleFactors.gridLineWidth,this.em)};let a=null;for(const[s,i]of h.entries()){const e=n.path(i);if(null===e)continue;t.path(e).fill("none").stroke(r);const h=n.exitPoint(i);null!==h&&(this.drawText(t,o[s],h.x+.4*this.em,"right"===h.edge?h.y+.35*this.em:h.y-.5*this.em,{}),(null===a||h.y<a.y)&&(a=h))}if(null!==a&&void 0!==i.label&&""!==i.label){const s=void 0!==i.unit&&""!==i.unit?`${e} ${i.unit}`:"";this.drawText(t,i.label,a.x+.4*this.em,a.y-1.6*this.em,{bold:!0}),""!==s&&this.drawText(t,s,a.x+.4*this.em,a.y-.5*this.em,{})}}isoValues(){const t=this.config.iso;return"auto"!==t.values?t.values:O.autoK(this.data.facets.flatMap((t=>t.points.map((t=>t.x*t.y)))))}isoValueLabels(){const t=this.isoValues(),s=Math.max(0,...t.map((t=>W.stepDecimals(Math.abs(t)))));return t.map((t=>L(t,s,this.styles.locale)))}}const I=["xy-duplicate-point","xy-point-clipped","xy-variance-nodata","xy-iso-domain","xy-label-unknown","xy-series-overflow","xy-point-budget"],X=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.chartTitle="",this.iso=null,this.facet=null,this.pointLevel="category",this.seriesLevel=null,this.aspect=16/9,this.limit=0,this.filter="",this.i18n=new Map,this.containerWidth=0,this.svgMarkup="",c(this)}getDb(){return this.stores||(this.stores=r(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),s=a(this.getDb(),this.tableName,this.filter);this.chart=new V(new d(this.ruleSetConfig),this.getDb(),s,{chartTitle:this.chartTitle,x:this.x,y:this.y,iso:this.iso,labels:this.labels,legend:this.legend,facet:this.facet,pointLevel:this.pointLevel,seriesLevel:this.seriesLevel,aspect:this.aspect,limit:this.limit},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings()),m(this.errors,this.chart.getQueryError())}syncWarnings(t){if(void 0===this.errors)return;const s=new Map(t.map((t=>[t.code,t.data])));for(const t of I){const i=`WARN_${t.replace(/-/g,"_")}`;if(s.has(t)){const n=void 0!==this.translator?this.translator(`.${t}`,s.get(t)):t;this.errors.addOrReplace({id:i,type:"warning",message:n})}else this.errors.remove(i)}}prepareStyle(){var t,s;const i=new C(new D,new f,new p(new x),new w).adapt(this.styles);return i.locale=(null===(s=null===(t=r(this.element).context)||void 0===t?void 0:t.state)||void 0===s?void 0:s.locale)||"de",i}render(){var t;if(void 0===this.chart||void 0!==this.chart.getQueryError())return i(n,null);if(this.chart.hasNoData()){const s=null!==(t=this.i18n.get("no-data"))&&void 0!==t?t:"No Data";return i(n,{class:"no-data"},i("div",{class:"empty-state"},s))}return i(n,null,i("div",{innerHTML:this.svgMarkup}))}get element(){return this}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}'}},[1,"bn-chart-scatter-renderer",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],chartTitle:[1,"chart-title"],x:[16],y:[16],iso:[16],labels:[16],legend:[16],facet:[16],pointLevel:[1,"point-level"],seriesLevel:[1,"series-level"],aspect:[2],limit:[2],filter:[1],styles:[16],i18n:[16],containerWidth:[2,"container-width"],ruleSetConfig:[16],errors:[16],translator:[16]}]);function A(){"undefined"!=typeof customElements&&["bn-chart-scatter-renderer"].forEach((t=>{"bn-chart-scatter-renderer"===t&&(customElements.get(e(t))||customElements.define(e(t),X))}))}export{X as B,A as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as s,g as o}from"./p-D6YGOYV1.js";import{g as r,c as t}from"./p-BVKLCz2k.js";import{r as a}from"./p-DEHnizot.js";import{m as e}from"./p-B2NXsfMz.js";const p=p=>{let m,f,i,n;const c=()=>{const s=f.componentStyles.state;n=e([s._system||{},s._default||{},s[i]||{}],{arrayMergeType:"overwrite"})},j=p.connectedCallback;p.connectedCallback=()=>{const t=o(p);f=r(t),n=f.componentStyles.state._system,i=p.selectedStyle,c(),m=f.componentStyles.on("set",(r=>{r!==i&&"_default"!==r||(i=p.selectedStyle,c(),s(o(p)))})),a(j,p)};const g=p.disconnectedCallback;return p.disconnectedCallback=()=>{a(m),t(o(p)),a(g,p)},s=>(void 0!==f&&p.selectedStyle!==i&&(i=p.selectedStyle,c()),s(n))};export{p as w}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as r}from"./p-CMM8vtHW.js";class t{adapt(t){return r.adaptDefaultString(t)}default(){return""}}export{t as S}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as t}from"./p-DEHnizot.js";var e,s;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(e||(e={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(s||(s={}));class r{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW kkkk",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormatPinned=!1,this.dateFormatShortPinned=!1,this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t,this.dateFormatPinned=!0}setDateFormatShort(t){this.dateFormatShort=t,this.dateFormatShortPinned=!0}setLocale(t){this.locale=t,this.dateFormatPinned||(this.dateFormat=Object.assign(Object.assign({},this._dateFormat),r.LOCALE_DATE_FORMAT[t]||{})),this.dateFormatShortPinned||(this.dateFormatShort=Object.assign(Object.assign({},this._dateFormatShort),r.LOCALE_DATE_FORMAT_SHORT[t]||{}))}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,s){switch(s){case e.DAY:return this.getFormatedDayDate(t);case e.MONTH:return this.getFormatedMonthDate(t);case e.QUARTER:return this.getFormatedQuarterDate(t);case e.WEEK:return this.getFormatedWeekDate(t);case e.HOUR:return this.getFormatedHourDate(t);case e.MINUTE:return this.getFormatedMinuteDate(t);case e.SECOND:return this.getFormatedSecondDate(t);case e.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,s)}}calculateDistanceType(s,r,i=32){if(null==r)return e.DAY;const a="number"==typeof s?t.fromMillis(s):s,n="number"==typeof r?t.fromMillis(r):r;return 0===n.diff(a).as("milliseconds")?e.DAY:n.diff(a).as("milliseconds")<i?e.MILLISECOND:n.diff(a).as("seconds")<i?e.SECOND:n.diff(a).as("minutes")<i?e.MINUTE:n.diff(a).as("hours")<i?e.HOUR:n.diff(a).as("days")<i?e.DAY:n.diff(a).as("weeks")<i?e.WEEK:n.diff(a).as("months")<i?e.MONTH:n.diff(a).as("quarters")<i?e.QUARTER:e.YEAR}datesBetween(t,e,s){const r=this.convertDateDistanceToMomentunitOfTime(s),i=t.startOf(r),a=e.endOf(r),n=[];let h=i;do{n.push(h),h=h.plus(this.createDiratonLike(r,1))}while(h<=a);return n}countBetween(t,e,s){const r=this.convertDateDistanceToMomentunitOfTime(s);return Math.floor(e.startOf(r).diff(t.startOf(r),r).as(r))+1}getDateLinkString(r,i,a,n,h){if(null==r&&null==i)return"";if(null==r&&a!==s.END&&a!==s.YTD)return"";if(null==i&&(s.INTERVAL===a||s.CUM===a||s.END===a||s.YTD===a))return"";const u=r||t.now(),c=i;n===e.AUTO&&(n=this.calculateDistanceType(u,c,h));let o=this.getDateString(u,n),l="",y=s.NONE;return null!=c&&(l=this.getDateString(c,n),y=s.INTERVAL,o===l&&a===s.INTERVAL&&(a=s.NONE),o===l&&a===s.AVG&&(y=s.NONE),s.END!==a&&s.YTD!==a||(o=l),a!==s.INTERVAL&&a!==s.CUM&&a!==s.AVG||(n===e.QUARTER?u.quarter===c.quarter&&u.year===c.year?l=l.replace(" "+c.year,""):u.year===c.year&&(o=o.replace(" "+u.year,"")):n===e.MONTH?u.month===c.month&&u.year===c.year?l=l.replace(" "+c.year,""):u.year===c.year&&(o=o.replace(" "+u.year,"")):n===e.WEEK&&(u.weekNumber===c.weekNumber&&u.weekYear===c.weekYear?l=l.replace(" "+c.weekYear,""):u.weekYear===c.weekYear&&(o=o.replace(" "+u.weekYear,""))))),this.dateLinkFormat[a].replace("[LINK]",this.dateLinkFormat[y]).replace("[DATE]",o).replace("[DATE2]",l)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" kk"),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let s;switch(t){case e.YEAR:s="year";break;case e.MONTH:s="month";break;case e.QUARTER:s="quarter";break;case e.WEEK:s="week";break;case e.DAY:s="day";break;case e.HOUR:s="hour";break;case e.MINUTE:s="minute";break;case e.SECOND:s="second";break;case e.MILLISECOND:s="millisecond";break;default:s="day"}return s}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}r.LOCALE_DATE_FORMAT={en:{week:"'W'WW kkkk",day:"MM/dd/yyyy",fallback:"MM/dd/yyyy"}},r.LOCALE_DATE_FORMAT_SHORT={en:{week:"'W'WW",fallback:"MM/dd/yyyy"}};export{e as D,s as a,r as b}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as t,g as n}from"./p-DEHnizot.js";import{m as r}from"./p-B2NXsfMz.js";class e{constructor(t){this.type="",this.base="",this.delta="",this.direction="",this.isValid=!1;const n=/(d|dr)(pl\d|ac\d|fc\d|pp\d)_(pl\d|ac\d|fc\d|pp\d)_(pos|neg|neu)/;if(n.test(t)){const r=n.exec(t);null!=r&&(this.type=String(r[1]),this.base=String(r[2]),this.delta=String(r[3]),this.direction=String(r[4]),this.isValid=!0)}}}const o=["ac","pp","fc","pl"],i={10:"ac",20:"pp",30:"fc",50:"pl"};function s(t){var n;return null!==(n=i[t])&&void 0!==n?n:"ac"}function c(t,n){const r=o.map((t=>s(n.getScenarioColorIndex(`${t}1`))));if(r.every(((t,n)=>t===o[n])))return t;const e=Object.assign(Object.create(Object.getPrototypeOf(t)),t);return o.forEach(((n,o)=>{e[n]=t[r[o]]})),e}function a(t){var n,r;const e=new Map;for(const i of o){const o=null===(r=null===(n=null==t?void 0:t.scenarios)||void 0===n?void 0:n[i])||void 0===r?void 0:r.name;if(o)for(const t of[1,2,3,4])e.set(`${i}${t}`,1===t?o:`${o}${t}`)}return e}class u{constructor(n){this._dateFormat={year:"YYYY",quarter:"Q[Q] YYYY",month:"MMM YYYY",locale:"[KW]WW YYYY",day:"DD.MM.YYYY"},this._dateLinkFormat={avg:"Ø[DATE]",interval:"[DATE]..[DATE]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE]",mat:"~[DATE]",none:"[DATE]"},this._scenarioMap=new Map;const e=r([t,null!=n?n:{}]);Object.entries(e.scenarios).forEach((([t,n])=>{var r,e,o;this.createScenarioMapEntry(t,null!==(r=n.name)&&void 0!==r?r:t,null!==(e=n.colorIndex)&&void 0!==e?e:10,null!==(o=n.sortIndex)&&void 0!==o?o:0)})),this._fallBackScenario=e.fallback}createScenarioMapEntry(t,n,r,e){const o=n,i=r;[1,2,3,4].forEach((r=>{this._scenarioMap.set(t+r,{name:n+r,group:o,colorIndex:i,sortIndex:e+10*r})}))}getScenario(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t):this._fallBackScenario}getScenarioGroup(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).name:this._fallBackScenario.name}getScenarioColorIndex(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).colorIndex:this._fallBackScenario.colorIndex}getScenarioSorIndex(t){const n=this.normalizeVarianceScenario(t);return this._scenarioMap.has(n)?this._scenarioMap.get(n).sortIndex:this._fallBackScenario.sortIndex}normalizeVarianceScenario(t){if(null==t)return"";const n=new e(t);return n.isValid?n.type+n.delta:t}}var l,d,p={},h=n(function(){if(l)return p;l=1;var t={};return Object.defineProperty(p,"__esModule",{value:!0}),p.default=function(n,r){void 0===r&&(r={});var e=JSON.stringify({text:n,options:r});if(t[e])return t[e];r.font=r.font||"Times",r.fontSize=r.fontSize||"16px",r.fontWeight=r.fontWeight||"normal",r.width=r.width||"auto";var o=function(t,n){var r=document.createElement("div"),e=document.createTextNode(t);return r.appendChild(e),r.style.fontFamily=n.font,r.style.fontSize=n.fontSize,r.style.fontWeight=n.fontWeight,r.style.position="absolute",r.style.visibility="hidden",r.style.left="-999px",r.style.top="-999px",r.style.width=n.width,r.style.height="auto",document.body.appendChild(r),r}(n,r),i={width:o.offsetWidth,height:o.offsetHeight};return function(t){t.parentNode.removeChild(t)}(o),t[e]=i,i},p}());!function(t){t.OPERATION="operation",t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CURRENTROW="currentRow",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.COLUMNGROUP="columnGroup",t.COLUMNGROUPINDEX="columnIndex",t.COLUMNSUBGROUP="columnSubGroup",t.COLUMNSUBGROUPINDEX="columnSubGroupIndex",t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4",t.TOTALROWCOUNT="totalRowCnt",t.ROWNR="rowNr",t.TYPE="type"}(d||(d={}));class f{static number(t,n="decimal",r=1,e=0,o=1,i="de"){const s=`${i}|${n}|${r}|${e}`;let c=this.formats.get(s);if(!c){const t={style:n,useGrouping:!0,maximumFractionDigits:r,minimumFractionDigits:e};try{c=new Intl.NumberFormat([i,"de-DE"],t)}catch(n){c=new Intl.NumberFormat("de-DE",t)}this.formats.set(s,c)}const a=c.format(t/o);return(a===c.format(-0)?c.format(0):a).replace(/\s+(%)/g,"$1")}static translateScenarioLabel(t,n){if(null==t)return"";const r=new e(t);if(!r.isValid)return`${n.get(t)||t}`;let o,i;return d.AC1===r.base?(o=n.get("dr"===r.type?"ibcssymbol_delta_ac_relative":"ibcssymbol_delta_ac"),i=n.get(r.delta)||r.delta):(o=n.get("dr"===r.type?"ibcssymbol_delta_generic_relative":"ibcssymbol_delta_generic"),i=`${n.get(r.base)||r.base} - ${n.get(r.delta)||r.delta}`),void 0===o&&(o="{%}"),`${o.replace("{%}",i)}`}static getMaxWidthOfArrayItems(t,n,r){return h(t.map((t=>f.translateScenarioLabel(t,n))).reduce(((t,n)=>t.length<n.length?n:t),""),{font:r.fontStyles.font,fontSize:r.fontStyles.size+"px"}).width}}f.formats=new Map;export{h as C,f as F,u as I,d as Q,e as V,c as a,a as r,s}
|