@ntlab/ntjs-assets 2.73.0 → 2.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (838) hide show
  1. package/assets/js/cdn.json +1 -1
  2. package/assets/js/exif-js/exif.min.js +1 -8
  3. package/assets/js/highcharts/css/annotations/popup.css +86 -45
  4. package/assets/js/highcharts/css/highcharts.css +40 -30
  5. package/assets/js/highcharts/css/stocktools/gui.css +28 -11
  6. package/assets/js/highcharts/es-modules/Accessibility/Components/InfoRegionsComponent.js +3 -3
  7. package/assets/js/highcharts/es-modules/Accessibility/Components/LegendComponent.js +10 -1
  8. package/assets/js/highcharts/es-modules/Accessibility/Components/MenuComponent.js +23 -22
  9. package/assets/js/highcharts/es-modules/Accessibility/HighContrastMode.js +0 -5
  10. package/assets/js/highcharts/es-modules/Core/Axis/AxisDefaults.js +5 -0
  11. package/assets/js/highcharts/es-modules/Core/Axis/OrdinalAxis.js +19 -11
  12. package/assets/js/highcharts/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +14 -1
  13. package/assets/js/highcharts/es-modules/Core/Axis/RadialAxis.js +3 -4
  14. package/assets/js/highcharts/es-modules/Core/Axis/Tick.js +1 -1
  15. package/assets/js/highcharts/es-modules/Core/Axis/WaterfallAxis.js +4 -4
  16. package/assets/js/highcharts/es-modules/Core/Chart/Chart.js +31 -25
  17. package/assets/js/highcharts/es-modules/Core/Chart/ChartDefaults.js +13 -0
  18. package/assets/js/highcharts/es-modules/Core/Chart/GanttChart.js +4 -2
  19. package/assets/js/highcharts/es-modules/Core/Chart/StockChart.js +1 -1
  20. package/assets/js/highcharts/es-modules/Core/Color/Color.js +4 -8
  21. package/assets/js/highcharts/es-modules/Core/Defaults.js +4 -0
  22. package/assets/js/highcharts/es-modules/Core/Globals.js +1 -1
  23. package/assets/js/highcharts/es-modules/Core/HttpUtilities.js +45 -38
  24. package/assets/js/highcharts/es-modules/Core/Pointer.js +3 -4
  25. package/assets/js/highcharts/es-modules/Core/Renderer/HTML/AST.js +14 -14
  26. package/assets/js/highcharts/es-modules/Core/Renderer/HTML/HTMLElement.js +6 -2
  27. package/assets/js/highcharts/es-modules/Core/Renderer/SVG/SVGRenderer.js +4 -1
  28. package/assets/js/highcharts/es-modules/Core/Series/DataLabel.js +4 -2
  29. package/assets/js/highcharts/es-modules/Core/Series/Series.js +16 -6
  30. package/assets/js/highcharts/es-modules/Core/Series/SeriesDefaults.js +1 -3
  31. package/assets/js/highcharts/es-modules/Core/Templating.js +6 -5
  32. package/assets/js/highcharts/es-modules/Core/Tooltip.js +3 -1
  33. package/assets/js/highcharts/es-modules/Data/Connectors/CSVConnector.js +32 -15
  34. package/assets/js/highcharts/es-modules/Data/Connectors/DataConnector.js +107 -12
  35. package/assets/js/highcharts/es-modules/Data/Connectors/GoogleSheetsConnector.js +29 -17
  36. package/assets/js/highcharts/es-modules/Data/Connectors/HTMLTableConnector.js +3 -3
  37. package/assets/js/highcharts/es-modules/Data/Connectors/JSONConnector.js +37 -16
  38. package/assets/js/highcharts/es-modules/Data/Converters/HTMLTableConverter.js +1 -1
  39. package/assets/js/highcharts/es-modules/Data/DataPool.js +15 -4
  40. package/assets/js/highcharts/es-modules/Extensions/Annotations/Annotation.js +10 -7
  41. package/assets/js/highcharts/es-modules/Extensions/Annotations/AnnotationChart.js +7 -3
  42. package/assets/js/highcharts/es-modules/Extensions/Annotations/AnnotationDefaults.js +38 -12
  43. package/assets/js/highcharts/es-modules/Extensions/Annotations/Controllables/ControllableLabel.js +10 -3
  44. package/assets/js/highcharts/es-modules/Extensions/Annotations/NavigationBindingsDefaults.js +1 -1
  45. package/assets/js/highcharts/es-modules/Extensions/Annotations/Popup/PopupAnnotations.js +10 -4
  46. package/assets/js/highcharts/es-modules/Extensions/Annotations/Popup/PopupComposition.js +1 -1
  47. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/BasicAnnotation.js +0 -3
  48. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/CrookedLine.js +97 -94
  49. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/ElliottWave.js +43 -36
  50. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/Fibonacci.js +86 -82
  51. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/FibonacciTimeZones.js +74 -71
  52. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/InfinityLine.js +17 -3
  53. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/Measure.js +229 -226
  54. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/Pitchfork.js +39 -40
  55. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/TimeCycles.js +56 -52
  56. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/Tunnel.js +80 -76
  57. package/assets/js/highcharts/es-modules/Extensions/Annotations/Types/VerticalLine.js +57 -53
  58. package/assets/js/highcharts/es-modules/Extensions/Boost/BoostSeries.js +22 -3
  59. package/assets/js/highcharts/es-modules/Extensions/DownloadURL.js +41 -8
  60. package/assets/js/highcharts/es-modules/Extensions/ExportData/ExportData.js +876 -780
  61. package/assets/js/highcharts/es-modules/Extensions/ExportData/ExportDataDefaults.js +67 -13
  62. package/assets/js/highcharts/es-modules/Extensions/Exporting/Exporting.js +1091 -546
  63. package/assets/js/highcharts/es-modules/Extensions/Exporting/ExportingDefaults.js +52 -36
  64. package/assets/js/highcharts/es-modules/Extensions/Exporting/Fullscreen.js +2 -2
  65. package/assets/js/highcharts/es-modules/Extensions/NonCartesianSeriesZoom/NonCartesianSeriesZoom.js +311 -0
  66. package/assets/js/highcharts/es-modules/Extensions/OfflineExporting/OfflineExporting.js +254 -575
  67. package/assets/js/highcharts/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +9 -38
  68. package/assets/js/highcharts/es-modules/Extensions/Pane/Pane.js +1 -1
  69. package/assets/js/highcharts/es-modules/Extensions/Pane/PaneDefaults.js +9 -1
  70. package/assets/js/highcharts/es-modules/Extensions/Themes/Adaptive.js +1009 -0
  71. package/assets/js/highcharts/es-modules/Maps/MapNavigation.js +1 -1
  72. package/assets/js/highcharts/es-modules/Series/Bubble/BubblePoint.js +2 -2
  73. package/assets/js/highcharts/es-modules/Series/Column/ColumnSeriesDefaults.js +1 -2
  74. package/assets/js/highcharts/es-modules/Series/DragNodesComposition.js +4 -0
  75. package/assets/js/highcharts/es-modules/Series/Flags/FlagsSeriesDefaults.js +2 -0
  76. package/assets/js/highcharts/es-modules/Series/GraphLayoutComposition.js +2 -1
  77. package/assets/js/highcharts/es-modules/Series/Heatmap/HeatmapSeriesDefaults.js +1 -2
  78. package/assets/js/highcharts/es-modules/Series/Item/ItemSeries.js +1 -1
  79. package/assets/js/highcharts/es-modules/Series/PackedBubble/PackedBubblePoint.js +5 -0
  80. package/assets/js/highcharts/es-modules/Series/Pie/PieSeriesDefaults.js +1 -2
  81. package/assets/js/highcharts/es-modules/Series/PolarComposition.js +1 -1
  82. package/assets/js/highcharts/es-modules/Series/SolidGauge/SolidGaugeSeries.js +7 -2
  83. package/assets/js/highcharts/es-modules/Series/Treegraph/TreegraphSeries.js +3 -1
  84. package/assets/js/highcharts/es-modules/Series/Variwide/VariwideSeries.js +8 -1
  85. package/assets/js/highcharts/es-modules/Series/Waterfall/WaterfallSeries.js +6 -8
  86. package/assets/js/highcharts/es-modules/Series/Wordcloud/WordcloudSeries.js +87 -10
  87. package/assets/js/highcharts/es-modules/Shared/BaseForm.js +6 -3
  88. package/assets/js/highcharts/es-modules/Shared/TimeBase.js +5 -1
  89. package/assets/js/highcharts/es-modules/Stock/Navigator/NavigatorComposition.js +2 -2
  90. package/assets/js/highcharts/es-modules/Stock/Scrollbar/Scrollbar.js +5 -7
  91. package/assets/js/highcharts/es-modules/Stock/StockTools/StockToolbar.js +1 -1
  92. package/assets/js/highcharts/es-modules/Stock/StockTools/StockToolsBindings.js +34 -113
  93. package/assets/js/highcharts/es-modules/masters/highcharts-3d.src.js +3 -1
  94. package/assets/js/highcharts/es-modules/masters/highcharts-gantt.src.js +1 -1
  95. package/assets/js/highcharts/es-modules/masters/highcharts-more.src.js +1 -1
  96. package/assets/js/highcharts/es-modules/masters/highcharts.src.js +1 -1
  97. package/assets/js/highcharts/es-modules/masters/highmaps.src.js +1 -1
  98. package/assets/js/highcharts/es-modules/masters/highstock.src.js +1 -1
  99. package/assets/js/highcharts/es-modules/masters/i18n/fr-FR.src.js +1 -1
  100. package/assets/js/highcharts/es-modules/masters/i18n/nb-NO.src.js +1 -1
  101. package/assets/js/highcharts/es-modules/masters/i18n/zh-CN.src.js +1 -1
  102. package/assets/js/highcharts/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
  103. package/assets/js/highcharts/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
  104. package/assets/js/highcharts/es-modules/masters/indicators/ao.src.js +1 -1
  105. package/assets/js/highcharts/es-modules/masters/indicators/apo.src.js +1 -1
  106. package/assets/js/highcharts/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
  107. package/assets/js/highcharts/es-modules/masters/indicators/aroon.src.js +1 -1
  108. package/assets/js/highcharts/es-modules/masters/indicators/atr.src.js +1 -1
  109. package/assets/js/highcharts/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
  110. package/assets/js/highcharts/es-modules/masters/indicators/cci.src.js +1 -1
  111. package/assets/js/highcharts/es-modules/masters/indicators/chaikin.src.js +1 -1
  112. package/assets/js/highcharts/es-modules/masters/indicators/cmf.src.js +1 -1
  113. package/assets/js/highcharts/es-modules/masters/indicators/cmo.src.js +1 -1
  114. package/assets/js/highcharts/es-modules/masters/indicators/dema.src.js +1 -1
  115. package/assets/js/highcharts/es-modules/masters/indicators/disparity-index.src.js +1 -1
  116. package/assets/js/highcharts/es-modules/masters/indicators/dmi.src.js +1 -1
  117. package/assets/js/highcharts/es-modules/masters/indicators/dpo.src.js +1 -1
  118. package/assets/js/highcharts/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
  119. package/assets/js/highcharts/es-modules/masters/indicators/indicators-all.src.js +1 -1
  120. package/assets/js/highcharts/es-modules/masters/indicators/indicators.src.js +1 -1
  121. package/assets/js/highcharts/es-modules/masters/indicators/keltner-channels.src.js +1 -1
  122. package/assets/js/highcharts/es-modules/masters/indicators/klinger.src.js +1 -1
  123. package/assets/js/highcharts/es-modules/masters/indicators/macd.src.js +1 -1
  124. package/assets/js/highcharts/es-modules/masters/indicators/mfi.src.js +1 -1
  125. package/assets/js/highcharts/es-modules/masters/indicators/momentum.src.js +1 -1
  126. package/assets/js/highcharts/es-modules/masters/indicators/natr.src.js +1 -1
  127. package/assets/js/highcharts/es-modules/masters/indicators/obv.src.js +1 -1
  128. package/assets/js/highcharts/es-modules/masters/indicators/pivot-points.src.js +1 -1
  129. package/assets/js/highcharts/es-modules/masters/indicators/ppo.src.js +1 -1
  130. package/assets/js/highcharts/es-modules/masters/indicators/price-channel.src.js +1 -1
  131. package/assets/js/highcharts/es-modules/masters/indicators/price-envelopes.src.js +1 -1
  132. package/assets/js/highcharts/es-modules/masters/indicators/psar.src.js +1 -1
  133. package/assets/js/highcharts/es-modules/masters/indicators/regressions.src.js +1 -1
  134. package/assets/js/highcharts/es-modules/masters/indicators/roc.src.js +1 -1
  135. package/assets/js/highcharts/es-modules/masters/indicators/rsi.src.js +1 -1
  136. package/assets/js/highcharts/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
  137. package/assets/js/highcharts/es-modules/masters/indicators/stochastic.src.js +1 -1
  138. package/assets/js/highcharts/es-modules/masters/indicators/supertrend.src.js +1 -1
  139. package/assets/js/highcharts/es-modules/masters/indicators/tema.src.js +1 -1
  140. package/assets/js/highcharts/es-modules/masters/indicators/trendline.src.js +1 -1
  141. package/assets/js/highcharts/es-modules/masters/indicators/trix.src.js +1 -1
  142. package/assets/js/highcharts/es-modules/masters/indicators/volume-by-price.src.js +1 -1
  143. package/assets/js/highcharts/es-modules/masters/indicators/vwap.src.js +1 -1
  144. package/assets/js/highcharts/es-modules/masters/indicators/williams-r.src.js +1 -1
  145. package/assets/js/highcharts/es-modules/masters/indicators/wma.src.js +1 -1
  146. package/assets/js/highcharts/es-modules/masters/indicators/zigzag.src.js +1 -1
  147. package/assets/js/highcharts/es-modules/masters/modules/accessibility.src.js +1 -1
  148. package/assets/js/highcharts/es-modules/masters/modules/annotations-advanced.src.js +1 -1
  149. package/assets/js/highcharts/es-modules/masters/modules/annotations.src.js +1 -1
  150. package/assets/js/highcharts/es-modules/masters/modules/arc-diagram.src.js +1 -1
  151. package/assets/js/highcharts/es-modules/masters/modules/arrow-symbols.src.js +1 -1
  152. package/assets/js/highcharts/es-modules/masters/modules/boost-canvas.src.js +1 -1
  153. package/assets/js/highcharts/es-modules/masters/modules/boost.src.js +1 -1
  154. package/assets/js/highcharts/es-modules/masters/modules/broken-axis.src.js +1 -1
  155. package/assets/js/highcharts/es-modules/masters/modules/bullet.src.js +1 -1
  156. package/assets/js/highcharts/es-modules/masters/modules/coloraxis.src.js +1 -1
  157. package/assets/js/highcharts/es-modules/masters/modules/current-date-indicator.src.js +1 -1
  158. package/assets/js/highcharts/es-modules/masters/modules/cylinder.src.js +1 -1
  159. package/assets/js/highcharts/es-modules/masters/modules/data-tools.src.js +1 -1
  160. package/assets/js/highcharts/es-modules/masters/modules/data.src.js +1 -1
  161. package/assets/js/highcharts/es-modules/masters/modules/datagrouping.src.js +1 -1
  162. package/assets/js/highcharts/es-modules/masters/modules/debugger.src.js +1 -1
  163. package/assets/js/highcharts/es-modules/masters/modules/dependency-wheel.src.js +1 -1
  164. package/assets/js/highcharts/es-modules/masters/modules/dotplot.src.js +1 -1
  165. package/assets/js/highcharts/es-modules/masters/modules/drag-panes.src.js +1 -1
  166. package/assets/js/highcharts/es-modules/masters/modules/draggable-points.src.js +1 -1
  167. package/assets/js/highcharts/es-modules/masters/modules/drilldown.src.js +3 -1
  168. package/assets/js/highcharts/es-modules/masters/modules/dumbbell.src.js +1 -1
  169. package/assets/js/highcharts/es-modules/masters/modules/export-data.src.js +3 -3
  170. package/assets/js/highcharts/es-modules/masters/modules/exporting.src.js +5 -1
  171. package/assets/js/highcharts/es-modules/masters/modules/flowmap.src.js +1 -1
  172. package/assets/js/highcharts/es-modules/masters/modules/full-screen.src.js +1 -1
  173. package/assets/js/highcharts/es-modules/masters/modules/funnel.src.js +1 -1
  174. package/assets/js/highcharts/es-modules/masters/modules/funnel3d.src.js +1 -1
  175. package/assets/js/highcharts/es-modules/masters/modules/gantt.src.js +1 -1
  176. package/assets/js/highcharts/es-modules/masters/modules/geoheatmap.src.js +1 -1
  177. package/assets/js/highcharts/es-modules/masters/modules/grid-axis.src.js +1 -1
  178. package/assets/js/highcharts/es-modules/masters/modules/heatmap.src.js +1 -1
  179. package/assets/js/highcharts/es-modules/masters/modules/heikinashi.src.js +1 -1
  180. package/assets/js/highcharts/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
  181. package/assets/js/highcharts/es-modules/masters/modules/hollowcandlestick.src.js +1 -1
  182. package/assets/js/highcharts/es-modules/masters/modules/item-series.src.js +1 -1
  183. package/assets/js/highcharts/es-modules/masters/modules/lollipop.src.js +1 -1
  184. package/assets/js/highcharts/es-modules/masters/modules/map.src.js +1 -1
  185. package/assets/js/highcharts/es-modules/masters/modules/marker-clusters.src.js +1 -1
  186. package/assets/js/highcharts/es-modules/masters/modules/mouse-wheel-zoom.src.js +1 -1
  187. package/assets/js/highcharts/es-modules/masters/modules/navigator.src.js +1 -1
  188. package/assets/js/highcharts/es-modules/masters/modules/networkgraph.src.js +1 -1
  189. package/assets/js/highcharts/es-modules/masters/modules/no-data-to-display.src.js +1 -1
  190. package/assets/js/highcharts/es-modules/masters/modules/non-cartesian-zoom.src.js +18 -0
  191. package/assets/js/highcharts/es-modules/masters/modules/offline-exporting.src.js +2 -2
  192. package/assets/js/highcharts/es-modules/masters/modules/organization.src.js +1 -1
  193. package/assets/js/highcharts/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
  194. package/assets/js/highcharts/es-modules/masters/modules/pareto.src.js +1 -1
  195. package/assets/js/highcharts/es-modules/masters/modules/pathfinder.src.js +1 -1
  196. package/assets/js/highcharts/es-modules/masters/modules/pattern-fill.src.js +1 -1
  197. package/assets/js/highcharts/es-modules/masters/modules/pictorial.src.js +1 -1
  198. package/assets/js/highcharts/es-modules/masters/modules/pointandfigure.src.js +1 -1
  199. package/assets/js/highcharts/es-modules/masters/modules/price-indicator.src.js +1 -1
  200. package/assets/js/highcharts/es-modules/masters/modules/pyramid3d.src.js +1 -1
  201. package/assets/js/highcharts/es-modules/masters/modules/renko.src.js +1 -1
  202. package/assets/js/highcharts/es-modules/masters/modules/sankey.src.js +1 -1
  203. package/assets/js/highcharts/es-modules/masters/modules/series-label.src.js +1 -1
  204. package/assets/js/highcharts/es-modules/masters/modules/series-on-point.src.js +1 -1
  205. package/assets/js/highcharts/es-modules/masters/modules/solid-gauge.src.js +1 -1
  206. package/assets/js/highcharts/es-modules/masters/modules/sonification.src.js +1 -1
  207. package/assets/js/highcharts/es-modules/masters/modules/static-scale.src.js +1 -1
  208. package/assets/js/highcharts/es-modules/masters/modules/stock-tools.src.js +1 -1
  209. package/assets/js/highcharts/es-modules/masters/modules/stock.src.js +1 -1
  210. package/assets/js/highcharts/es-modules/masters/modules/streamgraph.src.js +1 -1
  211. package/assets/js/highcharts/es-modules/masters/modules/sunburst.src.js +1 -1
  212. package/assets/js/highcharts/es-modules/masters/modules/textpath.src.js +1 -1
  213. package/assets/js/highcharts/es-modules/masters/modules/tiledwebmap.src.js +1 -1
  214. package/assets/js/highcharts/es-modules/masters/modules/tilemap.src.js +1 -1
  215. package/assets/js/highcharts/es-modules/masters/modules/timeline.src.js +1 -1
  216. package/assets/js/highcharts/es-modules/masters/modules/treegraph.src.js +1 -1
  217. package/assets/js/highcharts/es-modules/masters/modules/treegrid.src.js +1 -1
  218. package/assets/js/highcharts/es-modules/masters/modules/treemap.src.js +1 -1
  219. package/assets/js/highcharts/es-modules/masters/modules/variable-pie.src.js +1 -1
  220. package/assets/js/highcharts/es-modules/masters/modules/variwide.src.js +1 -1
  221. package/assets/js/highcharts/es-modules/masters/modules/vector.src.js +1 -1
  222. package/assets/js/highcharts/es-modules/masters/modules/venn.src.js +1 -1
  223. package/assets/js/highcharts/es-modules/masters/modules/windbarb.src.js +1 -1
  224. package/assets/js/highcharts/es-modules/masters/modules/wordcloud.src.js +1 -1
  225. package/assets/js/highcharts/es-modules/masters/modules/xrange.src.js +1 -1
  226. package/assets/js/highcharts/es-modules/masters/themes/adaptive.src.js +15 -0
  227. package/assets/js/highcharts/es-modules/masters/themes/avocado.src.js +1 -1
  228. package/assets/js/highcharts/es-modules/masters/themes/brand-dark.src.js +1 -1
  229. package/assets/js/highcharts/es-modules/masters/themes/brand-light.src.js +1 -1
  230. package/assets/js/highcharts/es-modules/masters/themes/dark-blue.src.js +1 -1
  231. package/assets/js/highcharts/es-modules/masters/themes/dark-green.src.js +1 -1
  232. package/assets/js/highcharts/es-modules/masters/themes/dark-unica.src.js +1 -1
  233. package/assets/js/highcharts/es-modules/masters/themes/gray.src.js +1 -1
  234. package/assets/js/highcharts/es-modules/masters/themes/grid-light.src.js +1 -1
  235. package/assets/js/highcharts/es-modules/masters/themes/grid.src.js +1 -1
  236. package/assets/js/highcharts/es-modules/masters/themes/high-contrast-dark.src.js +1 -1
  237. package/assets/js/highcharts/es-modules/masters/themes/high-contrast-light.src.js +1 -1
  238. package/assets/js/highcharts/es-modules/masters/themes/sand-signika.src.js +1 -1
  239. package/assets/js/highcharts/es-modules/masters/themes/skies.src.js +1 -1
  240. package/assets/js/highcharts/es-modules/masters/themes/sunset.src.js +1 -1
  241. package/assets/js/highcharts/esm/highcharts-3d.js +11 -1
  242. package/assets/js/highcharts/esm/highcharts-3d.src.js +3 -1
  243. package/assets/js/highcharts/esm/highcharts-gantt.js +8 -1
  244. package/assets/js/highcharts/esm/highcharts-gantt.src.js +1 -1
  245. package/assets/js/highcharts/esm/highcharts-more.js +9 -1
  246. package/assets/js/highcharts/esm/highcharts-more.src.js +44 -29
  247. package/assets/js/highcharts/esm/highcharts.js +9 -2
  248. package/assets/js/highcharts/esm/highcharts.src.js +138 -80
  249. package/assets/js/highcharts/esm/highmaps.js +8 -1
  250. package/assets/js/highcharts/esm/highmaps.src.js +1 -1
  251. package/assets/js/highcharts/esm/highstock.js +8 -1
  252. package/assets/js/highcharts/esm/highstock.src.js +1 -1
  253. package/assets/js/highcharts/esm/i18n/fr-FR.js +13 -1
  254. package/assets/js/highcharts/esm/i18n/fr-FR.src.js +1 -1
  255. package/assets/js/highcharts/esm/i18n/nb-NO.js +13 -1
  256. package/assets/js/highcharts/esm/i18n/nb-NO.src.js +1 -1
  257. package/assets/js/highcharts/esm/i18n/zh-CN.js +13 -1
  258. package/assets/js/highcharts/esm/i18n/zh-CN.src.js +1 -1
  259. package/assets/js/highcharts/esm/indicators/acceleration-bands.js +12 -1
  260. package/assets/js/highcharts/esm/indicators/acceleration-bands.src.js +1 -1
  261. package/assets/js/highcharts/esm/indicators/accumulation-distribution.js +12 -1
  262. package/assets/js/highcharts/esm/indicators/accumulation-distribution.src.js +1 -1
  263. package/assets/js/highcharts/esm/indicators/ao.js +12 -1
  264. package/assets/js/highcharts/esm/indicators/ao.src.js +1 -1
  265. package/assets/js/highcharts/esm/indicators/apo.js +12 -1
  266. package/assets/js/highcharts/esm/indicators/apo.src.js +1 -1
  267. package/assets/js/highcharts/esm/indicators/aroon-oscillator.js +12 -1
  268. package/assets/js/highcharts/esm/indicators/aroon-oscillator.src.js +1 -1
  269. package/assets/js/highcharts/esm/indicators/aroon.js +12 -1
  270. package/assets/js/highcharts/esm/indicators/aroon.src.js +1 -1
  271. package/assets/js/highcharts/esm/indicators/atr.js +12 -1
  272. package/assets/js/highcharts/esm/indicators/atr.src.js +1 -1
  273. package/assets/js/highcharts/esm/indicators/bollinger-bands.js +12 -1
  274. package/assets/js/highcharts/esm/indicators/bollinger-bands.src.js +1 -1
  275. package/assets/js/highcharts/esm/indicators/cci.js +12 -1
  276. package/assets/js/highcharts/esm/indicators/cci.src.js +1 -1
  277. package/assets/js/highcharts/esm/indicators/chaikin.js +12 -1
  278. package/assets/js/highcharts/esm/indicators/chaikin.src.js +1 -1
  279. package/assets/js/highcharts/esm/indicators/cmf.js +11 -1
  280. package/assets/js/highcharts/esm/indicators/cmf.src.js +1 -1
  281. package/assets/js/highcharts/esm/indicators/cmo.js +12 -1
  282. package/assets/js/highcharts/esm/indicators/cmo.src.js +1 -1
  283. package/assets/js/highcharts/esm/indicators/dema.js +12 -1
  284. package/assets/js/highcharts/esm/indicators/dema.src.js +1 -1
  285. package/assets/js/highcharts/esm/indicators/disparity-index.js +12 -1
  286. package/assets/js/highcharts/esm/indicators/disparity-index.src.js +1 -1
  287. package/assets/js/highcharts/esm/indicators/dmi.js +12 -1
  288. package/assets/js/highcharts/esm/indicators/dmi.src.js +1 -1
  289. package/assets/js/highcharts/esm/indicators/dpo.js +12 -1
  290. package/assets/js/highcharts/esm/indicators/dpo.src.js +1 -1
  291. package/assets/js/highcharts/esm/indicators/ichimoku-kinko-hyo.js +12 -1
  292. package/assets/js/highcharts/esm/indicators/ichimoku-kinko-hyo.src.js +1 -1
  293. package/assets/js/highcharts/esm/indicators/indicators-all.js +12 -1
  294. package/assets/js/highcharts/esm/indicators/indicators-all.src.js +1 -1
  295. package/assets/js/highcharts/esm/indicators/indicators.js +12 -1
  296. package/assets/js/highcharts/esm/indicators/indicators.src.js +1 -1
  297. package/assets/js/highcharts/esm/indicators/keltner-channels.js +12 -1
  298. package/assets/js/highcharts/esm/indicators/keltner-channels.src.js +1 -1
  299. package/assets/js/highcharts/esm/indicators/klinger.js +12 -1
  300. package/assets/js/highcharts/esm/indicators/klinger.src.js +1 -1
  301. package/assets/js/highcharts/esm/indicators/macd.js +12 -1
  302. package/assets/js/highcharts/esm/indicators/macd.src.js +1 -1
  303. package/assets/js/highcharts/esm/indicators/mfi.js +12 -1
  304. package/assets/js/highcharts/esm/indicators/mfi.src.js +1 -1
  305. package/assets/js/highcharts/esm/indicators/momentum.js +12 -1
  306. package/assets/js/highcharts/esm/indicators/momentum.src.js +1 -1
  307. package/assets/js/highcharts/esm/indicators/natr.js +12 -1
  308. package/assets/js/highcharts/esm/indicators/natr.src.js +1 -1
  309. package/assets/js/highcharts/esm/indicators/obv.js +12 -1
  310. package/assets/js/highcharts/esm/indicators/obv.src.js +1 -1
  311. package/assets/js/highcharts/esm/indicators/pivot-points.js +12 -1
  312. package/assets/js/highcharts/esm/indicators/pivot-points.src.js +1 -1
  313. package/assets/js/highcharts/esm/indicators/ppo.js +12 -1
  314. package/assets/js/highcharts/esm/indicators/ppo.src.js +1 -1
  315. package/assets/js/highcharts/esm/indicators/price-channel.js +12 -1
  316. package/assets/js/highcharts/esm/indicators/price-channel.src.js +1 -1
  317. package/assets/js/highcharts/esm/indicators/price-envelopes.js +12 -1
  318. package/assets/js/highcharts/esm/indicators/price-envelopes.src.js +1 -1
  319. package/assets/js/highcharts/esm/indicators/psar.js +12 -1
  320. package/assets/js/highcharts/esm/indicators/psar.src.js +1 -1
  321. package/assets/js/highcharts/esm/indicators/regressions.js +12 -1
  322. package/assets/js/highcharts/esm/indicators/regressions.src.js +1 -1
  323. package/assets/js/highcharts/esm/indicators/roc.js +12 -1
  324. package/assets/js/highcharts/esm/indicators/roc.src.js +1 -1
  325. package/assets/js/highcharts/esm/indicators/rsi.js +12 -1
  326. package/assets/js/highcharts/esm/indicators/rsi.src.js +1 -1
  327. package/assets/js/highcharts/esm/indicators/slow-stochastic.js +12 -1
  328. package/assets/js/highcharts/esm/indicators/slow-stochastic.src.js +1 -1
  329. package/assets/js/highcharts/esm/indicators/stochastic.js +12 -1
  330. package/assets/js/highcharts/esm/indicators/stochastic.src.js +1 -1
  331. package/assets/js/highcharts/esm/indicators/supertrend.js +12 -1
  332. package/assets/js/highcharts/esm/indicators/supertrend.src.js +1 -1
  333. package/assets/js/highcharts/esm/indicators/tema.js +12 -1
  334. package/assets/js/highcharts/esm/indicators/tema.src.js +1 -1
  335. package/assets/js/highcharts/esm/indicators/trendline.js +12 -1
  336. package/assets/js/highcharts/esm/indicators/trendline.src.js +1 -1
  337. package/assets/js/highcharts/esm/indicators/trix.js +12 -1
  338. package/assets/js/highcharts/esm/indicators/trix.src.js +1 -1
  339. package/assets/js/highcharts/esm/indicators/volume-by-price.js +12 -1
  340. package/assets/js/highcharts/esm/indicators/volume-by-price.src.js +1 -1
  341. package/assets/js/highcharts/esm/indicators/vwap.js +12 -1
  342. package/assets/js/highcharts/esm/indicators/vwap.src.js +1 -1
  343. package/assets/js/highcharts/esm/indicators/williams-r.js +12 -1
  344. package/assets/js/highcharts/esm/indicators/williams-r.src.js +1 -1
  345. package/assets/js/highcharts/esm/indicators/wma.js +12 -1
  346. package/assets/js/highcharts/esm/indicators/wma.src.js +1 -1
  347. package/assets/js/highcharts/esm/indicators/zigzag.js +12 -1
  348. package/assets/js/highcharts/esm/indicators/zigzag.src.js +1 -1
  349. package/assets/js/highcharts/esm/modules/accessibility.js +12 -1
  350. package/assets/js/highcharts/esm/modules/accessibility.src.js +46 -43
  351. package/assets/js/highcharts/esm/modules/annotations-advanced.js +11 -1
  352. package/assets/js/highcharts/esm/modules/annotations-advanced.src.js +866 -775
  353. package/assets/js/highcharts/esm/modules/annotations.js +11 -1
  354. package/assets/js/highcharts/esm/modules/annotations.src.js +89 -40
  355. package/assets/js/highcharts/esm/modules/arc-diagram.js +11 -1
  356. package/assets/js/highcharts/esm/modules/arc-diagram.src.js +1 -1
  357. package/assets/js/highcharts/esm/modules/arrow-symbols.js +11 -1
  358. package/assets/js/highcharts/esm/modules/arrow-symbols.src.js +1 -1
  359. package/assets/js/highcharts/esm/modules/boost-canvas.js +12 -1
  360. package/assets/js/highcharts/esm/modules/boost-canvas.src.js +23 -4
  361. package/assets/js/highcharts/esm/modules/boost.js +13 -1
  362. package/assets/js/highcharts/esm/modules/boost.src.js +23 -4
  363. package/assets/js/highcharts/esm/modules/broken-axis.js +9 -1
  364. package/assets/js/highcharts/esm/modules/broken-axis.src.js +1 -1
  365. package/assets/js/highcharts/esm/modules/bullet.js +11 -1
  366. package/assets/js/highcharts/esm/modules/bullet.src.js +1 -1
  367. package/assets/js/highcharts/esm/modules/coloraxis.js +11 -1
  368. package/assets/js/highcharts/esm/modules/coloraxis.src.js +1 -1
  369. package/assets/js/highcharts/esm/modules/current-date-indicator.js +11 -1
  370. package/assets/js/highcharts/esm/modules/current-date-indicator.src.js +1 -1
  371. package/assets/js/highcharts/esm/modules/cylinder.js +12 -1
  372. package/assets/js/highcharts/esm/modules/cylinder.src.js +1 -1
  373. package/assets/js/highcharts/esm/modules/data-tools.js +11 -1
  374. package/assets/js/highcharts/esm/modules/data-tools.src.js +225 -69
  375. package/assets/js/highcharts/esm/modules/data.js +11 -1
  376. package/assets/js/highcharts/esm/modules/data.src.js +46 -39
  377. package/assets/js/highcharts/esm/modules/datagrouping.js +11 -1
  378. package/assets/js/highcharts/esm/modules/datagrouping.src.js +1 -1
  379. package/assets/js/highcharts/esm/modules/debugger.js +11 -1
  380. package/assets/js/highcharts/esm/modules/debugger.src.js +1 -1
  381. package/assets/js/highcharts/esm/modules/dependency-wheel.js +12 -1
  382. package/assets/js/highcharts/esm/modules/dependency-wheel.src.js +1 -1
  383. package/assets/js/highcharts/esm/modules/dotplot.js +11 -1
  384. package/assets/js/highcharts/esm/modules/dotplot.src.js +1 -1
  385. package/assets/js/highcharts/esm/modules/drag-panes.js +13 -1
  386. package/assets/js/highcharts/esm/modules/drag-panes.src.js +1 -1
  387. package/assets/js/highcharts/esm/modules/draggable-points.js +9 -1
  388. package/assets/js/highcharts/esm/modules/draggable-points.src.js +1 -1
  389. package/assets/js/highcharts/esm/modules/drilldown.js +13 -1
  390. package/assets/js/highcharts/esm/modules/drilldown.src.js +3 -1
  391. package/assets/js/highcharts/esm/modules/dumbbell.js +9 -1
  392. package/assets/js/highcharts/esm/modules/dumbbell.src.js +1 -1
  393. package/assets/js/highcharts/esm/modules/export-data.js +12 -1
  394. package/assets/js/highcharts/esm/modules/export-data.src.js +984 -798
  395. package/assets/js/highcharts/esm/modules/exporting.js +11 -1
  396. package/assets/js/highcharts/esm/modules/exporting.src.js +1373 -642
  397. package/assets/js/highcharts/esm/modules/flowmap.js +9 -1
  398. package/assets/js/highcharts/esm/modules/flowmap.src.js +1 -1
  399. package/assets/js/highcharts/esm/modules/full-screen.js +12 -1
  400. package/assets/js/highcharts/esm/modules/full-screen.src.js +3 -3
  401. package/assets/js/highcharts/esm/modules/funnel.js +11 -1
  402. package/assets/js/highcharts/esm/modules/funnel.src.js +1 -1
  403. package/assets/js/highcharts/esm/modules/funnel3d.js +13 -1
  404. package/assets/js/highcharts/esm/modules/funnel3d.src.js +1 -1
  405. package/assets/js/highcharts/esm/modules/gantt.js +11 -1
  406. package/assets/js/highcharts/esm/modules/gantt.src.js +33 -25
  407. package/assets/js/highcharts/esm/modules/geoheatmap.js +9 -1
  408. package/assets/js/highcharts/esm/modules/geoheatmap.src.js +1 -1
  409. package/assets/js/highcharts/esm/modules/grid-axis.js +11 -1
  410. package/assets/js/highcharts/esm/modules/grid-axis.src.js +1 -1
  411. package/assets/js/highcharts/esm/modules/heatmap.js +9 -1
  412. package/assets/js/highcharts/esm/modules/heatmap.src.js +2 -3
  413. package/assets/js/highcharts/esm/modules/heikinashi.js +12 -1
  414. package/assets/js/highcharts/esm/modules/heikinashi.src.js +1 -1
  415. package/assets/js/highcharts/esm/modules/histogram-bellcurve.js +10 -1
  416. package/assets/js/highcharts/esm/modules/histogram-bellcurve.src.js +1 -1
  417. package/assets/js/highcharts/esm/modules/hollowcandlestick.js +12 -1
  418. package/assets/js/highcharts/esm/modules/hollowcandlestick.src.js +1 -1
  419. package/assets/js/highcharts/esm/modules/item-series.js +11 -1
  420. package/assets/js/highcharts/esm/modules/item-series.src.js +3 -5
  421. package/assets/js/highcharts/esm/modules/lollipop.js +9 -1
  422. package/assets/js/highcharts/esm/modules/lollipop.src.js +1 -1
  423. package/assets/js/highcharts/esm/modules/map.js +11 -1
  424. package/assets/js/highcharts/esm/modules/map.src.js +5 -6
  425. package/assets/js/highcharts/esm/modules/marker-clusters.js +11 -1
  426. package/assets/js/highcharts/esm/modules/marker-clusters.src.js +1 -1
  427. package/assets/js/highcharts/esm/modules/mouse-wheel-zoom.js +11 -1
  428. package/assets/js/highcharts/esm/modules/mouse-wheel-zoom.src.js +1 -1
  429. package/assets/js/highcharts/esm/modules/navigator.js +11 -1
  430. package/assets/js/highcharts/esm/modules/navigator.src.js +10 -12
  431. package/assets/js/highcharts/esm/modules/networkgraph.js +11 -1
  432. package/assets/js/highcharts/esm/modules/networkgraph.src.js +7 -2
  433. package/assets/js/highcharts/esm/modules/no-data-to-display.js +12 -1
  434. package/assets/js/highcharts/esm/modules/no-data-to-display.src.js +1 -1
  435. package/assets/js/highcharts/esm/modules/non-cartesian-zoom.js +11 -0
  436. package/assets/js/highcharts/esm/modules/non-cartesian-zoom.src.js +374 -0
  437. package/assets/js/highcharts/esm/modules/offline-exporting.js +12 -1
  438. package/assets/js/highcharts/esm/modules/offline-exporting.src.js +334 -3360
  439. package/assets/js/highcharts/esm/modules/organization.js +11 -1
  440. package/assets/js/highcharts/esm/modules/organization.src.js +1 -1
  441. package/assets/js/highcharts/esm/modules/parallel-coordinates.js +11 -1
  442. package/assets/js/highcharts/esm/modules/parallel-coordinates.src.js +1 -1
  443. package/assets/js/highcharts/esm/modules/pareto.js +11 -1
  444. package/assets/js/highcharts/esm/modules/pareto.src.js +1 -1
  445. package/assets/js/highcharts/esm/modules/pathfinder.js +11 -1
  446. package/assets/js/highcharts/esm/modules/pathfinder.src.js +1 -1
  447. package/assets/js/highcharts/esm/modules/pattern-fill.js +12 -1
  448. package/assets/js/highcharts/esm/modules/pattern-fill.src.js +1 -1
  449. package/assets/js/highcharts/esm/modules/pictorial.js +11 -1
  450. package/assets/js/highcharts/esm/modules/pictorial.src.js +1 -1
  451. package/assets/js/highcharts/esm/modules/pointandfigure.js +12 -1
  452. package/assets/js/highcharts/esm/modules/pointandfigure.src.js +1 -1
  453. package/assets/js/highcharts/esm/modules/price-indicator.js +13 -1
  454. package/assets/js/highcharts/esm/modules/price-indicator.src.js +1 -1
  455. package/assets/js/highcharts/esm/modules/pyramid3d.js +14 -1
  456. package/assets/js/highcharts/esm/modules/pyramid3d.src.js +1 -1
  457. package/assets/js/highcharts/esm/modules/renko.js +12 -1
  458. package/assets/js/highcharts/esm/modules/renko.src.js +1 -1
  459. package/assets/js/highcharts/esm/modules/sankey.js +11 -1
  460. package/assets/js/highcharts/esm/modules/sankey.src.js +1 -1
  461. package/assets/js/highcharts/esm/modules/series-label.js +9 -1
  462. package/assets/js/highcharts/esm/modules/series-label.src.js +1 -1
  463. package/assets/js/highcharts/esm/modules/series-on-point.js +12 -1
  464. package/assets/js/highcharts/esm/modules/series-on-point.src.js +1 -1
  465. package/assets/js/highcharts/esm/modules/solid-gauge.js +12 -1
  466. package/assets/js/highcharts/esm/modules/solid-gauge.src.js +8 -3
  467. package/assets/js/highcharts/esm/modules/sonification.js +12 -1
  468. package/assets/js/highcharts/esm/modules/sonification.src.js +42 -9
  469. package/assets/js/highcharts/esm/modules/static-scale.js +11 -1
  470. package/assets/js/highcharts/esm/modules/static-scale.src.js +1 -1
  471. package/assets/js/highcharts/esm/modules/stock-tools.js +13 -1
  472. package/assets/js/highcharts/esm/modules/stock-tools.src.js +37 -116
  473. package/assets/js/highcharts/esm/modules/stock.js +11 -1
  474. package/assets/js/highcharts/esm/modules/stock.src.js +32 -24
  475. package/assets/js/highcharts/esm/modules/streamgraph.js +11 -1
  476. package/assets/js/highcharts/esm/modules/streamgraph.src.js +1 -1
  477. package/assets/js/highcharts/esm/modules/sunburst.js +10 -1
  478. package/assets/js/highcharts/esm/modules/sunburst.src.js +1 -1
  479. package/assets/js/highcharts/esm/modules/textpath.js +9 -1
  480. package/assets/js/highcharts/esm/modules/textpath.src.js +1 -1
  481. package/assets/js/highcharts/esm/modules/tiledwebmap.js +10 -2
  482. package/assets/js/highcharts/esm/modules/tiledwebmap.src.js +1 -1
  483. package/assets/js/highcharts/esm/modules/tilemap.js +12 -1
  484. package/assets/js/highcharts/esm/modules/tilemap.src.js +1 -1
  485. package/assets/js/highcharts/esm/modules/timeline.js +12 -1
  486. package/assets/js/highcharts/esm/modules/timeline.src.js +1 -1
  487. package/assets/js/highcharts/esm/modules/treegraph.js +11 -1
  488. package/assets/js/highcharts/esm/modules/treegraph.src.js +4 -2
  489. package/assets/js/highcharts/esm/modules/treegrid.js +11 -1
  490. package/assets/js/highcharts/esm/modules/treegrid.src.js +1 -1
  491. package/assets/js/highcharts/esm/modules/treemap.js +10 -1
  492. package/assets/js/highcharts/esm/modules/treemap.src.js +1 -1
  493. package/assets/js/highcharts/esm/modules/variable-pie.js +11 -1
  494. package/assets/js/highcharts/esm/modules/variable-pie.src.js +1 -1
  495. package/assets/js/highcharts/esm/modules/variwide.js +11 -1
  496. package/assets/js/highcharts/esm/modules/variwide.src.js +9 -2
  497. package/assets/js/highcharts/esm/modules/vector.js +11 -1
  498. package/assets/js/highcharts/esm/modules/vector.src.js +1 -1
  499. package/assets/js/highcharts/esm/modules/venn.js +10 -1
  500. package/assets/js/highcharts/esm/modules/venn.src.js +1 -1
  501. package/assets/js/highcharts/esm/modules/windbarb.js +11 -1
  502. package/assets/js/highcharts/esm/modules/windbarb.src.js +1 -1
  503. package/assets/js/highcharts/esm/modules/wordcloud.js +10 -1
  504. package/assets/js/highcharts/esm/modules/wordcloud.src.js +88 -11
  505. package/assets/js/highcharts/esm/modules/xrange.js +11 -1
  506. package/assets/js/highcharts/esm/modules/xrange.src.js +1 -1
  507. package/assets/js/highcharts/esm/standalone-navigator.js +9 -2
  508. package/assets/js/highcharts/esm/standalone-navigator.src.js +146 -90
  509. package/assets/js/highcharts/esm/themes/adaptive.js +130 -0
  510. package/assets/js/highcharts/esm/themes/adaptive.src.js +1069 -0
  511. package/assets/js/highcharts/esm/themes/avocado.js +9 -1
  512. package/assets/js/highcharts/esm/themes/avocado.src.js +1 -1
  513. package/assets/js/highcharts/esm/themes/brand-dark.js +9 -1
  514. package/assets/js/highcharts/esm/themes/brand-dark.src.js +1 -1
  515. package/assets/js/highcharts/esm/themes/brand-light.js +9 -1
  516. package/assets/js/highcharts/esm/themes/brand-light.src.js +1 -1
  517. package/assets/js/highcharts/esm/themes/dark-blue.js +9 -1
  518. package/assets/js/highcharts/esm/themes/dark-blue.src.js +1 -1
  519. package/assets/js/highcharts/esm/themes/dark-green.js +9 -1
  520. package/assets/js/highcharts/esm/themes/dark-green.src.js +1 -1
  521. package/assets/js/highcharts/esm/themes/dark-unica.js +9 -1
  522. package/assets/js/highcharts/esm/themes/dark-unica.src.js +1 -1
  523. package/assets/js/highcharts/esm/themes/gray.js +9 -1
  524. package/assets/js/highcharts/esm/themes/gray.src.js +1 -1
  525. package/assets/js/highcharts/esm/themes/grid-light.js +9 -1
  526. package/assets/js/highcharts/esm/themes/grid-light.src.js +1 -1
  527. package/assets/js/highcharts/esm/themes/grid.js +9 -1
  528. package/assets/js/highcharts/esm/themes/grid.src.js +1 -1
  529. package/assets/js/highcharts/esm/themes/high-contrast-dark.js +9 -1
  530. package/assets/js/highcharts/esm/themes/high-contrast-dark.src.js +1 -1
  531. package/assets/js/highcharts/esm/themes/high-contrast-light.js +9 -1
  532. package/assets/js/highcharts/esm/themes/high-contrast-light.src.js +1 -1
  533. package/assets/js/highcharts/esm/themes/sand-signika.js +9 -1
  534. package/assets/js/highcharts/esm/themes/sand-signika.src.js +1 -1
  535. package/assets/js/highcharts/esm/themes/skies.js +9 -1
  536. package/assets/js/highcharts/esm/themes/skies.src.js +1 -1
  537. package/assets/js/highcharts/esm/themes/sunset.js +9 -1
  538. package/assets/js/highcharts/esm/themes/sunset.src.js +1 -1
  539. package/assets/js/highcharts/highcharts-3d.js +11 -1
  540. package/assets/js/highcharts/highcharts-3d.src.js +3 -1
  541. package/assets/js/highcharts/highcharts-gantt.js +16 -2
  542. package/assets/js/highcharts/highcharts-gantt.src.js +173 -107
  543. package/assets/js/highcharts/highcharts-more.js +9 -1
  544. package/assets/js/highcharts/highcharts-more.src.js +44 -29
  545. package/assets/js/highcharts/highcharts.js +9 -2
  546. package/assets/js/highcharts/highcharts.src.js +138 -80
  547. package/assets/js/highcharts/highmaps.js +16 -2
  548. package/assets/js/highcharts/highmaps.src.js +145 -88
  549. package/assets/js/highcharts/highstock.js +16 -2
  550. package/assets/js/highcharts/highstock.src.js +172 -106
  551. package/assets/js/highcharts/i18n/fr-FR.js +13 -1
  552. package/assets/js/highcharts/i18n/fr-FR.src.js +8 -8
  553. package/assets/js/highcharts/i18n/nb-NO.js +13 -1
  554. package/assets/js/highcharts/i18n/nb-NO.src.js +8 -8
  555. package/assets/js/highcharts/i18n/zh-CN.js +13 -1
  556. package/assets/js/highcharts/i18n/zh-CN.src.js +8 -8
  557. package/assets/js/highcharts/indicators/acceleration-bands.js +12 -1
  558. package/assets/js/highcharts/indicators/acceleration-bands.src.js +1 -1
  559. package/assets/js/highcharts/indicators/accumulation-distribution.js +12 -1
  560. package/assets/js/highcharts/indicators/accumulation-distribution.src.js +1 -1
  561. package/assets/js/highcharts/indicators/ao.js +12 -1
  562. package/assets/js/highcharts/indicators/ao.src.js +1 -1
  563. package/assets/js/highcharts/indicators/apo.js +12 -1
  564. package/assets/js/highcharts/indicators/apo.src.js +1 -1
  565. package/assets/js/highcharts/indicators/aroon-oscillator.js +12 -1
  566. package/assets/js/highcharts/indicators/aroon-oscillator.src.js +1 -1
  567. package/assets/js/highcharts/indicators/aroon.js +12 -1
  568. package/assets/js/highcharts/indicators/aroon.src.js +1 -1
  569. package/assets/js/highcharts/indicators/atr.js +12 -1
  570. package/assets/js/highcharts/indicators/atr.src.js +1 -1
  571. package/assets/js/highcharts/indicators/bollinger-bands.js +12 -1
  572. package/assets/js/highcharts/indicators/bollinger-bands.src.js +1 -1
  573. package/assets/js/highcharts/indicators/cci.js +12 -1
  574. package/assets/js/highcharts/indicators/cci.src.js +1 -1
  575. package/assets/js/highcharts/indicators/chaikin.js +12 -1
  576. package/assets/js/highcharts/indicators/chaikin.src.js +1 -1
  577. package/assets/js/highcharts/indicators/cmf.js +11 -1
  578. package/assets/js/highcharts/indicators/cmf.src.js +1 -1
  579. package/assets/js/highcharts/indicators/cmo.js +12 -1
  580. package/assets/js/highcharts/indicators/cmo.src.js +1 -1
  581. package/assets/js/highcharts/indicators/dema.js +12 -1
  582. package/assets/js/highcharts/indicators/dema.src.js +1 -1
  583. package/assets/js/highcharts/indicators/disparity-index.js +12 -1
  584. package/assets/js/highcharts/indicators/disparity-index.src.js +1 -1
  585. package/assets/js/highcharts/indicators/dmi.js +12 -1
  586. package/assets/js/highcharts/indicators/dmi.src.js +1 -1
  587. package/assets/js/highcharts/indicators/dpo.js +12 -1
  588. package/assets/js/highcharts/indicators/dpo.src.js +1 -1
  589. package/assets/js/highcharts/indicators/ema.src.js +3 -3
  590. package/assets/js/highcharts/indicators/ichimoku-kinko-hyo.js +12 -1
  591. package/assets/js/highcharts/indicators/ichimoku-kinko-hyo.src.js +1 -1
  592. package/assets/js/highcharts/indicators/indicators-all.js +12 -1
  593. package/assets/js/highcharts/indicators/indicators-all.src.js +1 -1
  594. package/assets/js/highcharts/indicators/indicators.js +12 -1
  595. package/assets/js/highcharts/indicators/indicators.src.js +1 -1
  596. package/assets/js/highcharts/indicators/keltner-channels.js +12 -1
  597. package/assets/js/highcharts/indicators/keltner-channels.src.js +1 -1
  598. package/assets/js/highcharts/indicators/klinger.js +12 -1
  599. package/assets/js/highcharts/indicators/klinger.src.js +1 -1
  600. package/assets/js/highcharts/indicators/macd.js +12 -1
  601. package/assets/js/highcharts/indicators/macd.src.js +1 -1
  602. package/assets/js/highcharts/indicators/mfi.js +12 -1
  603. package/assets/js/highcharts/indicators/mfi.src.js +1 -1
  604. package/assets/js/highcharts/indicators/momentum.js +12 -1
  605. package/assets/js/highcharts/indicators/momentum.src.js +1 -1
  606. package/assets/js/highcharts/indicators/natr.js +12 -1
  607. package/assets/js/highcharts/indicators/natr.src.js +1 -1
  608. package/assets/js/highcharts/indicators/obv.js +12 -1
  609. package/assets/js/highcharts/indicators/obv.src.js +1 -1
  610. package/assets/js/highcharts/indicators/pivot-points.js +12 -1
  611. package/assets/js/highcharts/indicators/pivot-points.src.js +1 -1
  612. package/assets/js/highcharts/indicators/ppo.js +12 -1
  613. package/assets/js/highcharts/indicators/ppo.src.js +1 -1
  614. package/assets/js/highcharts/indicators/price-channel.js +12 -1
  615. package/assets/js/highcharts/indicators/price-channel.src.js +1 -1
  616. package/assets/js/highcharts/indicators/price-envelopes.js +12 -1
  617. package/assets/js/highcharts/indicators/price-envelopes.src.js +1 -1
  618. package/assets/js/highcharts/indicators/psar.js +12 -1
  619. package/assets/js/highcharts/indicators/psar.src.js +1 -1
  620. package/assets/js/highcharts/indicators/regressions.js +12 -1
  621. package/assets/js/highcharts/indicators/regressions.src.js +1 -1
  622. package/assets/js/highcharts/indicators/roc.js +12 -1
  623. package/assets/js/highcharts/indicators/roc.src.js +1 -1
  624. package/assets/js/highcharts/indicators/rsi.js +12 -1
  625. package/assets/js/highcharts/indicators/rsi.src.js +1 -1
  626. package/assets/js/highcharts/indicators/slow-stochastic.js +12 -1
  627. package/assets/js/highcharts/indicators/slow-stochastic.src.js +1 -1
  628. package/assets/js/highcharts/indicators/stochastic.js +12 -1
  629. package/assets/js/highcharts/indicators/stochastic.src.js +1 -1
  630. package/assets/js/highcharts/indicators/supertrend.js +12 -1
  631. package/assets/js/highcharts/indicators/supertrend.src.js +1 -1
  632. package/assets/js/highcharts/indicators/tema.js +12 -1
  633. package/assets/js/highcharts/indicators/tema.src.js +1 -1
  634. package/assets/js/highcharts/indicators/trendline.js +12 -1
  635. package/assets/js/highcharts/indicators/trendline.src.js +1 -1
  636. package/assets/js/highcharts/indicators/trix.js +12 -1
  637. package/assets/js/highcharts/indicators/trix.src.js +1 -1
  638. package/assets/js/highcharts/indicators/volume-by-price.js +12 -1
  639. package/assets/js/highcharts/indicators/volume-by-price.src.js +1 -1
  640. package/assets/js/highcharts/indicators/vwap.js +12 -1
  641. package/assets/js/highcharts/indicators/vwap.src.js +1 -1
  642. package/assets/js/highcharts/indicators/williams-r.js +12 -1
  643. package/assets/js/highcharts/indicators/williams-r.src.js +1 -1
  644. package/assets/js/highcharts/indicators/wma.js +12 -1
  645. package/assets/js/highcharts/indicators/wma.src.js +1 -1
  646. package/assets/js/highcharts/indicators/zigzag.js +12 -1
  647. package/assets/js/highcharts/indicators/zigzag.src.js +1 -1
  648. package/assets/js/highcharts/modules/accessibility.js +12 -1
  649. package/assets/js/highcharts/modules/accessibility.src.js +46 -43
  650. package/assets/js/highcharts/modules/annotations-advanced.js +21 -1
  651. package/assets/js/highcharts/modules/annotations-advanced.src.js +879 -788
  652. package/assets/js/highcharts/modules/annotations.js +11 -1
  653. package/assets/js/highcharts/modules/annotations.src.js +89 -40
  654. package/assets/js/highcharts/modules/arc-diagram.js +11 -1
  655. package/assets/js/highcharts/modules/arc-diagram.src.js +1 -1
  656. package/assets/js/highcharts/modules/arrow-symbols.js +11 -1
  657. package/assets/js/highcharts/modules/arrow-symbols.src.js +1 -1
  658. package/assets/js/highcharts/modules/boost-canvas.js +12 -1
  659. package/assets/js/highcharts/modules/boost-canvas.src.js +23 -4
  660. package/assets/js/highcharts/modules/boost.js +13 -1
  661. package/assets/js/highcharts/modules/boost.src.js +23 -4
  662. package/assets/js/highcharts/modules/broken-axis.js +9 -1
  663. package/assets/js/highcharts/modules/broken-axis.src.js +1 -1
  664. package/assets/js/highcharts/modules/bullet.js +11 -1
  665. package/assets/js/highcharts/modules/bullet.src.js +1 -1
  666. package/assets/js/highcharts/modules/coloraxis.js +11 -1
  667. package/assets/js/highcharts/modules/coloraxis.src.js +1 -1
  668. package/assets/js/highcharts/modules/current-date-indicator.js +11 -1
  669. package/assets/js/highcharts/modules/current-date-indicator.src.js +1 -1
  670. package/assets/js/highcharts/modules/cylinder.js +12 -1
  671. package/assets/js/highcharts/modules/cylinder.src.js +1 -1
  672. package/assets/js/highcharts/modules/data-tools.js +11 -1
  673. package/assets/js/highcharts/modules/data-tools.src.js +225 -69
  674. package/assets/js/highcharts/modules/data.js +11 -1
  675. package/assets/js/highcharts/modules/data.src.js +46 -39
  676. package/assets/js/highcharts/modules/datagrouping.js +11 -1
  677. package/assets/js/highcharts/modules/datagrouping.src.js +1 -1
  678. package/assets/js/highcharts/modules/debugger.js +11 -1
  679. package/assets/js/highcharts/modules/debugger.src.js +1 -1
  680. package/assets/js/highcharts/modules/dependency-wheel.js +12 -1
  681. package/assets/js/highcharts/modules/dependency-wheel.src.js +1 -1
  682. package/assets/js/highcharts/modules/dotplot.js +11 -1
  683. package/assets/js/highcharts/modules/dotplot.src.js +1 -1
  684. package/assets/js/highcharts/modules/drag-panes.js +13 -1
  685. package/assets/js/highcharts/modules/drag-panes.src.js +1 -1
  686. package/assets/js/highcharts/modules/draggable-points.js +9 -1
  687. package/assets/js/highcharts/modules/draggable-points.src.js +1 -1
  688. package/assets/js/highcharts/modules/drilldown.js +13 -1
  689. package/assets/js/highcharts/modules/drilldown.src.js +3 -1
  690. package/assets/js/highcharts/modules/dumbbell.js +9 -1
  691. package/assets/js/highcharts/modules/dumbbell.src.js +1 -1
  692. package/assets/js/highcharts/modules/export-data.js +12 -1
  693. package/assets/js/highcharts/modules/export-data.src.js +996 -803
  694. package/assets/js/highcharts/modules/exporting.js +11 -1
  695. package/assets/js/highcharts/modules/exporting.src.js +1372 -636
  696. package/assets/js/highcharts/modules/flowmap.js +9 -1
  697. package/assets/js/highcharts/modules/flowmap.src.js +1 -1
  698. package/assets/js/highcharts/modules/full-screen.js +12 -1
  699. package/assets/js/highcharts/modules/full-screen.src.js +3 -3
  700. package/assets/js/highcharts/modules/funnel.js +11 -1
  701. package/assets/js/highcharts/modules/funnel.src.js +1 -1
  702. package/assets/js/highcharts/modules/funnel3d.js +13 -1
  703. package/assets/js/highcharts/modules/funnel3d.src.js +1 -1
  704. package/assets/js/highcharts/modules/gantt.js +31 -1
  705. package/assets/js/highcharts/modules/gantt.src.js +36 -28
  706. package/assets/js/highcharts/modules/geoheatmap.js +9 -1
  707. package/assets/js/highcharts/modules/geoheatmap.src.js +1 -1
  708. package/assets/js/highcharts/modules/grid-axis.js +11 -1
  709. package/assets/js/highcharts/modules/grid-axis.src.js +1 -1
  710. package/assets/js/highcharts/modules/heatmap.js +19 -1
  711. package/assets/js/highcharts/modules/heatmap.src.js +3 -4
  712. package/assets/js/highcharts/modules/heikinashi.js +12 -1
  713. package/assets/js/highcharts/modules/heikinashi.src.js +1 -1
  714. package/assets/js/highcharts/modules/histogram-bellcurve.js +10 -1
  715. package/assets/js/highcharts/modules/histogram-bellcurve.src.js +1 -1
  716. package/assets/js/highcharts/modules/hollowcandlestick.js +12 -1
  717. package/assets/js/highcharts/modules/hollowcandlestick.src.js +1 -1
  718. package/assets/js/highcharts/modules/item-series.js +11 -1
  719. package/assets/js/highcharts/modules/item-series.src.js +3 -5
  720. package/assets/js/highcharts/modules/lollipop.js +9 -1
  721. package/assets/js/highcharts/modules/lollipop.src.js +1 -1
  722. package/assets/js/highcharts/modules/map.js +21 -1
  723. package/assets/js/highcharts/modules/map.src.js +6 -7
  724. package/assets/js/highcharts/modules/marker-clusters.js +11 -1
  725. package/assets/js/highcharts/modules/marker-clusters.src.js +1 -1
  726. package/assets/js/highcharts/modules/mouse-wheel-zoom.js +11 -1
  727. package/assets/js/highcharts/modules/mouse-wheel-zoom.src.js +1 -1
  728. package/assets/js/highcharts/modules/navigator.js +11 -1
  729. package/assets/js/highcharts/modules/navigator.src.js +10 -12
  730. package/assets/js/highcharts/modules/networkgraph.js +11 -1
  731. package/assets/js/highcharts/modules/networkgraph.src.js +7 -2
  732. package/assets/js/highcharts/modules/no-data-to-display.js +12 -1
  733. package/assets/js/highcharts/modules/no-data-to-display.src.js +1 -1
  734. package/assets/js/highcharts/modules/non-cartesian-zoom.js +11 -0
  735. package/assets/js/highcharts/modules/non-cartesian-zoom.src.js +427 -0
  736. package/assets/js/highcharts/modules/offline-exporting.js +12 -1
  737. package/assets/js/highcharts/modules/offline-exporting.src.js +353 -3380
  738. package/assets/js/highcharts/modules/organization.js +11 -1
  739. package/assets/js/highcharts/modules/organization.src.js +1 -1
  740. package/assets/js/highcharts/modules/parallel-coordinates.js +11 -1
  741. package/assets/js/highcharts/modules/parallel-coordinates.src.js +1 -1
  742. package/assets/js/highcharts/modules/pareto.js +11 -1
  743. package/assets/js/highcharts/modules/pareto.src.js +1 -1
  744. package/assets/js/highcharts/modules/pathfinder.js +11 -1
  745. package/assets/js/highcharts/modules/pathfinder.src.js +1 -1
  746. package/assets/js/highcharts/modules/pattern-fill.js +12 -1
  747. package/assets/js/highcharts/modules/pattern-fill.src.js +1 -1
  748. package/assets/js/highcharts/modules/pictorial.js +11 -1
  749. package/assets/js/highcharts/modules/pictorial.src.js +1 -1
  750. package/assets/js/highcharts/modules/pointandfigure.js +12 -1
  751. package/assets/js/highcharts/modules/pointandfigure.src.js +1 -1
  752. package/assets/js/highcharts/modules/price-indicator.js +13 -1
  753. package/assets/js/highcharts/modules/price-indicator.src.js +1 -1
  754. package/assets/js/highcharts/modules/pyramid3d.js +14 -1
  755. package/assets/js/highcharts/modules/pyramid3d.src.js +1 -1
  756. package/assets/js/highcharts/modules/renko.js +12 -1
  757. package/assets/js/highcharts/modules/renko.src.js +1 -1
  758. package/assets/js/highcharts/modules/sankey.js +11 -1
  759. package/assets/js/highcharts/modules/sankey.src.js +1 -1
  760. package/assets/js/highcharts/modules/series-label.js +9 -1
  761. package/assets/js/highcharts/modules/series-label.src.js +1 -1
  762. package/assets/js/highcharts/modules/series-on-point.js +12 -1
  763. package/assets/js/highcharts/modules/series-on-point.src.js +1 -1
  764. package/assets/js/highcharts/modules/solid-gauge.js +12 -1
  765. package/assets/js/highcharts/modules/solid-gauge.src.js +8 -3
  766. package/assets/js/highcharts/modules/sonification.js +12 -1
  767. package/assets/js/highcharts/modules/sonification.src.js +42 -9
  768. package/assets/js/highcharts/modules/static-scale.js +11 -1
  769. package/assets/js/highcharts/modules/static-scale.src.js +1 -1
  770. package/assets/js/highcharts/modules/stock-tools.js +13 -1
  771. package/assets/js/highcharts/modules/stock-tools.src.js +37 -116
  772. package/assets/js/highcharts/modules/stock.js +29 -1
  773. package/assets/js/highcharts/modules/stock.src.js +35 -27
  774. package/assets/js/highcharts/modules/streamgraph.js +11 -1
  775. package/assets/js/highcharts/modules/streamgraph.src.js +1 -1
  776. package/assets/js/highcharts/modules/sunburst.js +10 -1
  777. package/assets/js/highcharts/modules/sunburst.src.js +1 -1
  778. package/assets/js/highcharts/modules/textpath.js +9 -1
  779. package/assets/js/highcharts/modules/textpath.src.js +1 -1
  780. package/assets/js/highcharts/modules/tiledwebmap.js +10 -2
  781. package/assets/js/highcharts/modules/tiledwebmap.src.js +1 -1
  782. package/assets/js/highcharts/modules/tilemap.js +12 -1
  783. package/assets/js/highcharts/modules/tilemap.src.js +1 -1
  784. package/assets/js/highcharts/modules/timeline.js +12 -1
  785. package/assets/js/highcharts/modules/timeline.src.js +1 -1
  786. package/assets/js/highcharts/modules/treegraph.js +11 -1
  787. package/assets/js/highcharts/modules/treegraph.src.js +4 -2
  788. package/assets/js/highcharts/modules/treegrid.js +11 -1
  789. package/assets/js/highcharts/modules/treegrid.src.js +1 -1
  790. package/assets/js/highcharts/modules/treemap.js +10 -1
  791. package/assets/js/highcharts/modules/treemap.src.js +1 -1
  792. package/assets/js/highcharts/modules/variable-pie.js +11 -1
  793. package/assets/js/highcharts/modules/variable-pie.src.js +1 -1
  794. package/assets/js/highcharts/modules/variwide.js +11 -1
  795. package/assets/js/highcharts/modules/variwide.src.js +9 -2
  796. package/assets/js/highcharts/modules/vector.js +11 -1
  797. package/assets/js/highcharts/modules/vector.src.js +1 -1
  798. package/assets/js/highcharts/modules/venn.js +10 -1
  799. package/assets/js/highcharts/modules/venn.src.js +1 -1
  800. package/assets/js/highcharts/modules/windbarb.js +11 -1
  801. package/assets/js/highcharts/modules/windbarb.src.js +1 -1
  802. package/assets/js/highcharts/modules/wordcloud.js +10 -1
  803. package/assets/js/highcharts/modules/wordcloud.src.js +88 -11
  804. package/assets/js/highcharts/modules/xrange.js +11 -1
  805. package/assets/js/highcharts/modules/xrange.src.js +1 -1
  806. package/assets/js/highcharts/standalone-navigator.js +9 -2
  807. package/assets/js/highcharts/standalone-navigator.src.js +146 -90
  808. package/assets/js/highcharts/themes/adaptive.js +130 -0
  809. package/assets/js/highcharts/themes/adaptive.src.js +1122 -0
  810. package/assets/js/highcharts/themes/avocado.js +9 -1
  811. package/assets/js/highcharts/themes/avocado.src.js +1 -1
  812. package/assets/js/highcharts/themes/brand-dark.js +9 -1
  813. package/assets/js/highcharts/themes/brand-dark.src.js +1 -1
  814. package/assets/js/highcharts/themes/brand-light.js +9 -1
  815. package/assets/js/highcharts/themes/brand-light.src.js +1 -1
  816. package/assets/js/highcharts/themes/dark-blue.js +9 -1
  817. package/assets/js/highcharts/themes/dark-blue.src.js +1 -1
  818. package/assets/js/highcharts/themes/dark-green.js +9 -1
  819. package/assets/js/highcharts/themes/dark-green.src.js +1 -1
  820. package/assets/js/highcharts/themes/dark-unica.js +9 -1
  821. package/assets/js/highcharts/themes/dark-unica.src.js +1 -1
  822. package/assets/js/highcharts/themes/gray.js +9 -1
  823. package/assets/js/highcharts/themes/gray.src.js +1 -1
  824. package/assets/js/highcharts/themes/grid-light.js +9 -1
  825. package/assets/js/highcharts/themes/grid-light.src.js +1 -1
  826. package/assets/js/highcharts/themes/grid.js +9 -1
  827. package/assets/js/highcharts/themes/grid.src.js +1 -1
  828. package/assets/js/highcharts/themes/high-contrast-dark.js +9 -1
  829. package/assets/js/highcharts/themes/high-contrast-dark.src.js +1 -1
  830. package/assets/js/highcharts/themes/high-contrast-light.js +9 -1
  831. package/assets/js/highcharts/themes/high-contrast-light.src.js +1 -1
  832. package/assets/js/highcharts/themes/sand-signika.js +9 -1
  833. package/assets/js/highcharts/themes/sand-signika.src.js +1 -1
  834. package/assets/js/highcharts/themes/skies.js +9 -1
  835. package/assets/js/highcharts/themes/skies.src.js +1 -1
  836. package/assets/js/highcharts/themes/sunset.js +9 -1
  837. package/assets/js/highcharts/themes/sunset.src.js +1 -1
  838. package/package.json +1 -1
