@bino-bi/bn-template-engine 1.0.0-alpha.8 → 1.0.0-next.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/LICENSE +203 -21
  2. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  3. package/dist/bn-template-engine/p-19bbac66.entry.js +1 -0
  4. package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
  5. package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
  6. package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
  7. package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
  8. package/dist/bn-template-engine/p-74c5a95d.entry.js +1 -0
  9. package/dist/bn-template-engine/p-7bdc0e28.entry.js +1 -0
  10. package/dist/bn-template-engine/p-83c71b16.entry.js +1 -0
  11. package/dist/bn-template-engine/p-90806e7a.entry.js +1 -0
  12. package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
  13. package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
  14. package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
  15. package/dist/bn-template-engine/p-BZV1b5VH.js +1 -0
  16. package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
  17. package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
  18. package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
  19. package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
  20. package/dist/bn-template-engine/p-CiudZRQr.js +1 -0
  21. package/dist/bn-template-engine/p-DTuaq8Pj.js +1 -0
  22. package/dist/bn-template-engine/p-DY7YYmpa.js +1 -0
  23. package/dist/bn-template-engine/p-Dg9OcXAO.js +1 -0
  24. package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
  25. package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
  26. package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
  27. package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
  28. package/dist/bn-template-engine/p-b25455a7.entry.js +1 -0
  29. package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
  30. package/dist/bn-template-engine/p-eca8e2e2.entry.js +1 -0
  31. package/dist/bn-template-engine/p-f9dfd120.entry.js +1 -0
  32. package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
  33. package/dist/cjs/AxisConfig-VnVelfSV.js +233 -0
  34. package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
  35. package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
  36. package/dist/cjs/Order-DobBozQC.js +87 -0
  37. package/dist/cjs/SVGStyle-BQOmGWLX.js +8209 -0
  38. package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
  39. package/dist/cjs/VarianceMeasure-NY9yhiNV.js +372 -0
  40. package/dist/cjs/XYChartDataRow-B7OKrAcC.js +829 -0
  41. package/dist/cjs/bn-asset_21.cjs.entry.js +16047 -0
  42. package/dist/cjs/bn-chart-bubble.cjs.entry.js +762 -0
  43. package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
  44. package/dist/cjs/bn-chart-scatter.cjs.entry.js +658 -0
  45. package/dist/cjs/bn-grid.cjs.entry.js +5 -3
  46. package/dist/cjs/bn-image.cjs.entry.js +5 -3
  47. package/dist/cjs/bn-internationalization.cjs.entry.js +10 -8
  48. package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
  49. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  50. package/dist/cjs/bn-template.cjs.entry.js +1 -1
  51. package/dist/cjs/bn-text.cjs.entry.js +8 -79
  52. package/dist/cjs/bn-tree.cjs.entry.js +9 -3
  53. package/dist/cjs/context-protocol-BDrMkhc4.js +9499 -0
  54. package/dist/cjs/editor-companion.cjs.entry.js +13 -6
  55. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +624 -0
  56. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
  57. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +667 -0
  58. package/dist/cjs/layoutObserver-o03YUfn_.js +199 -0
  59. package/dist/cjs/loader.cjs.js +1 -1
  60. package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
  61. package/dist/cjs/scaling-DKZyjWj5.js +587 -0
  62. package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
  63. package/dist/cjs/withScalingGroup-BmcRlWBs.js +73 -0
  64. package/dist/cjs/withStyled-CRiC9fzc.js +1137 -0
  65. package/dist/collection/collection-manifest.json +9 -1
  66. package/dist/collection/components/bn-body/bn-body.css +1 -0
  67. package/dist/collection/components/bn-card/bn-card.css +2 -0
  68. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
  69. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
  70. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
  71. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
  72. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
  73. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
  74. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
  75. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
  76. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
  77. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
  78. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
  79. package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
  80. package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
  81. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
  82. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
  83. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
  84. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
  85. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
  86. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +127 -41
  87. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +103 -36
  88. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +82 -58
  89. package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
  90. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
  91. package/dist/collection/components/bn-chart-time/bn-chart-time.css +1 -1
  92. package/dist/collection/components/bn-chart-time/bn-chart-time.js +162 -42
  93. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +94 -31
  94. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +132 -74
  95. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
  96. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -4
  97. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
  98. package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
  99. package/dist/collection/components/bn-context/bn-context.js +1 -1
  100. package/dist/collection/components/bn-dataset/bn-dataset.js +226 -23
  101. package/dist/collection/components/bn-datasource/bn-datasource.js +163 -12
  102. package/dist/collection/components/bn-footer/bn-footer.js +1 -1
  103. package/dist/collection/components/bn-grid/bn-grid.js +1 -1
  104. package/dist/collection/components/bn-image/bn-image.js +1 -1
  105. package/dist/collection/components/bn-internationalization/bn-internationalization.js +10 -7
  106. package/dist/collection/components/bn-layout-card/bn-layout-card.css +8 -3
  107. package/dist/collection/components/bn-layout-card/bn-layout-card.js +98 -35
  108. package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -3
  109. package/dist/collection/components/bn-layout-page/bn-layout-page.js +98 -25
  110. package/dist/collection/components/bn-message/bn-message.css +6 -2
  111. package/dist/collection/components/bn-message/bn-message.js +3 -2
  112. package/dist/collection/components/bn-page/bn-page.js +1 -1
  113. package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
  114. package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
  115. package/dist/collection/components/bn-scaling-group/bn-scaling-group.css +3 -0
  116. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +136 -0
  117. package/dist/collection/components/bn-table/bn-table.js +317 -61
  118. package/dist/collection/components/bn-table/ibcs-table.css +8 -0
  119. package/dist/collection/components/bn-table/ibcs-table.js +161 -32
  120. package/dist/collection/components/bn-table/utils/Table.js +72 -28
  121. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
  122. package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
  123. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
  124. package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
  125. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +117 -22
  126. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +380 -50
  127. package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
  128. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
  129. package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
  130. package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
  131. package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
  132. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +20 -4
  133. package/dist/collection/components/bn-template/bn-template.js +1 -1
  134. package/dist/collection/components/bn-text/bn-text.js +2 -75
  135. package/dist/collection/components/bn-title/bn-title.js +27 -3
  136. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
  137. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +29 -6
  138. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -0
  139. package/dist/collection/components/bn-tree/bn-tree.js +5 -1
  140. package/dist/collection/components/editor-companion/editor-companion.js +12 -5
  141. package/dist/collection/context/scopedDb.js +127 -0
  142. package/dist/collection/stores/componentStyles.js +67 -0
  143. package/dist/collection/stores/createScopedStores.js +11 -5
  144. package/dist/collection/stores/internationalization.js +68 -0
  145. package/dist/collection/stores/ruleSets.js +46 -0
  146. package/dist/collection/utils/constants.js +5 -0
  147. package/dist/collection/utils/dataAnalyzer.js +14 -8
  148. package/dist/collection/utils/ibcsRuleSet.js +14 -26
  149. package/dist/collection/utils/layoutObserver.js +88 -0
  150. package/dist/collection/utils/parentDimensions.js +71 -15
  151. package/dist/collection/utils/sanitizeHtml.js +81 -0
  152. package/dist/collection/utils/validate.js +47 -0
  153. package/dist/collection/utils/withBodyObserver.js +12 -7
  154. package/dist/collection/utils/withComponentStyle.js +3 -5
  155. package/dist/collection/utils/withDataset.js +43 -39
  156. package/dist/collection/utils/withDatasource.js +28 -18
  157. package/dist/collection/utils/withInheritedProps.js +26 -1
  158. package/dist/collection/utils/withRuleSet.js +105 -0
  159. package/dist/collection/utils/withScalingGroup.js +69 -0
  160. package/dist/collection/utils/withTranslation.js +50 -14
  161. package/dist/collection/utils/xy/FacetGrid.js +36 -0
  162. package/dist/collection/utils/xy/IsoCurves.js +156 -0
  163. package/dist/collection/utils/xy/NumericScale.js +103 -0
  164. package/dist/collection/utils/xy/PointLabeler.js +96 -0
  165. package/dist/collection/utils/xy/RadiusScale.js +42 -0
  166. package/dist/collection/utils/xy/SeriesPalette.js +80 -0
  167. package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
  168. package/dist/collection/utils/xy/XYFrame.js +120 -0
  169. package/dist/collection/utils/xy/XYLegend.js +107 -0
  170. package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
  171. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
  172. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  173. package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
  174. package/dist/components/AxisConfig.js +1 -0
  175. package/dist/components/CompareUtil.js +1 -0
  176. package/dist/components/DataFormatDigits.js +1 -1
  177. package/dist/components/DateStringFactory.js +1 -1
  178. package/dist/components/LabelCollisionManager.js +1 -0
  179. package/dist/components/NumericScale.js +1 -0
  180. package/dist/components/Order.js +1 -1
  181. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  182. package/dist/components/SiPrefix.js +1 -0
  183. package/dist/components/StringAdapter.js +1 -0
  184. package/dist/components/VarianceMeasure.js +1 -0
  185. package/dist/components/XYChartDataRow.js +1 -0
  186. package/dist/components/bn-body2.js +1 -1
  187. package/dist/components/bn-card2.js +1 -1
  188. package/dist/components/bn-chart-bubble.d.ts +11 -0
  189. package/dist/components/bn-chart-bubble.js +1 -0
  190. package/dist/components/bn-chart-bullet.d.ts +11 -0
  191. package/dist/components/bn-chart-bullet.js +1 -0
  192. package/dist/components/bn-chart-scatter.d.ts +11 -0
  193. package/dist/components/bn-chart-scatter.js +1 -0
  194. package/dist/components/bn-chart-structure.js +1 -1
  195. package/dist/components/bn-chart-time.js +1 -1
  196. package/dist/components/bn-component-style.js +1 -1
  197. package/dist/components/bn-context.js +1 -1
  198. package/dist/components/bn-dataset.js +1 -1
  199. package/dist/components/bn-datasource.js +1 -1
  200. package/dist/components/bn-footer2.js +1 -1
  201. package/dist/components/bn-grid.js +1 -1
  202. package/dist/components/bn-image.js +1 -1
  203. package/dist/components/bn-internationalization.js +1 -1
  204. package/dist/components/bn-layout-card.js +1 -1
  205. package/dist/components/bn-layout-page.js +1 -1
  206. package/dist/components/bn-message2.js +1 -1
  207. package/dist/components/bn-page2.js +1 -1
  208. package/dist/components/bn-ruleset.d.ts +11 -0
  209. package/dist/components/bn-ruleset.js +1 -0
  210. package/dist/components/bn-scaling-group.d.ts +11 -0
  211. package/dist/components/bn-scaling-group.js +1 -0
  212. package/dist/components/bn-table.js +1 -1
  213. package/dist/components/bn-template.js +1 -1
  214. package/dist/components/bn-text.js +1 -1
  215. package/dist/components/bn-title2.js +1 -1
  216. package/dist/components/bn-tree.js +1 -1
  217. package/dist/components/context-protocol.js +1 -1
  218. package/dist/components/editor-companion.js +1 -1
  219. package/dist/components/formatter.js +1 -0
  220. package/dist/components/ibcs-chart-bubble.d.ts +11 -0
  221. package/dist/components/ibcs-chart-bubble.js +1 -0
  222. package/dist/components/ibcs-chart-bubble2.js +1 -0
  223. package/dist/components/ibcs-chart-bullet.d.ts +11 -0
  224. package/dist/components/ibcs-chart-bullet.js +1 -0
  225. package/dist/components/ibcs-chart-bullet2.js +1 -0
  226. package/dist/components/ibcs-chart-scatter.d.ts +11 -0
  227. package/dist/components/ibcs-chart-scatter.js +1 -0
  228. package/dist/components/ibcs-chart-scatter2.js +1 -0
  229. package/dist/components/ibcs-chart-structure2.js +1 -1
  230. package/dist/components/ibcs-chart-time2.js +1 -1
  231. package/dist/components/ibcs-table2.js +1 -1
  232. package/dist/components/ibcs-title2.js +1 -1
  233. package/dist/components/layoutObserver.js +1 -0
  234. package/dist/components/luxon.js +1 -0
  235. package/dist/components/main.js +1 -0
  236. package/dist/components/merge.js +1 -0
  237. package/dist/components/sanitizeHtml.js +1 -0
  238. package/dist/components/stackColors.js +1 -0
  239. package/dist/components/validate.js +1 -1
  240. package/dist/components/withBodyObserver.js +1 -1
  241. package/dist/components/withComponentStyle.js +1 -1
  242. package/dist/components/withDataset.js +1 -0
  243. package/dist/components/withRuleSet.js +1 -0
  244. package/dist/components/withScalingGroup.js +1 -0
  245. package/dist/components/withStyled.js +1 -1
  246. package/dist/components/withTranslation.js +1 -1
  247. package/dist/esm/AxisConfig-C_zWCKlL.js +224 -0
  248. package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
  249. package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
  250. package/dist/esm/Order-BPeWfygb.js +83 -0
  251. package/dist/esm/SVGStyle-BxEDw9zh.js +8199 -0
  252. package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
  253. package/dist/esm/VarianceMeasure-DnwNKspZ.js +364 -0
  254. package/dist/esm/XYChartDataRow-DeV4r-Wm.js +820 -0
  255. package/dist/esm/bn-asset_21.entry.js +16025 -0
  256. package/dist/esm/bn-chart-bubble.entry.js +760 -0
  257. package/dist/esm/bn-chart-bullet.entry.js +783 -0
  258. package/dist/esm/bn-chart-scatter.entry.js +656 -0
  259. package/dist/esm/bn-grid.entry.js +5 -3
  260. package/dist/esm/bn-image.entry.js +5 -3
  261. package/dist/esm/bn-internationalization.entry.js +10 -8
  262. package/dist/esm/bn-ruleset.entry.js +39 -0
  263. package/dist/esm/bn-template-engine.js +1 -1
  264. package/dist/esm/bn-template.entry.js +1 -1
  265. package/dist/esm/bn-text.entry.js +7 -78
  266. package/dist/esm/bn-tree.entry.js +9 -3
  267. package/dist/esm/context-protocol-1Yj1uKvh.js +9484 -0
  268. package/dist/esm/editor-companion.entry.js +13 -6
  269. package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
  270. package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
  271. package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
  272. package/dist/esm/layoutObserver-BG5dOBYH.js +196 -0
  273. package/dist/esm/loader.js +1 -1
  274. package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
  275. package/dist/esm/scaling-CeSRcRl1.js +579 -0
  276. package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
  277. package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
  278. package/dist/esm/withStyled-Br2DGTPs.js +1104 -0
  279. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
  280. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
  281. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
  282. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
  283. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
  284. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
  285. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
  286. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
  287. package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
  288. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
  289. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
  290. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
  291. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +19 -5
  292. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
  293. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +16 -12
  294. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
  295. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
  296. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
  297. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
  298. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +16 -12
  299. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
  300. package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
  301. package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
  302. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +35 -8
  303. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +32 -1
  304. package/dist/types/components/bn-message/bn-message.d.ts +5 -2
  305. package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
  306. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
  307. package/dist/types/components/bn-table/bn-table.d.ts +74 -12
  308. package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
  309. package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
  310. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  311. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
  312. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
  313. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
  314. package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
  315. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +17 -9
  316. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
  317. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
  318. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
  319. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
  320. package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
  321. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
  322. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
  323. package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
  324. package/dist/types/components/bn-title/bn-title.d.ts +11 -1
  325. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
  326. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
  327. package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
  328. package/dist/types/components.d.ts +1691 -120
  329. package/dist/types/context/context-protocol.d.ts +7 -3
  330. package/dist/types/context/scopedDb.d.ts +37 -0
  331. package/dist/types/stores/componentStyles.d.ts +41 -0
  332. package/dist/types/stores/createScopedStores.d.ts +4 -2
  333. package/dist/types/stores/ruleSets.d.ts +40 -0
  334. package/dist/types/utils/DateStringFactory.d.ts +1 -1
  335. package/dist/types/utils/constants.d.ts +5 -0
  336. package/dist/types/utils/dataAnalyzer.d.ts +2 -1
  337. package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
  338. package/dist/types/utils/layoutObserver.d.ts +27 -0
  339. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  340. package/dist/types/utils/parentDimensions.d.ts +1 -1
  341. package/dist/types/utils/sanitizeHtml.d.ts +6 -0
  342. package/dist/types/utils/validate.d.ts +18 -0
  343. package/dist/types/utils/withDataset.d.ts +6 -2
  344. package/dist/types/utils/withDatasource.d.ts +3 -3
  345. package/dist/types/utils/withInheritedProps.d.ts +19 -0
  346. package/dist/types/utils/withRuleSet.d.ts +24 -0
  347. package/dist/types/utils/withScalingGroup.d.ts +14 -0
  348. package/dist/types/utils/withTranslation.d.ts +12 -4
  349. package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
  350. package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
  351. package/dist/types/utils/xy/NumericScale.d.ts +41 -0
  352. package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
  353. package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
  354. package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
  355. package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
  356. package/dist/types/utils/xy/XYFrame.d.ts +44 -0
  357. package/dist/types/utils/xy/XYLegend.d.ts +43 -0
  358. package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
  359. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
  360. package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
  361. package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
  362. package/package.json +5 -4
  363. package/readme.md +9 -5
  364. package/dist/bn-template-engine/p-0d41c5d8.entry.js +0 -1
  365. package/dist/bn-template-engine/p-67538176.entry.js +0 -1
  366. package/dist/bn-template-engine/p-825a07a8.entry.js +0 -1
  367. package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
  368. package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
  369. package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
  370. package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
  371. package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
  372. package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
  373. package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
  374. package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
  375. package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
  376. package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23541
  377. package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
  378. package/dist/cjs/scaling-CIAClQR5.js +0 -314
  379. package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
  380. package/dist/collection/stores/datasets.js +0 -14
  381. package/dist/collection/stores/datasources.js +0 -14
  382. package/dist/components/_commonjsHelpers.js +0 -1
  383. package/dist/components/alasql.min.js +0 -1
  384. package/dist/components/ibcsRuleSet.js +0 -1
  385. package/dist/components/scaling.js +0 -1
  386. package/dist/components/withInheritedProps.js +0 -1
  387. package/dist/esm/bn-asset_20.entry.js +0 -23520
  388. package/dist/esm/context-protocol-DdbSplvE.js +0 -656
  389. package/dist/esm/scaling-DGKKkuL9.js +0 -309
  390. package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
  391. package/dist/types/stores/datasets.d.ts +0 -14
  392. package/dist/types/stores/datasources.d.ts +0 -14