@@ -14,69 +14,267 @@ import AST from '../../Core/Renderer/HTML/AST.js';
14
14
  import Chart from '../../Core/Chart/Chart.js';
15
15
  import ChartNavigationComposition from '../../Core/Chart/ChartNavigationComposition.js';
16
16
  import D from '../../Core/Defaults.js';
17
- const { defaultOptions } = D;
17
+ const { defaultOptions, setOptions } = D;
18
+ import DownloadURL from '../DownloadURL.js';
19
+ const { downloadURL, getScript } = DownloadURL;
18
20
  import ExportingDefaults from './ExportingDefaults.js';
19
21
  import ExportingSymbols from './ExportingSymbols.js';
20
22
  import Fullscreen from './Fullscreen.js';
21
23
  import G from '../../Core/Globals.js';
22
- const { doc, SVG_NS, win } = G;
24
+ const { composed, doc, isFirefox, isMS, isSafari, SVG_NS, win } = G;
23
25
  import HU from '../../Core/HttpUtilities.js';
24
26
  import U from '../../Core/Utilities.js';
25
- const { addEvent, css, createElement, discardElement, extend, find, fireEvent, isObject, merge, objectEach, pick, removeEvent, splat, uniqueKey } = U;
27
+ const { addEvent, clearTimeout, createElement, css, discardElement, error, extend, find, fireEvent, isObject, merge, objectEach, pick, pushUnique, removeEvent, splat, uniqueKey } = U;
28
+ AST.allowedAttributes.push('data-z-index', 'fill-opacity', 'filter', 'preserveAspectRatio', 'rx', 'ry', 'stroke-dasharray', 'stroke-linejoin', 'stroke-opacity', 'text-anchor', 'transform', 'transform-origin', 'version', 'viewBox', 'visibility', 'xmlns', 'xmlns:xlink');
29
+ AST.allowedTags.push('desc', 'clippath', 'fedropshadow', 'femorphology', 'g', 'image');
26
30
  /* *
27
31
  *
28
- * Composition
32
+ * Constants
29
33
  *
30
34
  * */