@@ -0,0 +1 @@
1
+ import{g as t,f as e}from"./p-B_d-jp99.js";import{g as r,c as s,D as n}from"./p-BqhIhYr1.js";import{r as a}from"./p-B4JfKvVT.js";import{m as i,S as o,b as u,A as c,c as l,T as m,D as h,d,M as f,e as y,r as b}from"./p-BZV1b5VH.js";import{b as N,O as g}from"./p-Bdfxd_Ke.js";const v=n=>{let o,u,c,l;const m=()=>{const t=u.componentStyles.state;l=i([t._system||{},t._default||{},t[c]||{}],{arrayMergeType:"overwrite"})},h=new MutationObserver((r=>{r.forEach((r=>{"selected-style"===r.attributeName&&(c=t(n).getAttribute("selected-style"),m(),e(n))}))})),d=n.connectedCallback;n.connectedCallback=()=>{const s=t(n);u=r(s),l=u.componentStyles.state._system,h.observe(s,{attributes:!0,attributeFilter:["selected-style"]}),c=t(n).getAttribute("selected-style"),m(),o=u.componentStyles.on("set",(r=>{r===c&&(c=t(n).getAttribute("selected-style"),m(),e(t(n)))})),a(d,n)};const f=n.disconnectedCallback;return n.disconnectedCallback=()=>{h.disconnect(),a(o),s(t(n)),a(f,n)},t=>t(l)},p=/^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/,S=/^[A-Za-z_][A-Za-z0-9_]*$/,D=["min","max","avg","sum"];class k{constructor(t,e,r,s){this.label=t,this.alias=e,this.fn=r,this.arg=s}get isNumeric(){return D.includes(this.fn)}}function T(t){if("string"!=typeof t)return!1;const e=p.exec(t);if(!e)return!1;const[,r,s]=e;return"lit"===r?s.length>0:S.test(s)}function w(t,e,r){if(!T(r))return null;const[,s,n]=p.exec(r);return new k(t,e,s,n)}var A,O;!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"}(A||(A={})),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"}(O||(O={}));class J{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",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.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t}setDateFormatShort(t){this.dateFormatShort=t}setLocale(t){this.locale=t}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,e){switch(e){case A.DAY:return this.getFormatedDayDate(t);case A.MONTH:return this.getFormatedMonthDate(t);case A.QUARTER:return this.getFormatedQuarterDate(t);case A.WEEK:return this.getFormatedWeekDate(t);case A.HOUR:return this.getFormatedHourDate(t);case A.MINUTE:return this.getFormatedMinuteDate(t);case A.SECOND:return this.getFormatedSecondDate(t);case A.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,e)}}calculateDistanceType(t,e,r=32){if(null==e)return A.DAY;const s="number"==typeof t?n.fromMillis(t):t,a="number"==typeof e?n.fromMillis(e):e;return 0===a.diff(s).as("milliseconds")?A.DAY:a.diff(s).as("milliseconds")<r?A.MILLISECOND:a.diff(s).as("seconds")<r?A.SECOND:a.diff(s).as("minutes")<r?A.MINUTE:a.diff(s).as("hours")<r?A.HOUR:a.diff(s).as("days")<r?A.DAY:a.diff(s).as("weeks")<r?A.WEEK:a.diff(s).as("months")<r?A.MONTH:a.diff(s).as("quarters")<r?A.QUARTER:A.YEAR}datesBetween(t,e,r,s){const n=this.convertDateDistanceToMomentunitOfTime(r),a=t.startOf(n),i=e.endOf(n);let o=i.diff(a).as(n);const u=[];o>=s&&(o=s);let c=a;do{u.push(c),c=c.plus(this.createDiratonLike(n,1))}while(c<=i&&u.length<o);return u}getDateLinkString(t,e,r,s,a){if(null==t&&null==e)return"";if(null==t&&r!==O.END&&r!==O.YTD)return"";if(null==e&&(O.INTERVAL===r||O.CUM===r||O.END===r||O.YTD===r))return"";const i=t||n.now(),o=e;s===A.AUTO&&(s=this.calculateDistanceType(i,o,a));let u=this.getDateString(i,s),c="",l=O.NONE;return null!=o&&(c=this.getDateString(o,s),l=O.INTERVAL,u===c&&r===O.INTERVAL&&(r=O.NONE),u===c&&r===O.AVG&&(l=O.NONE),O.END!==r&&O.YTD!==r||(u=c),(r===O.INTERVAL||r===O.CUM||O.AVG)&&(s===A.QUARTER?i.quarter===o.quarter&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):s===A.MONTH?i.month===o.month&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):s===A.WEEK&&(i.weekNumber===o.weekNumber&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,""))))),this.dateLinkFormat[r].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",u).replace("[DATE2]",c)}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+=" "+this.dateFormatShort.year),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 e;switch(t){case A.YEAR:e="year";break;case A.MONTH:e="month";break;case A.QUARTER:e="quarter";break;case A.WEEK:e="week";break;case A.DAY:e="day";break;case A.HOUR:e="hour";break;case A.MINUTE:e="minute";break;case A.SECOND:e="second";break;case A.MILLISECOND:e="millisecond";break;default:e="day"}return e}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}}}}function F(t){return null==t||""===t||"null"===t}function M(t){return F(t)||"auto"===t.trim().toLowerCase()?[]:E((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in o)))).toString())}function E(t){return F(t)?[]:t.replace(";",",").split(",").filter((t=>{var e,r,s;const n=t.split("_"),a=null===(e=n[0])||void 0===e?void 0:e.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(r=n[1])||void 0===r?void 0:r.toUpperCase().trim(),c=null===(s=n[2])||void 0===s?void 0:s.toUpperCase().trim();return 3!==n.length||!(a in o)||!(i in o)||!(c in u)}))}function L(t){return F(t)?[]:E(t.split(",").filter((t=>!(t.toUpperCase().trim()in o))).toString())}function $(t){return F(t)||"auto"===t.trim().toLowerCase()?[]:E(t.split(",").filter((t=>!(t.toUpperCase()in N))).toString())}function j(t){return!F(t)&&Number.isInteger(Number(t))}function q(t){return!F(t)&&!Number.isNaN(Number(t))}function _(t){return!F(t)&&(null==t?void 0:t.toUpperCase())in g}function I(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in c}function W(t){if(F(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function x(t){const e=Date.parse(t);return Number.isInteger(e)}function z(t){return(null==t?void 0:t.toUpperCase())in O}function B(t){return(null==t?void 0:t.toUpperCase())in A}function G(t){return(null==t?void 0:t.toUpperCase())in l}function K(t){return!F(t)&&(null==t?void 0:t.toUpperCase())in h}function C(t){return!F(t)&&["true","false",!0,!1].some((e=>e===t))}function H(t){return!F(t)&&(null==t?void 0:t.toUpperCase())in d}function Q(t){if(F(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category")&&t.hasOwnProperty("subCategory"))))}catch(t){console.error("validateThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function Z(t){if(F(t))return[];try{const e=JSON.parse(t);if(null!==e&&"object"==typeof e&&!(e instanceof Array))return Object.entries(e).filter((([,t])=>"string"!=typeof t||!T(t))).map((([t,e])=>`${t}: ${e}`))}catch(t){console.error("validateAttributesJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function P(t){if(F(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function V(t){return(null==t?void 0:t.trim().toUpperCase())in f}function Y(t){return["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function R(t){return(null==t?void 0:t.toUpperCase().trim())in y}function U(t){return(null==t?void 0:t.toUpperCase().trim())in m}function X(t){if(F(t))return[];try{return JSON.parse(t).filter((t=>!(t.hasOwnProperty("scenario")&&t.hasOwnProperty("name")&&t.hasOwnProperty("subGroups"))))}catch(t){console.error("validateColumnThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function tt(t){if(F(t))return[];try{const e=JSON.parse(t);if("object"!=typeof e||null===e||Array.isArray(e))return["stack: must be a JSON object"];const r=[];if(e.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(e.by)||r.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else r.push("stack: 'by' is required");if(e.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(e.mode)||r.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(e.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(e.order)||r.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return r}catch(t){return["stack: invalid JSON"]}}function et(t){return!F(t)&&null!==b(t)}class rt{constructor(){this.cache=new Map,this.tag=rt.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const st=new rt;function nt(t){for(var e,r=0,s=0,n=t.length;n>=4;++s,n-=4)e=1540483477*(65535&(e=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(++s))<<24))+(59797*(e>>>16)<<16),r=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(n){case 3:r^=(255&t.charCodeAt(s+2))<<16;case 2:r^=(255&t.charCodeAt(s+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(s)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}const at=t=>q(t)?`${t}px`:t,it={width:{className:"w",cssName:"width",attrName:"width",transform:at},height:{className:"h",cssName:"height",attrName:"height",transform:at},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:at},right:{className:"rgt",cssName:"right",attrName:"right",transform:at},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:at},left:{className:"lft",cssName:"left",attrName:"left",transform:at},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:at},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},ot=Object.keys(it);function ut(t,e){const r=function(t,e){const r=nt(e);return`bn-c-${t.className}_${r}`}(t,e),s=function(t,e,r){return`.${e} {${t.cssName}: ${r};}`}(t,r,e);return{className:r,style:s}}const ct=t=>{const e=new Map;return ot.forEach((r=>{const s=t.getAttribute(r);s&&(["top","left","right","bottom"].includes(r)&&e.set("position",ut(it.position,"absolute")),e.set(r,ut(it[r],(it[r].transform||function(t){return t})(s))))})),e},lt=new MutationObserver((t=>{for(const r of t){const t=r.target,s=ct(t);st.apply(s);const n=Array.from(s.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...n).join(" "),e(t)}})),mt=e=>{const r=e.connectedCallback,s=e.disconnectedCallback;e.connectedCallback=()=>{const s=t(e);if(!s)throw new Error("Can't find element field in component undefined");(t=>{const e=ct(t);st.apply(e);const r=Array.from(e.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...r).join(" "),lt.observe(t,{attributes:!0,attributeFilter:ot,childList:!1,subtree:!1})})(s),a(r,e)},e.disconnectedCallback=()=>{a(s,e)}};export{X as A,Z as B,w as C,A as D,W as E,x as F,z as G,O as H,j as a,v as b,et as c,_ as d,C as e,q as f,M as g,E as h,F as i,I as j,Y as k,tt as l,B as m,G as n,nt as o,J as p,L as q,U as r,K as s,H as t,Q as u,$ as v,mt as w,P as x,V as y,R as z}
@@ -0,0 +1 @@
1
+ import{g as o,f as t}from"./p-B_d-jp99.js";import{g as s,c as f}from"./p-BqhIhYr1.js";import{r as n}from"./p-B4JfKvVT.js";const c=c=>{let p,r;const i=()=>{"function"==typeof c.validateUnitScaling&&c.validateUnitScaling(c.unitScaling),"function"==typeof c.validatePercentageScaling&&c.validatePercentageScaling(c.percentageScaling),"function"==typeof c.validateSizeScaling&&c.validateSizeScaling()},e=c.connectedCallback;c.connectedCallback=()=>{const f=o(c);r=s(f),(()=>{const o=r.scalingGroups.state;for(const t of Object.keys(o))void 0!==o[t]?c.pixelPerUnitGroupMap.set(t,o[t]):c.pixelPerUnitGroupMap.delete(t)})(),i(),p=r.scalingGroups.on("set",((s,f)=>{void 0!==f?c.pixelPerUnitGroupMap.set(s,f):c.pixelPerUnitGroupMap.delete(s),i(),t(o(c))})),n(e,c)};const a=c.disconnectedCallback;c.disconnectedCallback=()=>{n(p),f(o(c)),n(a,c)}};export{c as w}
@@ -0,0 +1 @@
1
+ import{f as t,g as e}from"./p-B_d-jp99.js";import{g as r,c as s}from"./p-BqhIhYr1.js";import{r as n}from"./p-B4JfKvVT.js";import{i as o,f as l}from"./p-DY7YYmpa.js";import{m as u}from"./p-BZV1b5VH.js";const i=i=>{let a,c,f,m,p=null;const v=()=>{const t=c.ruleSets.state;m=u([t._system||{},t._default||{},t[f]||{}])},d=()=>{const r=e(i),s=r.getAttribute("ruleset");if(p&&(p.disconnect(),p=null),s&&o(s)){const e=l(r,s);f=null==e?void 0:e.getAttribute("ruleset"),e&&(p=new MutationObserver((()=>{f=e.getAttribute("ruleset"),v(),t(i)})),p.observe(e,{attributes:!0,attributeFilter:["ruleset"]}))}else f=s},b=new MutationObserver((e=>{e.forEach((e=>{"ruleset"===e.attributeName&&(d(),v(),t(i))}))})),j=i.connectedCallback;i.connectedCallback=()=>{const s=e(i);c=r(s),m=c.ruleSets.state._system,b.observe(s,{attributes:!0,attributeFilter:["ruleset"]}),d(),v(),a=c.ruleSets.on("set",(r=>{r!==f&&"_default"!==r||(d(),v(),t(e(i)))})),n(j,i)};const h=i.disconnectedCallback;return i.disconnectedCallback=()=>{b.disconnect(),p&&(p.disconnect(),p=null),n(a),s(e(i)),n(h,i)},()=>m};function a(t,e,r=80){let s=null,n=!1,o=-1,l=-1;const u=function(t){var e;const r=t.parentElement;return(null===(e=null==r?void 0:r.assignedSlot)||void 0===e?void 0:e.parentElement)?r.assignedSlot.parentElement:r}(t);if(!u)return{disconnect(){}};const i=new ResizeObserver((t=>{var i;if(n)return;let a,c;const f=t[0];if(null===(i=null==f?void 0:f.contentBoxSize)||void 0===i?void 0:i.length){const t=f.contentBoxSize[0];a=t.inlineSize,c=t.blockSize}else a=u.clientWidth,c=u.clientHeight;Math.abs(a-o)<=2&&Math.abs(c-l)<=2||(o=a,l=c,null!=s&&clearTimeout(s),s=setTimeout((()=>{n||e()}),r))}));return i.observe(u),{disconnect(){n=!0,null!=s&&clearTimeout(s),i.disconnect()}}}export{a as o,i as w}
@@ -0,0 +1 @@
1
+ import{g as t,c as n}from"./p-BqhIhYr1.js";import{r as e}from"./p-B4JfKvVT.js";import{g as o,f as a}from"./p-B_d-jp99.js";const s=(t,n)=>{const e=[],o=[];for(const a of n)(t(a)?e:o).push(a);return[e,o]},i="WARN_use_dataset",r=(t,n)=>{const e=t.errors;if(e)if(n.length>0){const t=n.map((t=>t.substring(1))).join(", ");e.addOrReplace({id:i,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else e.remove(i)},l=(a,i,l)=>{let c,u,f=[],d=[],p=[];const h=(t,n)=>{const e=n?t.substring(1):t;let o;try{o=u.db.db.exec(`SELECT * FROM \`${e}\``)}catch(t){o=[]}i(t,o)},m=()=>{f.forEach((t=>t())),f=[],d.forEach((t=>{t&&(f.push(u.db.subscribe(t,(()=>h(t,!1)))),h(t,!1),(t=>{if(l){const n=u.datasetsMeta.get(t);n&&l(t,n)}})(t))})),p.forEach((t=>{t&&(f.push(u.db.subscribe(t.substring(1),(()=>h(t,!0)))),h(t,!0))}))},v=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&([p,d]=s((t=>t.startsWith("$")),o(a).getAttribute("datasets").split(",")),r(a,p),m())}))})),b=a.connectedCallback;a.connectedCallback=()=>{const n=o(a);u=t(n),[p,d]=s((t=>t.startsWith("$")),(n.getAttribute("datasets")||"").split(",")),r(a,p),m(),v.observe(n,{attributes:!0,attributeFilter:["datasets"]}),l&&(c=u.datasetsMeta.on("set",((t,n)=>{d.includes(t)&&l(t,n)}))),e(b,a)};const g=a.disconnectedCallback;return a.disconnectedCallback=()=>{v.disconnect(),f.forEach((t=>t())),f=[],e(c),n(o(a)),e(g,a)},t=>{d=t,m()}},c="inherited-page",u="bn-layout-page";function f(t){return"inherited-closest"===t||t===c}function d(t,n){let e=t.parentNode;for(;e;){if(e instanceof HTMLElement){const t=e.nodeName.toLowerCase();if(n===c){if(t===u)return e}else if("bn-layout-card"===t||t===u)return e}if(e.parentNode)e=e.parentNode;else{if(!(e instanceof ShadowRoot))break;e=e.host}}}const p=(t,n)=>{const s=new Map;let i,r=null;const l=t.connectedCallback;t.connectedCallback=()=>{(()=>{const e=o(t);s.clear();const l=[];for(const o of n){const n=t[o.propName];if("string"!=typeof n||!f(n))continue;if(i||(i=d(e,n)),!i)continue;const a=i.getAttribute(o.ancestorAttr);null!=a&&s.set(o.propName,a),l.push(o.ancestorAttr)}i&&l.length>0&&(r=new MutationObserver((()=>{for(const e of n){if(!f(t[e.propName]))continue;const n=i.getAttribute(e.ancestorAttr);null!=n?s.set(e.propName,n):s.delete(e.propName)}a(t)})),r.observe(i,{attributes:!0,attributeFilter:l}))})(),e(l,t)};const c=t.disconnectedCallback;return t.disconnectedCallback=()=>{r&&(r.disconnect(),r=null),i=void 0,s.clear(),e(c,t)},(t,n)=>{if(f(n))return s.get(t)}},h=s=>{let i,r,l,c=null;const u=()=>{var t;const n=o(s);if(c&&(c.disconnect(),c=null),r=null!==(t=n.getAttribute("i18n-namespace"))&&void 0!==t?t:n.getAttribute("namespace"),null!=r)return;const e=function(t){let n=t.parentNode;for(;n;){if(n instanceof HTMLElement&&n.hasAttribute("i18n-namespace"))return n;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof ShadowRoot))break;n=n.host}}}(n);e&&(r=e.getAttribute("i18n-namespace"),c=new MutationObserver((()=>{u(),a(s)})),c.observe(e,{attributes:!0,attributeFilter:["i18n-namespace"]}))},f=new MutationObserver((t=>{t.forEach((t=>{"i18n-namespace"!==t.attributeName&&"namespace"!==t.attributeName||(u(),a(s))}))})),d=s.connectedCallback;s.connectedCallback=()=>{const n=o(s);l=t(n),f.observe(n,{attributes:!0,attributeFilter:["i18n-namespace","namespace"]}),u(),i=l.internationalization.on("set",(t=>{t!==r&&"_system"!==t||a(s)})),e(d,s)};const p=s.disconnectedCallback;return s.disconnectedCallback=()=>{f.disconnect(),c&&(c.disconnect(),c=null),e(i),n(o(s)),e(p,s)},{t:(t,n)=>{var e,a,i,c,u;t.startsWith(".")&&(t=o(s).localName+t);const f=l.internationalization.state,d=l.context.state.locale,p=null!==(i=null===(a=null===(e=f[r])||void 0===e?void 0:e[d])||void 0===a?void 0:a[t])&&void 0!==i?i:null===(u=null===(c=f._system)||void 0===c?void 0:c[d])||void 0===u?void 0:u[t];return null==p?t:p.replace(/{{([\s\S]+?)}}/g,((t,e)=>{var o;return null!==(o=null==n?void 0:n[e.trim()])&&void 0!==o?o:""}))}}};function m(t,n=!1){const e=v(t);if(!e)return n&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const o=getComputedStyle(e),a=e.clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight),s=function(t,n=!1){let e=v(t),o=0,a=null,s=1;for(;e;){if(e.hasAttribute("data-bn-fit-content")){n&&console.log(`[height:${o}]`,e.tagName,"fit-content region → discarding inner candidate"),a=null;const t=parseInt(e.getAttribute("data-bn-fit-content"),10);!isNaN(t)&&t>1&&(s*=t),e=b(e),o++;continue}const t=getComputedStyle(e),i=t.overflowY;if(n&&console.log(`[height:${o}]`,e.tagName,e.className||"(no class)",`overflow=${i} clientH=${e.clientHeight} h=${t.height}`),null===a)if("hidden"===i||"scroll"===i||"auto"===i)a=e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom),n&&console.log(`[height] candidate at depth ${o}: ${Math.round(a)}px`);else if("none"!==t.maxHeight){const n=parseFloat(t.maxHeight);!isNaN(n)&&n>0&&(a=Math.min(n,e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)))}e=b(e),o++}return null!==a?a/s:(n&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight/s:0)}(t,n);return n&&console.log("[parentDims]",t.tagName,"→ layoutParent:",e.tagName,e.className||"(no class)",`clientW=${e.clientWidth} → w=${Math.round(a)}, h=${Math.round(s)}`,"overflow:",o.overflow),{width:Math.max(0,a),height:Math.max(0,s)}}function v(t){var n;const e=t.parentElement;return(null===(n=null==e?void 0:e.assignedSlot)||void 0===n?void 0:n.parentElement)?e.assignedSlot.parentElement:e}function b(t){var n;if(null===(n=t.assignedSlot)||void 0===n?void 0:n.parentElement)return t.assignedSlot.parentElement;if(t.parentElement)return t.parentElement;const e=t.getRootNode();return e instanceof ShadowRoot?e.host:null}function g(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const n=Number(t);return!isNaN(n)&&n>0?{mode:"factor",factor:n}:{mode:"empty"}}export{h as a,p as b,d as f,m as g,f as i,g as p,l as w}
@@ -0,0 +1 @@
1
+ import{C as n}from"./p-BZV1b5VH.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 m(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 g=["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,g),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,g),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,m as d,y as e,d as f,i as p,u as t}
@@ -0,0 +1 @@
1
+ class t{constructor(t,s,i,h){this.domainMin=t,this.domainMax=s,this.rangeMin=i,this.rangeMax=h}scale(t){const s=this.domainMax-this.domainMin;return 0===s?(this.rangeMin+this.rangeMax)/2:this.rangeMin+(t-this.domainMin)/s*(this.rangeMax-this.rangeMin)}static domain(t,s,i,h=.04){let n=s-t;if(0===n){const i=0===t?1:.1*Math.abs(t);n=(s+=i)-(t-=i)}return[void 0!==(null==i?void 0:i.min)?i.min:t-n*h,void 0!==(null==i?void 0:i.max)?i.max:s+n*h]}static niceStep(t,s){if(t<=0||s<=0)return 1;const i=t/s,h=Math.pow(10,Math.floor(Math.log10(i))),n=i/h;let r;return r=n<=1?1:n<=2?2:n<=2.5?2.5:n<=5?5:10,r*h}ticks(s){const i=this.domainMax-this.domainMin;if(i<=0)return[this.domainMin];const h=t.niceStep(i,s),n=[];for(let t=Math.ceil(this.domainMin/h)*h;t<=this.domainMax+1e-9*h;t+=h)n.push(Math.abs(t)<1e-9*h?0:t);return n}static tickDecimals(t){let s=0;for(const i of t){const t=String(i),h=t.indexOf(".");h>=0&&(s=Math.max(s,Math.min(2,t.length-h-1)))}return s}}export{t as N}
@@ -0,0 +1 @@
1
+ import{d as t,S as n}from"./p-BqhIhYr1.js";import{m as s,C as i}from"./p-BZV1b5VH.js";class r{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 s=n.exec(t);null!=s&&(this.type=String(s[1]),this.base=String(s[2]),this.delta=String(s[3]),this.direction=String(s[4]),this.isValid=!0)}}}var e;!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"}(e||(e={}));var h,u={},o=t(function(){if(h)return u;h=1;var t={};return Object.defineProperty(u,"__esModule",{value:!0}),u.default=function(n,s){void 0===s&&(s={});var i=JSON.stringify({text:n,options:s});if(t[i])return t[i];s.font=s.font||"Times",s.fontSize=s.fontSize||"16px",s.fontWeight=s.fontWeight||"normal",s.width=s.width||"auto";var r=function(t,n){var s=document.createElement("div"),i=document.createTextNode(t);return s.appendChild(i),s.style.fontFamily=n.font,s.style.fontSize=n.fontSize,s.style.fontWeight=n.fontWeight,s.style.position="absolute",s.style.visibility="hidden",s.style.left="-999px",s.style.top="-999px",s.style.width=n.width,s.style.height="auto",document.body.appendChild(s),s}(n,s),e={width:r.offsetWidth,height:r.offsetHeight};return function(t){t.parentNode.removeChild(t)}(r),t[i]=e,e},u}());class c{static number(t,n="decimal",s=1,i=0,r=1){return(t/r).toLocaleString("de-DE",{style:n,useGrouping:!0,maximumFractionDigits:s,minimumFractionDigits:i}).replace(/\s+(%)/g,"$1").replace(/\s/g,this.postfixSeperator).replace(/\./g,this.tsdDelimiter)}static translateScenarioLabel(t,n){if(null==t)return"";const s=new r(t);if(!s.isValid)return`${n.get(t)||t}`;let i,h;return e.AC1===s.base?(i=n.get("dr"===s.type?"ibcssymbol_delta_ac_relative":"ibcssymbol_delta_ac"),h=n.get(s.delta)||s.delta):(i=n.get("dr"===s.type?"ibcssymbol_delta_generic_relative":"ibcssymbol_delta_generic"),h=`${n.get(s.base)||s.base} - ${n.get(s.delta)||s.delta}`),void 0===i&&(i="{%}"),`${i.replace("{%}",h)}`}static getMaxWidthOfArrayItems(t,n,s){return o(t.map((t=>c.translateScenarioLabel(t,n))).reduce(((t,n)=>t.length<n.length?n:t),""),{font:s.fontStyles.font,fontSize:s.fontStyles.size+"px"}).width}}c.tsdDelimiter=".",c.postfixSeperator=",";const l={},a=[];function f(t,n){if(Array.isArray(t))for(const s of t)f(s,n);else if("object"!=typeof t)d(Object.getOwnPropertyNames(n)),l[t]=Object.assign(l[t]||{},n);else for(const n in t)f(n,t[n])}function p(t){return l[t]||{}}function d(t){a.push(...t)}function w(t,n){let s;const i=t.length,r=[];for(s=0;s<i;s++)r.push(n(t[s]));return r}function m(t){return t%360*Math.PI/180}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t,n,s,i){return null!=n&&null!=s||(i=i||t.bbox(),null==n?n=i.width/i.height*s:null==s&&(s=i.height/i.width*n)),{width:n,height:s}}function x(t,n){const s=t.origin;let i=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",r=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=s&&([i,r]=Array.isArray(s)?s:"object"==typeof s?[s.x,s.y]:[s,s]);const e="string"==typeof i,h="string"==typeof r;if(e||h){const{height:t,width:s,x:u,y:o}=n.bbox();e&&(i=i.includes("left")?u:i.includes("right")?u+s:u+s/2),h&&(r=r.includes("top")?o:r.includes("bottom")?o+t:o+t/2)}return[i,r]}const b=new Set(["desc","metadata","title"]),v=t=>b.has(t.nodeName),_=(t,n,s={})=>{const i={...n};for(const t in i)i[t].valueOf()===s[t]&&delete i[t];Object.keys(i).length?t.node.setAttribute("data-svgjs",JSON.stringify(i)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},M="http://www.w3.org/2000/svg",A="http://www.w3.org/2000/xmlns/",k="http://www.w3.org/1999/xlink",O={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class j{}const S={},E="___SYMBOL___ROOT___";function T(t,n=M){return O.document.createElementNS(n,t)}function C(t,n=!1){if(t instanceof j)return t;if("object"==typeof t)return Y(t);if(null==t)return new S[E];if("string"==typeof t&&"<"!==t.trim().charAt(0))return Y(O.document.querySelector(t));const s=n?O.document.createElement("div"):T("svg");return s.innerHTML=t.trim(),t=Y(s.firstElementChild),s.removeChild(s.firstElementChild),t}function D(t,n){return n&&(n instanceof O.window.Node||n.ownerDocument&&n instanceof n.ownerDocument.defaultView.Node)?n:T(t)}function z(t){if(!t)return null;if(t.instance instanceof j)return t.instance;if("#document-fragment"===t.nodeName)return new S.Fragment(t);let n=y(t.nodeName||"Dom");return"LinearGradient"===n||"RadialGradient"===n?n="Gradient":S[n]||(n="Dom"),new S[n](t)}let Y=z;function F(t,n=t.name,s=!1){return S[n]=t,s&&(S[E]=t),d(Object.getOwnPropertyNames(t.prototype)),t}let N=1e3;function I(t){return"Svgjs"+y(t)+N++}function P(t){for(let n=t.children.length-1;n>=0;n--)P(t.children[n]);return t.id?(t.id=I(t.nodeName),t):t}function G(t,n){let s,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;i>=0;i--)for(s in n)t[i].prototype[s]=n[s]}function $(t){return function(...n){const s=n[n.length-1];return!s||s.constructor!==Object||s instanceof Array?t.apply(this,n):t.apply(this,n.slice(0,-1)).attr(s)}}f("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=C(t)).remove();const n=this.position();return this.parent().add(t,n),this},after:function(t){(t=C(t)).remove();const n=this.position();return this.parent().add(t,n+1),this},insertBefore:function(t){return(t=C(t)).before(this),this},insertAfter:function(t){return(t=C(t)).after(this),this}});const R=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,L=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,H=/rgb\((\d+),(\d+),(\d+)\)/,V=/(#[a-z_][a-z0-9\-_]*)/i,X=/\)\s*,?\s*/,B=/\s/g,Q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,q=/^rgb\(/,W=/^(\s+)?$/,J=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Z=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,U=/[\s,]+/,K=/[MLHVCSQTAZ]/i;function tt(t){const n=Math.round(t),s=Math.max(0,Math.min(255,n)).toString(16);return 1===s.length?"0"+s:s}function nt(t,n){for(let s=n.length;s--;)if(null==t[n[s]])return!1;return!0}function st(t,n,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+6*(n-t)*s:s<.5?n:s<2/3?t+(n-t)*(2/3-s)*6:t}f("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(U)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const n=this.classes();n.push(t),this.attr("class",n.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(n){return n!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),f("Dom",{css:function(t,n){const s={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const n=t.split(/\s*:\s*/);s[n[0]]=n[1]})),s;if(arguments.length<2){if(Array.isArray(t)){for(const n of t)s[n]=this.node.style.getPropertyValue(n);return s}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const n in t)this.node.style.setProperty(n,null==t[n]||W.test(t[n])?"":t[n])}return 2===arguments.length&&this.node.style.setProperty(t,null==n||W.test(n)?"":n),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),f("Dom",{data:function(t,n,s){if(null==t)return this.data(w(function(t){let n;const s=t.length,i=[];for(n=0;n<s;n++)0===t[n].nodeName.indexOf("data-")&&i.push(t[n]);return i}(this.node.attributes),(t=>t.nodeName.slice(5))));if(t instanceof Array){const n={};for(const s of t)n[s]=this.data(s);return n}if("object"==typeof t)for(n in t)this.data(n,t[n]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(n){return this.attr("data-"+t)}else this.attr("data-"+t,null===n?null:!0===s||"string"==typeof n||"number"==typeof n?n:JSON.stringify(n));return this}}),f("Dom",{remember:function(t,n){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=n}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class it{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof it||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",n){const{random:s,round:i,sin:r,PI:e}=Math;if("vibrant"===t){const t=24*s()+57,n=38*s()+45,i=360*s();return new it(t,n,i,"lch")}if("sine"===t){const t=i(80*r(2*e*(n=null==n?s():n)/.5+.01)+150),h=i(50*r(2*e*n/.5+4.6)+200),u=i(100*r(2*e*n/.5+2.3)+150);return new it(t,h,u)}if("pastel"===t){const t=8*s()+86,n=17*s()+9,i=360*s();return new it(t,n,i,"lch")}if("dark"===t){const t=10+10*s(),n=50*s()+86,i=360*s();return new it(t,n,i,"lch")}if("rgb"===t){const t=255*s(),n=255*s(),i=255*s();return new it(t,n,i)}if("lab"===t){const t=100*s(),n=256*s()-128,i=256*s()-128;return new it(t,n,i,"lab")}if("grey"===t){const t=255*s();return new it(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Q.test(t)||q.test(t))}cmyk(){const{_a:t,_b:n,_c:s}=this.rgb(),[i,r,e]=[t,n,s].map((t=>t/255)),h=Math.min(1-i,1-r,1-e);return 1===h?new it(0,0,0,1,"cmyk"):new it((1-i-h)/(1-h),(1-r-h)/(1-h),(1-e-h)/(1-h),h,"cmyk")}hsl(){const{_a:t,_b:n,_c:s}=this.rgb(),[i,r,e]=[t,n,s].map((t=>t/255)),h=Math.max(i,r,e),u=Math.min(i,r,e),o=(h+u)/2,c=h===u,l=h-u;return new it(360*(c?0:h===i?((r-e)/l+(r<e?6:0))/6:h===r?((e-i)/l+2)/6:h===e?((i-r)/l+4)/6:0),100*(c?0:o>.5?l/(2-h-u):l/(h+u)),100*o,"hsl")}init(t=0,n=0,s=0,i=0,r="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)r="string"==typeof i?i:r,i="string"==typeof i?0:i,Object.assign(this,{_a:t,_b:n,_c:s,_d:i,space:r});else if(t instanceof Array)this.space=n||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const s=function(t,n){const s=nt(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:nt(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:nt(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:nt(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:nt(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:nt(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return s.space=n||s.space,s}(t,n);Object.assign(this,s)}else if("string"==typeof t)if(q.test(t)){const n=t.replace(B,""),[s,i,r]=H.exec(n).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:s,_b:i,_c:r,_d:0,space:"rgb"})}else{if(!Q.test(t))throw Error("Unsupported string format, can't construct Color");{const n=t=>parseInt(t,16),[,s,i,r]=L.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(n);Object.assign(this,{_a:s,_b:i,_c:r,_d:0,space:"rgb"})}}const{_a:e,_b:h,_c:u,_d:o}=this;Object.assign(this,"rgb"===this.space?{r:e,g:h,b:u}:"xyz"===this.space?{x:e,y:h,z:u}:"hsl"===this.space?{h:e,s:h,l:u}:"lab"===this.space?{l:e,a:h,b:u}:"lch"===this.space?{l:e,c:h,h:u}:"cmyk"===this.space?{c:e,m:h,y:u,k:o}:{})}lab(){const{x:t,y:n,z:s}=this.xyz();return new it(116*n-16,500*(t-n),200*(n-s),"lab")}lch(){const{l:t,a:n,b:s}=this.lab(),i=Math.sqrt(n**2+s**2);let r=180*Math.atan2(s,n)/Math.PI;return r<0&&(r*=-1,r=360-r),new it(t,i,r,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:n,z:s}=this;if("lab"===this.space||"lch"===this.space){let{l:i,a:r,b:e}=this;if("lch"===this.space){const{c:t,h:n}=this,s=Math.PI/180;r=t*Math.cos(s*n),e=t*Math.sin(s*n)}const h=(i+16)/116,u=r/500+h,o=h-e/200,c=16/116,l=.008856,a=7.787;t=.95047*(u**3>l?u**3:(u-c)/a),n=1*(h**3>l?h**3:(h-c)/a),s=1.08883*(o**3>l?o**3:(o-c)/a)}const i=3.2406*t+-1.5372*n+-.4986*s,r=-.9689*t+1.8758*n+.0415*s,e=.0557*t+-.204*n+1.057*s,h=Math.pow,u=.0031308,o=i>u?1.055*h(i,1/2.4)-.055:12.92*i,c=r>u?1.055*h(r,1/2.4)-.055:12.92*r,l=e>u?1.055*h(e,1/2.4)-.055:12.92*e;return new it(255*o,255*c,255*l)}if("hsl"===this.space){let{h:t,s:n,l:s}=this;if(t/=360,n/=100,s/=100,0===n)return s*=255,new it(s,s,s);const i=s<.5?s*(1+n):s+n-s*n,r=2*s-i,e=255*st(r,i,t+1/3),h=255*st(r,i,t),u=255*st(r,i,t-1/3);return new it(e,h,u)}if("cmyk"===this.space){const{c:t,m:n,y:s,k:i}=this,r=255*(1-Math.min(1,t*(1-i)+i)),e=255*(1-Math.min(1,n*(1-i)+i)),h=255*(1-Math.min(1,s*(1-i)+i));return new it(r,e,h)}return this;var t}toArray(){const{_a:t,_b:n,_c:s,_d:i,space:r}=this;return[t,n,s,i,r]}toHex(){const[t,n,s]=this._clamped().map(tt);return`#${t}${n}${s}`}toRgb(){const[t,n,s]=this._clamped();return`rgb(${t},${n},${s})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:n,_c:s}=this.rgb(),[i,r,e]=[t,n,s].map((t=>t/255)),h=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,o=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,c=(.4124*h+.3576*u+.1805*o)/.95047,l=(.2126*h+.7152*u+.0722*o)/1,a=(.0193*h+.1192*u+.9505*o)/1.08883,f=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116,d=a>.008856?Math.pow(a,1/3):7.787*a+16/116;return new it(f,p,d,"xyz")}_clamped(){const{_a:t,_b:n,_c:s}=this.rgb(),{max:i,min:r,round:e}=Math;return[t,n,s].map((t=>i(0,r(e(t),255))))}}class rt{constructor(...t){this.init(...t)}clone(){return new rt(this)}init(t,n){const s=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:n};return this.x=null==s.x?0:s.x,this.y=null==s.y?0:s.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ht.isMatrixLike(t)||(t=new ht(t));const{x:n,y:s}=this;return this.x=t.a*n+t.c*s+t.e,this.y=t.b*n+t.d*s+t.f,this}}function et(t,n){return Math.abs(n-t)<1e-6}class ht{constructor(...t){this.init(...t)}static formatTransforms(t){const n="both"===t.flip||!0===t.flip,s=t.flip&&(n||"x"===t.flip)?-1:1,i=t.flip&&(n||"y"===t.flip)?-1:1,r=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,e=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,h=t.scale&&t.scale.length?t.scale[0]*s:isFinite(t.scale)?t.scale*s:isFinite(t.scaleX)?t.scaleX*s:s,u=t.scale&&t.scale.length?t.scale[1]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleY)?t.scaleY*i:i,o=t.shear||0,c=t.rotate||t.theta||0,l=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),a=l.x,f=l.y,p=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),d=p.x,w=p.y,m=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=m.x,g=m.y,x=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:h,scaleY:u,skewX:r,skewY:e,shear:o,theta:c,rx:x.x,ry:x.y,tx:y,ty:g,ox:a,oy:f,px:d,py:w}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,n,s){const i=t.b*n.a+t.d*n.b,r=t.a*n.c+t.c*n.d,e=t.b*n.c+t.d*n.d,h=t.e+t.a*n.e+t.c*n.f,u=t.f+t.b*n.e+t.d*n.f;return s.a=t.a*n.a+t.c*n.b,s.b=i,s.c=r,s.d=e,s.e=h,s.f=u,s}around(t,n,s){return this.clone().aroundO(t,n,s)}aroundO(t,n,s){const i=t||0,r=n||0;return this.translateO(-i,-r).lmultiplyO(s).translateO(i,r)}clone(){return new ht(this)}decompose(t=0,n=0){const s=this.a,i=this.b,r=this.c,e=this.d,h=this.e,u=this.f,o=s*e-i*r,c=o>0?1:-1,l=c*Math.sqrt(s*s+i*i),a=Math.atan2(c*i,c*s),f=180/Math.PI*a,p=Math.cos(a),d=Math.sin(a),w=(s*r+i*e)/o,m=r*l/(w*s-i)||e*l/(w*i+s);return{scaleX:l,scaleY:m,shear:w,rotate:f,translateX:h-t+t*p*l+n*(w*p*l-d*m),translateY:u-n+t*d*l+n*(w*d*l+p*m),originX:t,originY:n,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const n=new ht(t);return et(this.a,n.a)&&et(this.b,n.b)&&et(this.c,n.c)&&et(this.d,n.d)&&et(this.e,n.e)&&et(this.f,n.f)}flip(t,n){return this.clone().flipO(t,n)}flipO(t,n){return"x"===t?this.scaleO(-1,1,n,0):"y"===t?this.scaleO(1,-1,0,n):this.scaleO(-1,-1,t,n||t)}init(t){const n=ht.fromArray([1,0,0,1,0,0]);return t=t instanceof St?t.matrixify():"string"==typeof t?ht.fromArray(t.split(U).map(parseFloat)):Array.isArray(t)?ht.fromArray(t):"object"==typeof t&&ht.isMatrixLike(t)?t:"object"==typeof t?(new ht).transform(t):6===arguments.length?ht.fromArray([].slice.call(arguments)):n,this.a=null!=t.a?t.a:n.a,this.b=null!=t.b?t.b:n.b,this.c=null!=t.c?t.c:n.c,this.d=null!=t.d?t.d:n.d,this.e=null!=t.e?t.e:n.e,this.f=null!=t.f?t.f:n.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,n=this.b,s=this.c,i=this.d,r=this.e,e=this.f,h=t*i-n*s;if(!h)throw new Error("Cannot invert "+this);const u=i/h,o=-n/h,c=-s/h,l=t/h,a=-(u*r+c*e),f=-(o*r+l*e);return this.a=u,this.b=o,this.c=c,this.d=l,this.e=a,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const n=t instanceof ht?t:new ht(t);return ht.matrixMultiply(n,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const n=t instanceof ht?t:new ht(t);return ht.matrixMultiply(this,n,this)}rotate(t,n,s){return this.clone().rotateO(t,n,s)}rotateO(t,n=0,s=0){t=m(t);const i=Math.cos(t),r=Math.sin(t),{a:e,b:h,c:u,d:o,e:c,f:l}=this;return this.a=e*i-h*r,this.b=h*i+e*r,this.c=u*i-o*r,this.d=o*i+u*r,this.e=c*i-l*r+s*r-n*i+n,this.f=l*i+c*r-n*r-s*i+s,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,n=t,s=0,i=0){3===arguments.length&&(i=s,s=n,n=t);const{a:r,b:e,c:h,d:u,e:o,f:c}=this;return this.a=r*t,this.b=e*n,this.c=h*t,this.d=u*n,this.e=o*t-s*t+s,this.f=c*n-i*n+i,this}shear(t,n,s){return this.clone().shearO(t,n,s)}shearO(t,n=0,s=0){const{a:i,b:r,c:e,d:h,e:u,f:o}=this;return this.a=i+r*t,this.c=e+h*t,this.e=u+o*t-s*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,n=t,s=0,i=0){3===arguments.length&&(i=s,s=n,n=t),t=m(t),n=m(n);const r=Math.tan(t),e=Math.tan(n),{a:h,b:u,c:o,d:c,e:l,f:a}=this;return this.a=h+u*r,this.b=u+h*e,this.c=o+c*r,this.d=c+o*e,this.e=l+a*r-i*r,this.f=a+l*e-s*e,this}skewX(t,n,s){return this.skew(t,0,n,s)}skewY(t,n,s){return this.skew(0,t,n,s)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(ht.isMatrixLike(t))return new ht(t).multiplyO(this);const n=ht.formatTransforms(t),{x:s,y:i}=new rt(n.ox,n.oy).transform(this),r=(new ht).translateO(n.rx,n.ry).lmultiplyO(this).translateO(-s,-i).scaleO(n.scaleX,n.scaleY).skewO(n.skewX,n.skewY).shearO(n.shear).rotateO(n.theta).translateO(s,i);if(isFinite(n.px)||isFinite(n.py)){const t=new rt(s,i).transform(r),e=isFinite(n.px)?n.px-t.x:0,h=isFinite(n.py)?n.py-t.y:0;r.translateO(e,h)}return r.translateO(n.tx,n.ty),r}translate(t,n){return this.clone().translateO(t,n)}translateO(t,n){return this.e+=t||0,this.f+=n||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function ut(){if(!ut.nodes){const t=C().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const n=t.path().node;ut.nodes={svg:t,path:n}}return ut.nodes.svg.node.parentNode||ut.nodes.svg.addTo(O.document.body||O.document.documentElement),ut.nodes}function ot(t){return!(t.width||t.height||t.x||t.y)}F(ht,"Matrix");class ct{constructor(...t){this.init(...t)}addOffset(){return this.x+=O.window.pageXOffset,this.y+=O.window.pageYOffset,new ct(this)}init(t){return t="string"==typeof t?t.split(U).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ot(this)}merge(t){const n=Math.min(this.x,t.x),s=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width)-n,r=Math.max(this.y+this.height,t.y+t.height)-s;return new ct(n,s,i,r)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof ht||(t=new ht(t));let n=1/0,s=-1/0,i=1/0,r=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(e){e=e.transform(t),n=Math.min(n,e.x),s=Math.max(s,e.x),i=Math.min(i,e.y),r=Math.max(r,e.y)})),new ct(n,i,s-n,r-i)}}function lt(t,n,s){let i;try{if(i=n(t.node),ot(i)&&(r=t.node)!==O.document&&!(O.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===O.document}).call(O.document.documentElement,r))throw new Error("Element not in the dom")}catch(n){i=s(t)}var r;return i}f({viewbox:{viewbox(t,n,s,i){return null==t?new ct(this.attr("viewBox")):this.attr("viewBox",new ct(t,n,s,i))},zoom(t,n){let{width:s,height:i}=this.attr(["width","height"]);if((s||i)&&"string"!=typeof s&&"string"!=typeof i||(s=this.node.clientWidth,i=this.node.clientHeight),!s||!i)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const r=this.viewbox(),e=s/r.width,h=i/r.height,u=Math.min(e,h);if(null==t)return u;let o=u/t;o===1/0&&(o=Number.MAX_SAFE_INTEGER/100),n=n||new rt(s/2/e+r.x,i/2/h+r.y);const c=new ct(r).transform(new ht({scale:o,origin:n}));return this.viewbox(c)}}}),F(ct,"Box");class at extends Array{constructor(t=[],...n){if(super(t,...n),"number"==typeof t)return this;this.length=0,this.push(...t)}}G([at],{each(t,...n){return this.map("function"==typeof t?(n,s,i)=>t.call(n,n,s,i):s=>s[t](...n))},toArray(){return Array.prototype.concat.apply([],this)}});const ft=["toArray","constructor","each"];function pt(t,n){return new at(w((n||O.document).querySelectorAll(t),(function(t){return z(t)})))}at.extend=function(t){t=t.reduce(((t,n)=>(ft.includes(n)||"_"===n[0]||(n in Array.prototype&&(t["$"+n]=Array.prototype[n]),t[n]=function(...t){return this.each(n,...t)}),t)),{}),G([at],t)};let dt=0;const wt={};function mt(t){let n=t.getEventHolder();return n===O.window&&(n=wt),n.events||(n.events={}),n.events}function yt(t){return t.getEventTarget()}function gt(t,n,s,i,r){const e=s.bind(i||t),h=C(t),u=mt(h),o=yt(h);n=Array.isArray(n)?n:n.split(U),s._svgjsListenerId||(s._svgjsListenerId=++dt),n.forEach((function(t){const n=t.split(".")[0],i=t.split(".")[1]||"*";u[n]=u[n]||{},u[n][i]=u[n][i]||{},u[n][i][s._svgjsListenerId]=e,o.addEventListener(n,e,r||!1)}))}function xt(t,n,s,i){const r=C(t),e=mt(r),h=yt(r);("function"!=typeof s||(s=s._svgjsListenerId))&&(n=Array.isArray(n)?n:(n||"").split(U)).forEach((function(t){const n=t&&t.split(".")[0],u=t&&t.split(".")[1];let o,c;if(s)e[n]&&e[n][u||"*"]&&(h.removeEventListener(n,e[n][u||"*"][s],i||!1),delete e[n][u||"*"][s]);else if(n&&u){if(e[n]&&e[n][u]){for(c in e[n][u])xt(h,[n,u].join("."),c);delete e[n][u]}}else if(u)for(t in e)for(o in e[t])u===o&&xt(h,[t,u].join("."));else if(n){if(e[n]){for(o in e[n])xt(h,[n,o].join("."));delete e[n]}}else{for(t in e)xt(h,t);!function(t){let n=t.getEventHolder();n===O.window&&(n=wt),n.events&&(n.events={})}(r)}}))}class bt extends j{addEventListener(){}dispatch(t,n,s){return function(t,n,s,i){const r=yt(t);return n instanceof O.window.Event||(n=new O.window.CustomEvent(n,{detail:s,cancelable:!0,...i})),r.dispatchEvent(n),n}(this,t,n,s)}dispatchEvent(t){const n=this.getEventHolder().events;if(!n)return!0;const s=n[t.type];for(const n in s)for(const i in s[n])s[n][i](t);return!t.defaultPrevented}fire(t,n,s){return this.dispatch(t,n,s),this}getEventHolder(){return this}getEventTarget(){return this}off(t,n,s){return xt(this,t,n,s),this}on(t,n,s,i){return gt(this,t,n,s,i),this}removeEventListener(){}}function vt(){}F(bt,"EventTarget");const _t={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class Mt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(U).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class At{constructor(...t){this.init(...t)}convert(t){return new At(this.value,t)}divide(t){return t=new At(t),new At(this/t,this.unit||t.unit)}init(t,n){return n=Array.isArray(t)?t[1]:n,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=n||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(n=t.match(R))&&(this.value=parseFloat(n[1]),"%"===n[5]?this.value/=100:"s"===n[5]&&(this.value*=1e3),this.unit=n[5]):t instanceof At&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new At(t),new At(this-t,this.unit||t.unit)}plus(t){return t=new At(t),new At(this+t,this.unit||t.unit)}times(t){return t=new At(t),new At(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const kt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ot=[];class jt extends bt{constructor(t,n){super(),this.node=t,this.type=t.nodeName,n&&t!==n&&this.attr(n)}add(t,n){return(t=C(t)).removeNamespace&&this.node instanceof O.window.SVGElement&&t.removeNamespace(),null==n?this.node.appendChild(t.node):t.node!==this.node.childNodes[n]&&this.node.insertBefore(t.node,this.node.childNodes[n]),this}addTo(t,n){return C(t).put(this,n)}children(){return new at(w(this.node.children,(function(t){return z(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,n=!0){this.writeDataToDom();let s=this.node.cloneNode(t);return n&&(s=P(s)),new this.constructor(s)}each(t,n){const s=this.children();let i,r;for(i=0,r=s.length;i<r;i++)t.apply(s[i],[i,s]),n&&s[i].each(t,n);return this}element(t,n){return this.put(new jt(T(t),n))}first(){return z(this.node.firstChild)}get(t){return z(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,n){return this.xml(t,n,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=I(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return z(this.node.lastChild)}matches(t){const n=this.node,s=n.matches||n.matchesSelector||n.msMatchesSelector||n.mozMatchesSelector||n.webkitMatchesSelector||n.oMatchesSelector||null;return s&&s.call(n,t)}parent(t){let n=this;if(!n.node.parentNode)return null;if(n=z(n.node.parentNode),!t)return n;do{if("string"==typeof t?n.matches(t):n instanceof t)return n}while(n=z(n.node.parentNode));return n}put(t,n){return t=C(t),this.add(t,n),t}putIn(t,n){return C(t).add(this,n)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=C(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,n=null){const s=10**t,i=this.attr(n);for(const t in i)"number"==typeof i[t]&&(i[t]=Math.round(i[t]*s)/s);return this.attr(i),this}svg(t,n){return this.xml(t,n,M)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const n=this.parent();if(!n)return this.addTo(t);const s=n.index(this);return n.put(t,s).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,n,s){if("boolean"==typeof t&&(s=n,n=t,t=null),null==t||"function"==typeof t){n=null==n||n,this.writeDataToDom();let s=this;if(null!=t){if(s=z(s.node.cloneNode(!0)),n){const n=t(s);if(s=n||s,!1===n)return""}s.each((function(){const n=t(this),s=n||this;!1===n?this.remove():n&&this!==s&&this.replace(s)}),!0)}return n?s.node.outerHTML:s.node.innerHTML}n=null!=n&&n;const i=T("wrapper",s),r=O.document.createDocumentFragment();i.innerHTML=t;for(let t=i.children.length;t--;)r.appendChild(i.firstElementChild);const e=this.parent();return n?this.replace(r)&&e:this.add(r)}}G(jt,{attr:function(t,n,s){if(null==t){t={},n=this.node.attributes;for(const s of n)t[s.nodeName]=J.test(s.nodeValue)?parseFloat(s.nodeValue):s.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,n)=>(t[n]=this.attr(n),t)),{});if("object"==typeof t&&t.constructor===Object)for(n in t)this.attr(n,t[n]);else if(null===n)this.node.removeAttribute(t);else{if(null==n)return null==(n=this.node.getAttribute(t))?_t[t]:J.test(n)?parseFloat(n):n;"number"==typeof(n=Ot.reduce(((n,s)=>s(t,n,this)),n))?n=new At(n):kt.has(t)&&it.isColor(n)?n=new it(n):n.constructor===Array&&(n=new Mt(n)),"leading"===t?this.leading&&this.leading(n):"string"==typeof s?this.node.setAttributeNS(s,t,n.toString()):this.node.setAttribute(t,n.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return pt(t,this.node)},findOne:function(t){return z(this.node.querySelector(t))}}),F(jt,"Dom");class St extends jt{constructor(t,n){super(t,n),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,n){return this.cx(t).cy(n)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,n){return this.dx(t).dy(n)}dx(t=0){return this.x(new At(t).plus(this.x()))}dy(t=0){return this.y(new At(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,n){return this.x(t).y(n)}parents(t=this.root()){const n="string"==typeof t;n||(t=C(t));const s=new at;let i=this;for(;(i=i.parent())&&i.node!==O.document&&"#document-fragment"!==i.nodeName&&(s.push(i),n||i.node!==t.node)&&(!n||!i.matches(t));)if(i.node===this.root().node)return null;return s}reference(t){if(!(t=this.attr(t)))return null;const n=(t+"").match(V);return n?C(n[1]):null}root(){const t=this.parent(S[E]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,n){const s=g(this,t,n);return this.width(new At(s.width)).height(new At(s.height))}width(t){return this.attr("width",t)}writeDataToDom(){return _(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}G(St,{bbox:function(){const t=lt(this,(t=>t.getBBox()),(t=>{try{const n=t.clone().addTo(ut().svg).show(),s=n.node.getBBox();return n.remove(),s}catch(n){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${n.toString()}`)}}));return new ct(t)},rbox:function(t){const n=lt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),s=new ct(n);return t?s.transform(t.screenCTM().inverseO()):s.addOffset()},inside:function(t,n){const s=this.bbox();return t>s.x&&n>s.y&&t<s.x+s.width&&n<s.y+s.height},point:function(t,n){return new rt(t,n).transformO(this.screenCTM().inverseO())},ctm:function(){return new ht(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),n=t.node.getScreenCTM();return t.remove(),new ht(n)}return new ht(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new ht}}}),F(St,"Element");const Et={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,n){return"color"===n?t:t+"-"+n}};["fill","stroke"].forEach((function(t){const n={};let s;n[t]=function(n){if(void 0===n)return this.attr(t);if("string"==typeof n||n instanceof it||it.isRgb(n)||n instanceof St)this.attr(t,n);else for(s=Et[t].length-1;s>=0;s--)null!=n[Et[t][s]]&&this.attr(Et.prefix(t,Et[t][s]),n[Et[t][s]]);return this},f(["Element","Runner"],n)})),f(["Element","Runner"],{matrix:function(t,n,s,i,r,e){return null==t?new ht(this):this.attr("transform",new ht(t,n,s,i,r,e))},rotate:function(t,n,s){return this.transform({rotate:t,ox:n,oy:s},!0)},skew:function(t,n,s,i){return this.transform(1===arguments.length||3===arguments.length?{skew:t,ox:n,oy:s}:{skew:[t,n],ox:s,oy:i},!0)},shear:function(t,n,s){return this.transform({shear:t,ox:n,oy:s},!0)},scale:function(t,n,s,i){return this.transform(1===arguments.length||3===arguments.length?{scale:t,ox:n,oy:s}:{scale:[t,n],ox:s,oy:i},!0)},translate:function(t,n){return this.transform({translate:[t,n]},!0)},relative:function(t,n){return this.transform({relative:[t,n]},!0)},flip:function(t="both",n="center"){return-1==="xybothtrue".indexOf(t)&&(n=t,t="both"),this.transform({flip:t,origin:n},!0)},opacity:function(t){return this.attr("opacity",t)}}),f("radius",{radius:function(t,n=t){return"radialGradient"===(this._element||this).type?this.attr("r",new At(t)):this.rx(t).ry(n)}}),f("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),f(["Element","Runner"],{font:function(t,n){if("object"==typeof t){for(n in t)this.font(n,t[n]);return this}return"leading"===t?this.leading(n):this.attr("anchor"===t?"text-anchor":"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?"font-"+t:t,n)}}),f("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,n){return t[n]=function(t){return null===t?this.off(n):this.on(n,t),this},t}),{})),f("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(X).slice(0,-1).map((function(t){const n=t.trim().split("(");return[n[0],n[1].split(U).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,n){return"matrix"===n[0]?t.lmultiply(ht.fromArray(n[1])):t[n[0]].apply(t,n[1])}),new ht)},toParent:function(t,n){if(this===t)return this;if(v(this.node))return this.addTo(t,n);const s=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t,n).untransform().transform(i.multiply(s)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,n){if(null==t||"string"==typeof t){const n=new ht(this).decompose();return null==t?n:n[t]}ht.isMatrixLike(t)||(t={...t,origin:x(t,this)});const s=new ht(!0===n?this:n||!1).transform(t);return this.attr("transform",s)}});class Tt extends St{flatten(){return this.each((function(){if(this instanceof Tt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),n=t.index(this)){return n=-1===n?t.children().length:n,this.each((function(s,i){return i[i.length-s-1].toParent(t,n)})),this.remove()}}F(Tt,"Container");class Ct extends Tt{constructor(t,n=t){super(D("defs",t),n)}flatten(){return this}ungroup(){return this}}F(Ct,"Defs");class Dt extends St{}function zt(t){return this.attr("rx",t)}function Yt(t){return this.attr("ry",t)}function Ft(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Nt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function It(t){return this.attr("cx",t)}function Pt(t){return this.attr("cy",t)}function Gt(t){return null==t?2*this.rx():this.rx(new At(t).divide(2))}function $t(t){return null==t?2*this.ry():this.ry(new At(t).divide(2))}F(Dt,"Shape");var Rt=Object.freeze({__proto__:null,cx:It,cy:Pt,height:$t,rx:zt,ry:Yt,width:Gt,x:Ft,y:Nt});class Lt extends Dt{constructor(t,n=t){super(D("ellipse",t),n)}size(t,n){const s=g(this,t,n);return this.rx(new At(s.width).divide(2)).ry(new At(s.height).divide(2))}}G(Lt,Rt),f("Container",{ellipse:$((function(t=0,n=t){return this.put(new Lt).size(t,n).move(0,0)}))}),F(Lt,"Ellipse");class Ht extends jt{constructor(t=O.document.createDocumentFragment()){super(t)}xml(t,n,s){if("boolean"==typeof t&&(s=n,n=t,t=null),null==t||"function"==typeof t){const t=new jt(T("wrapper",s));return t.add(this.node.cloneNode(!0)),t.xml(!1,s)}return super.xml(t,!1,s)}}function Vt(t,n){return this.attr("radialGradient"===(this._element||this).type?{fx:new At(t),fy:new At(n)}:{x1:new At(t),y1:new At(n)})}function Xt(t,n){return this.attr("radialGradient"===(this._element||this).type?{cx:new At(t),cy:new At(n)}:{x2:new At(t),y2:new At(n)})}F(Ht,"Fragment");var Bt=Object.freeze({__proto__:null,from:Vt,to:Xt});class Qt extends Tt{constructor(t,n){super(D(t+"Gradient","string"==typeof t?null:t),n)}attr(t,n,s){return"transform"===t&&(t="gradientTransform"),super.attr(t,n,s)}bbox(){return new ct}targets(){return pt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}G(Qt,Bt),f({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:$((function(t,n){return this.put(new Qt(t)).update(n)}))}}),F(Qt,"Gradient");class qt extends Tt{constructor(t,n=t){super(D("pattern",t),n)}attr(t,n,s){return"transform"===t&&(t="patternTransform"),super.attr(t,n,s)}bbox(){return new ct}targets(){return pt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}f({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:$((function(t,n,s){return this.put(new qt).update(s).attr({x:0,y:0,width:t,height:n,patternUnits:"userSpaceOnUse"})}))}}),F(qt,"Pattern");class Wt extends Dt{constructor(t,n=t){super(D("image",t),n)}load(t,n){if(!t)return this;const s=new O.window.Image;return gt(s,"load",(function(t){const i=this.parent(qt);0===this.width()&&0===this.height()&&this.size(s.width,s.height),i instanceof qt&&0===i.width()&&0===i.height()&&i.size(this.width(),this.height()),"function"==typeof n&&n.call(this,t)}),this),gt(s,"load error",(function(){xt(s)})),this.attr("href",s.src=t,k)}}Ot.push((function(t,n,s){return"fill"!==t&&"stroke"!==t||Z.test(n)&&(n=s.root().defs().image(n)),n instanceof Wt&&(n=s.root().defs().pattern(0,0,(t=>{t.add(n)}))),n})),f({Container:{image:$((function(t,n){return this.put(new Wt).size(0,0).load(t,n)}))}}),F(Wt,"Image");class Jt extends Mt{bbox(){let t=-1/0,n=-1/0,s=1/0,i=1/0;return this.forEach((function(r){t=Math.max(r[0],t),n=Math.max(r[1],n),s=Math.min(r[0],s),i=Math.min(r[1],i)})),new ct(s,i,t-s,n-i)}move(t,n){const s=this.bbox();if(t-=s.x,n-=s.y,!isNaN(t)&&!isNaN(n))for(let s=this.length-1;s>=0;s--)this[s]=[this[s][0]+t,this[s][1]+n];return this}parse(t=[0,0]){const n=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(U).map(parseFloat)).length%2!=0&&t.pop();for(let s=0,i=t.length;s<i;s+=2)n.push([t[s],t[s+1]]);return n}size(t,n){let s;const i=this.bbox();for(s=this.length-1;s>=0;s--)i.width&&(this[s][0]=(this[s][0]-i.x)*t/i.width+i.x),i.height&&(this[s][1]=(this[s][1]-i.y)*n/i.height+i.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let n=0,s=this.length;n<s;n++)t.push(this[n].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){ht.isMatrixLike(t)||(t=new ht(t));for(let n=this.length;n--;){const[s,i]=this[n];this[n][0]=t.a*s+t.c*i+t.e,this[n][1]=t.b*s+t.d*i+t.f}return this}}var Zt=Object.freeze({__proto__:null,MorphArray:Jt,height:function(t){const n=this.bbox();return null==t?n.height:this.size(n.width,t)},width:function(t){const n=this.bbox();return null==t?n.width:this.size(t,n.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}});class Ut extends Dt{constructor(t,n=t){super(D("line",t),n)}array(){return new Jt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,n){return this.attr(this.array().move(t,n).toLine())}plot(t,n,s,i){return null==t?this.array():(t=void 0!==n?{x1:t,y1:n,x2:s,y2:i}:new Jt(t).toLine(),this.attr(t))}size(t,n){const s=g(this,t,n);return this.attr(this.array().size(s.width,s.height).toLine())}}G(Ut,Zt),f({Container:{line:$((function(...t){return Ut.prototype.plot.apply(this.put(new Ut),null!=t[0]?t:[0,0,0,0])}))}}),F(Ut,"Line");class Kt extends Tt{constructor(t,n=t){super(D("marker",t),n)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,n){return this.attr("refX",t).attr("refY",n)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function tn(t,n){return function(s){return null==s?this[t]:(this[t]=s,n&&n.call(this),this)}}f({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:$((function(t,n,s){return this.put(new Kt).size(t,n).ref(t/2,n/2).viewbox(0,0,t,n).attr("orient","auto").update(s)}))},marker:{marker(t,n,s,i){let r=["marker"];return"all"!==t&&r.push(t),r=r.join("-"),t=arguments[1]instanceof Kt?arguments[1]:this.defs().marker(n,s,i),this.attr(r,t)}}}),F(Kt,"Marker");const nn={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,n,s,i){return function(r){return r<0?t>0?n/t*r:s>0?i/s*r:0:r>1?s<1?(1-i)/(1-s)*r+(i-s)/(1-s):t<1?(1-n)/(1-t)*r+(n-t)/(1-t):1:3*r*(1-r)**2*n+3*r**2*(1-r)*i+r**3}},steps:function(t,n="end"){n=n.split("-").reverse()[0];let s=t;return"none"===n?--s:"both"===n&&++s,(i,r=!1)=>{let e=Math.floor(i*t);const h=i*e%1==0;return"start"!==n&&"both"!==n||++e,r&&h&&--e,i>=0&&e<0&&(e=0),i<=1&&e>s&&(e=s),e/s}}};class sn{done(){return!1}}class rn extends sn{constructor(t=">"){super(),this.ease=nn[t]||t}step(t,n,s){return"number"!=typeof t?s<1?t:n:t+(n-t)*this.ease(s)}}class en extends sn{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,n,s,i){return this.stepper(t,n,s,i)}}function hn(){const t=(this._duration||500)/1e3,n=Math.PI,s=Math.log((this._overshoot||0)/100+1e-10),i=-s/Math.sqrt(n*n+s*s),r=3.9/(i*t);this.d=2*i*r,this.k=r*r}G(class extends en{constructor(t=500,n=0){super(),this.duration(t).overshoot(n)}step(t,n,s,i){if("string"==typeof t)return t;if(i.done=s===1/0,s===1/0)return n;if(0===s)return t;s>100&&(s=16);const r=i.velocity||0,e=-this.d*r-this.k*(t-n),h=t+r*(s/=1e3)+e*s*s/2;return i.velocity=r+e*s,i.done=Math.abs(n-h)+Math.abs(r)<.002,i.done?n:h}},{duration:tn("_duration",hn),overshoot:tn("_overshoot",hn)}),G(class extends en{constructor(t=.1,n=.01,s=0,i=1e3){super(),this.p(t).i(n).d(s).windup(i)}step(t,n,s,i){if("string"==typeof t)return t;if(i.done=s===1/0,s===1/0)return n;if(0===s)return t;const r=n-t;let e=(i.integral||0)+r*s;const h=(r-(i.error||0))/s,u=this._windup;return!1!==u&&(e=Math.max(-u,Math.min(e,u))),i.error=r,i.integral=e,i.done=Math.abs(r)<.001,i.done?n:t+(this.P*r+this.I*e+this.D*h)}},{windup:tn("_windup"),p:tn("P"),i:tn("I"),d:tn("D")});const un={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},on={M:function(t,n,s){return n.x=s.x=t[0],n.y=s.y=t[1],["M",n.x,n.y]},L:function(t,n){return n.x=t[0],n.y=t[1],["L",t[0],t[1]]},H:function(t,n){return n.x=t[0],["H",t[0]]},V:function(t,n){return n.y=t[0],["V",t[0]]},C:function(t,n){return n.x=t[4],n.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,n){return n.x=t[2],n.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,n){return n.x=t[2],n.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,n){return n.x=t[0],n.y=t[1],["T",t[0],t[1]]},Z:function(t,n,s){return n.x=s.x,n.y=s.y,["Z"]},A:function(t,n){return n.x=t[5],n.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},cn="mlhvqtcsaz".split("");for(let t=0,n=cn.length;t<n;++t)on[cn[t]]=function(t){return function(n,s,i){if("H"===t)n[0]=n[0]+s.x;else if("V"===t)n[0]=n[0]+s.y;else if("A"===t)n[5]=n[5]+s.x,n[6]=n[6]+s.y;else for(let t=0,i=n.length;t<i;++t)n[t]=n[t]+(t%2?s.y:s.x);return on[t](n,s,i)}}(cn[t].toUpperCase());function ln(t){return t.segment.length&&t.segment.length-1===un[t.segment[0].toUpperCase()]}function an(t,n){t.inNumber&&fn(t,!1);const s=K.test(n);if(s)t.segment=[n];else{const n=t.lastCommand,s=n.toLowerCase();t.segment=["m"===s?n===s?"l":"L":n]}return t.inSegment=!0,t.lastCommand=t.segment[0],s}function fn(t,n){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=n,t.number="",t.pointSeen=!1,t.hasExponent=!1,ln(t)&&pn(t)}function pn(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){return on[t.segment[0]](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function dn(t){if(!t.segment.length)return!1;const n="A"===t.segment[0].toUpperCase(),s=t.segment.length;return n&&(4===s||5===s)}function wn(t){return"E"===t.lastToken.toUpperCase()}const mn=new Set([" ",",","\t","\n","\r","\f"]);class yn extends Mt{bbox(){return ut().path.setAttribute("d",this.toString()),new ct(ut.nodes.path.getBBox())}move(t,n){const s=this.bbox();if(t-=s.x,n-=s.y,!isNaN(t)&&!isNaN(n))for(let s,i=this.length-1;i>=0;i--)s=this[i][0],"M"===s||"L"===s||"T"===s?(this[i][1]+=t,this[i][2]+=n):"H"===s?this[i][1]+=t:"V"===s?this[i][1]+=n:"C"===s||"S"===s||"Q"===s?(this[i][1]+=t,this[i][2]+=n,this[i][3]+=t,this[i][4]+=n,"C"===s&&(this[i][5]+=t,this[i][6]+=n)):"A"===s&&(this[i][6]+=t,this[i][7]+=n);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,n=!0){let s=0,i="";const r={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:n,p0:new rt,p:new rt};for(;r.lastToken=i,i=t.charAt(s++);)if(r.inSegment||!an(r,i))if("."!==i)if(isNaN(parseInt(i)))if(mn.has(i))r.inNumber&&fn(r,!1);else if("-"!==i&&"+"!==i)if("E"!==i.toUpperCase()){if(K.test(i)){if(r.inNumber)fn(r,!1);else{if(!ln(r))throw new Error("parser Error");pn(r)}--s}}else r.number+=i,r.hasExponent=!0;else{if(r.inNumber&&!wn(r)){fn(r,!1),--s;continue}r.number+=i,r.inNumber=!0}else{if("0"===r.number||dn(r)){r.inNumber=!0,r.number=i,fn(r,!0);continue}r.inNumber=!0,r.number+=i}else{if(r.pointSeen||r.hasExponent){fn(r,!1),--s;continue}r.inNumber=!0,r.pointSeen=!0,r.number+=i}return r.inNumber&&fn(r,!1),r.inSegment&&ln(r)&&pn(r),r.segments}(t)}size(t,n){const s=this.bbox();let i,r;for(s.width=0===s.width?1:s.width,s.height=0===s.height?1:s.height,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]=(this[i][1]-s.x)*t/s.width+s.x,this[i][2]=(this[i][2]-s.y)*n/s.height+s.y):"H"===r?this[i][1]=(this[i][1]-s.x)*t/s.width+s.x:"V"===r?this[i][1]=(this[i][1]-s.y)*n/s.height+s.y:"C"===r||"S"===r||"Q"===r?(this[i][1]=(this[i][1]-s.x)*t/s.width+s.x,this[i][2]=(this[i][2]-s.y)*n/s.height+s.y,this[i][3]=(this[i][3]-s.x)*t/s.width+s.x,this[i][4]=(this[i][4]-s.y)*n/s.height+s.y,"C"===r&&(this[i][5]=(this[i][5]-s.x)*t/s.width+s.x,this[i][6]=(this[i][6]-s.y)*n/s.height+s.y)):"A"===r&&(this[i][1]=this[i][1]*t/s.width,this[i][2]=this[i][2]*n/s.height,this[i][6]=(this[i][6]-s.x)*t/s.width+s.x,this[i][7]=(this[i][7]-s.y)*n/s.height+s.y);return this}toString(){return function(t){let n="";for(let s=0,i=t.length;s<i;s++)n+=t[s][0],null!=t[s][1]&&(n+=t[s][1],null!=t[s][2]&&(n+=" ",n+=t[s][2],null!=t[s][3]&&(n+=" ",n+=t[s][3],n+=" ",n+=t[s][4],null!=t[s][5]&&(n+=" ",n+=t[s][5],n+=" ",n+=t[s][6],null!=t[s][7]&&(n+=" ",n+=t[s][7])))));return n+" "}(this)}}const gn=t=>{const n=typeof t;return"number"===n?At:"string"===n?it.isColor(t)?it:U.test(t)?K.test(t)?yn:Mt:R.test(t)?At:bn:An.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Mt:"object"===n?Mn:bn};class xn{constructor(t){this._stepper=t||new rn("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,n){return t&&n}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(gn(t));let n=new this._type(t);return this._type===it&&(n=this._to?n[this._to[4]]():this._from?n[this._from[4]]():n),this._type===Mn&&(n=this._to?n.align(this._to):this._from?n.align(this._from):n),n=n.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(n.length)).map(Object).map((function(t){return t.done=!0,t})),n}}class bn{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class vn{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,vn.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}vn.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const _n=(t,n)=>t[0]<n[0]?-1:t[0]>n[0]?1:0;class Mn{constructor(...t){this.init(...t)}align(t){const n=this.values;for(let s=0,i=n.length;s<i;++s){if(n[s+1]===t[s+1]){if(n[s+1]===it&&t[s+7]!==n[s+7]){const n=t[s+7],i=new it(this.values.splice(s+3,5))[n]().toArray();this.values.splice(s+3,0,...i)}s+=n[s+2]+2;continue}if(!t[s+1])return this;const i=(new t[s+1]).toArray();n.splice(s,n[s+2]+3,t[s],t[s+1],t[s+2],...i),s+=n[s+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const n=[];for(const s in t){const i=gn(t[s]),r=new i(t[s]).toArray();n.push([s,i,r.length,...r])}return n.sort(_n),this.values=n.reduce(((t,n)=>t.concat(n)),[]),this}toArray(){return this.values}valueOf(){const t={},n=this.values;for(;n.length;){const s=n.shift(),i=n.shift(),r=n.shift(),e=n.splice(0,r);t[s]=new i(e)}return t}}const An=[bn,vn,Mn];class kn extends Dt{constructor(t,n=t){super(D("path",t),n)}array(){return this._array||(this._array=new yn(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,n){return this.attr("d",this.array().move(t,n))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new yn(t))}size(t,n){const s=g(this,t,n);return this.attr("d",this.array().size(s.width,s.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}kn.prototype.MorphArray=yn,f({Container:{path:$((function(t){return this.put(new kn).plot(t||new yn)}))}}),F(kn,"Path");var On=Object.freeze({__proto__:null,array:function(){return this._array||(this._array=new Jt(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,n){return this.attr("points",this.array().move(t,n))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Jt(t))},size:function(t,n){const s=g(this,t,n);return this.attr("points",this.array().size(s.width,s.height))}});class jn extends Dt{constructor(t,n=t){super(D("polygon",t),n)}}f({Container:{polygon:$((function(t){return this.put(new jn).plot(t||new Jt)}))}}),G(jn,Zt),G(jn,On),F(jn,"Polygon");class Sn extends Dt{constructor(t,n=t){super(D("polyline",t),n)}}f({Container:{polyline:$((function(t){return this.put(new Sn).plot(t||new Jt)}))}}),G(Sn,Zt),G(Sn,On),F(Sn,"Polyline");class En extends Dt{constructor(t,n=t){super(D("rect",t),n)}}G(En,{rx:zt,ry:Yt}),f({Container:{rect:$((function(t,n){return this.put(new En).size(t,n)}))}}),F(En,"Rect");class Tn{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const n=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(n.prev=this._last,this._last.next=n,this._last=n):(this._last=n,this._first=n),n}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Cn={nextDraw:null,frames:new Tn,timeouts:new Tn,immediates:new Tn,timer:()=>O.window.performance||O.window.Date,transforms:[],frame(t){const n=Cn.frames.push({run:t});return null===Cn.nextDraw&&(Cn.nextDraw=O.window.requestAnimationFrame(Cn._draw)),n},timeout(t,n){n=n||0;const s=Cn.timer().now()+n,i=Cn.timeouts.push({run:t,time:s});return null===Cn.nextDraw&&(Cn.nextDraw=O.window.requestAnimationFrame(Cn._draw)),i},immediate(t){const n=Cn.immediates.push(t);return null===Cn.nextDraw&&(Cn.nextDraw=O.window.requestAnimationFrame(Cn._draw)),n},cancelFrame(t){null!=t&&Cn.frames.remove(t)},clearTimeout(t){null!=t&&Cn.timeouts.remove(t)},cancelImmediate(t){null!=t&&Cn.immediates.remove(t)},_draw(t){let n=null;const s=Cn.timeouts.last();for(;(n=Cn.timeouts.shift())&&(t>=n.time?n.run():Cn.timeouts.push(n),n!==s););let i=null;const r=Cn.frames.last();for(;i!==r&&(i=Cn.frames.shift());)i.run(t);let e=null;for(;e=Cn.immediates.shift();)e();Cn.nextDraw=Cn.timeouts.first()||Cn.frames.first()?O.window.requestAnimationFrame(Cn._draw):null}},Dn=function(t){const n=t.start,s=t.runner.duration();return{start:n,duration:s,end:n+s,runner:t.runner}},zn=function(){const t=O.window;return(t.performance||t.Date).now()};class Yn extends bt{constructor(t=zn){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),n=t?t.runner.duration():0;return(t?t.start:this._time)+n}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const n=this.speed();if(null==t)return this.speed(-n);const s=Math.abs(n);return this.speed(t?-s:s)}schedule(t,n,s){if(null==t)return this._runners.map(Dn);let i=0;const r=this.getEndTime();if(n=n||0,null==s||"last"===s||"after"===s)i=r;else if("absolute"===s||"start"===s)i=n,n=0;else if("now"===s)i=this._time;else if("relative"===s){const s=this.getRunnerInfoById(t.id);s&&(i=s.start+n,n=0)}else{if("with-last"!==s)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();i=t?t.start:this._time}}t.unschedule(),t.timeline(this);const e=t.persist(),h={persist:null===e?this._persist:e,start:i+n,runner:t};return this._lastRunnerId=t.id,this._runners.push(h),this._runners.sort(((t,n)=>t.start-n.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const n=this._runnerIds.indexOf(t.id);return n<0||(this._runners.splice(n,1),this._runnerIds.splice(n,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Cn.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Cn.frame(this._step)),this)}_stepFn(t=!1){const n=this._timeSource();let s=n-this._lastSourceTime;t&&(s=0);const i=this._speed*s+(this._time-this._lastStepTime);this._lastSourceTime=n,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const n=this._runners[t];this._time-n.start<=0&&n.runner.reset()}let r=!1;for(let t=0,n=this._runners.length;t<n;t++){const s=this._runners[t],e=s.runner;let h=i;const u=this._time-s.start;u<=0?r=!0:(u<h&&(h=u),e.active()&&(e.step(h).done?!0!==s.persist&&e.duration()-e.time()+this._time+s.persist<this._time&&(e.unschedule(),--t,--n):r=!0))}return r&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}f({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Yn,this._timeline):(this._timeline=t,this)}}});class Fn extends bt{constructor(t){super(),this.id=Fn.id++,t="function"==typeof(t=null==t?400:t)?new en(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof en,this._stepper=this._isDeclarative?t:new rn,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ht,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,n,s){let i=1,r=!1,e=0;return n=n??0,s=s||"last","object"!=typeof(t=t??400)||t instanceof sn||(n=t.delay??n,s=t.when??s,r=t.swing||r,i=t.times??i,e=t.wait??e,t=t.duration??400),{duration:t,delay:n,swing:r,times:i,wait:e,when:s}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,n,s){const i=Fn.sanitise(t,n,s),r=new Fn(i.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new ht,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new rn(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,n,s){return"object"==typeof t&&(n=t.swing,s=t.wait,t=t.times),this._times=t||1/0,this._swing=n||!1,this._wait=s||0,!0===this._times&&(this._times=1/0),this}loops(t){const n=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/n);return Math.min(t+(this._time-t*n)/this._duration,this._times)}const s=Math.floor(t);return this.time(n*s+this._duration*(t%1))}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const n=this._time,s=this._duration,i=this._wait,r=this._swing,e=this._reverse;let h;if(null==t){const t=function(t){const n=r*Math.floor(t%(2*(i+s))/(i+s)),h=n&&!e||!n&&e,u=Math.pow(-1,h)*(t%(i+s))/s+h;return Math.max(Math.min(u,1),0)},u=this._times*(i+s)-i;return h=n<=0?Math.round(t(1e-5)):n<u?t(n):Math.round(t(u-1e-5)),h}const u=Math.floor(this.loops()),o=r&&u%2==0;return h=u+(o&&!e||e&&o?t:1-t),this.loops(h)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,n,s,i){return this._queue.push({initialiser:t||vt,runner:n||vt,retarget:s,isTransform:i,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,n,s){if(t instanceof Yn||(s=n,n=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,n,s),this}step(t){if(!this.enabled)return this;this._time+=t=null==t?16:t;const n=this.position(),s=this._lastPosition!==n&&this._time>=0;this._lastPosition=n;const i=this.duration(),r=this._lastTime<=0&&this._time>0,e=this._lastTime<i&&this._time>=i;this._lastTime=this._time,r&&this.fire("start",this);const h=this._isDeclarative;this.done=!h&&!e&&this._time>=i,this._reseted=!1;let u=!1;return(s||h)&&(this._initialise(s),this.transforms=new ht,u=this._run(h?t:n),this.fire("step",this)),this.done=this.done||u&&h,e&&this.fire("finished",this),this}time(t){return null==t?this._time:(this.step(t-this._time),this)}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let n=0,s=this._queue.length;n<s;++n){const s=this._queue[n],i=this._isDeclarative||!s.initialised&&t;t=!s.finished,i&&t&&(s.initialiser.call(this),s.initialised=!0)}}_rememberMorpher(t,n){if(this._history[t]={morpher:n,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let n=!0;for(let s=0,i=this._queue.length;s<i;++s){const i=this._queue[s],r=i.runner.call(this,t);i.finished=i.finished||!0===r,n=n&&i.finished}return n}_tryRetarget(t,n,s){if(this._history[t]){if(!this._history[t].caller.initialised){const n=this._queue.indexOf(this._history[t].caller);return this._queue.splice(n,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,n,s):this._history[t].morpher.to(n),this._history[t].caller.finished=!1;const i=this.timeline();return i&&i.play(),!0}return!1}}Fn.id=0;class Nn{constructor(t=new ht,n=-1,s=!0){this.transforms=t,this.id=n,this.done=s}clearTransformsFromQueue(){}}G([Fn,Nn],{mergeWith(t){return new Nn(t.transforms.lmultiply(this.transforms),t.id)}});const In=(t,n)=>t.lmultiplyO(n),Pn=t=>t.transforms;function Gn(){const t=this._transformationRunners.runners.map(Pn).reduce(In,new ht);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class $n{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const n=t.id+1;return this.runners.push(t),this.ids.push(n),this}clearBefore(t){const n=this.ids.indexOf(t+1)||1;return this.ids.splice(0,n,0),this.runners.splice(0,n,new Nn).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,n){const s=this.ids.indexOf(t+1);return this.ids.splice(s,1,t+1),this.runners.splice(s,1,n),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let n=0;n<this.runners.length;++n){const s=this.runners[n];if(!(t&&s.done&&t.done)||s._timeline&&s._timeline._runnerIds.includes(s.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=s;else{this.remove(s.id);const i=s.mergeWith(t);this.edit(t.id,i),t=i,--n}}return this}remove(t){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1),this.runners.splice(n,1),this}}f({Element:{animate(t,n,s){const i=Fn.sanitise(t,n,s),r=this.timeline();return new Fn(i.duration).loop(i).element(this).timeline(r.play()).schedule(i.delay,i.when)},delay(t,n){return this.animate(0,t,n)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((n=>n.id<=t.id)).map(Pn).reduce(In,new ht)},_addRunner(t){this._transformationRunners.add(t),Cn.cancelImmediate(this._frameId),this._frameId=Cn.immediate(Gn.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new $n).add(new Nn(new ht(this))))}}}),G(Fn,{attr(t,n){return this.styleAttr("attr",t,n)},css(t,n){return this.styleAttr("css",t,n)},styleAttr(t,n,s){if("string"==typeof n)return this.styleAttr(t,{[n]:s});let i=n;if(this._tryRetarget(t,i))return this;let r=new xn(this._stepper).to(i),e=Object.keys(i);return this.queue((function(){r=r.from(this.element()[t](e))}),(function(n){return this.element()[t](r.at(n).valueOf()),r.done()}),(function(n){const s=Object.keys(n),h=(u=e,s.filter((t=>!u.includes(t))));var u;if(h.length){const n=this.element()[t](h),s=new Mn(r.from()).valueOf();Object.assign(s,n),r.from(s)}const o=new Mn(r.to()).valueOf();Object.assign(o,n),r.to(o),e=s,i=n})),this._rememberMorpher(t,r),this},zoom(t,n){if(this._tryRetarget("zoom",t,n))return this;let s=new xn(this._stepper).to(new At(t));return this.queue((function(){s=s.from(this.element().zoom())}),(function(t){return this.element().zoom(s.at(t),n),s.done()}),(function(t,i){n=i,s.to(t)})),this._rememberMorpher("zoom",s),this},transform(t,n,s){if(n=t.relative||n,this._isDeclarative&&!n&&this._tryRetarget("transform",t))return this;const i=ht.isMatrixLike(t);s=null!=t.affine?t.affine:null!=s?s:!i;const r=new xn(this._stepper).type(s?vn:ht);let e,h,u,o,c;return this.queue((function(){h=h||this.element(),e=e||x(t,h),c=new ht(n?void 0:h),h._addRunner(this),n||h._clearTransformRunnersBefore(this)}),(function(l){n||this.clearTransform();const{x:a,y:f}=new rt(e).transform(h._currentTransform(this));let p=new ht({...t,origin:[a,f]}),d=this._isDeclarative&&u?u:c;if(s){p=p.decompose(a,f),d=d.decompose(a,f);const t=p.rotate,n=d.rotate,s=[t-360,t,t+360],i=s.map((t=>Math.abs(t-n))),r=Math.min(...i),e=i.indexOf(r);p.rotate=s[e]}n&&(i||(p.rotate=t.rotate||0),this._isDeclarative&&o&&(d.rotate=o)),r.from(d),r.to(p);const w=r.at(l);return o=w.rotate,u=new ht(w),this.addTransform(u),h._addRunner(this),r.done()}),(function(n){(n.origin||"center").toString()!==(t.origin||"center").toString()&&(e=x(n,h)),t={...n,origin:e}}),!0),this._isDeclarative&&this._rememberMorpher("transform",r),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,n){return this.dx(t).dy(n)},_queueNumberDelta(t,n){if(n=new At(n),this._tryRetarget(t,n))return this;const s=new xn(this._stepper).to(n);let i=null;return this.queue((function(){i=this.element()[t](),s.from(i),s.to(i+n)}),(function(n){return this.element()[t](s.at(n)),s.done()}),(function(t){s.to(i+new At(t))})),this._rememberMorpher(t,s),this},_queueObject(t,n){if(this._tryRetarget(t,n))return this;const s=new xn(this._stepper).to(n);return this.queue((function(){s.from(this.element()[t]())}),(function(n){return this.element()[t](s.at(n)),s.done()})),this._rememberMorpher(t,s),this},_queueNumber(t,n){return this._queueObject(t,new At(n))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,n){return this.x(t).y(n)},amove(t,n){return this.ax(t).ay(n)},center(t,n){return this.cx(t).cy(n)},size(t,n){let s;return t&&n||(s=this._element.bbox()),t||(t=s.width/s.height*n),n||(n=s.height/s.width*t),this.width(t).height(n)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,n,s,i){if(4===arguments.length)return this.plot([t,n,s,i]);if(this._tryRetarget("plot",t))return this;const r=new xn(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){r.from(this._element.array())}),(function(t){return this._element.plot(r.at(t)),r.done()})),this._rememberMorpher("plot",r),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,n,s,i){return this._queueObject("viewbox",new ct(t,n,s,i))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),G(Fn,{rx:zt,ry:Yt,from:Vt,to:Xt}),F(Fn,"Runner");class Rn extends Tt{constructor(t,n=t){super(D("svg",t),n),this.namespace()}defs(){return this.isRoot()?z(this.node.querySelector("defs"))||this.put(new Ct):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof O.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:M,version:"1.1"}).attr("xmlns:xlink",k,A):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,A).attr("xmlns:svgjs",null,A)}root(){return this.isRoot()?this:super.root()}}f({Container:{nested:$((function(){return this.put(new Rn)}))}}),F(Rn,"Svg",!0);class Ln extends Tt{constructor(t,n=t){super(D("symbol",t),n)}}f({Container:{symbol:$((function(){return this.put(new Ln)}))}}),F(Ln,"Symbol");var Hn=Object.freeze({__proto__:null,amove:function(t,n){return this.ax(t).ay(n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,n,s=this.bbox()){return this.cx(t,s).cy(n,s)},cx:function(t,n=this.bbox()){return null==t?n.cx:this.attr("x",this.attr("x")+t-n.cx)},cy:function(t,n=this.bbox()){return null==t?n.cy:this.attr("y",this.attr("y")+t-n.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,n,s=this.bbox()){return this.x(t,s).y(n,s)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(O.document.createTextNode(t)),this},x:function(t,n=this.bbox()){return null==t?n.x:this.attr("x",this.attr("x")+t-n.x)},y:function(t,n=this.bbox()){return null==t?n.y:this.attr("y",this.attr("y")+t-n.y)}});class Vn extends Dt{constructor(t,n=t){super(D("text",t),n),this.dom.leading=this.dom.leading??new At(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new At(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let n=0;const s=this.dom.leading;this.each((function(i){if(v(this.node))return;const r=O.window.getComputedStyle(this.node).getPropertyValue("font-size"),e=s*new At(r);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?n+=e:(this.attr("dy",i?e+n:0),n=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new At(t.leading||1.3),this}writeDataToDom(){return _(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const n=this.node.childNodes;let s=0;t="";for(let i=0,r=n.length;i<r;++i)"textPath"===n[i].nodeName||v(n[i])?0===i&&(s=i+1):(i!==s&&3!==n[i].nodeType&&!0===z(n[i]).dom.newLined&&(t+="\n"),t+=n[i].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let n=0,s=(t=(t+"").split("\n")).length;n<s;n++)this.newLine(t[n]);return this.build(!1).rebuild()}}G(Vn,Hn),f({Container:{text:$((function(t=""){return this.put(new Vn).text(t)})),plain:$((function(t=""){return this.put(new Vn).plain(t)}))}}),F(Vn,"Text");class Xn extends Dt{constructor(t,n=t){super(D("tspan",t),n),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof Vn))return this;const n=t.index(this),s=O.window.getComputedStyle(this.node).getPropertyValue("font-size"),i=t.dom.leading*new At(s);return this.dy(n?i:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}G(Xn,Hn),f({Tspan:{tspan:$((function(t=""){const n=new Xn;return this._build||this.clear(),this.put(n).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),F(Xn,"Tspan");class Bn extends Dt{constructor(t,n=t){super(D("circle",t),n)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new At(t).divide(2))}}G(Bn,{x:Ft,y:Nt,cx:It,cy:Pt,width:Gt,height:$t}),f({Container:{circle:$((function(t=0){return this.put(new Bn).size(t).move(0,0)}))}}),F(Bn,"Circle");class Qn extends Tt{constructor(t,n=t){super(D("clipPath",t),n)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return pt("svg [clip-path*="+this.id()+"]")}}f({Container:{clip:$((function(){return this.defs().put(new Qn)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const n=t instanceof Qn?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+n.id()+")")},unclip(){return this.attr("clip-path",null)}}}),F(Qn,"ClipPath");class qn extends St{constructor(t,n=t){super(D("foreignObject",t),n)}}f({Container:{foreignObject:$((function(t,n){return this.put(new qn).size(t,n)}))}}),F(qn,"ForeignObject");var Wn=Object.freeze({__proto__:null,dmove:function(t,n){return this.children().forEach((s=>{let i;try{i=s.node instanceof O.window.SVGSVGElement?new ct(s.attr(["x","y","width","height"])):s.bbox()}catch(t){return}const r=new ht(s),e=r.translate(t,n).transform(r.inverse()),h=new rt(i.x,i.y).transform(e);s.move(h.x,h.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,n=this.bbox()){return null==t?n.height:this.size(n.width,t,n)},move:function(t=0,n=0,s=this.bbox()){return this.dmove(t-s.x,n-s.y)},size:function(t,n,s=this.bbox()){const i=g(this,t,n,s),r=i.width/s.width,e=i.height/s.height;return this.children().forEach((t=>{const n=new rt(s).transform(new ht(t).inverse());t.scale(r,e,n.x,n.y)})),this},width:function(t,n=this.bbox()){return null==t?n.width:this.size(t,n.height,n)},x:function(t,n=this.bbox()){return null==t?n.x:this.move(t,n.y,n)},y:function(t,n=this.bbox()){return null==t?n.y:this.move(n.x,t,n)}});class Jn extends Tt{constructor(t,n=t){super(D("g",t),n)}}G(Jn,Wn),f({Container:{group:$((function(){return this.put(new Jn)}))}}),F(Jn,"G");class Zn extends Tt{constructor(t,n=t){super(D("a",t),n)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,k)}}G(Zn,Wn),f({Container:{link:$((function(t){return this.put(new Zn).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const n=t.parent();if(!n)return this.remove();const s=n.index(t);return n.add(this,s),t.remove(),this},linkTo(t){let n=this.linker();return n||(n=new Zn,this.wrap(n)),"function"==typeof t?t.call(n,n):n.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),F(Zn,"A");class Un extends Tt{constructor(t,n=t){super(D("mask",t),n)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return pt("svg [mask*="+this.id()+"]")}}f({Container:{mask:$((function(){return this.defs().put(new Un)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const n=t instanceof Un?t:this.parent().mask().add(t);return this.attr("mask","url(#"+n.id()+")")},unmask(){return this.attr("mask",null)}}}),F(Un,"Mask");class Kn extends St{constructor(t,n=t){super(D("stop",t),n)}update(t){return("number"==typeof t||t instanceof At)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new At(t.offset)),this}}f({Gradient:{stop:function(t,n,s){return this.put(new Kn).update(t,n,s)}}}),F(Kn,"Stop");class ts extends St{constructor(t,n=t){super(D("style",t),n)}addText(t=""){return this.node.textContent+=t,this}font(t,n,s={}){return this.rule("@font-face",{fontFamily:t,src:n,...s})}rule(t,n){return this.addText(function(t,n){if(!t)return"";if(!n)return t;let s=t+"{";for(const t in n)s+=t.replace(/([A-Z])/g,(function(t,n){return"-"+n.toLowerCase()}))+":"+n[t]+";";return s+="}",s}(t,n))}}f("Dom",{style(t,n){return this.put(new ts).rule(t,n)},fontface(t,n,s){return this.put(new ts).font(t,n,s)}}),F(ts,"Style");class ns extends Vn{constructor(t,n=t){super(D("textPath",t),n)}array(){const t=this.track();return t?t.array():null}plot(t){const n=this.track();let s=null;return n&&(s=n.plot(t)),null==t?s:this}track(){return this.reference("href")}}f({Container:{textPath:$((function(t,n){return t instanceof Vn||(t=this.text(t)),t.path(n)}))},Text:{path:$((function(t,n=!0){const s=new ns;let i;if(t instanceof kn||(t=this.defs().path(t)),s.attr("href","#"+t,k),n)for(;i=this.node.firstChild;)s.node.appendChild(i);return this.put(s)})),textPath(){return this.findOne("textPath")}},Path:{text:$((function(t){return t instanceof Vn||(t=(new Vn).addTo(this.parent()).text(t)),t.path(this)})),targets(){return pt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),ns.prototype.MorphArray=yn,F(ns,"TextPath");class ss extends Dt{constructor(t,n=t){super(D("use",t),n)}use(t,n){return this.attr("href",(n||"")+"#"+t,k)}}f({Container:{use:$((function(t,n){return this.put(new ss).use(t,n)}))}}),F(ss,"Use"),G([Rn,Ln,Wt,qt,Kt],p("viewbox")),G([Ut,Sn,jn,kn],p("marker")),G(Vn,p("Text")),G(kn,p("Path")),G(Ct,p("Defs")),G([Vn,Xn],p("Tspan")),G([En,Lt,Qt,Fn],p("radius")),G(bt,p("EventTarget")),G(jt,p("Dom")),G(St,p("Element")),G(Dt,p("Shape")),G([Tt,Ht],p("Container")),G(Qt,p("Gradient")),G(Fn,p("Runner")),at.extend([...new Set(a)]),function(t=[]){An.push(...[].concat(t))}([At,it,ct,ht,Mt,Jt,yn,rt]),G(An,{to(t){return(new xn).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,n,s,i,r){return this.fromArray(t.map((function(t,e){return i.step(t,n[e],s,r[e],r)})))}});class is{constructor(t){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 i=s([n,null!=t?t:{}]);Object.entries(i.scenarios).forEach((([t,n])=>{var s,i,r;this.createScenarioMapEntry(t,null!==(s=n.name)&&void 0!==s?s:t,null!==(i=n.colorIndex)&&void 0!==i?i:10,null!==(r=n.sortIndex)&&void 0!==r?r:0)})),this._fallBackScenario=i.fallback}createScenarioMapEntry(t,n,s,i){const r=n,e=s;[1,2,3,4].forEach((s=>{this._scenarioMap.set(t+s,{name:n+s,group:r,colorIndex:e,sortIndex:i+10*s})}))}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 r(t);return n.isValid?n.type+n.delta:t}}class rs{constructor(){this.font="16px Arial",this.size=16,this.color="#000000",this.background="#ffffff",this.leading=1.8}}class es{adapt(t){const n=new rs;return i.isString(t.font)&&(n.font=t.font),i.isNumber(t.size)&&(n.size=t.size),i.isString(t.color)&&(n.color=t.color),i.isString(t.background)&&(n.background=t.background),i.isNumber(t.leading)&&(n.leading=t.leading),n}default(){return new rs}}class hs{constructor(t,n,s,i){this.ac=t,this.fc=n,this.pp=s,this.pl=i}getSVGStyle(t){return"ac"===t?this.ac:"fc"===t?this.fc:"pp"===t?this.pp:"pl"===t?this.pl:this.ac}}class us{constructor(t){this.svgStyleAdapter=t}adapt(t){const n=new hs(this.svgStyleAdapter.defaultAC(),this.svgStyleAdapter.defaultFC(),this.svgStyleAdapter.defaultPP(),this.svgStyleAdapter.defaultPL());return i.isExisting(t.ac)&&(n.ac=this.svgStyleAdapter.adapt(t.ac)),i.isExisting(t.fc)&&(n.fc=this.svgStyleAdapter.adapt(t.fc)),i.isExisting(t.pp)&&(n.pp=this.svgStyleAdapter.adapt(t.pp)),i.isExisting(t.pl)&&(n.pl=this.svgStyleAdapter.adapt(t.pl)),n}default(){return new hs(this.svgStyleAdapter.defaultAC(),this.svgStyleAdapter.defaultFC(),this.svgStyleAdapter.defaultPP(),this.svgStyleAdapter.defaultPL())}}class os{constructor(){this.top=10,this.left=10,this.right=10,this.bottom=10}}class cs{adapt(t){const n=new os;return i.isNumber(t.top)&&(n.top=t.top),i.isNumber(t.left)&&(n.left=t.left),i.isNumber(t.right)&&(n.right=t.right),i.isNumber(t.bottom)&&(n.bottom=t.bottom),n}default(){return new os}}class ls{constructor(t="#000000",n="#000000",s=.1){this.stroke=t,this.fill=n,this.width=s}}class as{adapt(t){const n=new ls(t.stroke,t.fill,t.width);return i.isString(t.fillpattern)&&(n.fillpattern=t.fillpattern),i.isString(t.dasharray)&&(n.dasharray=t.dasharray),n}default(){return new ls("#000000","#000000",.3)}defaultAC(){return new ls("#000000","#000000",.3)}defaultFC(){const t=new ls("#000000","#000000",.3);return t.dasharray="10 5 5 5",t.fillpattern="fc",t}defaultPP(){return new ls("#999999","#999999",.3)}defaultPL(){return new ls("#000000","#ffffff",.3)}defaultPos(){return new ls("#00ff00","#00ff00",.3)}defaultNeg(){return new ls("#ff0000","#ff0000",.3)}defaultNeu(){return new ls("#999999","#999999",.3)}}export{o as C,c as F,is as I,cs as P,e as Q,Rn as S,r as V,es as a,us as b,as as c}
@@ -0,0 +1 @@
1
+ import{r as e,h as s,H as t,g as r}from"./p-B_d-jp99.js";import{w as a,a as b}from"./p-B4JfKvVT.js";const c=class{constructor(s){e(this,s),a(this),this.errors=b(this)}render(){return s(t,{key:"d8c7214c5beab0eb52999b596d241ac052bee543"},s("slot",{key:"41cc485bf9666117d449642d3e7948551b5b0701"}))}get element(){return r(this)}};export{c as bn_template}
@@ -0,0 +1 @@
1
+ import{C as t}from"./p-BZV1b5VH.js";class s{constructor(t,s,i){this.pos=t,this.neg=s,this.neu=i,this.needleHeadColour="#000000"}getSVGStyle(t){return"pos"===t?this.pos:"neg"===t?this.neg:this.neu}}class i{constructor(t){this.svgStyleAdapter=t}adapt(i){const h=new s(this.svgStyleAdapter.defaultPos(),this.svgStyleAdapter.defaultNeg(),this.svgStyleAdapter.defaultNeu());return t.isExisting(i.pos)&&(h.pos=this.svgStyleAdapter.adapt(i.pos)),t.isExisting(i.neg)&&(h.neg=this.svgStyleAdapter.adapt(i.neg)),t.isExisting(i.pp)&&(h.neu=this.svgStyleAdapter.adapt(i.neu)),t.isString(i.needleHeadColour)&&(h.needleHeadColour=i.needleHeadColour),h}default(){return new s(this.svgStyleAdapter.defaultPos(),this.svgStyleAdapter.defaultNeg(),this.svgStyleAdapter.defaultNeu())}}export{i as S}
@@ -0,0 +1 @@
1
+ import{r as t,d as s,f as i,h as e,H as a,g as r}from"./p-B_d-jp99.js";import{a as n}from"./p-BqhIhYr1.js";import{w as o,a as l,g as h,p as u}from"./p-DY7YYmpa.js";import{w as c,o as d}from"./p-DTuaq8Pj.js";import{i as p,a as v,w as f,b as m,c as g}from"./p-C0Pwqx-O.js";import{w as y,a as b}from"./p-B4JfKvVT.js";import{r as x,s as w}from"./p-BZV1b5VH.js";import{f as _,c as $,d as R,e as L,p as E,t as S}from"./p-Dg9OcXAO.js";import"./p-Bdfxd_Ke.js";const A={rowGroup:0,category:1,subCategory:2},j=class{validateX(t){this.validateAxisSpec("x",t)}validateY(t){this.validateAxisSpec("y",t)}validateIso(t){this.validateObjectSpec("iso",t,null,(t=>_(t)))}validateLevel(t){const s="ERR_level",i=["auto","category","subcategory"];p(t)||i.includes(t.trim().toLowerCase())?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`level: invalid value '${t}' — expected ${i.join("/")}; using 'auto'.`})}validateSeriesLevel(t){const s="ERR_seriesLevel",i=["auto","rowgroup","category","none"];p(t)||i.includes(t.trim().toLowerCase())?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`series-level: invalid value '${t}' — expected ${i.join("/")}; using 'auto'.`})}validateFacet(t){this.validateObjectSpec("facet",t,null,(t=>$(t)))}validateLabels(t){this.validateObjectSpec("labels",t,null,(t=>R(t,this.labelDefaults())))}validateLegend(t){this.validateObjectSpec("legend",t,null,(t=>L(t)))}validateAspect(t){const s="ERR_aspect";p(t)||null!==this.parseAspect(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`aspect: invalid value '${t}' — expected "w:h" (e.g. "16:9"); using the default.`})}validateLimit(t){const s="ERR_limit";v(t)&&Number(t)>=0?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`limit: invalid value '${t}' — expected a non-negative integer; using 0.`})}validateScale(t){const s="ERR_scale";if(p(t))return void this.errors.remove(s);const{mode:i,factor:e}=u(t);"factor"===i&&(void 0===e||e<=0)?this.errors.addOrReplace({id:s,type:"warning",message:`scale: invalid value '${t}' — expected none/auto or a positive number.`}):this.errors.remove(s)}constructor(s){t(this,s),this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.layoutObserver=null,this.activeErrors=new Set,this.chartTitle="",this.filter="",this.iso="",this.level="auto",this.seriesLevel="auto",this.facet="",this.labels="",this.legend="",this.aspect="16:9",this.limit=0,this._autoScaleGuard=!1,this._lastObservedWidth=0,this.translateForInner=(t,s)=>this.t(t,s),f(this),y(this),o(this,(t=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1}),((t,s)=>{this.datasetMeta=s})),this.errors=b(this),this.componentStyle=m(this),this.ruleSetConfig=c(this),this.t=l(this).t}componentWillLoad(){this.validateX(this.x),this.validateY(this.y),this.validateIso(this.iso),this.validateLevel(this.level),this.validateSeriesLevel(this.seriesLevel),this.validateFacet(this.facet),this.validateLabels(this.labels),this.validateLegend(this.legend),this.validateAspect(this.aspect),this.validateLimit(this.limit),this.validateScale(this.scale)}componentDidRender(){const{mode:t}=u(this.scale);if("auto"!==t&&"empty"!==t){this._autoScaleGuard=!1;const t=h(this.element),s="WARN_overflow";return void(t.width>0&&this.element.scrollWidth>t.width+1?this.errors.addOrReplace({id:s,type:"warning",message:"Chart exceeds available space and will be cut off. Check the scale value."}):this.errors.remove(s))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const i=this.element,{width:e}=h(i);if(e<=0)return;this._lastObservedWidth=e;const a=this.componentStyle((t=>{var s;return(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(!Number.isFinite(r)||r<=e+1)return void this.errors.remove("AUTO_scale");const o=Math.max(.3,n*(e-1)/r);Math.abs(o-n)<.01||(i.style.setProperty("--bn-font-size",a*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${o.toFixed(3)}`}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,s((()=>{this.appliedScaleFactor=o})))}componentDidLoad(){this.layoutObserver=d(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=h(this.element);t>0&&Math.abs(t-this._lastObservedWidth)>2&&(this._lastObservedWidth=t,i(this))})),requestAnimationFrame((()=>{requestAnimationFrame((()=>{if(this._autoScaleGuard)return;const{width:t}=h(this.element);this._lastObservedWidth=t,i(this)}))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}labelDefaults(){return{points:"auto",values:!1,max:12}}setBlockingError(t,s){null===s?(this.errors.remove(t),this.activeErrors.delete(t)):(this.errors.addOrReplace({id:t,type:"error",message:s}),this.activeErrors.add(t))}hasBlockingErrors(){return this.activeErrors.size>0}validateAxisSpec(t,s){var i;const e=`ERR_xy_json_${t}`,a=`ERR_xy_measure_${t}`,r=`WARN_xy_fields_${t}`,n="x"===t||"y"===t||"size"===t,{data:o,parseError:l}=E(s,"measure");if(l)return this.setBlockingError(e,this.t(".xy-prop-json",{prop:t})),this.setBlockingError(a,null),void this.errors.remove(r);if(this.setBlockingError(e,null),null===o)return this.setBlockingError(a,n?this.t(".xy-measure-invalid",{prop:t,measure:""}):null),void this.errors.remove(r);const h="share"===t?null:S(o),u=null!==(i=o.measure)&&void 0!==i?i:"";g(u)?this.setBlockingError(a,null):this.setBlockingError(a,this.t(".xy-measure-invalid",{prop:t,measure:u})),this.reportSpecIssues(r,t,h)}validateObjectSpec(t,s,i,e){const a=`ERR_xy_json_${t}`,r=`WARN_xy_fields_${t}`,{data:n,parseError:o}=E(s,i);if(o)return this.setBlockingError(a,this.t(".xy-prop-json",{prop:t})),void this.errors.remove(r);this.setBlockingError(a,null),null!==n?this.reportSpecIssues(r,t,e(n)):this.errors.remove(r)}reportSpecIssues(t,s,i){const e=[];null!==i&&i.invalidFields.length>0&&e.push(`invalid: ${i.invalidFields.join(", ")}`),null!==i&&i.unknownKeys.length>0&&e.push(`unknown: ${i.unknownKeys.join(", ")}`),e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:`${s}: ignored sub-fields (${e.join("; ")}).`}):this.errors.remove(t)}prepareAxis(t,s){const{data:i,parseError:e}=E(s,"measure");if(e||null===i)return null;const{config:a}=S(i);return null!==a&&g(a.measure)?(void 0!==a.min&&void 0!==a.max&&a.min>=a.max?(this.errors.addOrReplace({id:`WARN_xy_domain_${t}`,type:"warning",message:`${t}: min must be smaller than max; the override is ignored.`}),a.min=void 0,a.max=void 0):this.errors.remove(`WARN_xy_domain_${t}`),a):null}prepareIso(){const{data:t,parseError:s}=E(this.iso,null);return s||null===t?null:_(t).config}prepareLabels(){const t=this.labelDefaults(),{data:s,parseError:i}=E(this.labels,null);return i||null===s?{points:t.points,values:t.values,max:t.max}:R(s,t).config}prepareLegend(){const{data:t,parseError:s}=E(this.legend,null);return s||null===t?{show:!0,position:"right"}:L(t).config}prepareFacet(){const{data:t,parseError:s}=E(this.facet,null);return s||null===t?null:$(t).config}preparePointLevel(){var t,s;const i=null===(t=this.level)||void 0===t?void 0:t.trim().toLowerCase();if("category"===i)return"category";if("subcategory"===i)return"subCategory";const e=null===(s=this.datasetMeta)||void 0===s?void 0:s.suggestedLevel;return"rowGroup"===e||"category"===e||"subCategory"===e?e:"category"}prepareSeriesLevel(t){var s;const i=null===(s=this.seriesLevel)||void 0===s?void 0:s.trim().toLowerCase();return"none"===i?null:"rowgroup"===i?"rowGroup":"category"===i||"subCategory"===t?"category":"category"===t?"rowGroup":null}validateCrossProp(t,s){const i=new Set;for(const s of t){if(void 0===s)continue;const t=x(s);null!==t&&"scenario"===t.kind&&i.add(w(t.slot))}this.setBlockingError("ERR_xy_family",i.size>1?this.t(".xy-family-mixed",{families:[...i].join(", ")}):null);const e=this.preparePointLevel(),a=this.prepareSeriesLevel(e),r=null!==s?"rowgroup"===s.level?"rowGroup":"category":null;let n=null;if(null!==a&&A[a]>=A[e]&&(n=`series '${a}' vs point '${e}'`),null!==r){const t=null!=a?a:e;A[r]>=A[t]&&(n=`facet '${r}' vs '${t}'`)}this.setBlockingError("ERR_xy_level_order",null!==n?this.t(".xy-level-order",{detail:n}):null)}parseAspect(t){const s=/^\s*(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)\s*$/.exec(null!=t?t:"");if(null===s)return null;const i=Number(s[1]),e=Number(s[2]);return i<=0||e<=0?null:i/e}prepareAspect(){var t;return null!==(t=this.parseAspect(this.aspect))&&void 0!==t?t:16/9}prepareLimit(){const t=Math.floor(Number(this.limit)||0);return t>0?t:0}i18nLocalKeys(){return["no-data","axis.in","legend.title"]}prepareI18n(){const t=new Map(this.i18nLocalKeys().map((t=>[t,this.t(".".concat(t))]))),s=new Map(n.map((t=>[t,this.t("global.".concat(t))])));return new Map([...s.entries(),...t.entries()])}prepareStyle(){const t=this.getEffectiveScaleFactor(),s=this.element.localName;return this.componentStyle((i=>{const e=i.global.fontSizePx*t;return{scaleFactors:i[s].scaleFactors,fontStyles:{font:`${e}px ${i.global.fontFamily}`,size:e,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i[s].axisStyles,seriesColors:i[s].seriesColors,padding:i[s].padding}}))}getEffectiveScaleFactor(){const{mode:t,factor:s}=u(this.scale);return"factor"===t?s:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((s=>{var i,e,a,r;const n=(null===(i=s.global)||void 0===i?void 0:i.fontSizePx)||13.3333;return{"--bn-font-family":(null===(e=s.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(a=s.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(r=s.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}getDataStructure(){const t={};for(const s of["ac","pp","fc","pl"])for(const i of[1,2,3,4])t[`${s}${i}`]={type:"number",isOptional:!0,description:""};for(const[s,i]of Object.entries(this.mappedAxes())){if(null===i)continue;const e=x(i.measure);null!==e&&("scenario"===e.kind?t[e.slot].description=`${s}: ${"label"in i&&void 0!==i.label?i.label:i.measure}`:(t[e.measure.base].description=`${s}: ${i.measure} (base)`,t[e.measure.delta].description=`${s}: ${i.measure} (delta)`))}return{[this.dataStructureName()]:Object.assign({operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!0,description:""},rowGroupIndex:{type:"number",isOptional:!0,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!0,description:""},subCategoryIndex:{type:"number",isOptional:!0,description:""}},t)}}mappedAxes(){return{x:this.prepareAxis("x",this.x),y:this.prepareAxis("y",this.y)}}dataStructureName(){return"IScatterChartDataRow"}chartTemplate(){const t=this.prepareAxis("x",this.x),s=this.prepareAxis("y",this.y),i=this.prepareFacet();if(this.validateCrossProp([null==t?void 0:t.measure,null==s?void 0:s.measure],i),this.hasBlockingErrors()||null===t||null===s)return null;const a=this.preparePointLevel(),r=this.prepareI18n(),n=this.prepareStyle(),o=h(this.element).width;return e("ibcs-chart-scatter",{tableName:this.datasetName,dataVersion:this.dataVersion,chartTitle:this.chartTitle,x:t,y:s,iso:this.prepareIso(),labels:this.prepareLabels(),legend:this.prepareLegend(),facet:i,pointLevel:a,seriesLevel:this.prepareSeriesLevel(a),aspect:this.prepareAspect(),limit:this.prepareLimit(),filter:this.filter,styles:n,i18n:r,containerWidth:o,ruleSetConfig:this.ruleSetConfig(),errors:this.errors,translate:this.translateForInner})}render(){return e(a,{key:"ed677e73aa37e238651a64cff1ca8d59b5d73f06",style:this.getFontStyles()},e("div",{key:"575065fb76228cc3d5a7a45af7009ea590437fa1",class:"container"},this.chartTemplate()))}get element(){return r(this)}static get watchers(){return{x:[{validateX:0}],y:[{validateY:0}],iso:[{validateIso:0}],level:[{validateLevel:0}],seriesLevel:[{validateSeriesLevel:0}],facet:[{validateFacet:0}],labels:[{validateLabels:0}],legend:[{validateLegend:0}],aspect:[{validateAspect:0}],limit:[{validateLimit:0}],scale:[{validateScale:0}]}}};j.style=":host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}";export{j as bn_chart_scatter}
@@ -0,0 +1 @@
1
+ import{r as t,h as s,H as i,g as o}from"./p-B_d-jp99.js";import{w as r,b as e}from"./p-C0Pwqx-O.js";import{w as n,a}from"./p-B4JfKvVT.js";import{g as l}from"./p-BqhIhYr1.js";import"./p-BZV1b5VH.js";import"./p-Bdfxd_Ke.js";const f=class{constructor(s){t(this,s),r(this),n(this),this.errors=a(this),this.componentStyle=e(this)}connectedCallback(){this.stores=l(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,i,o,r;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.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===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(r=t.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}prepareAssetUrl(t){if(null==t||""===t)return"";const s=this.stores.assets.state;return t.startsWith("asset:")?s[t.substring(6)]:s[t]||t}render(){return s(i,{key:"cfa7e1b2978773f449f6596174edf51e4a61d4d7",style:this.getFontStyles()},null!=this.source&&""!==this.source?s("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return o(this)}};f.style=":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}";export{f as bn_image}
@@ -0,0 +1 @@
1
+ import{r as t,d as i,f as e,h as s,H as r,g as a}from"./p-B_d-jp99.js";import{a as n}from"./p-BqhIhYr1.js";import{C as l,r as o,A as u}from"./p-BZV1b5VH.js";import{w as h,o as d}from"./p-DTuaq8Pj.js";import{O as c,a as p,b as v}from"./p-Bdfxd_Ke.js";import{w as g,a as m,g as f,p as b}from"./p-DY7YYmpa.js";import{v as _,i as y,d as w,a as O,w as R,b as A}from"./p-C0Pwqx-O.js";import{w as $,a as E}from"./p-B4JfKvVT.js";import{p as j}from"./p-Dg9OcXAO.js";const T=["measure","label","unit"];function x(t){const i=[],e=D(t,"measure",i);if(void 0===e||""===e.trim())return i.push("measure"),{config:null,unknownKeys:k(t,T),invalidFields:i};const s={measure:e.trim()};return s.label=D(t,"label",i),s.unit=D(t,"unit",i),{config:s,unknownKeys:k(t,T),invalidFields:i}}const N=["show","decimals"];function S(t,i){const e=[],s={show:i.show,decimals:i.decimals};return l.isExisting(t.show)&&("auto"===t.show||"none"===t.show?s.show=t.show:e.push("show")),l.isExisting(t.decimals)&&(l.isNumber(t.decimals)&&t.decimals>=0&&t.decimals<=4?s.decimals=Math.floor(t.decimals):e.push("decimals")),{config:s,unknownKeys:k(t,N),invalidFields:e}}function U(t){var i;const e=null!==(i=null==t?void 0:t.trim())&&void 0!==i?i:"";if(""===e||"null"===e)return{ranges:[],parseError:!1,issues:[]};let s;try{s=JSON.parse(e)}catch(t){return{ranges:[],parseError:!0,issues:[]}}if(!Array.isArray(s)||0===s.length)return{ranges:[],parseError:!0,issues:[]};if(!s.every((t=>l.isNumber(t)&&isFinite(t)&&t>0)))return{ranges:[],parseError:!0,issues:[]};const r=[];let a=s;const n=[...a].sort(((t,i)=>t-i));return n.some(((t,i)=>t!==a[i]))&&r.push("not ascending, sorted"),a=n,a.length>2&&(r.push(`${a.length} entries, first 2 kept`),a=a.slice(0,2)),{ranges:a,parseError:!1,issues:r}}function k(t,i){return Object.keys(t).filter((t=>!i.includes(t)))}function D(t,i,e){if(l.isExisting(t[i]))return l.isString(t[i])?t[i]:void e.push(i)}const L=["pl1","pp1","fc1"],W=class{validateActual(t){this.validateMeasureSpec("actual",t)}validateTarget(t){this.validateMeasureSpec("target",t)}validateRanges(t){const i="ERR_bullet_json_ranges",e="WARN_bullet_ranges",s=U(t);if(s.parseError)return this.setBlockingError(i,this.t(".bullet-prop-json",{prop:"ranges"})),void this.errors.remove(e);this.setBlockingError(i,null),s.issues.length>0?this.errors.addOrReplace({id:e,type:"warning",message:this.t(".bullet-ranges-invalid",{detail:s.issues.join("; ")})}):this.errors.remove(e)}validateNormalize(t){this.validateEnum("normalize","ERR_normalize",t,["target","none"],"target")}validateVariances(t){this.validateEnum("variances","ERR_variances",t,["auto","none"],"auto")}validateLevel(t){this.validateEnum("level","ERR_level",t,["auto","rowgroup","category","subcategory"],"auto")}validateOrder(t){const i="ERR_order",e=_(t).filter((t=>""!==t));0===e.length?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`order: invalid value(s) '${e.join(", ")}'; using the dataset order.`})}validateOrderDirection(t){const i="ERR_orderDirection";y(t)||w(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`order-direction: invalid value '${t}' — expected asc/desc; using asc.`})}validateLimit(t){const i="ERR_limit";O(t)&&Number(t)>=0?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`limit: invalid value '${t}' — expected a non-negative integer; using 0.`})}validateLabels(t){const i="ERR_bullet_json_labels",e="WARN_bullet_fields_labels",{data:s,parseError:r}=j(t,null);if(r)return this.setBlockingError(i,this.t(".bullet-prop-json",{prop:"labels"})),void this.errors.remove(e);this.setBlockingError(i,null),null!==s?this.reportSpecIssues(e,"labels",S(s,this.labelDefaults())):this.errors.remove(e)}validateScale(t){const i="ERR_scale";if(y(t))return void this.errors.remove(i);const{mode:e,factor:s}=b(t);"factor"===e&&(void 0===s||s<=0)?this.errors.addOrReplace({id:i,type:"warning",message:`scale: invalid value '${t}' — expected none/auto or a positive number.`}):this.errors.remove(i)}constructor(i){t(this,i),this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.layoutObserver=null,this.activeErrors=new Set,this.chartTitle="",this.filter="",this.actual="",this.target="",this.ranges="",this.normalize="target",this.variances="auto",this.level="auto",this.order="",this.orderDirection="",this.limit=0,this.labels="",this._autoScaleGuard=!1,this._lastScaledParentHeight=0,this.translateForInner=(t,i)=>this.t(t,i),R(this),$(this),g(this,(t=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1}),((t,i)=>{this.datasetMeta=i})),this.errors=E(this),this.componentStyle=A(this),this.ruleSetConfig=h(this),this.t=m(this).t}componentWillLoad(){this.validateActual(this.actual),this.validateTarget(this.target),this.validateRanges(this.ranges),this.validateNormalize(this.normalize),this.validateVariances(this.variances),this.validateLevel(this.level),this.validateOrder(this.order),this.validateOrderDirection(this.orderDirection),this.validateLimit(this.limit),this.validateLabels(this.labels),this.validateScale(this.scale)}componentDidRender(){const{mode:t}=b(this.scale);if("auto"!==t&&"empty"!==t)return void(this._autoScaleGuard=!1);if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const e=this.element,{height:s}=f(e);if(s<=0)return;this._lastScaledParentHeight=s;const r=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),a=e.scrollHeight,n=this.appliedScaleFactor;if(a<=s+1)return void this.errors.remove("AUTO_scale");const l=Math.max(.3,n*(s-1)/a);Math.abs(l-n)<.01||(e.style.setProperty("--bn-font-size",r*l+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${l.toFixed(3)}`}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,i((()=>{this.appliedScaleFactor=l})))}componentDidLoad(){this.layoutObserver=d(this.element,(()=>{if(this._autoScaleGuard)return;const{height:t}=f(this.element);t>0&&Math.abs(t-this._lastScaledParentHeight)>2&&(this._lastScaledParentHeight=t,e(this))})),requestAnimationFrame((()=>{requestAnimationFrame((()=>{if(this._autoScaleGuard)return;const{height:t}=f(this.element);this._lastScaledParentHeight=t,e(this)}))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}labelDefaults(){return{show:"auto",decimals:1}}setBlockingError(t,i){null===i?(this.errors.remove(t),this.activeErrors.delete(t)):(this.errors.addOrReplace({id:t,type:"error",message:i}),this.activeErrors.add(t))}hasBlockingErrors(){return this.activeErrors.size>0}validateMeasureSpec(t,i){var e;const s=`ERR_bullet_json_${t}`,r=`ERR_bullet_measure_${t}`,a=`WARN_bullet_fields_${t}`,{data:n,parseError:l}=j(i,"measure");if(l)return this.setBlockingError(s,this.t(".bullet-prop-json",{prop:t})),this.setBlockingError(r,null),void this.errors.remove(a);if(this.setBlockingError(s,null),null===n)return this.setBlockingError(r,null),void this.errors.remove(a);const u=(null!==(e=n.measure)&&void 0!==e?e:"").trim(),h=o(u);"auto"===u.toLowerCase()||null!==h&&"scenario"===h.kind?this.setBlockingError(r,null):this.setBlockingError(r,this.t(".bullet-measure-invalid",{prop:t,measure:u})),this.reportSpecIssues(a,t,x(n))}validateEnum(t,i,e,s,r){y(e)||s.includes(e.trim().toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`${t}: invalid value '${e}' — expected ${s.join("/")}; using '${r}'.`})}reportSpecIssues(t,i,e){const s=[];null!==e&&e.invalidFields.length>0&&s.push(`invalid: ${e.invalidFields.join(", ")}`),null!==e&&e.unknownKeys.length>0&&s.push(`unknown: ${e.unknownKeys.join(", ")}`),s.length>0?this.errors.addOrReplace({id:t,type:"warning",message:`${i}: ignored sub-fields (${s.join("; ")}).`}):this.errors.remove(t)}prepareActual(){var t,i,e,s,r;const{data:a,parseError:n}=j(this.actual,"measure");if(n)return null;const l=null!==a?x(a).config:null;if(null===l||"auto"===l.measure.toLowerCase()){const r=null!==l,a=null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[],n=null!==(s=a.includes("ac1")?"ac1":null!==(e=a.find((t=>t.startsWith("ac"))))&&void 0!==e?e:a[0])&&void 0!==s?s:"ac1";return r||null===this.datasetMeta?this.errors.remove("AUTO_actual"):this.errors.addOrReplace({id:"AUTO_actual",type:"warning",message:`actual: not set, auto-detected: ${n}`}),null===l?{measure:n}:Object.assign(Object.assign({},l),{measure:n})}return this.errors.remove("AUTO_actual"),"scenario"===(null===(r=o(l.measure))||void 0===r?void 0:r.kind)?l:null}prepareTarget(){var t,i,e;const{data:s,parseError:r}=j(this.target,"measure");if(r)return null;const a=null!==s?x(s).config:null;if(null===a||"auto"===a.measure.toLowerCase()){const e=null!==a,s=null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[],r=L.find((t=>s.includes(t)));return void 0===r?(this.errors.remove("AUTO_target"),null!==this.datasetMeta?this.errors.addOrReplace({id:"WARN_bullet_target_unavailable",type:"warning",message:this.t(".bullet-target-none")}):this.errors.remove("WARN_bullet_target_unavailable"),null):(this.errors.remove("WARN_bullet_target_unavailable"),e||null===this.datasetMeta?this.errors.remove("AUTO_target"):this.errors.addOrReplace({id:"AUTO_target",type:"warning",message:`target: not set, auto-detected: ${r}`}),null===a?{measure:r}:Object.assign(Object.assign({},a),{measure:r}))}return this.errors.remove("AUTO_target"),this.errors.remove("WARN_bullet_target_unavailable"),"scenario"===(null===(e=o(a.measure))||void 0===e?void 0:e.kind)?a:null}prepareNormalize(){var t;return"none"===(null===(t=this.normalize)||void 0===t?void 0:t.trim().toLowerCase())?"none":"target"}prepareShowVariances(){var t;return"none"!==(null===(t=this.variances)||void 0===t?void 0:t.trim().toLowerCase())}prepareLevel(){var t,i;const e=null===(t=this.level)||void 0===t?void 0:t.trim().toLowerCase();if("rowgroup"===e)return u.ROWGROUP;if("category"===e)return u.CATEGORY;if("subcategory"===e)return u.SUBCATEGORY;const s=null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedLevel;if(void 0!==s&&""!==s){const t=u[s.toUpperCase()];if(void 0!==t)return t}return u.CATEGORY}prepareOrder(){var t,i,e,s;const r="auto"===(null===(t=this.order)||void 0===t?void 0:t.trim().toLowerCase());let a;y(this.order)||r?(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedOrder)?(r?this.errors.remove("AUTO_order"):this.errors.addOrReplace({id:"AUTO_order",type:"warning",message:`order: not set, auto-detected: ${this.datasetMeta.suggestedOrder}`}),a=this.datasetMeta.suggestedOrder):(this.errors.remove("AUTO_order"),a=""):(this.errors.remove("AUTO_order"),a=this.order);const n=null!==(s=c[null===(e=this.orderDirection)||void 0===e?void 0:e.toUpperCase()])&&void 0!==s?s:c.ASC;if(y(a))return new p([v.CATEGORYINDEX],n);const l=a.split(",").map((t=>v[t.trim().toUpperCase()])).filter((t=>void 0!==t));return new p(l.length>0?l:[v.CATEGORYINDEX],n)}prepareLabels(){const t=this.labelDefaults(),{data:i,parseError:e}=j(this.labels,null);return e||null===i?{show:t.show,decimals:t.decimals}:S(i,t).config}prepareLimit(){const t=Math.floor(Number(this.limit)||0);return t>0?t:0}i18nLocalKeys(){return["no-data","target","axis.in"]}prepareI18n(){const t=new Map(this.i18nLocalKeys().map((t=>[t,this.t(".".concat(t))]))),i=new Map(n.map((t=>[t,this.t("global.".concat(t))])));return new Map([...i.entries(),...t.entries()])}prepareStyle(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{const e=i.global.fontSizePx*t;return{scaleFactors:i["bn-chart-bullet"].scaleFactors,fontStyles:{font:`${e}px ${i.global.fontFamily}`,size:e,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i["bn-chart-bullet"].axisStyles,barStyles:i["bn-chart-bullet"].barStyles,varianceStyles:i["bn-chart-bullet"].varianceStyles,rangeColors:i["bn-chart-bullet"].rangeColors,padding:i["bn-chart-bullet"].padding}}))}getEffectiveScaleFactor(){const{mode:t,factor:i}=b(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,s,r,a;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(s=i.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(r=i.global)||void 0===r?void 0:r.fontColor)||"#000000","--bn-font-background":(null===(a=i.global)||void 0===a?void 0:a.fontBackgroundColor)||"#ffffff"}}))}getDataStructure(){const t={};for(const i of["ac","pp","fc","pl"])for(const e of[1,2,3,4])t[`${i}${e}`]={type:"number",isOptional:!0,description:""};const i={actual:this.prepareActual(),target:this.prepareTarget()};for(const[e,s]of Object.entries(i))null!==s&&void 0!==t[s.measure]&&(t[s.measure].description=`${e}: ${void 0!==s.label?s.label:s.measure}`);return{IBulletChartDataRow:Object.assign({operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!0,description:""},rowGroupIndex:{type:"number",isOptional:!0,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!0,description:""},subCategoryIndex:{type:"number",isOptional:!0,description:""}},t)}}chartTemplate(){const t=this.prepareActual(),i=this.prepareTarget(),e=U(this.ranges).ranges,r=this.prepareNormalize();return this.setBlockingError("ERR_bullet_measure_same",null!==t&&null!==i&&t.measure===i.measure?this.t(".bullet-measure-same",{measure:t.measure}):null),e.length>0&&"target"===r?this.errors.addOrReplace({id:"WARN_bullet_ranges_ignored",type:"warning",message:this.t(".bullet-ranges-ignored")}):this.errors.remove("WARN_bullet_ranges_ignored"),this.hasBlockingErrors()||null===t?null:s("ibcs-chart-bullet",{tableName:this.datasetName,dataVersion:this.dataVersion,chartTitle:this.chartTitle,actual:t,target:i,ranges:e,normalize:r,showVariances:this.prepareShowVariances(),level:this.prepareLevel(),order:this.prepareOrder(),limit:this.prepareLimit(),labels:this.prepareLabels(),filter:this.filter,styles:this.prepareStyle(),i18n:this.prepareI18n(),containerWidth:f(this.element).width,ruleSetConfig:this.ruleSetConfig(),errors:this.errors,translate:this.translateForInner})}render(){return s(r,{key:"9fd8c656471de9582652769edf49b80756575830",style:this.getFontStyles()},s("div",{key:"a6fe8d33dde8912a77a86244db092bb364c1aeaa",class:"container"},this.chartTemplate()))}get element(){return a(this)}static get watchers(){return{actual:[{validateActual:0}],target:[{validateTarget:0}],ranges:[{validateRanges:0}],normalize:[{validateNormalize:0}],variances:[{validateVariances:0}],level:[{validateLevel:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],limit:[{validateLimit:0}],labels:[{validateLabels:0}],scale:[{validateScale:0}]}}};W.style=":host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}";export{W as bn_chart_bullet}
@@ -0,0 +1 @@
1
+ import{r as s,h as t,H as e,g as r}from"./p-B_d-jp99.js";import{w as a}from"./p-BjBz5cSL.js";import{g as i}from"./p-BqhIhYr1.js";import{w as o,a as h}from"./p-B4JfKvVT.js";const n=class{constructor(t){s(this,t),this.name="_default",o(this),this.errors=h(this),a(this,(s=>{this.stores||(this.stores=i(this.element));try{const t=JSON.parse(s);this.stores.ruleSets.set(this.name,t),this.errors.remove("JSON_PARSE")}catch(s){this.errors.addOrReplace({id:"JSON_PARSE",type:"error",message:`bn-ruleset: Failed to parse JSON body — ${s.message}`}),console.error(s)}}))}render(){return t(e,{key:"9fa99c590cee15a870554baa592395a50ee0d311"})}get element(){return r(this)}};n.style="bn-ruleset{display:none}";export{n as bn_ruleset}
@@ -0,0 +1 @@
1
+ import{C as t,a as s}from"./p-BZV1b5VH.js";import{X as i,D as n}from"./p-BqhIhYr1.js";import{L as o,H as e}from"./p-BWKdb9ym.js";import{F as r,C as h}from"./p-X6CxL6W-.js";class l{constructor(t,s,n,o){this.scaleFactors=t,this.fontStyles=s,this.axisStyles=n,this.padding=o,this.seriesColors=[...i]}}class a{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 l(this.scaleFactorsXYChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.paddingAdapter.default())}}class c{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=1,this.gridLineWidth=1}}class u{adapt(s){const i=new c;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 c}}class f{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}}const d=["n","ne","e","se","s","sw","w","nw"],v=Math.SQRT1_2;class w{constructor(t,s,i=new o){this.frame=t,this.gapPx=s,this.manager=i}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 d){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*v+.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,n){return{x:t,y:s,width:i,height:n,pointIndex:0,preferredHook:e.Center}}}class m{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:this.styles.scaleFactors.gridLineWidth};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:this.styles.scaleFactors.refLineWidth};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:this.styles.scaleFactors.gridLineWidth})}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 h of s.ticksX){const l=this.xScale.scale(h);t.text(r.number(h,"decimal",s.xDecimals,s.xDecimals)).font(Object.assign(Object.assign({},n),{anchor:"middle"})).fill(e).attr({x:l,y:this.rect.y+this.rect.height+i+.8*this.em,"font-family":o})}if(s.showYLabels)for(const h of s.ticksY){const l=this.yScale.scale(h);t.text(r.number(h,"decimal",s.yDecimals,s.yDecimals)).font(Object.assign(Object.assign({},n),{anchor:"end"})).fill(e).attr({x:this.rect.x-i,y:l+.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 p{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=h(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)s.push({text:i.label,bold:!1,treatment:i.treatment});for(const i of t.entries)s.push({text:i.label,bold:!1,treatment:i.treatment});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){const e=this.rows(s),r=this.swatchSize+.4*this.em;let h=i,l=n;for(const s of e){let i=h;if(null!==s.treatment){const n=t.circle(this.swatchSize).move(h,l+(this.rowHeight-this.swatchSize)/2).fill(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+=r}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:l+this.rowHeight/2+.35*this.em,"font-family":this.fontFamily()}),"bottom"===o?h=i+this.textWidth(s.text,s.bold)+1.5*this.em:l+=this.rowHeight}}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}}class x{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 y=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"];class b{adapt(s){const i=new x;if(t.isOperator(s.operation)&&(i.operation=s.operation),t.isString(s.date)){const t=n.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 y){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 x}}const g={rowGroup:"rowGroupIndex",category:"categoryIndex",subCategory:"subCategoryIndex"};function M(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 N(t,s){return void 0!==s&&(void 0!==s.min&&t<s.min||void 0!==s.max&&t>s.max)}function S(t,i){return"scenario"!==t.kind?null:i+s(t.slot)}function k(t,s){var i,n,o,e,r,h,l,a,c;const u=[],f=new Set,d=[];let v=0,w=0,m=0,p=0,x=0;const y=new Map,b=new Map,k=new Map,j=null!==(i=s.compareFamily)&&void 0!==i?i:null,z=null!==j?S(s.measures.x,j):null,O=null!==j?S(s.measures.y,j):null,B=null!==j&&void 0!==s.measures.size?S(s.measures.size,j):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:"",S=null!==(o=null!==s.seriesLevel?i[s.seriesLevel]:"")&&void 0!==o?o:"",j=`${u}\0${t}`;if(f.has(j)){v++,d.length<5&&!d.includes(t)&&d.push(t);continue}const C=M(i,s.measures.x),F=M(i,s.measures.y);if(null===C.value||null===F.value){(C.varianceNoData||F.varianceNoData)&&w++;continue}if(N(C.value,null===(e=s.domains)||void 0===e?void 0:e.x)||N(F.value,null===(r=s.domains)||void 0===r?void 0:r.y)){m++;continue}const D={name:t,seriesKey:S,facetKey:u,x:C.value,y:F.value,row:i};if(void 0!==s.measures.size){const t=M(i,s.measures.size).value;if(null===t)continue;if(t<0){p++;continue}D.size=t}if(void 0!==s.measures.share){const t=M(i,s.measures.share).value;null!==t&&(t<0||t>1?(x++,D.share=Math.min(1,Math.max(0,t))):D.share=t)}if(null!==z&&null!==O){const t=i.slotValue(z),n=i.slotValue(O),o=null!==B?i.slotValue(B):null;null===t||null===n||null!==B&&null===o?D.compare=null:N(t,null===(h=s.domains)||void 0===h?void 0:h.x)||N(n,null===(l=s.domains)||void 0===l?void 0:l.y)?(m++,D.compare=null):(D.compare={x:t,y:n},null!==o&&(D.compare.size=o))}if(f.add(j),k.has(u)||k.set(u,[]),k.get(u).push(D),null!==s.facetLevel){const t=i[g[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[g[s.seriesLevel]];null!=t&&t<(null!==(c=b.get(S))&&void 0!==c?c:Number.POSITIVE_INFINITY)&&b.set(S,t)}}const C=[...k.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)})),F=C.map((t=>{let i=k.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}})),D=new Set;for(const t of F)for(const s of t.points)D.add(s.seriesKey);const H=[...D].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 I=null,L=0;for(const t of F)for(const s of t.points){L++;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===I&&(I={xMin:t[0],xMax:t[0],yMin:i[0],yMax:i[0],sizeMax:0});for(const s of t)I.xMin=Math.min(I.xMin,s),I.xMax=Math.max(I.xMax,s);for(const t of i)I.yMin=Math.min(I.yMin,t),I.yMax=Math.max(I.yMax,t);for(const t of n)I.sizeMax=Math.max(I.sizeMax,t)}return v>0&&u.push({code:"xy-duplicate-point",data:{count:String(v),names:d.join(", ")}}),w>0&&u.push({code:"xy-variance-nodata",data:{count:String(w)}}),m>0&&u.push({code:"xy-point-clipped",data:{count:String(m)}}),p>0&&u.push({code:"bubble-size-negative",data:{count:String(p)}}),x>0&&u.push({code:"bubble-share-range",data:{count:String(x)}}),L>5e3&&u.push({code:"xy-point-budget",data:{count:String(L)}}),{facets:F,series:H,extents:I,warnings:u,totalPoints:L}}export{f as F,w as P,u as S,b as X,p as a,m as b,a as c,k as r}