31
- var Exporting;
32
- (function (Exporting) {
35
+ export const domurl = win.URL || win.webkitURL || win;
36
+ /* *
37
+ *
38
+ * Class
39
+ *
40
+ * */
41
+ /**
42
+ * The Exporting class provides methods for exporting charts to images. If the
43
+ * exporting module is loaded, this class is instantiated on the chart and
44
+ * available through the `chart.exporting` property. Read more about the
45
+ * [exporting module](https://www.highcharts.com/docs/export-module-overview).
46
+ *
47
+ * @class
48
+ * @name Highcharts.Exporting
49
+ *
50
+ * @param {Highcharts.Chart} chart
51
+ * The chart instance.
52
+ *
53
+ */
54
+ class Exporting {
33
55
  /* *
34
56
  *
35
- * Declarations
57
+ * Constructor
36
58
  *
37
59
  * */
60
+ constructor(chart, options) {
61
+ this.options = {};
62
+ this.chart = chart;
63
+ this.options = options;
64
+ this.btnCount = 0;
65
+ this.buttonOffset = 0;
66
+ this.divElements = [];
67
+ this.svgElements = [];
68
+ }
38
69
  /* *
39
70
  *
40
- * Constants
71
+ * Static Functions
41
72
  *
42
73
  * */
43
- // These CSS properties are not inlined. Remember camelCase.
44
- const inlineDenylist = [
45
- /-/, // In Firefox, both hyphened and camelCased names are listed
46
- /^(clipPath|cssText|d|height|width)$/, // Full words
47
- /^font$/, // More specific props are set
48
- /[lL]ogical(Width|Height)$/,
49
- /^parentRule$/,
50
- /^(cssRules|ownerRules)$/, // #19516 read-only properties
51
- /perspective/,
52
- /TapHighlightColor/,
53
- /^transition/,
54
- /^length$/, // #7700
55
- /^\d+$/ // #17538
56
- ];
57
- // These ones are translated to attributes rather than styles
58
- const inlineToAttributes = [
59
- 'fill',
60
- 'stroke',
61
- 'strokeLinecap',
62
- 'strokeLinejoin',
63
- 'strokeWidth',
64
- 'textAnchor',
65
- 'x',
66
- 'y'
67
- ];
68
- Exporting.inlineAllowlist = [];
69
- const unstyledElements = [
70
- 'clipPath',
71
- 'defs',
72
- 'desc'
73
- ];
74
- /* *
74
+ /**
75
+ * Make hyphenated property names out of camelCase.
75
76
  *
76
- * Variables
77
+ * @private
78
+ * @static
79
+ * @function Highcharts.Exporting#hyphenate
77
80
  *
78
- * */
79
- let printingChart;
81
+ * @param {string} property
82
+ * Property name in camelCase.
83
+ *
84
+ * @return {string}
85
+ * Hyphenated property name.
86
+ *
87
+ * @requires modules/exporting
88
+ */
89
+ static hyphenate(property) {
90
+ return property.replace(/[A-Z]/g, function (match) {
91
+ return '-' + match.toLowerCase();
92
+ });
93
+ }
94
+ /**
95
+ * Get data:URL from image URL.
96
+ *
97
+ * @private
98
+ * @static
99
+ * @async
100
+ * @function Highcharts.Exporting#imageToDataURL
101
+ *
102
+ * @param {string} imageURL
103
+ * The address or URL of the image.
104
+ * @param {number} scale
105
+ * The scale of the image.
106
+ * @param {string} imageType
107
+ * The export type of the image.
108
+ *
109
+ * @requires modules/exporting
110
+ */
111
+ static async imageToDataURL(imageURL, scale, imageType) {
112
+ // First, wait for the image to be loaded
113
+ const img = await Exporting.loadImage(imageURL), canvas = doc.createElement('canvas'), ctx = canvas?.getContext('2d');
114
+ if (!ctx) {
115
+ throw new Error('No canvas found!');
116
+ }
117
+ else {
118
+ canvas.height = img.height * scale;
119
+ canvas.width = img.width * scale;
120
+ ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
121
+ // Now we try to get the contents of the canvas
122
+ return canvas.toDataURL(imageType);
123
+ }
124
+ }
125
+ /**
126
+ * Loads an image from the provided URL.
127
+ *
128
+ * @private
129
+ * @static
130
+ * @function Highcharts.Exporting#loadImage
131
+ *
132
+ * @param {string} imageURL
133
+ * The address or URL of the image.
134
+ *
135
+ * @return {Promise<HTMLImageElement>}
136
+ * Returns a Promise that resolves with the loaded HTMLImageElement.
137
+ *
138
+ * @requires modules/exporting
139
+ */
140
+ static loadImage(imageURL) {
141
+ return new Promise((resolve, reject) => {
142
+ // Create an image
143
+ const image = new win.Image();
144
+ // Must be set prior to loading image source
145
+ image.crossOrigin = 'Anonymous';
146
+ // Return the image in case of success
147
+ image.onload = () => {
148
+ // IE bug where image is not always ready despite load event
149
+ setTimeout(() => {
150
+ resolve(image);
151
+ }, Exporting.loadEventDeferDelay);
152
+ };
153
+ // Reject in case of fail
154
+ image.onerror = (error) => {
155
+ reject(error);
156
+ };
157
+ // Provide the image URL
158
+ image.src = imageURL;
159
+ });
160
+ }
161
+ /**
162
+ * Prepares and returns the image export options with default values where
163
+ * necessary.
164
+ *
165
+ * @private
166
+ * @static
167
+ * @function Highcharts.Exporting#prepareImageOptions
168
+ *
169
+ * @param {Highcharts.ExportingOptions} exportingOptions
170
+ * The exporting options.
171
+ *
172
+ * @return {Exporting.ImageOptions}
173
+ * The finalized image export options with ensured values.
174
+ *
175
+ * @requires modules/exporting
176
+ */
177
+ static prepareImageOptions(exportingOptions) {
178
+ const type = exportingOptions?.type || 'image/png', libURL = (exportingOptions?.libURL ||
179
+ defaultOptions.exporting?.libURL);
180
+ return {
181
+ type,
182
+ filename: ((exportingOptions?.filename || 'chart') +
183
+ '.' +
184
+ (type === 'image/svg+xml' ? 'svg' : type.split('/')[1])),
185
+ scale: exportingOptions?.scale || 1,
186
+ // Allow libURL to end with or without fordward slash
187
+ libURL: libURL?.slice(-1) !== '/' ? libURL + '/' : libURL
188
+ };
189
+ }
190
+ /**
191
+ * A collection of fixes on the produced SVG to account for expand
192
+ * properties and browser bugs. Returns a cleaned SVG.
193
+ *
194
+ * @private
195
+ * @static
196
+ * @function Highcharts.Exporting#sanitizeSVG
197
+ *
198
+ * @param {string} svg
199
+ * SVG code to sanitize.
200
+ * @param {Highcharts.Options} options
201
+ * Chart options to apply.
202
+ *
203
+ * @return {string}
204
+ * Sanitized SVG code.
205
+ *
206
+ * @requires modules/exporting
207
+ */
208
+ static sanitizeSVG(svg, options) {
209
+ const split = svg.indexOf('</svg>') + 6, useForeignObject = svg.indexOf('<foreignObject') > -1;
210
+ let html = svg.substr(split);
211
+ // Remove any HTML added to the container after the SVG (#894, #9087)
212
+ svg = svg.substr(0, split);
213
+ if (useForeignObject) {
214
+ // Some tags needs to be closed in xhtml (#13726)
215
+ svg = svg.replace(/(<(?:img|br).*?(?=\>))>/g, '$1 />');
216
+ // Move HTML into a foreignObject
217
+ }
218
+ else if (html && options?.exporting?.allowHTML) {
219
+ html = '<foreignObject x="0" y="0" ' +
220
+ 'width="' + options.chart.width + '" ' +
221
+ 'height="' + options.chart.height + '">' +
222
+ '<body xmlns="http://www.w3.org/1999/xhtml">' +
223
+ // Some tags needs to be closed in xhtml (#13726)
224
+ html.replace(/(<(?:img|br).*?(?=\>))>/g, '$1 />') +
225
+ '</body>' +
226
+ '</foreignObject>';
227
+ svg = svg.replace('</svg>', html + '</svg>');
228
+ }
229
+ svg = svg
230
+ .replace(/zIndex="[^"]+"/g, '')
231
+ .replace(/symbolName="[^"]+"/g, '')
232
+ .replace(/jQuery\d+="[^"]+"/g, '')
233
+ .replace(/url\(("|&quot;)(.*?)("|&quot;)\;?\)/g, 'url($2)')
234
+ .replace(/url\([^#]+#/g, 'url(#')
235
+ .replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
236
+ .replace(/ (NS\d+\:)?href=/g, ' xlink:href=') // #3567
237
+ .replace(/\n+/g, ' ')
238
+ // Replace HTML entities, issue #347
239
+ .replace(/&nbsp;/g, '\u00A0') // No-break space
240
+ .replace(/&shy;/g, '\u00AD'); // Soft hyphen
241
+ return svg;
242
+ }
243
+ /**
244
+ * Get blob URL from SVG code. Falls back to normal data URI.
245
+ *
246
+ * @private
247
+ * @static
248
+ * @function Highcharts.Exporting#svgToDataURL
249
+ *
250
+ * @param {string} svg
251
+ * SVG to get the URL from.
252
+ *
253
+ * @return {string}
254
+ * The data URL.
255
+ *
256
+ * @requires modules/exporting
257
+ */
258
+ static svgToDataURL(svg) {
259
+ // Webkit and not chrome
260
+ const userAgent = win.navigator.userAgent;
261
+ const webKit = (userAgent.indexOf('WebKit') > -1 &&
262
+ userAgent.indexOf('Chrome') < 0);
263
+ try {
264
+ // Safari requires data URI since it doesn't allow navigation to
265
+ // blob URLs. ForeignObjects also don't work well in Blobs in Chrome
266
+ // (#14780).
267
+ if (!webKit && svg.indexOf('<foreignObject') === -1) {
268
+ return domurl.createObjectURL(new win.Blob([svg], {
269
+ type: 'image/svg+xml;charset-utf-16'
270
+ }));
271
+ }
272
+ }
273
+ catch {
274
+ // Ignore
275
+ }
276
+ return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svg);
277
+ }
80
278
  /* *
81
279
  *
82
280
  * Functions
@@ -86,26 +284,21 @@ var Exporting;
86
284
  * Add the export button to the chart, with options.
87
285
  *
88
286
  * @private
89
- * @function Highcharts.Chart#addButton
90
- * @param {Highcharts.NavigationButtonOptions} options
287
+ * @function Highcharts.Exporting#addButton
288
+ *
289
+ * @param {Highcharts.ExportingButtonOptions} options
290
+ * The exporting button options object.
291
+ *
91
292
  * @requires modules/exporting
92
293
  */
93
- function addButton(options) {
94
- const chart = this, renderer = chart.renderer, btnOptions = merge(chart.options.navigation.buttonOptions, options), onclick = btnOptions.onclick, menuItems = btnOptions.menuItems, symbolSize = btnOptions.symbolSize || 12;
294
+ addButton(options) {
295
+ const exporting = this, chart = exporting.chart, renderer = chart.renderer, btnOptions = merge(chart.options.navigation?.buttonOptions, options), onclick = btnOptions.onclick, menuItems = btnOptions.menuItems, symbolSize = btnOptions.symbolSize || 12;
95
296
  let symbol;
96
- if (!chart.btnCount) {
97
- chart.btnCount = 0;
98
- }
99
- // Keeps references to the button elements
100
- if (!chart.exportDivElements) {
101
- chart.exportDivElements = [];
102
- chart.exportSVGElements = [];
103
- }
104
297
  if (btnOptions.enabled === false || !btnOptions.theme) {
105
298
  return;
106
299
  }
107
300
  const theme = chart.styledMode ? {} : btnOptions.theme;
108
- let callback;
301
+ let callback = (() => { });
109
302
  if (onclick) {
110
303
  callback = function (e) {
111
304
  if (e) {
@@ -120,7 +313,7 @@ var Exporting;
120
313
  if (e) {
121
314
  e.stopPropagation();
122
315
  }
123
- chart.contextMenu(button.menuClassName, menuItems, button.translateX || 0, button.translateY || 0, button.width || 0, button.height || 0, button);
316
+ exporting.contextMenu(button.menuClassName, menuItems, button.translateX || 0, button.translateY || 0, button.width || 0, button.height || 0, button);
124
317
  button.setState(2);
125
318
  };
126
319
  }
@@ -135,18 +328,19 @@ var Exporting;
135
328
  });
136
329
  }
137
330
  const button = renderer
138
- .button(btnOptions.text, 0, 0, callback, theme, void 0, void 0, void 0, void 0, btnOptions.useHTML)
139
- .addClass(options.className)
331
+ .button(btnOptions.text || '', 0, 0, callback, theme, void 0, void 0, void 0, void 0, btnOptions.useHTML)
332
+ .addClass(options.className || '')
140
333
  .attr({
141
- title: pick(chart.options.lang[btnOptions._titleKey || btnOptions.titleKey], '')
334
+ title: pick(chart.options.lang[(btnOptions._titleKey ||
335
+ btnOptions.titleKey)], '')
142
336
  });
143
337
  button.menuClassName = (options.menuClassName ||
144
- 'highcharts-menu-' + chart.btnCount++);
338
+ 'highcharts-menu-' + exporting.btnCount++);
145
339
  if (btnOptions.symbol) {
146
340
  symbol = renderer
147
- .symbol(btnOptions.symbol, Math.round((btnOptions.symbolX || 0) - (symbolSize / 2)), Math.round((btnOptions.symbolY || 0) - (symbolSize / 2)), symbolSize, symbolSize
341
+ .symbol(btnOptions.symbol, Math.round((btnOptions.symbolX || 0) - (symbolSize / 2)), Math.round((btnOptions.symbolY || 0) - (symbolSize / 2)), symbolSize, symbolSize,
148
342
  // If symbol is an image, scale it (#7957)
149
- , {
343
+ {
150
344
  width: symbolSize,
151
345
  height: symbolSize
152
346
  })
@@ -164,73 +358,69 @@ var Exporting;
164
358
  }
165
359
  }
166
360
  button
167
- .add(chart.exportingGroup)
361
+ .add(exporting.group)
168
362
  .align(extend(btnOptions, {
169
363
  width: button.width,
170
- x: pick(btnOptions.x, chart.buttonOffset) // #1654
364
+ x: pick(btnOptions.x, exporting.buttonOffset) // #1654
171
365
  }), true, 'spacingBox');
172
- chart.buttonOffset += (((button.width || 0) + btnOptions.buttonSpacing) *
366
+ exporting.buttonOffset += (((button.width || 0) + (btnOptions.buttonSpacing || 0)) *
173
367
  (btnOptions.align === 'right' ? -1 : 1));
174
- chart.exportSVGElements.push(button, symbol);
368
+ exporting.svgElements.push(button, symbol);
175
369
  }
176
370
  /**
177
371
  * Clean up after printing a chart.
178
372
  *
179
- * @function Highcharts#afterPrint
180
- *
181
373
  * @private
182
- *
183
- * @param {Highcharts.Chart} chart
184
- * Chart that was (or suppose to be) printed
374
+ * @function Highcharts.Exporting#afterPrint
185
375
  *
186
376
  * @emits Highcharts.Chart#event:afterPrint
377
+ *
378
+ * @requires modules/exporting
187
379
  */
188
- function afterPrint() {
189
- const chart = this;
190
- if (!chart.printReverseInfo) {
380
+ afterPrint() {
381
+ const chart = this.chart;
382
+ if (!this.printReverseInfo) {
191
383
  return void 0;
192
384
  }
193
- const { childNodes, origDisplay, resetParams } = chart.printReverseInfo;
385
+ const { childNodes, origDisplay, resetParams } = this.printReverseInfo;
194
386
  // Put the chart back in
195
- chart.moveContainers(chart.renderTo);
387
+ this.moveContainers(chart.renderTo);
196
388
  // Restore all body content
197
389
  [].forEach.call(childNodes, function (node, i) {
198
390
  if (node.nodeType === 1) {
199
391
  node.style.display = (origDisplay[i] || '');
200
392
  }
201
393
  });
202
- chart.isPrinting = false;
394
+ this.isPrinting = false;
203
395
  // Reset printMaxWidth
204
396
  if (resetParams) {
205
397
  chart.setSize.apply(chart, resetParams);
206
398
  }
207
- delete chart.printReverseInfo;
208
- printingChart = void 0;
399
+ delete this.printReverseInfo;
400
+ Exporting.printingChart = void 0;
209
401
  fireEvent(chart, 'afterPrint');
210
402
  }
211
403
  /**
212
404
  * Prepare chart and document before printing a chart.
213
405
  *
214
- * @function Highcharts#beforePrint
215
- *
216
406
  * @private
217
- *
407
+ * @function Highcharts.Exporting#beforePrint
218
408
  *
219
409
  * @emits Highcharts.Chart#event:beforePrint
410
+ *
411
+ * @requires modules/exporting
220
412
  */
221
- function beforePrint() {
222
- const chart = this, body = doc.body, printMaxWidth = chart.options.exporting.printMaxWidth, printReverseInfo = {
413
+ beforePrint() {
414
+ const chart = this.chart, body = doc.body, printMaxWidth = this.options.printMaxWidth, printReverseInfo = {
223
415
  childNodes: body.childNodes,
224
416
  origDisplay: [],
225
417
  resetParams: void 0
226
418
  };
227
- chart.isPrinting = true;
419
+ this.isPrinting = true;
228
420
  chart.pointer?.reset(void 0, 0);
229
421
  fireEvent(chart, 'beforePrint');
230
422
  // Handle printMaxWidth
231
- const handleMaxWidth = printMaxWidth &&
232
- chart.chartWidth > printMaxWidth;
233
- if (handleMaxWidth) {
423
+ if (printMaxWidth && chart.chartWidth > printMaxWidth) {
234
424
  printReverseInfo.resetParams = [
235
425
  chart.options.chart.width,
236
426
  void 0,
@@ -246,131 +436,45 @@ var Exporting;
246
436
  }
247
437
  });
248
438
  // Pull out the chart
249
- chart.moveContainers(body);
439
+ this.moveContainers(body);
250
440
  // Storage details for undo action after printing
251
- chart.printReverseInfo = printReverseInfo;
252
- }
253
- /**
254
- * @private
255
- */
256
- function chartCallback(chart) {
257
- const composition = chart;
258
- composition.renderExporting();
259
- addEvent(chart, 'redraw', composition.renderExporting);
260
- // Destroy the export elements at chart destroy
261
- addEvent(chart, 'destroy', composition.destroyExport);
262
- // Uncomment this to see a button directly below the chart, for quick
263
- // testing of export
264
- /*
265
- let button, viewImage, viewSource;
266
- if (!chart.renderer.forExport) {
267
- viewImage = function () {
268
- let div = doc.createElement('div');
269
- div.innerHTML = chart.getSVGForExport();
270
- chart.renderTo.parentNode.appendChild(div);
271
- };
272
-
273
- viewSource = function () {
274
- let pre = doc.createElement('pre');
275
- pre.innerHTML = chart.getSVGForExport()
276
- .replace(/</g, '\n&lt;')
277
- .replace(/>/g, '&gt;');
278
- chart.renderTo.parentNode.appendChild(pre);
279
- };
280
-
281
- viewImage();
282
-
283
- // View SVG Image
284
- button = doc.createElement('button');
285
- button.innerHTML = 'View SVG Image';
286
- chart.renderTo.parentNode.appendChild(button);
287
- button.onclick = viewImage;
288
-
289
- // View SVG Source
290
- button = doc.createElement('button');
291
- button.innerHTML = 'View SVG Source';
292
- chart.renderTo.parentNode.appendChild(button);
293
- button.onclick = viewSource;
294
- }
295
- //*/
296
- }
297
- /**
298
- * @private
299
- */
300
- function compose(ChartClass, SVGRendererClass) {
301
- ExportingSymbols.compose(SVGRendererClass);
302
- Fullscreen.compose(ChartClass);
303
- const chartProto = ChartClass.prototype;
304
- if (!chartProto.exportChart) {
305
- chartProto.afterPrint = afterPrint;
306
- chartProto.exportChart = exportChart;
307
- chartProto.inlineStyles = inlineStyles;
308
- chartProto.print = print;
309
- chartProto.sanitizeSVG = sanitizeSVG;
310
- chartProto.getChartHTML = getChartHTML;
311
- chartProto.getSVG = getSVG;
312
- chartProto.getSVGForExport = getSVGForExport;
313
- chartProto.getFilename = getFilename;
314
- chartProto.moveContainers = moveContainers;
315
- chartProto.beforePrint = beforePrint;
316
- chartProto.contextMenu = contextMenu;
317
- chartProto.addButton = addButton;
318
- chartProto.destroyExport = destroyExport;
319
- chartProto.renderExporting = renderExporting;
320
- chartProto.resolveCSSVariables = resolveCSSVariables;
321
- chartProto.callbacks.push(chartCallback);
322
- addEvent(ChartClass, 'init', onChartInit);
323
- addEvent(ChartClass, 'layOutTitle', onChartLayOutTitle);
324
- if (G.isSafari) {
325
- win.matchMedia('print').addListener(function (mqlEvent) {
326
- if (!printingChart) {
327
- return void 0;
328
- }
329
- if (mqlEvent.matches) {
330
- printingChart.beforePrint();
331
- }
332
- else {
333
- printingChart.afterPrint();
334
- }
335
- });
336
- }
337
- defaultOptions.exporting = merge(ExportingDefaults.exporting, defaultOptions.exporting);
338
- defaultOptions.lang = merge(ExportingDefaults.lang, defaultOptions.lang);
339
- // Buttons and menus are collected in a separate config option set
340
- // called 'navigation'. This can be extended later to add control
341
- // buttons like zoom and pan right click menus.
342
- defaultOptions.navigation = merge(ExportingDefaults.navigation, defaultOptions.navigation);
343
- }
441
+ this.printReverseInfo = printReverseInfo;
344
442
  }
345
- Exporting.compose = compose;
346
443
  /**
347
444
  * Display a popup menu for choosing the export type.
348
445
  *
349
446
  * @private
350
- * @function Highcharts.Chart#contextMenu
447
+ * @function Highcharts.Exporting#contextMenu
448
+ *
351
449
  * @param {string} className
352
- * An identifier for the menu.
353
- * @param {Array<string|Highcharts.ExportingMenuObject>} items
354
- * A collection with text and onclicks for the items.
450
+ * An identifier for the menu.
451
+ * @param {Array<(string | Highcharts.ExportingMenuObject)>} items
452
+ * A collection with text and onclicks for the items.
355
453
  * @param {number} x
356
- * The x position of the opener button
454
+ * The x position of the opener button.
357
455
  * @param {number} y
358
- * The y position of the opener button
456
+ * The y position of the opener button.
359
457
  * @param {number} width
360
- * The width of the opener button
458
+ * The width of the opener button.
361
459
  * @param {number} height
362
- * The height of the opener button
460
+ * The height of the opener button.
461
+ * @param {SVGElement} button
462
+ * The SVG button element.
463
+ *
464
+ * @emits Highcharts.Chart#event:exportMenuHidden
465
+ * @emits Highcharts.Chart#event:exportMenuShown
466
+ *
363
467
  * @requires modules/exporting
364
468
  */
365
- function contextMenu(className, items, x, y, width, height, button) {
366
- const chart = this, navOptions = chart.options.navigation, chartWidth = chart.chartWidth, chartHeight = chart.chartHeight, cacheName = 'cache-' + className,
469
+ contextMenu(className, items, x, y, width, height, button) {
470
+ const exporting = this, chart = exporting.chart, navOptions = chart.options.navigation, chartWidth = chart.chartWidth, chartHeight = chart.chartHeight, cacheName = 'cache-' + className,
367
471
  // For mouse leave detection
368
472
  menuPadding = Math.max(width, height);
369
473
  let innerMenu, menu = chart[cacheName];
370
474
  // Create the menu only the first time
371
475
  if (!menu) {
372
476
  // Create a HTML element above the SVG
373
- chart.exportContextMenu = chart[cacheName] = menu =
477
+ exporting.contextMenuEl = chart[cacheName] = menu =
374
478
  createElement('div', {
375
479
  className: className
376
480
  }, {
@@ -388,10 +492,10 @@ var Exporting;
388
492
  // Presentational CSS
389
493
  if (!chart.styledMode) {
390
494
  css(innerMenu, extend({
391
- MozBoxShadow: '3px 3px 10px #888',
392
- WebkitBoxShadow: '3px 3px 10px #888',
393
- boxShadow: '3px 3px 10px #888'
394
- }, navOptions.menuStyle));
495
+ MozBoxShadow: '3px 3px 10px #0008',
496
+ WebkitBoxShadow: '3px 3px 10px #0008',
497
+ boxShadow: '3px 3px 10px #0008'
498
+ }, navOptions?.menuStyle || {}));
395
499
  }
396
500
  // Hide on mouse out
397
501
  menu.hideMenu = function () {
@@ -399,18 +503,20 @@ var Exporting;
399
503
  if (button) {
400
504
  button.setState(0);
401
505
  }
402
- chart.openMenu = false;
506
+ if (chart.exporting) {
507
+ chart.exporting.openMenu = false;
508
+ }
403
509
  // #10361, #9998
404
510
  css(chart.renderTo, { overflow: 'hidden' });
405
511
  css(chart.container, { overflow: 'hidden' });
406
- U.clearTimeout(menu.hideTimer);
512
+ clearTimeout(menu.hideTimer);
407
513
  fireEvent(chart, 'exportMenuHidden');
408
514
  };
409
515
  // Hide the menu some time after mouse leave (#1357)
410
- chart.exportEvents.push(addEvent(menu, 'mouseleave', function () {
516
+ exporting.events?.push(addEvent(menu, 'mouseleave', function () {
411
517
  menu.hideTimer = win.setTimeout(menu.hideMenu, 500);
412
518
  }), addEvent(menu, 'mouseenter', function () {
413
- U.clearTimeout(menu.hideTimer);
519
+ clearTimeout(menu.hideTimer);
414
520
  }),
415
521
  // Hide it on clicking or touching outside the menu (#2258,
416
522
  // #2335, #2407)
@@ -419,15 +525,16 @@ var Exporting;
419
525
  menu.hideMenu();
420
526
  }
421
527
  }), addEvent(menu, 'click', function () {
422
- if (chart.openMenu) {
528
+ if (chart.exporting?.openMenu) {
423
529
  menu.hideMenu();
424
530
  }
425
531
  }));
426
532
  // Create the items
427
533
  items.forEach(function (item) {
428
534
  if (typeof item === 'string') {
429
- item = chart.options.exporting
430
- .menuItemDefinitions[item];
535
+ if (exporting.options.menuItemDefinitions?.[item]) {
536
+ item = exporting.options.menuItemDefinitions[item];
537
+ }
431
538
  }
432
539
  if (isObject(item, true)) {
433
540
  let element;
@@ -438,7 +545,7 @@ var Exporting;
438
545
  // When chart initialized with the table, wrong button
439
546
  // text displayed, #14352.
440
547
  if (item.textKey === 'viewData' &&
441
- chart.isDataTableVisible) {
548
+ exporting.isDataTableVisible) {
442
549
  item.textKey = 'hideData';
443
550
  }
444
551
  element = createElement('li', {
@@ -449,44 +556,45 @@ var Exporting;
449
556
  }
450
557
  menu.hideMenu();
451
558
  if (typeof item !== 'string' && item.onclick) {
559
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
452
560
  item.onclick.apply(chart, arguments);
453
561
  }
454
562
  }
455
563
  }, void 0, innerMenu);
456
- AST.setElementHTML(element, item.text ||
457
- chart.options.lang[item.textKey]);
564
+ AST.setElementHTML(element, item.text || chart.options.lang[item.textKey]);
458
565
  if (!chart.styledMode) {
459
566
  element.onmouseover = function () {
460
- css(this, navOptions.menuItemHoverStyle);
567
+ css(this, navOptions?.menuItemHoverStyle || {});
461
568
  };
462
569
  element.onmouseout = function () {
463
- css(this, navOptions.menuItemStyle);
570
+ css(this, navOptions?.menuItemStyle || {});
464
571
  };
465
572
  css(element, extend({
466
573
  cursor: 'pointer'
467
- }, navOptions.menuItemStyle || {}));
574
+ }, navOptions?.menuItemStyle || {}));
468
575
  }
469
576
  }
470
577
  // Keep references to menu divs to be able to destroy them
471
- chart.exportDivElements.push(element);
578
+ exporting.divElements.push(element);
472
579
  }
473
580
  });
474
581
  // Keep references to menu and innerMenu div to be able to destroy
475
582
  // them
476
- chart.exportDivElements.push(innerMenu, menu);
477
- chart.exportMenuWidth = menu.offsetWidth;
478
- chart.exportMenuHeight = menu.offsetHeight;
583
+ exporting.divElements.push(innerMenu, menu);
584
+ exporting.menuHeight = menu.offsetHeight;
585
+ exporting.menuWidth = menu.offsetWidth;
479
586
  }
480
587
  const menuStyle = { display: 'block' };
481
588
  // If outside right, right align it
482
- if (x + (chart.exportMenuWidth || 0) > chartWidth) {
589
+ if (x + (exporting.menuWidth || 0) > chartWidth) {
483
590
  menuStyle.right = (chartWidth - x - width - menuPadding) + 'px';
484
591
  }
485
592
  else {
486
593
  menuStyle.left = (x - menuPadding) + 'px';
487
594
  }
488
595
  // If outside bottom, bottom align it
489
- if (y + height + (chart.exportMenuHeight || 0) > chartHeight &&
596
+ if (y + height + (exporting.menuHeight || 0) >
597
+ chartHeight &&
490
598
  button.alignOptions?.verticalAlign !== 'top') {
491
599
  menuStyle.bottom = (chartHeight - y - menuPadding) + 'px';
492
600
  }
@@ -497,106 +605,272 @@ var Exporting;
497
605
  // #10361, #9998
498
606
  css(chart.renderTo, { overflow: '' });
499
607
  css(chart.container, { overflow: '' });
500
- chart.openMenu = true;
608
+ if (chart.exporting) {
609
+ chart.exporting.openMenu = true;
610
+ }
501
611
  fireEvent(chart, 'exportMenuShown');
502
612
  }
503
613
  /**
504
614
  * Destroy the export buttons.
615
+ *
505
616
  * @private
506
- * @function Highcharts.Chart#destroyExport
617
+ * @function Highcharts.Exporting#destroy
618
+ *
507
619
  * @param {global.Event} [e]
620
+ * Event object.
621
+ *
508
622
  * @requires modules/exporting
509
623
  */
510
- function destroyExport(e) {
511
- const chart = e ? e.target : this, exportSVGElements = chart.exportSVGElements, exportDivElements = chart.exportDivElements, exportEvents = chart.exportEvents;
624
+ destroy(e) {
625
+ const exporting = this, chart = e ? e.target : exporting.chart, { divElements, events, svgElements } = exporting;
512
626
  let cacheName;
513
627
  // Destroy the extra buttons added
514
- if (exportSVGElements) {
515
- exportSVGElements.forEach((elem, i) => {
516
- // Destroy and null the svg elements
517
- if (elem) { // #1822
518
- elem.onclick = elem.ontouchstart = null;
519
- cacheName = 'cache-' + elem.menuClassName;
520
- if (chart[cacheName]) {
521
- delete chart[cacheName];
522
- }
523
- exportSVGElements[i] = elem.destroy();
628
+ svgElements.forEach((elem, i) => {
629
+ // Destroy and null the svg elements
630
+ if (elem) { // #1822
631
+ elem.onclick = elem.ontouchstart = null;
632
+ cacheName = 'cache-' + elem.menuClassName;
633
+ if (chart[cacheName]) {
634
+ delete chart[cacheName];
524
635
  }
525
- });
526
- exportSVGElements.length = 0;
527
- }
636
+ svgElements[i] = elem.destroy();
637
+ }
638
+ });
639
+ svgElements.length = 0;
528
640
  // Destroy the exporting group
529
- if (chart.exportingGroup) {
530
- chart.exportingGroup.destroy();
531
- delete chart.exportingGroup;
641
+ if (exporting.group) {
642
+ exporting.group.destroy();
643
+ delete exporting.group;
532
644
  }
533
645
  // Destroy the divs for the menu
534
- if (exportDivElements) {
535
- exportDivElements.forEach(function (elem, i) {
536
- if (elem) {
537
- // Remove the event handler
538
- U.clearTimeout(elem.hideTimer); // #5427
539
- removeEvent(elem, 'mouseleave');
540
- // Remove inline events
541
- // (chart.exportDivElements as any)[i] =
542
- exportDivElements[i] =
543
- elem.onmouseout =
544
- elem.onmouseover =
545
- elem.ontouchstart =
546
- elem.onclick = null;
547
- // Destroy the div by moving to garbage bin
548
- discardElement(elem);
549
- }
550
- });
551
- exportDivElements.length = 0;
552
- }
553
- if (exportEvents) {
554
- exportEvents.forEach(function (unbind) {
646
+ divElements.forEach(function (elem, i) {
647
+ if (elem) {
648
+ // Remove the event handler
649
+ clearTimeout(elem.hideTimer); // #5427
650
+ removeEvent(elem, 'mouseleave');
651
+ // Remove inline events
652
+ divElements[i] =
653
+ elem.onmouseout =
654
+ elem.onmouseover =
655
+ elem.ontouchstart =
656
+ elem.onclick = null;
657
+ // Destroy the div by moving to garbage bin
658
+ discardElement(elem);
659
+ }
660
+ });
661
+ divElements.length = 0;
662
+ if (events) {
663
+ events.forEach(function (unbind) {
555
664
  unbind();
556
665
  });
557
- exportEvents.length = 0;
666
+ events.length = 0;
558
667
  }
559
668
  }
560
669
  /**
561
- * Exporting module required. Submit an SVG version of the chart to a server
562
- * along with some parameters for conversion.
670
+ * Get data URL to an image of an SVG and call download on its options
671
+ * object:
672
+ *
673
+ * - **filename:** Name of resulting downloaded file without extension.
674
+ * Default is based on the chart title.
675
+ * - **type:** File type of resulting download. Default is `image/png`.
676
+ * - **scale:** Scaling factor of downloaded image compared to source.
677
+ * Default is `2`.
678
+ * - **libURL:** URL pointing to location of dependency scripts to download
679
+ * on demand. Default is the exporting.libURL option of the global
680
+ * Highcharts options pointing to our server.
681
+ *
682
+ * @async
683
+ * @private
684
+ * @function Highcharts.Exporting#downloadSVG
685
+ *
686
+ * @param {string} svg
687
+ * The generated SVG.
688
+ * @param {Highcharts.ExportingOptions} exportingOptions
689
+ * The exporting options.
690
+ *
691
+ * @requires modules/exporting
692
+ */
693
+ // eslint-disable-next-line @typescript-eslint/require-await
694
+ async downloadSVG(svg, exportingOptions) {
695
+ const eventArgs = {
696
+ svg,
697
+ exportingOptions,
698
+ exporting: this
699
+ };
700
+ // Fire a custom event before the export starts
701
+ fireEvent(Exporting.prototype, 'downloadSVG', eventArgs);
702
+ // If the event was prevented, do not proceed with the export
703
+ if (eventArgs.defaultPrevented) {
704
+ return;
705
+ }
706
+ // Get the final image options
707
+ const { type, filename, scale, libURL } = Exporting.prepareImageOptions(exportingOptions);
708
+ let svgURL;
709
+ // Initiate download depending on file type
710
+ if (type === 'application/pdf') {
711
+ // Error in case of offline-exporting module is not loaded
712
+ throw new Error('Offline exporting logic for PDF type is not found.');
713
+ }
714
+ else if (type === 'image/svg+xml') {
715
+ // SVG download. In this case, we want to use Microsoft specific
716
+ // Blob if available
717
+ if (typeof win.MSBlobBuilder !== 'undefined') {
718
+ const blob = new win.MSBlobBuilder();
719
+ blob.append(svg);
720
+ svgURL = blob.getBlob('image/svg+xml');
721
+ }
722
+ else {
723
+ svgURL = Exporting.svgToDataURL(svg);
724
+ }
725
+ // Download the chart
726
+ downloadURL(svgURL, filename);
727
+ }
728
+ else {
729
+ // PNG/JPEG download - create bitmap from SVG
730
+ svgURL = Exporting.svgToDataURL(svg);
731
+ try {
732
+ Exporting.objectURLRevoke = true;
733
+ // First, try to get PNG by rendering on canvas
734
+ const dataURL = await Exporting.imageToDataURL(svgURL, scale, type);
735
+ downloadURL(dataURL, filename);
736
+ }
737
+ catch (error) {
738
+ // No need for the below logic to run in case no canvas is
739
+ // found
740
+ if (error.message === 'No canvas found!') {
741
+ throw error;
742
+ }
743
+ // Or in case of exceeding the input length
744
+ if (svg.length > 100000000 /* RegexLimits.svgLimit */) {
745
+ throw new Error('Input too long');
746
+ }
747
+ // Failed due to tainted canvas
748
+ // Create new and untainted canvas
749
+ const canvas = doc.createElement('canvas'), ctx = canvas.getContext('2d'), matchedImageWidth = svg.match(
750
+ // eslint-disable-next-line max-len
751
+ /^<svg[^>]*\s{,1000}width\s{,1000}=\s{,1000}\"?(\d+)\"?[^>]*>/), matchedImageHeight = svg.match(
752
+ // eslint-disable-next-line max-len
753
+ /^<svg[^>]*\s{0,1000}height\s{,1000}=\s{,1000}\"?(\d+)\"?[^>]*>/);
754
+ if (ctx &&
755
+ matchedImageWidth &&
756
+ matchedImageHeight) {
757
+ const imageWidth = +matchedImageWidth[1] * scale, imageHeight = +matchedImageHeight[1] * scale, downloadWithCanVG = () => {
758
+ const v = win.canvg.Canvg.fromString(ctx, svg);
759
+ v.start();
760
+ downloadURL(win.navigator.msSaveOrOpenBlob ?
761
+ canvas.msToBlob() :
762
+ canvas.toDataURL(type), filename);
763
+ };
764
+ canvas.width = imageWidth;
765
+ canvas.height = imageHeight;
766
+ // Must load canVG first if not found. Don't destroy the
767
+ // object URL yet since we are doing things
768
+ // asynchronously
769
+ if (!win.canvg) {
770
+ Exporting.objectURLRevoke = true;
771
+ await getScript(libURL + 'canvg.js');
772
+ }
773
+ // Use loaded canvg
774
+ downloadWithCanVG();
775
+ }
776
+ }
777
+ finally {
778
+ if (Exporting.objectURLRevoke) {
779
+ try {
780
+ domurl.revokeObjectURL(svgURL);
781
+ }
782
+ catch {
783
+ // Ignore
784
+ }
785
+ }
786
+ }
787
+ }
788
+ }
789
+ /**
790
+ * Submit an SVG version of the chart along with some parameters for local
791
+ * conversion (PNG, JPEG, and SVG) or conversion on a server (PDF).
563
792
  *
564
793
  * @sample highcharts/members/chart-exportchart/
565
- * Export with no options
794
+ * Export with no options
566
795
  * @sample highcharts/members/chart-exportchart-filename/
567
- * PDF type and custom filename
796
+ * PDF type and custom filename
797
+ * @sample highcharts/exporting/menuitemdefinitions-webp/
798
+ * Export to WebP
568
799
  * @sample highcharts/members/chart-exportchart-custom-background/
569
- * Different chart background in export
800
+ * Different chart background in export
570
801
  * @sample stock/members/chart-exportchart/
571
- * Export with Highcharts Stock
802
+ * Export with Highcharts Stock
803
+ *
804
+ * @async
805
+ * @function Highcharts.Exporting#exportChart
806
+ *
807
+ * @param {Highcharts.ExportingOptions} [exportingOptions]
808
+ * Exporting options in addition to those defined in
809
+ * [exporting](https://api.highcharts.com/highcharts/exporting).
810
+ * @param {Highcharts.Options} [chartOptions]
811
+ * Additional chart options for the exported chart. For example a different
812
+ * background color can be added here, or `dataLabels` for export only.
813
+ *
814
+ * @requires modules/exporting
815
+ */
816
+ async exportChart(exportingOptions, chartOptions) {
817
+ // Merge the options
818
+ exportingOptions = merge(this.options, exportingOptions);
819
+ // If local if expected
820
+ if (exportingOptions.local) {
821
+ // Trigger the local export logic
822
+ await this.localExport(exportingOptions, chartOptions || {});
823
+ }
824
+ else {
825
+ // Get the SVG representation
826
+ const svg = this.getSVGForExport(exportingOptions, chartOptions);
827
+ // Do the post
828
+ if (exportingOptions.url) {
829
+ await HU.post(exportingOptions.url, {
830
+ filename: exportingOptions.filename ?
831
+ exportingOptions.filename.replace(/\//g, '-') :
832
+ this.getFilename(),
833
+ type: exportingOptions.type,
834
+ width: exportingOptions.width,
835
+ scale: exportingOptions.scale,
836
+ svg
837
+ }, exportingOptions.fetchOptions);
838
+ }
839
+ }
840
+ }
841
+ /**
842
+ * Handles the fallback to the export server when a local export fails.
572
843
  *
573
- * @function Highcharts.Chart#exportChart
844
+ * @private
845
+ * @async
846
+ * @function Highcharts.Exporting#fallbackToServer
574
847
  *
575
848
  * @param {Highcharts.ExportingOptions} exportingOptions
576
- * Exporting options in addition to those defined in
577
- * [exporting](https://api.highcharts.com/highcharts/exporting).
849
+ * The exporting options.
850
+ * @param {Error} err
851
+ * The error that caused the local export to fail.
578
852
  *
579
- * @param {Highcharts.Options} chartOptions
580
- * Additional chart options for the exported chart. For example a
581
- * different background color can be added here, or `dataLabels` for
582
- * export only.
853
+ * @return {Promise<void>}
854
+ * A promise that resolves when the fallback process is complete.
583
855
  *
584
856
  * @requires modules/exporting
585
857
  */
586
- function exportChart(exportingOptions, chartOptions) {
587
- const svg = this.getSVGForExport(exportingOptions, chartOptions);
588
- // Merge the options
589
- exportingOptions = merge(this.options.exporting, exportingOptions);
590
- // Do the post
591
- HU.post(exportingOptions.url, {
592
- filename: exportingOptions.filename ?
593
- exportingOptions.filename.replace(/\//g, '-') :
594
- this.getFilename(),
595
- type: exportingOptions.type,
596
- width: exportingOptions.width,
597
- scale: exportingOptions.scale,
598
- svg: svg
599
- }, exportingOptions.fetchOptions);
858
+ async fallbackToServer(exportingOptions, err) {
859
+ if (exportingOptions.fallbackToExportServer === false) {
860
+ if (exportingOptions.error) {
861
+ exportingOptions.error(exportingOptions, err);
862
+ }
863
+ else {
864
+ // Fallback disabled
865
+ error(28, true);
866
+ }
867
+ }
868
+ else if (exportingOptions.type === 'application/pdf') {
869
+ // The local must be false to fallback to server for PDF export
870
+ exportingOptions.local = false;
871
+ // Allow fallbacking to server only for PDFs that failed locally
872
+ await this.exportChart(exportingOptions);
873
+ }
600
874
  }
601
875
  /**
602
876
  * Return the unfiltered innerHTML of the chart container. Used as hook for
@@ -604,38 +878,43 @@ var Exporting;
604
878
  *
605
879
  * @see Chart#getSVG
606
880
  *
607
- * @function Highcharts.Chart#getChartHTML
881
+ * @function Highcharts.Exporting#getChartHTML
882
+ *
883
+ * @param {boolean} [applyStyleSheets]
884
+ * whether or not to apply the style sheets.
608
885
  *
609
886
  * @return {string}
610
887
  * The unfiltered SVG of the chart.
611
888
  *
612
889
  * @requires modules/exporting
613
890
  */
614
- function getChartHTML(applyStyleSheets) {
891
+ getChartHTML(applyStyleSheets) {
892
+ const chart = this.chart;
615
893
  if (applyStyleSheets) {
616
894
  this.inlineStyles();
617
895
  }
618
896
  this.resolveCSSVariables();
619
- return this.container.innerHTML;
897
+ return chart.container.innerHTML;
620
898
  }
621
899
  /**
622
900
  * Get the default file name used for exported charts. By default it creates
623
901
  * a file name based on the chart title.
624
902
  *
625
- * @function Highcharts.Chart#getFilename
903
+ * @function Highcharts.Exporting#getFilename
626
904
  *
627
- * @return {string} A file name without extension.
905
+ * @return {string}
906
+ * A file name without extension.
628
907
  *
629
908
  * @requires modules/exporting
630
909
  */
631
- function getFilename() {
632
- const s = this.userOptions.title && this.userOptions.title.text;
633
- let filename = this.options.exporting.filename;
910
+ getFilename() {
911
+ const titleText = this.chart.userOptions.title?.text;
912
+ let filename = this.options.filename;
634
913
  if (filename) {
635
914
  return filename.replace(/\//g, '-');
636
915
  }
637
- if (typeof s === 'string') {
638
- filename = s
916
+ if (typeof titleText === 'string') {
917
+ filename = titleText
639
918
  .toLowerCase()
640
919
  .replace(/<\/?[^>]+(>|$)/g, '') // Strip HTML tags
641
920
  .replace(/[\s_]+/g, '-')
@@ -654,45 +933,45 @@ var Exporting;
654
933
  * Return an SVG representation of the chart.
655
934
  *
656
935
  * @sample highcharts/members/chart-getsvg/
657
- * View the SVG from a button
936
+ * View the SVG from a button
658
937
  *
659
- * @function Highcharts.Chart#getSVG
938
+ * @function Highcharts.Exporting#getSVG
660
939
  *
661
940
  * @param {Highcharts.Options} [chartOptions]
662
- * Additional chart options for the generated SVG representation. For
663
- * collections like `xAxis`, `yAxis` or `series`, the additional
664
- * options is either merged in to the original item of the same
665
- * `id`, or to the first item if a common id is not found.
941
+ * Additional chart options for the generated SVG representation. For
942
+ * collections like `xAxis`, `yAxis` or `series`, the additional options is
943
+ * either merged in to the original item of the same `id`, or to the first
944
+ * item if a common id is not found.
666
945
  *
667
946
  * @return {string}
668
- * The SVG representation of the rendered chart.
947
+ * The SVG representation of the rendered chart.
669
948
  *
670
949
  * @emits Highcharts.Chart#event:getSVG
671
950
  *
672
951
  * @requires modules/exporting
673
952
  */
674
- function getSVG(chartOptions) {
675
- const chart = this;
953
+ getSVG(chartOptions) {
954
+ const chart = this.chart;
676
955
  let svg, seriesOptions,
677
956
  // Copy the options and add extra options
678
957
  options = merge(chart.options, chartOptions);
679
958
  // Use userOptions to make the options chain in series right (#3881)
680
- options.plotOptions = merge(chart.userOptions.plotOptions, chartOptions && chartOptions.plotOptions);
959
+ options.plotOptions = merge(chart.userOptions.plotOptions, chartOptions?.plotOptions);
681
960
  // ... and likewise with time, avoid that undefined time properties are
682
961
  // merged over legacy global time options
683
- options.time = merge(chart.userOptions.time, chartOptions && chartOptions.time);
962
+ options.time = merge(chart.userOptions.time, chartOptions?.time);
684
963
  // Create a sandbox where a new chart will be generated
685
- const sandbox = createElement('div', null, {
964
+ const sandbox = createElement('div', void 0, {
686
965
  position: 'absolute',
687
966
  top: '-9999em',
688
967
  width: chart.chartWidth + 'px',
689
968
  height: chart.chartHeight + 'px'
690
969
  }, doc.body);
691
970
  // Get the source size
692
- const cssWidth = chart.renderTo.style.width, cssHeight = chart.renderTo.style.height, sourceWidth = options.exporting.sourceWidth ||
971
+ const cssWidth = chart.renderTo.style.width, cssHeight = chart.renderTo.style.height, sourceWidth = options.exporting?.sourceWidth ||
693
972
  options.chart.width ||
694
973
  (/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
695
- (options.isGantt ? 800 : 600), sourceHeight = options.exporting.sourceHeight ||
974
+ (options.isGantt ? 800 : 600), sourceHeight = options.exporting?.sourceHeight ||
696
975
  options.chart.height ||
697
976
  (/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
698
977
  400;
@@ -705,9 +984,11 @@ var Exporting;
705
984
  width: sourceWidth,
706
985
  height: sourceHeight
707
986
  });
708
- options.exporting.enabled = false; // Hide buttons in print
987
+ if (options.exporting) {
988
+ options.exporting.enabled = false; // Hide buttons in print
989
+ }
709
990
  delete options.data; // #3004
710
- // prepare for replicating the chart
991
+ // Prepare for replicating the chart
711
992
  options.series = [];
712
993
  chart.series.forEach(function (serie) {
713
994
  seriesOptions = merge(serie.userOptions, {
@@ -718,7 +999,7 @@ var Exporting;
718
999
  });
719
1000
  // Used for the navigator series that has its own option set
720
1001
  if (!seriesOptions.isInternal) {
721
- options.series.push(seriesOptions);
1002
+ options?.series?.push(seriesOptions);
722
1003
  }
723
1004
  });
724
1005
  const colls = {};
@@ -727,7 +1008,7 @@ var Exporting;
727
1008
  if (!axis.userOptions.internalKey) { // #6444
728
1009
  axis.userOptions.internalKey = uniqueKey();
729
1010
  }
730
- if (!axis.options.isInternal) {
1011
+ if (options && !axis.options.isInternal) {
731
1012
  if (!colls[axis.coll]) {
732
1013
  colls[axis.coll] = true;
733
1014
  options[axis.coll] = [];
@@ -750,10 +1031,10 @@ var Exporting;
750
1031
  // Axis options and series options (#2022, #3900, #5982)
751
1032
  if (chartOptions) {
752
1033
  ['xAxis', 'yAxis', 'series'].forEach(function (coll) {
753
- const collOptions = {};
754
1034
  if (chartOptions[coll]) {
755
- collOptions[coll] = chartOptions[coll];
756
- chartCopy.update(collOptions);
1035
+ chartCopy.update({
1036
+ [coll]: chartOptions[coll]
1037
+ });
757
1038
  }
758
1039
  });
759
1040
  }
@@ -779,92 +1060,96 @@ var Exporting;
779
1060
  }
780
1061
  });
781
1062
  // Get the SVG from the container's innerHTML
782
- svg = chartCopy.getChartHTML(chart.styledMode ||
783
- options.exporting?.applyStyleSheets);
784
- fireEvent(this, 'getSVG', { chartCopy: chartCopy });
785
- svg = chart.sanitizeSVG(svg, options);
1063
+ svg = chartCopy.exporting?.getChartHTML(chart.styledMode ||
1064
+ options.exporting?.applyStyleSheets) || '';
1065
+ fireEvent(chart, 'getSVG', { chartCopy: chartCopy });
1066
+ svg = Exporting.sanitizeSVG(svg, options);
786
1067
  // Free up memory
787
- options = null;
1068
+ options = void 0;
788
1069
  chartCopy.destroy();
789
1070
  discardElement(sandbox);
790
1071
  return svg;
791
1072
  }
792
1073
  /**
1074
+ * Gets the SVG for export using the getSVG function with additional
1075
+ * options.
1076
+ *
793
1077
  * @private
794
- * @function Highcharts.Chart#getSVGForExport
1078
+ * @function Highcharts.Exporting#getSVGForExport
1079
+ *
1080
+ * @param {Highcharts.ExportingOptions} [exportingOptions]
1081
+ * The exporting options.
1082
+ * @param {Highcharts.Options} [chartOptions]
1083
+ * Additional chart options for the exported chart.
1084
+ *
1085
+ * @return {string}
1086
+ * The SVG representation of the rendered chart.
1087
+ *
1088
+ * @requires modules/exporting
795
1089
  */
796
- function getSVGForExport(options, chartOptions) {
797
- const chartExportingOptions = this.options.exporting;
798
- return this.getSVG(merge({ chart: { borderRadius: 0 } }, chartExportingOptions.chartOptions, chartOptions, {
1090
+ getSVGForExport(exportingOptions, chartOptions) {
1091
+ const currentExportingOptions = this.options;
1092
+ return this.getSVG(merge({ chart: { borderRadius: 0 } }, currentExportingOptions.chartOptions, chartOptions, {
799
1093
  exporting: {
800
- sourceWidth: ((options && options.sourceWidth) ||
801
- chartExportingOptions.sourceWidth),
802
- sourceHeight: ((options && options.sourceHeight) ||
803
- chartExportingOptions.sourceHeight)
1094
+ sourceWidth: (exportingOptions?.sourceWidth ||
1095
+ currentExportingOptions.sourceWidth),
1096
+ sourceHeight: (exportingOptions?.sourceHeight ||
1097
+ currentExportingOptions.sourceHeight)
804
1098
  }
805
1099
  }));
806
1100
  }
807
1101
  /**
808
- * Make hyphenated property names out of camelCase
809
- * @private
810
- * @param {string} prop
811
- * Property name in camelCase
812
- * @return {string}
813
- * Hyphenated property name
814
- */
815
- function hyphenate(prop) {
816
- return prop.replace(/[A-Z]/g, function (match) {
817
- return '-' + match.toLowerCase();
818
- });
819
- }
820
- /**
821
- * Analyze inherited styles from stylesheets and add them inline
1102
+ * Analyze inherited styles from stylesheets and add them inline.
822
1103
  *
823
1104
  * @private
824
- * @function Highcharts.Chart#inlineStyles
1105
+ * @function Highcharts.Exporting#inlineStyles
825
1106
  *
826
1107
  * @todo What are the border styles for text about? In general, text has a
827
- * lot of properties.
1108
+ * lot of properties.
828
1109
  *
829
1110
  * @todo Make it work with IE9 and IE10.
830
1111
  *
831
1112
  * @requires modules/exporting
832
1113
  */
833
- function inlineStyles() {
834
- const denylist = inlineDenylist, allowlist = Exporting.inlineAllowlist, // For IE
1114
+ inlineStyles() {
1115
+ const denylist = Exporting.inlineDenylist, allowlist = Exporting.inlineAllowlist, // For IE
835
1116
  defaultStyles = {};
836
1117
  let dummySVG;
837
1118
  // Create an iframe where we read default styles without pollution from
838
1119
  // this body
839
- const iframe = doc.createElement('iframe');
840
- css(iframe, {
1120
+ const iframe = createElement('iframe', void 0, {
841
1121
  width: '1px',
842
1122
  height: '1px',
843
1123
  visibility: 'hidden'
844
- });
845
- doc.body.appendChild(iframe);
846
- const iframeDoc = (iframe.contentWindow && iframe.contentWindow.document);
1124
+ }, doc.body);
1125
+ const iframeDoc = iframe.contentWindow?.document;
847
1126
  if (iframeDoc) {
848
1127
  iframeDoc.body.appendChild(iframeDoc.createElementNS(SVG_NS, 'svg'));
849
1128
  }
850
1129
  /**
851
- * Call this on all elements and recurse to children
1130
+ * Call this on all elements and recurse to children.
1131
+ *
852
1132
  * @private
853
- * @param {Highcharts.HTMLDOMElement} node
854
- * Element child
855
- */
1133
+ * @function recurse
1134
+ *
1135
+ * @param {Highcharts.HTMLDOMElement | Highcharts.SVGSVGElement} node
1136
+ * Element child.
1137
+ */
856
1138
  function recurse(node) {
857
1139
  const filteredStyles = {};
858
1140
  let styles, parentStyles, dummy, denylisted, allowlisted, i;
859
1141
  /**
860
1142
  * Check computed styles and whether they are in the allow/denylist
861
1143
  * for styles or attributes.
1144
+ *
862
1145
  * @private
863
- * @param {string} val
864
- * Style value
1146
+ * @function filterStyles
1147
+ *
1148
+ * @param {string | number | Highcharts.GradientColor | Highcharts.PatternObject | undefined} val
1149
+ * Style value.
865
1150
  * @param {string} prop
866
- * Style property name
867
- */
1151
+ * Style property name.
1152
+ */
868
1153
  function filterStyles(val, prop) {
869
1154
  // Check against allowlist & denylist
870
1155
  denylisted = allowlisted = false;
@@ -895,12 +1180,12 @@ var Exporting;
895
1180
  // against parent (#7687).
896
1181
  if ((parentStyles[prop] !== val ||
897
1182
  node.nodeName === 'svg') &&
898
- defaultStyles[node.nodeName][prop] !== val) {
1183
+ (defaultStyles[node.nodeName])[prop] !== val) {
899
1184
  // Attributes
900
- if (!inlineToAttributes ||
901
- inlineToAttributes.indexOf(prop) !== -1) {
1185
+ if (!Exporting.inlineToAttributes ||
1186
+ Exporting.inlineToAttributes.indexOf(prop) !== -1) {
902
1187
  if (val) {
903
- node.setAttribute(hyphenate(prop), val);
1188
+ node.setAttribute(Exporting.hyphenate(prop), val);
904
1189
  }
905
1190
  // Styles
906
1191
  }
@@ -912,8 +1197,9 @@ var Exporting;
912
1197
  }
913
1198
  if (iframeDoc &&
914
1199
  node.nodeType === 1 &&
915
- unstyledElements.indexOf(node.nodeName) === -1) {
916
- styles = win.getComputedStyle(node, null);
1200
+ Exporting.unstyledElements.indexOf(node.nodeName) === -1) {
1201
+ styles =
1202
+ win.getComputedStyle(node, null);
917
1203
  parentStyles = node.nodeName === 'svg' ?
918
1204
  {} :
919
1205
  win.getComputedStyle(node.parentNode, null);
@@ -927,7 +1213,8 @@ var Exporting;
927
1213
  doc.body.appendChild(dummySVG);
928
1214
  }
929
1215
  */
930
- dummySVG = iframeDoc.getElementsByTagName('svg')[0];
1216
+ dummySVG =
1217
+ iframeDoc.getElementsByTagName('svg')[0];
931
1218
  dummy = iframeDoc.createElementNS(node.namespaceURI, node.nodeName);
932
1219
  dummySVG.appendChild(dummy);
933
1220
  // Get the defaults into a standard object (simple merge
@@ -952,9 +1239,9 @@ var Exporting;
952
1239
  for (const p in styles) {
953
1240
  if (
954
1241
  // Some browsers put lots of styles on the prototype...
955
- G.isFirefox ||
956
- G.isMS ||
957
- G.isSafari || // #16902
1242
+ isFirefox ||
1243
+ isMS ||
1244
+ isSafari || // #16902
958
1245
  // ... Chrome puts them on the instance
959
1246
  Object.hasOwnProperty.call(styles, p)) {
960
1247
  filterStyles(styles[p], p);
@@ -974,43 +1261,140 @@ var Exporting;
974
1261
  }
975
1262
  }
976
1263
  /**
977
- * Remove the dummy objects used to get defaults
1264
+ * Remove the dummy objects used to get defaults.
1265
+ *
978
1266
  * @private
1267
+ * @function tearDown
979
1268
  */
980
1269
  function tearDown() {
981
1270
  dummySVG.parentNode.removeChild(dummySVG);
982
1271
  // Remove trash from DOM that stayed after each exporting
983
1272
  iframe.parentNode.removeChild(iframe);
984
1273
  }
985
- recurse(this.container.querySelector('svg'));
1274
+ recurse(this.chart.container.querySelector('svg'));
986
1275
  tearDown();
987
1276
  }
988
1277
  /**
989
- * Resolve CSS variables into hex colors
1278
+ * Get SVG of chart prepared for client side export. This converts embedded
1279
+ * images in the SVG to data URIs. It requires the regular exporting module.
1280
+ * The options and chartOptions arguments are passed to the getSVGForExport
1281
+ * function.
1282
+ *
1283
+ * @private
1284
+ * @async
1285
+ * @function Highcharts.Exporting#localExport
1286
+ *
1287
+ * @param {Highcharts.ExportingOptions} exportingOptions
1288
+ * The exporting options.
1289
+ * @param {Highcharts.Options} chartOptions
1290
+ * Additional chart options for the exported chart.
1291
+ *
1292
+ * @return {Promise<string>}
1293
+ * The sanitized SVG.
1294
+ *
1295
+ * @requires modules/exporting
990
1296
  */
991
- function resolveCSSVariables() {
992
- const svgElements = this.container.querySelectorAll('*'), colorAttributes = ['color', 'fill', 'stop-color', 'stroke'];
993
- Array.from(svgElements).forEach((element) => {
994
- colorAttributes.forEach((attr) => {
995
- const attrValue = element.getAttribute(attr);
996
- if (attrValue?.includes('var(')) {
997
- element.setAttribute(attr, getComputedStyle(element).getPropertyValue(attr));
998
- }
1297
+ async localExport(exportingOptions, chartOptions) {
1298
+ const chart = this.chart, exporting = this,
1299
+ // After grabbing the SVG of the chart's copy container we need
1300
+ // to do sanitation on the SVG
1301
+ sanitize = (svg) => Exporting.sanitizeSVG(svg || '', chartCopyOptions),
1302
+ // Return true if the SVG contains images with external data.
1303
+ // With the boost module there are `image` elements with encoded
1304
+ // PNGs, these are supported by svg2pdf and should pass (#10243)
1305
+ hasExternalImages = function () {
1306
+ return [].some.call(chart.container.getElementsByTagName('image'), function (image) {
1307
+ const href = image.getAttribute('href');
1308
+ return (href !== '' &&
1309
+ typeof href === 'string' &&
1310
+ href.indexOf('data:') !== 0);
999
1311
  });
1312
+ };
1313
+ let chartCopyContainer, chartCopyOptions, href = null, images;
1314
+ // If we are on IE and in styled mode, add an allowlist to the
1315
+ // renderer for inline styles that we want to pass through. There
1316
+ // are so many styles by default in IE that we don't want to
1317
+ // denylist them all
1318
+ if (isMS && chart.styledMode && !Exporting.inlineAllowlist.length) {
1319
+ Exporting.inlineAllowlist.push(/^blockSize/, /^border/, /^caretColor/, /^color/, /^columnRule/, /^columnRuleColor/, /^cssFloat/, /^cursor/, /^fill$/, /^fillOpacity/, /^font/, /^inlineSize/, /^length/, /^lineHeight/, /^opacity/, /^outline/, /^parentRule/, /^rx$/, /^ry$/, /^stroke/, /^textAlign/, /^textAnchor/, /^textDecoration/, /^transform/, /^vectorEffect/, /^visibility/, /^x$/, /^y$/);
1320
+ }
1321
+ // Always fall back on:
1322
+ // - MS browsers: Embedded images JPEG/PNG, or any PDF
1323
+ // - Embedded images and PDF
1324
+ if ((isMS &&
1325
+ (exportingOptions.type === 'application/pdf' ||
1326
+ chart.container.getElementsByTagName('image').length &&
1327
+ exportingOptions.type !== 'image/svg+xml')) || (exportingOptions.type === 'application/pdf' &&
1328
+ hasExternalImages())) {
1329
+ await this.fallbackToServer(exportingOptions, new Error('Image type not supported for this chart/browser.'));
1330
+ return;
1331
+ }
1332
+ // Hook into getSVG to get a copy of the chart copy's container (#8273)
1333
+ const unbindGetSVG = addEvent(chart, 'getSVG', (e) => {
1334
+ chartCopyOptions = e.chartCopy.options;
1335
+ chartCopyContainer =
1336
+ e.chartCopy.container.cloneNode(true);
1337
+ images = chartCopyContainer && chartCopyContainer
1338
+ .getElementsByTagName('image') || [];
1000
1339
  });
1340
+ try {
1341
+ // Trigger hook to get chart copy
1342
+ this.getSVGForExport(exportingOptions, chartOptions);
1343
+ // Get the static array
1344
+ const imagesArray = images ? Array.from(images) : [];
1345
+ // Go through the images we want to embed
1346
+ for (const image of imagesArray) {
1347
+ href = image.getAttributeNS('http://www.w3.org/1999/xlink', 'href');
1348
+ if (href) {
1349
+ Exporting.objectURLRevoke = false;
1350
+ const dataURL = await Exporting.imageToDataURL(href, exportingOptions?.scale || 1, exportingOptions?.type || 'image/png');
1351
+ // Change image href in chart copy
1352
+ image.setAttributeNS('http://www.w3.org/1999/xlink', 'href', dataURL);
1353
+ // Hidden, boosted series have blank href (#10243)
1354
+ }
1355
+ else {
1356
+ image.parentNode.removeChild(image);
1357
+ }
1358
+ }
1359
+ // Sanitize the SVG
1360
+ const sanitizedSVG = sanitize(chartCopyContainer?.innerHTML);
1361
+ // Use SVG of chart copy. If SVG contains foreignObjects PDF fails
1362
+ // in all browsers and all exports except SVG will fail in IE, as
1363
+ // both CanVG and svg2pdf choke on this. Gracefully fall back.
1364
+ if (sanitizedSVG.indexOf('<foreignObject') > -1 &&
1365
+ exportingOptions.type !== 'image/svg+xml' &&
1366
+ (isMS ||
1367
+ exportingOptions.type === 'application/pdf')) {
1368
+ throw new Error('Image type not supported for charts with embedded HTML');
1369
+ }
1370
+ else {
1371
+ // Trigger SVG download
1372
+ await exporting.downloadSVG(sanitizedSVG, extend({ filename: exporting.getFilename() }, exportingOptions));
1373
+ }
1374
+ // Return the sanitized SVG
1375
+ return sanitizedSVG;
1376
+ }
1377
+ catch (error) {
1378
+ await this.fallbackToServer(exportingOptions, error);
1379
+ }
1380
+ finally {
1381
+ // Clean up
1382
+ unbindGetSVG();
1383
+ }
1001
1384
  }
1002
1385
  /**
1003
1386
  * Move the chart container(s) to another div.
1004
1387
  *
1005
- * @function Highcharts#moveContainers
1006
- *
1007
1388
  * @private
1389
+ * @function Highcharts.Exporting#moveContainers
1008
1390
  *
1009
1391
  * @param {Highcharts.HTMLDOMElement} moveTo
1010
- * Move target
1392
+ * Move target.
1393
+ *
1394
+ * @requires modules/exporting
1011
1395
  */
1012
- function moveContainers(moveTo) {
1013
- const { scrollablePlotArea } = this;
1396
+ moveContainers(moveTo) {
1397
+ const chart = this.chart, { scrollablePlotArea } = chart;
1014
1398
  (
1015
1399
  // When scrollablePlotArea is active (#9533)
1016
1400
  scrollablePlotArea ?
@@ -1018,95 +1402,35 @@ var Exporting;
1018
1402
  scrollablePlotArea.fixedDiv,
1019
1403
  scrollablePlotArea.scrollingContainer
1020
1404
  ] :
1021
- [this.container]).forEach(function (div) {
1405
+ [chart.container]).forEach(function (div) {
1022
1406
  moveTo.appendChild(div);
1023
1407
  });
1024
1408
  }
1025
1409
  /**
1026
- * Add update methods to handle chart.update and chart.exporting.update and
1027
- * chart.navigation.update. These must be added to the chart instance rather
1028
- * than the Chart prototype in order to use the chart instance inside the
1029
- * update function.
1030
- * @private
1031
- */
1032
- function onChartInit() {
1033
- const chart = this,
1034
- /**
1035
- * @private
1036
- * @param {"exporting"|"navigation"} prop
1037
- * Property name in option root
1038
- * @param {Highcharts.ExportingOptions|Highcharts.NavigationOptions} options
1039
- * Options to update
1040
- * @param {boolean} [redraw=true]
1041
- * Whether to redraw
1042
- */
1043
- update = (prop, options, redraw) => {
1044
- chart.isDirtyExporting = true;
1045
- merge(true, chart.options[prop], options);
1046
- if (pick(redraw, true)) {
1047
- chart.redraw();
1048
- }
1049
- };
1050
- chart.exporting = {
1051
- update: function (options, redraw) {
1052
- update('exporting', options, redraw);
1053
- }
1054
- };
1055
- // Register update() method for navigation. Cannot be set the same way
1056
- // as for exporting, because navigation options are shared with bindings
1057
- // which has separate update() logic.
1058
- ChartNavigationComposition
1059
- .compose(chart).navigation
1060
- .addUpdate((options, redraw) => {
1061
- update('navigation', options, redraw);
1062
- });
1063
- }
1064
- /**
1065
- * On layout of titles (title, subtitle and caption), adjust the `alignTo``
1066
- * box to avoid the context menu button.
1067
- * @private
1068
- */
1069
- function onChartLayOutTitle({ alignTo, key, textPxLength }) {
1070
- const exportingOptions = this.options.exporting, { align, buttonSpacing = 0, verticalAlign, width = 0 } = merge(this.options.navigation?.buttonOptions, exportingOptions?.buttons?.contextButton), space = alignTo.width - textPxLength, widthAdjust = width + buttonSpacing;
1071
- if ((exportingOptions?.enabled ?? true) &&
1072
- key === 'title' &&
1073
- align === 'right' &&
1074
- verticalAlign === 'top') {
1075
- if (space < 2 * widthAdjust) {
1076
- if (space < widthAdjust) {
1077
- alignTo.width -= widthAdjust;
1078
- }
1079
- else if (this.title?.alignValue !== 'left') {
1080
- alignTo.x -= widthAdjust - space / 2;
1081
- }
1082
- }
1083
- }
1084
- }
1085
- /**
1086
- * Exporting module required. Clears away other elements in the page and
1087
- * prints the chart as it is displayed. By default, when the exporting
1088
- * module is enabled, a context button with a drop down menu in the upper
1089
- * right corner accesses this function.
1410
+ * Clears away other elements in the page and prints the chart as it is
1411
+ * displayed. By default, when the exporting module is enabled, a context
1412
+ * button with a drop down menu in the upper right corner accesses this
1413
+ * function.
1090
1414
  *
1091
1415
  * @sample highcharts/members/chart-print/
1092
- * Print from a HTML button
1093
- *
1094
- * @function Highcharts.Chart#print
1416
+ * Print from a HTML button
1095
1417
  *
1418
+ * @function Highcharts.Exporting#print
1096
1419
  *
1097
1420
  * @emits Highcharts.Chart#event:beforePrint
1098
1421
  * @emits Highcharts.Chart#event:afterPrint
1099
1422
  *
1100
1423
  * @requires modules/exporting
1101
1424
  */
1102
- function print() {
1103
- const chart = this;
1104
- if (chart.isPrinting) { // Block the button while in printing mode
1425
+ print() {
1426
+ const chart = this.chart;
1427
+ // Block the button while in printing mode
1428
+ if (this.isPrinting) {
1105
1429
  return;
1106
1430
  }
1107
- printingChart = chart;
1108
- if (!G.isSafari) {
1109
- chart.beforePrint();
1431
+ Exporting.printingChart = chart;
1432
+ if (!isSafari) {
1433
+ this.beforePrint();
1110
1434
  }
1111
1435
  // Give the browser time to draw WebGL content, an issue that randomly
1112
1436
  // appears (at least) in Chrome ~67 on the Mac (#8708).
@@ -1114,86 +1438,310 @@ var Exporting;
1114
1438
  win.focus(); // #1510
1115
1439
  win.print();
1116
1440
  // Allow the browser to prepare before reverting
1117
- if (!G.isSafari) {
1441
+ if (!isSafari) {
1118
1442
  setTimeout(() => {
1119
- chart.afterPrint();
1443
+ chart.exporting?.afterPrint();
1120
1444
  }, 1000);
1121
1445
  }
1122
1446
  }, 1);
1123
1447
  }
1124
1448
  /**
1125
- * Add the buttons on chart load
1449
+ * Add the buttons on chart load.
1450
+ *
1126
1451
  * @private
1127
- * @function Highcharts.Chart#renderExporting
1452
+ * @function Highcharts.Exporting#render
1453
+ *
1128
1454
  * @requires modules/exporting
1129
1455
  */
1130
- function renderExporting() {
1131
- const chart = this, exportingOptions = chart.options.exporting, buttons = exportingOptions.buttons, isDirty = chart.isDirtyExporting || !chart.exportSVGElements;
1132
- chart.buttonOffset = 0;
1133
- if (chart.isDirtyExporting) {
1134
- chart.destroyExport();
1456
+ render() {
1457
+ const exporting = this, { chart, options } = exporting, isDirty = exporting?.isDirty || !exporting?.svgElements.length;
1458
+ exporting.buttonOffset = 0;
1459
+ if (exporting.isDirty) {
1460
+ exporting.destroy();
1135
1461
  }
1136
- if (isDirty && exportingOptions.enabled !== false) {
1137
- chart.exportEvents = [];
1138
- chart.exportingGroup = chart.exportingGroup ||
1139
- chart.renderer.g('exporting-group').attr({
1140
- zIndex: 3 // #4955, // #8392
1141
- }).add();
1142
- objectEach(buttons, function (button) {
1143
- chart.addButton(button);
1462
+ if (isDirty && options.enabled !== false) {
1463
+ exporting.events = [];
1464
+ exporting.group || (exporting.group = chart.renderer.g('exporting-group').attr({
1465
+ zIndex: 3 // #4955, // #8392
1466
+ }).add());
1467
+ objectEach(options?.buttons, function (button) {
1468
+ exporting.addButton(button);
1144
1469
  });
1145
- chart.isDirtyExporting = false;
1470
+ exporting.isDirty = false;
1146
1471
  }
1147
1472
  }
1148
1473
  /**
1149
- * Exporting module only. A collection of fixes on the produced SVG to
1150
- * account for expand properties, browser bugs.
1151
- * Returns a cleaned SVG.
1474
+ * Resolve CSS variables into hex colors.
1152
1475
  *
1153
1476
  * @private
1154
- * @function Highcharts.Chart#sanitizeSVG
1155
- * @param {string} svg
1156
- * SVG code to sanitize
1157
- * @param {Highcharts.Options} options
1158
- * Chart options to apply
1159
- * @return {string}
1160
- * Sanitized SVG code
1477
+ * @function Highcharts.Exporting#resolveCSSVariables
1478
+ *
1161
1479
  * @requires modules/exporting
1162
1480
  */
1163
- function sanitizeSVG(svg, options) {
1164
- const split = svg.indexOf('</svg>') + 6, useForeignObject = svg.indexOf('<foreignObject') > -1;
1165
- let html = svg.substr(split);
1166
- // Remove any HTML added to the container after the SVG (#894, #9087)
1167
- svg = svg.substr(0, split);
1168
- if (useForeignObject) {
1169
- // Some tags needs to be closed in xhtml (#13726)
1170
- svg = svg.replace(/(<(?:img|br).*?(?=\>))>/g, '$1 />');
1171
- // Move HTML into a foreignObject
1481
+ resolveCSSVariables() {
1482
+ Array.from(this.chart.container.querySelectorAll('*')).forEach((element) => {
1483
+ ['color', 'fill', 'stop-color', 'stroke'].forEach((prop) => {
1484
+ const attrValue = element.getAttribute(prop);
1485
+ if (attrValue?.includes('var(')) {
1486
+ element.setAttribute(prop, getComputedStyle(element).getPropertyValue(prop));
1487
+ }
1488
+ const styleValue = element.style?.[prop];
1489
+ if (styleValue?.includes('var(')) {
1490
+ element.style[prop] =
1491
+ getComputedStyle(element).getPropertyValue(prop);
1492
+ }
1493
+ });
1494
+ });
1495
+ }
1496
+ /**
1497
+ * Updates the exporting object with the provided exporting options.
1498
+ *
1499
+ * @private
1500
+ * @function Highcharts.Exporting#update
1501
+ *
1502
+ * @param {Highcharts.ExportingOptions} exportingOptions
1503
+ * The exporting options to update with.
1504
+ * @param {boolean} [redraw=true]
1505
+ * Whether to redraw or not.
1506
+ *
1507
+ * @requires modules/exporting
1508
+ */
1509
+ update(exportingOptions, redraw) {
1510
+ this.isDirty = true;
1511
+ merge(true, this.options, exportingOptions);
1512
+ if (pick(redraw, true)) {
1513
+ this.chart.redraw();
1172
1514
  }
1173
- else if (html && options?.exporting?.allowHTML) {
1174
- html = '<foreignObject x="0" y="0" ' +
1175
- 'width="' + options.chart.width + '" ' +
1176
- 'height="' + options.chart.height + '">' +
1177
- '<body xmlns="http://www.w3.org/1999/xhtml">' +
1178
- // Some tags needs to be closed in xhtml (#13726)
1179
- html.replace(/(<(?:img|br).*?(?=\>))>/g, '$1 />') +
1180
- '</body>' +
1181
- '</foreignObject>';
1182
- svg = svg.replace('</svg>', html + '</svg>');
1515
+ }
1516
+ }
1517
+ /* *
1518
+ *
1519
+ * Static Properties
1520
+ *
1521
+ * */
1522
+ Exporting.inlineAllowlist = [];
1523
+ // These CSS properties are not inlined. Remember camelCase.
1524
+ Exporting.inlineDenylist = [
1525
+ /-/, // In Firefox, both hyphened and camelCased names are listed
1526
+ /^(clipPath|cssText|d|height|width)$/, // Full words
1527
+ /^font$/, // More specific props are set
1528
+ /[lL]ogical(Width|Height)$/,
1529
+ /^parentRule$/,
1530
+ /^(cssRules|ownerRules)$/, // #19516 read-only properties
1531
+ /perspective/,
1532
+ /TapHighlightColor/,
1533
+ /^transition/,
1534
+ /^length$/, // #7700
1535
+ /^\d+$/ // #17538
1536
+ ];
1537
+ // These ones are translated to attributes rather than styles
1538
+ Exporting.inlineToAttributes = [
1539
+ 'fill',
1540
+ 'stroke',
1541
+ 'strokeLinecap',
1542
+ 'strokeLinejoin',
1543
+ 'strokeWidth',
1544
+ 'textAnchor',
1545
+ 'x',
1546
+ 'y'
1547
+ ];
1548
+ // Milliseconds to defer image load event handlers to offset IE bug
1549
+ Exporting.loadEventDeferDelay = isMS ? 150 : 0;
1550
+ Exporting.unstyledElements = [
1551
+ 'clipPath',
1552
+ 'defs',
1553
+ 'desc'
1554
+ ];
1555
+ /* *
1556
+ *
1557
+ * Class Namespace
1558
+ *
1559
+ * */
1560
+ (function (Exporting) {
1561
+ /* *
1562
+ *
1563
+ * Declarations
1564
+ *
1565
+ * */
1566
+ /* *
1567
+ *
1568
+ * Functions
1569
+ *
1570
+ * */
1571
+ /**
1572
+ * Composition function.
1573
+ *
1574
+ * @private
1575
+ * @function Highcharts.Exporting#compose
1576
+ *
1577
+ * @param {ChartClass} ChartClass
1578
+ * Chart class.
1579
+ * @param {SVGRendererClass} SVGRendererClass
1580
+ * SVGRenderer class.
1581
+ *
1582
+ * @requires modules/exporting
1583
+ */
1584
+ function compose(ChartClass, SVGRendererClass) {
1585
+ ExportingSymbols.compose(SVGRendererClass);
1586
+ Fullscreen.compose(ChartClass);
1587
+ // Check the composition registry for the Exporting
1588
+ if (!pushUnique(composed, 'Exporting')) {
1589
+ return;
1590
+ }
1591
+ // Adding wrappers for the deprecated functions
1592
+ extend(Chart.prototype, {
1593
+ exportChart: async function (exportingOptions, chartOptions) {
1594
+ await this.exporting?.exportChart(exportingOptions, chartOptions);
1595
+ return;
1596
+ },
1597
+ getChartHTML: function (applyStyleSheets) {
1598
+ return this.exporting?.getChartHTML(applyStyleSheets);
1599
+ },
1600
+ getFilename: function () {
1601
+ return this.exporting?.getFilename();
1602
+ },
1603
+ getSVG: function (chartOptions) {
1604
+ return this.exporting?.getSVG(chartOptions);
1605
+ },
1606
+ print: function () {
1607
+ return this.exporting?.print();
1608
+ }
1609
+ });
1610
+ ChartClass.prototype.callbacks.push(chartCallback);
1611
+ addEvent(ChartClass, 'afterInit', onChartAfterInit);
1612
+ addEvent(ChartClass, 'layOutTitle', onChartLayOutTitle);
1613
+ if (isSafari) {
1614
+ win.matchMedia('print').addListener(function (mqlEvent) {
1615
+ if (!Exporting.printingChart) {
1616
+ return void 0;
1617
+ }
1618
+ if (mqlEvent.matches) {
1619
+ Exporting.printingChart.exporting?.beforePrint();
1620
+ }
1621
+ else {
1622
+ Exporting.printingChart.exporting?.afterPrint();
1623
+ }
1624
+ });
1625
+ }
1626
+ // Update with defaults of the exporting module
1627
+ setOptions(ExportingDefaults);
1628
+ }
1629
+ Exporting.compose = compose;
1630
+ /**
1631
+ * Function that is added to the callbacks array that runs on chart load.
1632
+ *
1633
+ * @private
1634
+ * @function Highcharts#chartCallback
1635
+ *
1636
+ * @param {Highcharts.Chart} chart
1637
+ * The chart instance.
1638
+ *
1639
+ * @requires modules/exporting
1640
+ */
1641
+ function chartCallback(chart) {
1642
+ const exporting = chart.exporting;
1643
+ if (exporting) {
1644
+ exporting.render();
1645
+ // Add the exporting buttons on each chart redraw
1646
+ addEvent(chart, 'redraw', function () {
1647
+ this.exporting?.render();
1648
+ });
1649
+ // Destroy the export elements at chart destroy
1650
+ addEvent(chart, 'destroy', function () {
1651
+ this.exporting?.destroy();
1652
+ });
1653
+ }
1654
+ // Uncomment this to see a button directly below the chart, for quick
1655
+ // testing of export
1656
+ // let button, viewImage, viewSource;
1657
+ // if (!chart.renderer.forExport) {
1658
+ // viewImage = function (): void {
1659
+ // const div = doc.createElement('div');
1660
+ // div.innerHTML = chart.exporting?.getSVGForExport() || '';
1661
+ // chart.renderTo.parentNode.appendChild(div);
1662
+ // };
1663
+ // viewSource = function (): void {
1664
+ // const pre = doc.createElement('pre');
1665
+ // pre.innerHTML = chart.exporting?.getSVGForExport()
1666
+ // .replace(/</g, '\n&lt;')
1667
+ // .replace(/>/g, '&gt;') || '';
1668
+ // chart.renderTo.parentNode.appendChild(pre);
1669
+ // };
1670
+ // viewImage();
1671
+ // // View SVG Image
1672
+ // button = doc.createElement('button');
1673
+ // button.innerHTML = 'View SVG Image';
1674
+ // chart.renderTo.parentNode.appendChild(button);
1675
+ // button.onclick = viewImage;
1676
+ // // View SVG Source
1677
+ // button = doc.createElement('button');
1678
+ // button.innerHTML = 'View SVG Source';
1679
+ // chart.renderTo.parentNode.appendChild(button);
1680
+ // button.onclick = viewSource;
1681
+ // }
1682
+ }
1683
+ /**
1684
+ * Add update methods to handle chart.update and chart.exporting.update and
1685
+ * chart.navigation.update. These must be added to the chart instance rather
1686
+ * than the Chart prototype in order to use the chart instance inside the
1687
+ * update function.
1688
+ *
1689
+ * @private
1690
+ * @function Highcharts#onChartAfterInit
1691
+ *
1692
+ * @requires modules/exporting
1693
+ */
1694
+ function onChartAfterInit() {
1695
+ const chart = this;
1696
+ // Create the exporting instance
1697
+ if (chart.options.exporting) {
1698
+ /**
1699
+ * Exporting object.
1700
+ *
1701
+ * @name Highcharts.Chart#exporting
1702
+ * @type {Highcharts.Exporting}
1703
+ */
1704
+ chart.exporting = new Exporting(chart, chart.options.exporting);
1705
+ // Register update() method for navigation. Cannot be set the same
1706
+ // way as for exporting, because navigation options are shared with
1707
+ // bindings which has separate update() logic.
1708
+ ChartNavigationComposition
1709
+ .compose(chart).navigation
1710
+ .addUpdate((options, redraw) => {
1711
+ if (chart.exporting) {
1712
+ chart.exporting.isDirty = true;
1713
+ merge(true, chart.options.navigation, options);
1714
+ if (pick(redraw, true)) {
1715
+ chart.redraw();
1716
+ }
1717
+ }
1718
+ });
1719
+ }
1720
+ }
1721
+ /**
1722
+ * On layout of titles (title, subtitle and caption), adjust the `alignTo`
1723
+ * box to avoid the context menu button.
1724
+ *
1725
+ * @private
1726
+ * @function Highcharts#onChartLayOutTitle
1727
+ *
1728
+ * @requires modules/exporting
1729
+ */
1730
+ function onChartLayOutTitle({ alignTo, key, textPxLength }) {
1731
+ const exportingOptions = this.options.exporting, { align, buttonSpacing = 0, verticalAlign, width = 0 } = merge(this.options.navigation?.buttonOptions, exportingOptions?.buttons?.contextButton), space = alignTo.width - textPxLength, widthAdjust = width + buttonSpacing;
1732
+ if ((exportingOptions?.enabled ?? true) &&
1733
+ key === 'title' &&
1734
+ align === 'right' &&
1735
+ verticalAlign === 'top') {
1736
+ if (space < 2 * widthAdjust) {
1737
+ if (space < widthAdjust) {
1738
+ alignTo.width -= widthAdjust;
1739
+ }
1740
+ else if (this.title?.alignValue !== 'left') {
1741
+ alignTo.x -= widthAdjust - space / 2;
1742
+ }
1743
+ }
1183
1744
  }
1184
- svg = svg
1185
- .replace(/zIndex="[^"]+"/g, '')
1186
- .replace(/symbolName="[^"]+"/g, '')
1187
- .replace(/jQuery\d+="[^"]+"/g, '')
1188
- .replace(/url\(("|&quot;)(.*?)("|&quot;)\;?\)/g, 'url($2)')
1189
- .replace(/url\([^#]+#/g, 'url(#')
1190
- .replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
1191
- .replace(/ (NS\d+\:)?href=/g, ' xlink:href=') // #3567
1192
- .replace(/\n+/g, ' ')
1193
- // Replace HTML entities, issue #347
1194
- .replace(/&nbsp;/g, '\u00A0') // No-break space
1195
- .replace(/&shy;/g, '\u00AD'); // Soft hyphen
1196
- return svg;
1197
1745
  }
1198
1746
  })(Exporting || (Exporting = {}));
1199
1747
  /* *
@@ -1214,10 +1762,9 @@ export default Exporting;
1214
1762
  * @callback Highcharts.ExportingAfterPrintCallbackFunction
1215
1763
  *
1216
1764
  * @param {Highcharts.Chart} this
1217
- * The chart on which the event occurred.
1218
- *
1765
+ * The chart on which the event occurred.
1219
1766
  * @param {global.Event} event
1220
- * The event that occurred.
1767
+ * The event that occurred.
1221
1768
  */
1222
1769
  /**
1223
1770
  * Gets fired before a chart is printed through the context menu item or the
@@ -1226,10 +1773,9 @@ export default Exporting;
1226
1773
  * @callback Highcharts.ExportingBeforePrintCallbackFunction
1227
1774
  *
1228
1775
  * @param {Highcharts.Chart} this
1229
- * The chart on which the event occurred.
1230
- *
1776
+ * The chart on which the event occurred.
1231
1777
  * @param {global.Event} event
1232
- * The event that occurred.
1778
+ * The event that occurred.
1233
1779
  */
1234
1780
  /**
1235
1781
  * Function to call if the offline-exporting module fails to export a chart on
@@ -1238,10 +1784,9 @@ export default Exporting;
1238
1784
  * @callback Highcharts.ExportingErrorCallbackFunction
1239
1785
  *
1240
1786
  * @param {Highcharts.ExportingOptions} options
1241
- * The exporting options.
1242
- *
1787
+ * The exporting options.
1243
1788
  * @param {global.Error} err
1244
- * The error from the module.
1789
+ * The error from the module.
1245
1790
  */
1246
1791
  /**
1247
1792
  * Definition for a menu item in the context menu.
@@ -1251,27 +1796,27 @@ export default Exporting;
1251
1796
  * The text for the menu item.
1252
1797
  *
1253
1798
  * @name Highcharts.ExportingMenuObject#text
1254
- * @type {string|undefined}
1799
+ * @type {string | undefined}
1255
1800
  */ /**
1256
1801
  * If internationalization is required, the key to a language string.
1257
1802
  *
1258
1803
  * @name Highcharts.ExportingMenuObject#textKey
1259
- * @type {string|undefined}
1804
+ * @type {string | undefined}
1260
1805
  */ /**
1261
1806
  * The click handler for the menu item.
1262
1807
  *
1263
1808
  * @name Highcharts.ExportingMenuObject#onclick
1264
- * @type {Highcharts.EventCallbackFunction<Highcharts.Chart>|undefined}
1809
+ * @type {Highcharts.EventCallbackFunction<Highcharts.Chart> | undefined}
1265
1810
  */ /**
1266
1811
  * Indicates a separator line instead of an item.
1267
1812
  *
1268
1813
  * @name Highcharts.ExportingMenuObject#separator
1269
- * @type {boolean|undefined}
1814
+ * @type {boolean | undefined}
1270
1815
  */
1271
1816
  /**
1272
1817
  * Possible MIME types for exporting.
1273
1818
  *
1274
- * @typedef {"image/png"|"image/jpeg"|"application/pdf"|"image/svg+xml"} Highcharts.ExportingMimeTypeValue
1819
+ * @typedef {"image/png" | "image/jpeg" | "application/pdf" | "image/svg+xml"} Highcharts.ExportingMimeTypeValue
1275
1820
  */
1276
1821
  (''); // Keeps doclets above in transpiled file
1277
1822
  /* *
@@ -1284,12 +1829,12 @@ export default Exporting;
1284
1829
  * `Chart.print` method.
1285
1830
  *
1286
1831
  * @sample highcharts/chart/events-beforeprint-afterprint/
1287
- * Rescale the chart to print
1832
+ * Rescale the chart to print
1288
1833
  *
1289
- * @type {Highcharts.ExportingAfterPrintCallbackFunction}
1290
- * @since 4.1.0
1291
- * @context Highcharts.Chart
1292
- * @requires modules/exporting
1834
+ * @type {Highcharts.ExportingAfterPrintCallbackFunction}
1835
+ * @since 4.1.0
1836
+ * @context Highcharts.Chart
1837
+ * @requires modules/exporting
1293
1838
  * @apioption chart.events.afterPrint
1294
1839
  */
1295
1840
  /**
@@ -1297,12 +1842,12 @@ export default Exporting;
1297
1842
  * the `Chart.print` method.
1298
1843
  *
1299
1844
  * @sample highcharts/chart/events-beforeprint-afterprint/
1300
- * Rescale the chart to print
1845
+ * Rescale the chart to print
1301
1846
  *
1302
- * @type {Highcharts.ExportingBeforePrintCallbackFunction}
1303
- * @since 4.1.0
1304
- * @context Highcharts.Chart
1305
- * @requires modules/exporting
1847
+ * @type {Highcharts.ExportingBeforePrintCallbackFunction}
1848
+ * @since 4.1.0
1849
+ * @context Highcharts.Chart
1850
+ * @requires modules/exporting
1306
1851
  * @apioption chart.events.beforePrint
1307
1852
  */
1308
1853
  (''); // Keeps doclets above in transpiled file