@e-llm-studio/federated-dashboard-components 1.0.10 → 1.0.12-human-intel-test

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 (221) hide show
  1. package/dist/ExecutiveDashboard/ExecutiveDashboardWrapper.js +1 -1
  2. package/dist/ExecutiveDashboard/api/dashboardApi.js +1 -1
  3. package/dist/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.js +1 -1
  4. package/dist/ExecutiveDashboard/components/DashboardDateFilter/datePreset.js +1 -1
  5. package/dist/ExecutiveDashboard/components/DropDowns/CustomMultiSelect.js +1 -1
  6. package/dist/ExecutiveDashboard/components/ExecutiveDashboard.js +1 -1
  7. package/dist/ExecutiveDashboard/components/Graph/Graph.js +1 -1
  8. package/dist/ExecutiveDashboard/components/Graph/LineChart.js +1 -1
  9. package/dist/ExecutiveDashboard/components/MetricCard/MetricCard.js +1 -1
  10. package/dist/ExecutiveDashboard/components/ui/chart.js +1 -1
  11. package/dist/HumanIntelligence/HumanChangesTableWrapper.js +2 -0
  12. package/dist/HumanIntelligence/HumanChangesTableWrapper.js.map +1 -0
  13. package/dist/HumanIntelligence/components/CitationContent/CitationContent.js +2 -0
  14. package/dist/HumanIntelligence/components/CitationContent/CitationContent.js.map +1 -0
  15. package/dist/HumanIntelligence/components/CitationContent/CitationContent.module.css.js +2 -0
  16. package/dist/HumanIntelligence/components/CitationContent/CitationContent.module.css.js.map +1 -0
  17. package/dist/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.js +2 -0
  18. package/dist/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.js.map +1 -0
  19. package/dist/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.module.css.js +2 -0
  20. package/dist/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.module.css.js.map +1 -0
  21. package/dist/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.js +2 -0
  22. package/dist/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.js.map +1 -0
  23. package/dist/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.module.css.js +2 -0
  24. package/dist/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.module.css.js.map +1 -0
  25. package/dist/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.js +2 -0
  26. package/dist/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.js.map +1 -0
  27. package/dist/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.module.css.js +2 -0
  28. package/dist/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.module.css.js.map +1 -0
  29. package/dist/HumanIntelligence/components/LogFilters/LogFilterDropdown.js +2 -0
  30. package/dist/HumanIntelligence/components/LogFilters/LogFilterDropdown.js.map +1 -0
  31. package/dist/HumanIntelligence/components/LogFilters/LogFilters.js +2 -0
  32. package/dist/HumanIntelligence/components/LogFilters/LogFilters.js.map +1 -0
  33. package/dist/HumanIntelligence/components/LogTable/LogTable.js +2 -0
  34. package/dist/HumanIntelligence/components/LogTable/LogTable.js.map +1 -0
  35. package/dist/HumanIntelligence/components/PatternDetails/PatternDetails.js +2 -0
  36. package/dist/HumanIntelligence/components/PatternDetails/PatternDetails.js.map +1 -0
  37. package/dist/HumanIntelligence/components/PatternDetails/PatternDetails.module.css.js +2 -0
  38. package/dist/HumanIntelligence/components/PatternDetails/PatternDetails.module.css.js.map +1 -0
  39. package/dist/HumanIntelligence/components/Shared/ReusableTable.js +2 -0
  40. package/dist/HumanIntelligence/components/Shared/ReusableTable.js.map +1 -0
  41. package/dist/HumanIntelligence/components/Shared/ReusableTable.module.css.js +2 -0
  42. package/dist/HumanIntelligence/components/Shared/ReusableTable.module.css.js.map +1 -0
  43. package/dist/HumanIntelligence/hooks/useHighlightNavigation.js +2 -0
  44. package/dist/HumanIntelligence/hooks/useHighlightNavigation.js.map +1 -0
  45. package/dist/HumanIntelligence/hooks/useHumanChangesData.js +2 -0
  46. package/dist/HumanIntelligence/hooks/useHumanChangesData.js.map +1 -0
  47. package/dist/HumanIntelligence/hooks/useHumanIntelligenceController.js +2 -0
  48. package/dist/HumanIntelligence/hooks/useHumanIntelligenceController.js.map +1 -0
  49. package/dist/HumanIntelligence/styles/HumanIntelligence.module.css.js +2 -0
  50. package/dist/HumanIntelligence/styles/HumanIntelligence.module.css.js.map +1 -0
  51. package/dist/RecordDashboard/RecordApi/RecordDashboardApi.js +1 -1
  52. package/dist/RecordDashboard/RecordComponents/AnalyticsChart/AnalyticsChart.js +1 -1
  53. package/dist/RecordDashboard/RecordComponents/RecordDashboard.js +1 -1
  54. package/dist/RecordDashboard/RecordDashboardWrapper.js +1 -1
  55. package/dist/RecordDashboard/RecordUtils/RecordTableColumns.js +1 -1
  56. package/dist/cjs/ExecutiveDashboard/ExecutiveDashboardWrapper.js +1 -1
  57. package/dist/cjs/ExecutiveDashboard/api/dashboardApi.js +1 -1
  58. package/dist/cjs/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.js +1 -1
  59. package/dist/cjs/ExecutiveDashboard/components/DashboardDateFilter/datePreset.js +1 -1
  60. package/dist/cjs/ExecutiveDashboard/components/DropDowns/CustomMultiSelect.js +1 -1
  61. package/dist/cjs/ExecutiveDashboard/components/ExecutiveDashboard.js +1 -1
  62. package/dist/cjs/ExecutiveDashboard/components/Graph/Graph.js +1 -1
  63. package/dist/cjs/ExecutiveDashboard/components/Graph/LineChart.js +1 -1
  64. package/dist/cjs/ExecutiveDashboard/components/MetricCard/MetricCard.js +1 -1
  65. package/dist/cjs/ExecutiveDashboard/components/ui/chart.js +1 -1
  66. package/dist/cjs/HumanIntelligence/HumanChangesTableWrapper.js +2 -0
  67. package/dist/cjs/HumanIntelligence/HumanChangesTableWrapper.js.map +1 -0
  68. package/dist/cjs/HumanIntelligence/components/CitationContent/CitationContent.js +2 -0
  69. package/dist/cjs/HumanIntelligence/components/CitationContent/CitationContent.js.map +1 -0
  70. package/dist/cjs/HumanIntelligence/components/CitationContent/CitationContent.module.css.js +2 -0
  71. package/dist/cjs/HumanIntelligence/components/CitationContent/CitationContent.module.css.js.map +1 -0
  72. package/dist/cjs/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.js +2 -0
  73. package/dist/cjs/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.js.map +1 -0
  74. package/dist/cjs/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.module.css.js +2 -0
  75. package/dist/cjs/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.module.css.js.map +1 -0
  76. package/dist/cjs/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.js +2 -0
  77. package/dist/cjs/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.js.map +1 -0
  78. package/dist/cjs/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.module.css.js +2 -0
  79. package/dist/cjs/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.module.css.js.map +1 -0
  80. package/dist/cjs/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.js +2 -0
  81. package/dist/cjs/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.js.map +1 -0
  82. package/dist/cjs/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.module.css.js +2 -0
  83. package/dist/cjs/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.module.css.js.map +1 -0
  84. package/dist/cjs/HumanIntelligence/components/LogFilters/LogFilterDropdown.js +2 -0
  85. package/dist/cjs/HumanIntelligence/components/LogFilters/LogFilterDropdown.js.map +1 -0
  86. package/dist/cjs/HumanIntelligence/components/LogFilters/LogFilters.js +2 -0
  87. package/dist/cjs/HumanIntelligence/components/LogFilters/LogFilters.js.map +1 -0
  88. package/dist/cjs/HumanIntelligence/components/LogTable/LogTable.js +2 -0
  89. package/dist/cjs/HumanIntelligence/components/LogTable/LogTable.js.map +1 -0
  90. package/dist/cjs/HumanIntelligence/components/PatternDetails/PatternDetails.js +2 -0
  91. package/dist/cjs/HumanIntelligence/components/PatternDetails/PatternDetails.js.map +1 -0
  92. package/dist/cjs/HumanIntelligence/components/PatternDetails/PatternDetails.module.css.js +2 -0
  93. package/dist/cjs/HumanIntelligence/components/PatternDetails/PatternDetails.module.css.js.map +1 -0
  94. package/dist/cjs/HumanIntelligence/components/Shared/ReusableTable.js +2 -0
  95. package/dist/cjs/HumanIntelligence/components/Shared/ReusableTable.js.map +1 -0
  96. package/dist/cjs/HumanIntelligence/components/Shared/ReusableTable.module.css.js +2 -0
  97. package/dist/cjs/HumanIntelligence/components/Shared/ReusableTable.module.css.js.map +1 -0
  98. package/dist/cjs/HumanIntelligence/hooks/useHighlightNavigation.js +2 -0
  99. package/dist/cjs/HumanIntelligence/hooks/useHighlightNavigation.js.map +1 -0
  100. package/dist/cjs/HumanIntelligence/hooks/useHumanChangesData.js +2 -0
  101. package/dist/cjs/HumanIntelligence/hooks/useHumanChangesData.js.map +1 -0
  102. package/dist/cjs/HumanIntelligence/hooks/useHumanIntelligenceController.js +2 -0
  103. package/dist/cjs/HumanIntelligence/hooks/useHumanIntelligenceController.js.map +1 -0
  104. package/dist/cjs/HumanIntelligence/styles/HumanIntelligence.module.css.js +2 -0
  105. package/dist/cjs/HumanIntelligence/styles/HumanIntelligence.module.css.js.map +1 -0
  106. package/dist/cjs/RecordDashboard/RecordApi/RecordDashboardApi.js +1 -1
  107. package/dist/cjs/RecordDashboard/RecordComponents/AnalyticsChart/AnalyticsChart.js +1 -1
  108. package/dist/cjs/RecordDashboard/RecordComponents/RecordDashboard.js +1 -1
  109. package/dist/cjs/RecordDashboard/RecordDashboardWrapper.js +1 -1
  110. package/dist/cjs/RecordDashboard/RecordUtils/RecordTableColumns.js +1 -1
  111. package/dist/cjs/index.js +1 -1
  112. package/dist/cjs/styles.css +1 -1
  113. package/dist/index.js +1 -1
  114. package/dist/styles.css +1 -1
  115. package/dist/types/App.d.ts.map +1 -1
  116. package/dist/types/ExecutiveDashboard/ExecutiveDashboardWrapper.d.ts +1 -1
  117. package/dist/types/ExecutiveDashboard/ExecutiveDashboardWrapper.d.ts.map +1 -1
  118. package/dist/types/ExecutiveDashboard/TestExecutiveDashboard.d.ts.map +1 -1
  119. package/dist/types/ExecutiveDashboard/api/dashboardApi.d.ts +1 -2
  120. package/dist/types/ExecutiveDashboard/api/dashboardApi.d.ts.map +1 -1
  121. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.d.ts +1 -6
  122. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/DashboardDateFilter.d.ts.map +1 -1
  123. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/datePreset.d.ts +0 -47
  124. package/dist/types/ExecutiveDashboard/components/DashboardDateFilter/datePreset.d.ts.map +1 -1
  125. package/dist/types/ExecutiveDashboard/components/DropDowns/CustomMultiSelect.d.ts +3 -1
  126. package/dist/types/ExecutiveDashboard/components/DropDowns/CustomMultiSelect.d.ts.map +1 -1
  127. package/dist/types/ExecutiveDashboard/components/ExecutiveDashboard.d.ts +1 -5
  128. package/dist/types/ExecutiveDashboard/components/ExecutiveDashboard.d.ts.map +1 -1
  129. package/dist/types/ExecutiveDashboard/components/Graph/Graph.d.ts +1 -1
  130. package/dist/types/ExecutiveDashboard/components/Graph/Graph.d.ts.map +1 -1
  131. package/dist/types/ExecutiveDashboard/components/Graph/LineChart.d.ts +2 -4
  132. package/dist/types/ExecutiveDashboard/components/Graph/LineChart.d.ts.map +1 -1
  133. package/dist/types/ExecutiveDashboard/components/Graph/types.d.ts +0 -61
  134. package/dist/types/ExecutiveDashboard/components/Graph/types.d.ts.map +1 -1
  135. package/dist/types/ExecutiveDashboard/components/MetricCard/MetricCard.d.ts +1 -2
  136. package/dist/types/ExecutiveDashboard/components/MetricCard/MetricCard.d.ts.map +1 -1
  137. package/dist/types/ExecutiveDashboard/components/ui/chart.d.ts +0 -1
  138. package/dist/types/ExecutiveDashboard/components/ui/chart.d.ts.map +1 -1
  139. package/dist/types/ExecutiveDashboard/constant/index.d.ts.map +1 -1
  140. package/dist/types/ExecutiveDashboard/types/index.d.ts +0 -60
  141. package/dist/types/ExecutiveDashboard/types/index.d.ts.map +1 -1
  142. package/dist/types/HumanIntelligence/HumanChangesTableWrapper.d.ts +108 -0
  143. package/dist/types/HumanIntelligence/HumanChangesTableWrapper.d.ts.map +1 -0
  144. package/dist/types/HumanIntelligence/TestHumanIntelligence.d.ts +3 -0
  145. package/dist/types/HumanIntelligence/TestHumanIntelligence.d.ts.map +1 -0
  146. package/dist/types/HumanIntelligence/components/CitationContent/CitationContent.d.ts +26 -0
  147. package/dist/types/HumanIntelligence/components/CitationContent/CitationContent.d.ts.map +1 -0
  148. package/dist/types/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.d.ts +36 -0
  149. package/dist/types/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.d.ts.map +1 -0
  150. package/dist/types/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.d.ts +12 -0
  151. package/dist/types/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.d.ts.map +1 -0
  152. package/dist/types/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.d.ts +40 -0
  153. package/dist/types/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.d.ts.map +1 -0
  154. package/dist/types/HumanIntelligence/components/LogFilters/LogFilterDropdown.d.ts +27 -0
  155. package/dist/types/HumanIntelligence/components/LogFilters/LogFilterDropdown.d.ts.map +1 -0
  156. package/dist/types/HumanIntelligence/components/LogFilters/LogFilters.d.ts +38 -0
  157. package/dist/types/HumanIntelligence/components/LogFilters/LogFilters.d.ts.map +1 -0
  158. package/dist/types/HumanIntelligence/components/LogFilters/LogFiltersSidebar.d.ts +38 -0
  159. package/dist/types/HumanIntelligence/components/LogFilters/LogFiltersSidebar.d.ts.map +1 -0
  160. package/dist/types/HumanIntelligence/components/LogTable/LogTable.d.ts +73 -0
  161. package/dist/types/HumanIntelligence/components/LogTable/LogTable.d.ts.map +1 -0
  162. package/dist/types/HumanIntelligence/components/PatternDetails/PatternDetails.d.ts +11 -0
  163. package/dist/types/HumanIntelligence/components/PatternDetails/PatternDetails.d.ts.map +1 -0
  164. package/dist/types/HumanIntelligence/components/Shared/ReusableTable.d.ts +18 -0
  165. package/dist/types/HumanIntelligence/components/Shared/ReusableTable.d.ts.map +1 -0
  166. package/dist/types/HumanIntelligence/hooks/useHighlightNavigation.d.ts +42 -0
  167. package/dist/types/HumanIntelligence/hooks/useHighlightNavigation.d.ts.map +1 -0
  168. package/dist/types/HumanIntelligence/hooks/useHumanChangesData.d.ts +146 -0
  169. package/dist/types/HumanIntelligence/hooks/useHumanChangesData.d.ts.map +1 -0
  170. package/dist/types/HumanIntelligence/hooks/useHumanIntelligenceController.d.ts +48 -0
  171. package/dist/types/HumanIntelligence/hooks/useHumanIntelligenceController.d.ts.map +1 -0
  172. package/dist/types/HumanIntelligence/index.d.ts +21 -0
  173. package/dist/types/HumanIntelligence/index.d.ts.map +1 -0
  174. package/dist/types/RecordDashboard/RecordApi/RecordDashboardApi.d.ts +2 -3
  175. package/dist/types/RecordDashboard/RecordApi/RecordDashboardApi.d.ts.map +1 -1
  176. package/dist/types/RecordDashboard/RecordComponents/AnalyticsChart/AnalyticsChart.d.ts +1 -1
  177. package/dist/types/RecordDashboard/RecordComponents/AnalyticsChart/AnalyticsChart.d.ts.map +1 -1
  178. package/dist/types/RecordDashboard/RecordComponents/RecordDashboard.d.ts.map +1 -1
  179. package/dist/types/RecordDashboard/RecordDashboardWrapper.d.ts +1 -1
  180. package/dist/types/RecordDashboard/RecordDashboardWrapper.d.ts.map +1 -1
  181. package/dist/types/RecordDashboard/RecordTypes/index.d.ts +4 -25
  182. package/dist/types/RecordDashboard/RecordTypes/index.d.ts.map +1 -1
  183. package/dist/types/RecordDashboard/RecordUtils/RecordTableColumns.d.ts +1 -13
  184. package/dist/types/RecordDashboard/RecordUtils/RecordTableColumns.d.ts.map +1 -1
  185. package/dist/types/index.d.ts +2 -10
  186. package/dist/types/index.d.ts.map +1 -1
  187. package/package.json +25 -5
  188. package/dist/ExecutiveDashboard/components/Graph/Seperator.js +0 -2
  189. package/dist/ExecutiveDashboard/components/Graph/Seperator.js.map +0 -1
  190. package/dist/ExecutiveDashboard/hooks/useVisibilityPolling.js +0 -2
  191. package/dist/ExecutiveDashboard/hooks/useVisibilityPolling.js.map +0 -1
  192. package/dist/cjs/ExecutiveDashboard/components/Graph/Seperator.js +0 -2
  193. package/dist/cjs/ExecutiveDashboard/components/Graph/Seperator.js.map +0 -1
  194. package/dist/cjs/ExecutiveDashboard/hooks/useVisibilityPolling.js +0 -2
  195. package/dist/cjs/ExecutiveDashboard/hooks/useVisibilityPolling.js.map +0 -1
  196. package/dist/cjs/node_modules/@kurkle/color/dist/color.esm.js +0 -9
  197. package/dist/cjs/node_modules/@kurkle/color/dist/color.esm.js.map +0 -1
  198. package/dist/cjs/node_modules/chart.js/auto/auto.js +0 -2
  199. package/dist/cjs/node_modules/chart.js/auto/auto.js.map +0 -1
  200. package/dist/cjs/node_modules/chart.js/dist/chart.js +0 -8
  201. package/dist/cjs/node_modules/chart.js/dist/chart.js.map +0 -1
  202. package/dist/cjs/node_modules/chart.js/dist/chunks/helpers.dataset.js +0 -8
  203. package/dist/cjs/node_modules/chart.js/dist/chunks/helpers.dataset.js.map +0 -1
  204. package/dist/cjs/node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js +0 -2
  205. package/dist/cjs/node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js.map +0 -1
  206. package/dist/node_modules/@kurkle/color/dist/color.esm.js +0 -8
  207. package/dist/node_modules/@kurkle/color/dist/color.esm.js.map +0 -1
  208. package/dist/node_modules/chart.js/auto/auto.js +0 -2
  209. package/dist/node_modules/chart.js/auto/auto.js.map +0 -1
  210. package/dist/node_modules/chart.js/dist/chart.js +0 -8
  211. package/dist/node_modules/chart.js/dist/chart.js.map +0 -1
  212. package/dist/node_modules/chart.js/dist/chunks/helpers.dataset.js +0 -8
  213. package/dist/node_modules/chart.js/dist/chunks/helpers.dataset.js.map +0 -1
  214. package/dist/node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js +0 -8
  215. package/dist/node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js.map +0 -1
  216. package/dist/types/ExecutiveDashboard/components/Graph/Seperator.d.ts +0 -7
  217. package/dist/types/ExecutiveDashboard/components/Graph/Seperator.d.ts.map +0 -1
  218. package/dist/types/ExecutiveDashboard/components/common/Accordion.d.ts +0 -34
  219. package/dist/types/ExecutiveDashboard/components/common/Accordion.d.ts.map +0 -1
  220. package/dist/types/ExecutiveDashboard/hooks/useVisibilityPolling.d.ts +0 -12
  221. package/dist/types/ExecutiveDashboard/hooks/useVisibilityPolling.d.ts.map +0 -1
@@ -1,8 +0,0 @@
1
- import{d as t,a3 as e,ac as i,ad as s,k as n,ae as o,af as a,Q as r,F as h,ag as l,a7 as c,ah as u,Y as g,$ as p,C as f,j as m,h as x,ai as b,aj as _,E as y,M as v,v as M,a6 as w,a8 as k,i as S,a9 as D,aa as P,b as A,ab as C,g as L,aP as O,t as T,_ as E,B as R,r as I,f as z,s as F,m as V,n as B,T as N,o as W,q as H,w as j,y as $,P as U,z as Y,G as X,I as G,O as K,R as J,S as q,U as Z,V as Q,W as tt,X as et,Z as it,a0 as st,a5 as nt,D as ot,p as at,an as rt,ao as ht,ap as lt,av as ct,aw as dt,a as ut,aM as gt,aH as pt,aN as ft,al as mt,H as xt,x as bt,aQ as _t,u as yt,l as vt,J as Mt,a4 as wt,ak as kt,aq as St,ar as Dt,as as Pt,aA as At,a2 as Ct,aB as Lt,aC as Ot,aD as Tt,a1 as Et,aF as Rt,aG as It,ay as zt,A as Ft,N as Vt,ax as Bt,az as Nt,aE as Wt,aI as Ht,aJ as jt,aK as $t,aO as Ut,e as Yt,K as Xt,L as Gt,at as Kt,au as Jt,aL as qt,c as Zt,am as Qt}from"./chunks/helpers.dataset.js";export{aM as Ticks,d as defaults}from"./chunks/helpers.dataset.js";
2
- /*!
3
- * Chart.js v4.5.1
4
- * https://www.chartjs.org
5
- * (c) 2025 Chart.js Contributors
6
- * Released under the MIT License
7
- */class te{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach(s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=I.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ee=new te;const ie="transparent",se={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=Zt(t||ie),n=s.valid&&Zt(e||ie);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class ne{constructor(t,e,i,s){const n=e[i];s=ut([t.to,s,n,t.from]);const o=ut([t.from,n,s]);this._active=!0,this._fn=t.fn||se[t.type||typeof o],this._easing=Yt[t.easing]||Yt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=ut([t.to,e,s,t.from]),this._from=ut([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e<i),!this._active)return this._target[s]=a,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class oe{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(e){if(!S(e))return;const i=Object.keys(t.animation),s=this._properties;Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t];if(!S(n))return;const o={};for(const t of i)o[t]=n[t];(A(n.properties)&&n.properties||[t]).forEach(e=>{e!==t&&s.has(e)||s.set(e,o)})})}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const h=o[r];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,e));continue}const l=e[h];let c=n[h];const d=i.get(h);if(c){if(d&&c.active()){c.update(d,l,a);continue}c.cancel()}d&&d.duration?(n[h]=c=new ne(d,t,h,l),s.push(c)):t[h]=l}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(ee.add(this._chart,i),!0):void 0}}function ae(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function re(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function he(t,e,i,s={}){const n=t.keys,o="single"===s.mode;let a,r,h,l;if(null===e)return;let c=!1;for(a=0,r=n.length;a<r;++a){if(h=+n[a],h===i){if(c=!0,s.all)continue;break}l=t.values[h],L(l)&&(o||0===e||F(e)===F(l))&&(e+=l)}return c||s.all?e:0}function le(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function ce(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function de(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function ue(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,h=o.axis,l=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[h]:o,[l]:d}=i;u=(i._stacks||(i._stacks={}))[l]=ce(n,c,o),u[r]=d,u._top=de(u,a,!0,s.type),u._bottom=de(u,a,!1,s.type);(u._visualValues||(u._visualValues={}))[r]=d}}function ge(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function pe(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const fe=t=>"reset"===t||"none"===t,me=(t,e)=>e?t:Object.assign({},t);class xe{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=le(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&pe(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=M(i.xAxisID,ge(t,"x")),o=e.yAxisID=M(i.yAxisID,ge(t,"y")),a=e.rAxisID=M(i.rAxisID,ge(t,"r")),r=e.indexAxis,h=e.iAxisID=s(r,n,o,a),l=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&yt(this._data,this),t._stacked&&pe(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(S(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",a=Object.keys(t),r=new Array(a.length);let h,l,c;for(h=0,l=a.length;h<l;++h)c=a[h],r[h]={[n]:c,[o]:t[c]};return r}(e,t)}else if(i!==e){if(i){yt(i,this);const t=this._cachedMeta;pe(t),t._parsed=[]}e&&Object.isExtensible(e)&&vt(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=le(e.vScale,e),e.stack!==i.stack&&(s=!0,pe(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(ue(this,e._parsed),e._stacked=le(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,a=n.axis;let r,h,l,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,l=s;else{l=A(s[t])?this.parseArrayData(i,s,t,e):S(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===h[a]||d&&h[a]<d[a];for(r=0;r<e;++r)i._parsed[r+t]=h=l[r],c&&(n()&&(c=!1),d=h);i._sorted=c}o&&ue(this,l)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,a=n.axis,r=o.axis,h=n.getLabels(),l=n===o,c=new Array(s);let d,u,g;for(d=0,u=s;d<u;++d)g=d+i,c[d]={[a]:l||n.parse(h[g],g),[r]:o.parse(e[g],g)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,a=new Array(s);let r,h,l,c;for(r=0,h=s;r<h;++r)l=r+i,c=e[l],a[r]={x:n.parse(c[0],l),y:o.parse(c[1],l)};return a}parseObjectData(t,e,i,s){const{xScale:n,yScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,h=new Array(s);let l,c,d,u;for(l=0,c=s;l<c;++l)d=l+i,u=e[d],h[l]={x:n.parse(z(u,a),d),y:o.parse(z(u,r),d)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return he({keys:re(s,!0),values:e._stacks[t.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=he(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),r=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:re(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:l,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(a);let d,u;function g(){u=s[d];const e=u[a.axis];return!L(u[t.axis])||l>e||c<e}for(d=0;d<o&&(g()||(this.updateRangeFromParsed(h,t,u,r),!n));++d);if(n)for(d=o-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(h,t,u,r);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s<n;++s)o=e[s][t.axis],L(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,s,n;return S(t)?(e=t.top,i=t.right,s=t.bottom,n=t.left):e=i=s=n=t,{top:e,right:i,bottom:s,left:n,disabled:!1===t}}(M(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=ae(t,i),n=ae(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||s.length-a,h=this.options.drawActiveElementsOnTop;let l;for(i.dataset&&i.dataset.draw(t,n,a,r),l=a;l<a+r;++l){const e=s[l];e.hidden||(e.active&&h?o.push(e):e.draw(t,n))}for(l=0;l<o.length;++l)o[l].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return m(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return m(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(e,i="default",s){const n="active"===i,o=this._cachedDataOpts,a=e+"-"+i,r=o[a],h=this.enableOptionSharing&&x(s);if(r)return me(r,h);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),d=n?[`${e}Hover`,"hover",e,""]:[e,""],u=l.getOptionScopes(this.getDataset(),c),g=Object.keys(t.elements[e]),p=l.resolveNamedOptions(u,g,()=>this.getContext(s,n,i),d);return p.$shared&&(p.$shared=h,o[a]=Object.freeze(me(p,h))),p}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const h=new oe(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||fe(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){fe(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!fe(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a<o;++a)n[a]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&pe(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function be(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=E(s.sort((t,e)=>t-e))}return t._cache.$bar}(e,t.type);let s,n,o,a,r=e._length;const h=()=>{32767!==o&&-32768!==o&&(x(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;s<n;++s)o=e.getPixelForValue(i[s]),h();for(a=void 0,s=0,n=e.ticks.length;s<n;++s)o=e.getPixelForTick(s),h();return r}function _e(t,e,i,s){return A(t)?function(t,e,i,s){const n=i.parse(t[0],s),o=i.parse(t[1],s),a=Math.min(n,o),r=Math.max(n,o);let h=a,l=r;Math.abs(a)>Math.abs(r)&&(h=r,l=a),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:n,end:o,min:a,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function ye(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,h=[];let l,c,d,u;for(l=i,c=i+s;l<c;++l)u=e[l],d={},d[n.axis]=r||n.parse(a[l],l),h.push(_e(u,d,o,l));return h}function ve(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Me(t,e,i,s){let n=e.borderSkipped;const o={};if(!n)return void(t.borderSkipped=o);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:r,reverse:h,top:l,bottom:c}=function(t){let e,i,s,n,o;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",o="start"):(n="start",o="end"),{start:i,end:s,reverse:e,top:n,bottom:o}}(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=l:(i._bottom||0)===s?n=c:(o[we(c,a,r,h)]=!0,n=l)),o[we(n,a,r,h)]=!0,t.borderSkipped=o}function we(t,e,i,s){var n,o,a;return s?(a=i,t=ke(t=(n=t)===(o=e)?a:n===a?o:n,i,e)):t=ke(t,e,i),t}function ke(t,e,i){return"start"===t?e:"end"===t?i:t}function Se(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class De extends xe{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return ye(t,e,i,s)}parseArrayData(t,e,i,s){return ye(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,h="x"===n.axis?a:r,l="x"===o.axis?a:r,c=[];let d,u,g,p;for(d=i,u=i+s;d<u;++d)p=e[d],g={},g[n.axis]=n.parse(z(p,h),d),c.push(_e(z(p,l),g,o,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),o=n._custom,a=ve(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const o="reset"===s,{index:a,_cachedMeta:{vScale:r}}=this,h=r.getBasePixel(),l=r.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const e=this.getParsed(g),i=o||n(e[r.axis])?{base:h,head:h}:this._calculateBarValuePixels(g),p=this._calculateBarIndexPixels(g,c),f=(e._stacks||{})[r.axis],m={horizontal:l,base:i.base,enableBorderRadius:!f||ve(e._custom)||a===f._top||a===f._bottom,x:l?i.head:p.center,y:l?p.center:i.head,height:l?p.size:Math.abs(i.size),width:l?Math.abs(i.size):p.size};u&&(m.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const x=m.options||t[g].options;Me(m,x,f,a),Se(m,x,c.ratio),this.updateElement(t[g],g,m,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(t=>t.controller.options.grouped),o=i.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),h=r&&r[i.axis],l=t=>{const e=t._parsed.find(t=>t[i.axis]===h),s=e&&e[t.vScale.axis];if(n(s)||isNaN(s))return!0};for(const i of s)if((void 0===e||!l(i))&&((!1===o||-1===a.indexOf(i.stack)||void 0===o&&void 0===i.stack)&&a.push(i.stack),i.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[M("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n<o;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const a=t.barThickness;return{min:a||be(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,h=this.getParsed(t),l=h._custom,c=ve(l);let d,u,g=h[e.axis],p=0,f=i?this.applyStack(e,h,i):g;f!==g&&(p=f-g,f=g),c&&(g=l.barStart,f=l.barEnd-l.barStart,0!==g&&F(g)!==F(l.barEnd)&&(p=0),p+=g);const m=n(o)||c?p:o;let x=e.getPixelForValue(m);if(d=this.chart.getDataVisibility(t)?e.getPixelForValue(p+f):x,u=d-x,Math.abs(u)<a){u=function(t,e,i){return 0!==t?F(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(u,e,r)*a,g===r&&(x-=u/2);const t=e.getPixelForDecimal(0),n=e.getPixelForDecimal(1),o=Math.min(t,n),l=Math.max(t,n);x=Math.max(Math.min(x,l),o),d=x+u,i&&!c&&(h._stacks[e.axis]._visualValues[s]=e.getValueForPixel(d)-e.getValueForPixel(x))}if(x===e.getPixelForValue(r)){const t=F(u)*e.getLineWidthForValue(r)/2;x+=t,u-=t}return{size:u,base:x,head:d,center:d+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,a=M(s.maxBarThickness,1/0);let r,h;const l=this._getAxisCount();if(e.grouped){const i=o?this._getStackCount(t):e.stackCount,c="flex"===s.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t<n.length-1?n[t+1]:null;const h=i.categoryPercentage;null===a&&(a=o-(null===r?e.end-e.start:r-o)),null===r&&(r=o+o-a);const l=o-(o-Math.min(a,r))/2*h;return{chunk:Math.abs(r-a)/2*h/s,ratio:i.barPercentage,start:l}}(t,e,s,i*l):function(t,e,i,s){const o=i.barThickness;let a,r;return n(o)?(a=e.min*i.categoryPercentage,r=i.barPercentage):(a=o*s,r=1),{chunk:a/s,ratio:r,start:e.pixels[t]-a/2}}(t,e,s,i*l),d="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,u=this._getAxis().indexOf(M(d,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+u;r=c.start+c.chunk*g+c.chunk/2,h=Math.min(a,c.chunk*c.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),h=Math.min(a,e.min*e.ratio);return{base:r-h/2,head:r+h/2,center:r,size:h}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null===this.getParsed(n)[e.axis]||i[n].hidden||i[n].draw(this._ctx)}}class Pe extends xe{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const n=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<n.length;t++)n[t]._custom=this.resolveDataElementOptions(t+i).radius;return n}parseArrayData(t,e,i,s){const n=super.parseArrayData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=M(s[2],this.resolveDataElementOptions(t+i).radius)}return n}parseObjectData(t,e,i,s){const n=super.parseObjectData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=M(s&&s.r&&+s.r,this.resolveDataElementOptions(t+i).radius)}return n}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y),h=o._custom;return{label:i[t]||"",value:"("+a+", "+r+(h?", "+h:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:r,includeOptions:h}=this._getSharedOptions(e,s),l=o.axis,c=a.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!n&&this.getParsed(d),u={},g=u[l]=n?o.getPixelForDecimal(.5):o.getPixelForValue(i[l]),p=u[c]=n?a.getBasePixel():a.getPixelForValue(i[c]);u.skip=isNaN(g)||isNaN(p),h&&(u.options=r||this.resolveDataElementOptions(d,e.active?"active":s),n&&(u.options.radius=0)),this.updateElement(e,d,u,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const n=s.radius;return"active"!==e&&(s.radius=0),s.radius+=M(i&&i._custom,n),s}}class Ae extends xe{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:s,color:n,useBorderRadius:o,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,r)=>{const h=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:h.backgroundColor,fontColor:n,hidden:!t.getDataVisibility(r),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:s,pointStyle:i,borderRadius:o&&(a||h.borderRadius),index:r}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,a=t=>+i[t];if(S(i[t])){const{key:t="value"}=this._parsing;a=e=>+z(i[e],t)}for(n=t,o=t+e;n<o;++n)s._parsed[n]=a(n)}}_getRotation(){return T(this.options.rotation-90)}_getCircumference(){return T(this.options.circumference)}_getRotationExtents(){let t=N,e=-N;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),o=s._getCircumference();t=Math.min(t,n),e=Math.max(e,n+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,n=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),r=Math.min(V(this.options.cutout,a),1),h=this._getRingWeight(this.index),{circumference:l,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:u,offsetX:g,offsetY:p}=function(t,e,i){let s=1,n=1,o=0,a=0;if(e<N){const r=t,h=r+e,l=Math.cos(r),c=Math.sin(r),d=Math.cos(h),u=Math.sin(h),g=(t,e,s)=>at(t,r,h,!0)?1:Math.max(e,e*i,s,s*i),p=(t,e,s)=>at(t,r,h,!0)?-1:Math.min(e,e*i,s,s*i),f=g(0,l,d),m=g(xt,c,u),x=p(U,l,d),b=p(U+xt,c,u);s=(f-x)/2,n=(m-b)/2,o=-(f+x)/2,a=-(m+b)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}(c,l,r),f=(i.width-o)/d,m=(i.height-o)/u,x=Math.max(Math.min(f,m)/2,0),b=B(this.options.radius,x),_=(b-Math.max(b*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*b,this.offsetY=p*b,s.total=this.calculateTotal(),this.outerRadius=b-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*h,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/N)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,h=(a.left+a.right)/2,l=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,s);let f,m=this._getRotation();for(f=0;f<e;++f)m+=this._circumference(f,n);for(f=e;f<e+i;++f){const e=this._circumference(f,n),i=t[f],o={x:h+this.offsetX,y:l+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:u,innerRadius:d};p&&(o.options=g||this.resolveDataElementOptions(f,i.active?"active":s)),m+=e,this.updateElement(i,f,o,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?N*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=W(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)r=a.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(M(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Ce extends xe{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled;let{start:a,count:r}=H(e,s,o);this._drawStart=a,this._drawCount=r,j(e)&&(a=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:h},t),this.updateElements(s,a,r,t)}updateElements(t,e,i,s){const o="reset"===s,{iScale:a,vScale:r,_stacked:h,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,s),u=a.axis,g=r.axis,{spanGaps:p,segment:f}=this.options,m=bt(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===s,b=e+i,_=t.length;let y=e>0&&this.getParsed(e-1);for(let i=0;i<_;++i){const p=t[i],_=x?p:{};if(i<e||i>=b){_.skip=!0;continue}const v=this.getParsed(i),M=n(v[g]),w=_[u]=a.getPixelForValue(v[u],i),k=_[g]=o||M?r.getBasePixel():r.getPixelForValue(h?this.applyStack(r,v,h):v[g],i);_.skip=isNaN(w)||isNaN(k)||M,_.stop=i>0&&Math.abs(v[u]-y[u])>m,f&&(_.parsed=v,_.raw=l.data[i]),d&&(_.options=c||this.resolveDataElementOptions(i,p.active?"active":s)),x||this.updateElement(p,i,_,s),y=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Le extends xe{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=W(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return $.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.options.animation,r=this._cachedMeta.rScale,h=r.xCenter,l=r.yCenter,c=r.getIndexAngle(0)-.5*U;let d,u=c;const g=360/this.countVisibleElements();for(d=0;d<e;++d)u+=this._computeAngle(d,s,g);for(d=e;d<e+i;d++){const e=t[d];let i=u,p=u+this._computeAngle(d,s,g),f=o.getDataVisibility(d)?r.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=p,n&&(a.animateScale&&(f=0),a.animateRotate&&(i=p=c));const m={x:h,y:l,innerRadius:0,outerRadius:f,startAngle:i,endAngle:p,options:this.resolveDataElementOptions(d,e.active?"active":s)};this.updateElement(e,d,m,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?T(this.resolveDataElementOptions(t,e).angle||i):0}}class Oe extends Ae{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Te extends xe{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return $.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this._cachedMeta.rScale,o="reset"===s;for(let a=e;a<e+i;a++){const e=t[a],i=this.resolveDataElementOptions(a,e.active?"active":s),r=n.getPointPositionForValue(a,this.getParsed(a).r),h=o?n.xCenter:r.x,l=o?n.yCenter:r.y,c={x:h,y:l,angle:r.angle,skip:isNaN(h)||isNaN(l),options:i};this.updateElement(e,a,c,s)}}}class Ee extends xe{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+r+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:n,count:o}=H(e,i,s);if(this._drawStart=n,this._drawCount=o,j(e)&&(n=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:n,_dataset:o}=e;n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=i;const a=this.resolveDatasetElementOptions(t);a.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:a},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,n,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const o="reset"===s,{iScale:a,vScale:r,_stacked:h,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(c),u=this.includeOptions(s,d),g=a.axis,p=r.axis,{spanGaps:f,segment:m}=this.options,x=bt(f)?f:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||"none"===s;let _=e>0&&this.getParsed(e-1);for(let c=e;c<e+i;++c){const e=t[c],i=this.getParsed(c),f=b?e:{},y=n(i[p]),v=f[g]=a.getPixelForValue(i[g],c),M=f[p]=o||y?r.getBasePixel():r.getPixelForValue(h?this.applyStack(r,i,h):i[p],c);f.skip=isNaN(v)||isNaN(M)||y,f.stop=c>0&&Math.abs(i[g]-_[g])>x,m&&(f.parsed=i,f.raw=l.data[c]),u&&(f.options=d||this.resolveDataElementOptions(c,e.active?"active":s)),b||this.updateElement(e,c,f,s),_=i}this.updateSharedOptions(d,s,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const n=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,n,o)/2}}var Re=Object.freeze({__proto__:null,BarController:De,BubbleController:Pe,DoughnutController:Ae,LineController:Ce,PieController:Oe,PolarAreaController:Le,RadarController:Te,ScatterController:Ee});function Ie(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ze{static override(t){Object.assign(ze.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Ie()}parse(){return Ie()}format(){return Ie()}add(){return Ie()}diff(){return Ie()}startOf(){return Ie()}endOf(){return Ie()}}var Fe={_date:ze};function Ve(t,e,i,s){const{controller:o,data:a,_sorted:r}=t,h=o._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(h&&e===h.axis&&"r"!==e&&r&&a.length){const r=h._reversePixels?Ft:R;if(!s){const s=r(a,e,i);if(l){const{vScale:e}=o._cachedMeta,{_parsed:i}=t,a=i.slice(0,s.lo+1).reverse().findIndex(t=>!n(t[e.axis]));s.lo-=Math.max(0,a);const r=i.slice(s.hi).findIndex(t=>!n(t[e.axis]));s.hi+=Math.max(0,r)}return s}if(o._sharedOptions){const t=a[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){const t=r(a,e,i-s),n=r(a,e,i+s);return{lo:t.lo,hi:n.hi}}}}return{lo:0,hi:a.length-1}}function Be(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:r}=o[t],{lo:h,hi:l}=Ve(o[t],e,a,n);for(let t=h;t<=l;++t){const e=r[t];e.skip||s(e,i,t)}}}function Ne(t,e,i,s,n){const o=[];if(!n&&!t.isPointInArea(e))return o;return Be(t,i,e,function(i,a,r){(n||f(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&o.push({element:i,datasetIndex:a,index:r})},!0),o}function We(t,e,i,s,n,o){let a=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let h=Number.POSITIVE_INFINITY;return Be(t,i,e,function(i,l,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!(!!o||t.isPointInArea(u))&&!d)return;const g=r(e,u);g<h?(a=[{element:i,datasetIndex:l,index:c}],h=g):g===h&&a.push({element:i,datasetIndex:l,index:c})}),a}function He(t,e,i,s,n,o){return o||t.isPointInArea(e)?"r"!==i||s?We(t,e,i,s,n,o):function(t,e,i,s){let n=[];return Be(t,i,e,function(t,i,o){const{startAngle:a,endAngle:r}=t.getProps(["startAngle","endAngle"],s),{angle:h}=ot(t,{x:e.x,y:e.y});at(h,a,r)&&n.push({element:t,datasetIndex:i,index:o})}),n}(t,e,i,n):[]}function je(t,e,i,s,n){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return Be(t,i,e,(t,s,h)=>{t[a]&&t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:h}),r=r||t.inRange(e.x,e.y,n))}),s&&!r?[]:o}var $e={evaluateInteractionItems:Be,modes:{index(t,e,i,s){const n=Y(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?Ne(t,n,o,s,a):He(t,n,o,!1,s,a),h=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})}),h):[]},dataset(t,e,i,s){const n=Y(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?Ne(t,n,o,s,a):He(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;t<i.length;++t)r.push({element:i[t],datasetIndex:e,index:t})}return r},point:(t,e,i,s)=>Ne(t,Y(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=Y(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;return He(t,n,o,i.intersect,s,a)},x:(t,e,i,s)=>je(t,Y(e,t),"x",i.intersect,s),y:(t,e,i,s)=>je(t,Y(e,t),"y",i.intersect,s)}};const Ue=["left","top","right","bottom"];function Ye(t,e){return t.filter(t=>t.pos===e)}function Xe(t,e){return t.filter(t=>-1===Ue.indexOf(t.pos)&&t.box.axis===e)}function Ge(t,e){return t.sort((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight})}function Ke(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!Ue.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o<a;++o){r=t[o];const{fullSize:a}=r.box,h=i[r.stack],l=h&&r.stackWeight/h.weight;r.horizontal?(r.width=l?l*s:a&&e.availableWidth,r.height=n):(r.width=s,r.height=l?l*n:a&&e.availableHeight)}return i}function Je(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function qe(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Ze(t,e,i,s){const{pos:n,box:o}=i,a=t.maxPadding;if(!S(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&qe(a,o.getPadding());const r=Math.max(0,e.outerWidth-Je(a,t,"left","right")),h=Math.max(0,e.outerHeight-Je(a,t,"top","bottom")),l=r!==t.w,c=h!==t.h;return t.w=r,t.h=h,i.horizontal?{same:l,other:c}:{same:c,other:l}}function Qe(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{s[t]=Math.max(e[t],i[t])}),s}return s(t?["left","right"]:["top","bottom"])}function ti(t,e,i,s){const n=[];let o,a,r,h,l,c;for(o=0,a=t.length,l=0;o<a;++o){r=t[o],h=r.box,h.update(r.width||e.w,r.height||e.h,Qe(r.horizontal,e));const{same:a,other:d}=Ze(e,i,r,s);l|=a&&n.length,c=c||d,h.fullSize||n.push(r)}return l&&ti(n,e,i,s)||c}function ei(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function ii(t,e,i,s){const n=i.padding;let{x:o,y:a}=e;for(const r of t){const t=r.box,h=s[r.stack]||{count:1,placed:0,weight:1},l=r.stackWeight/h.weight||1;if(r.horizontal){const s=e.w*l,o=h.size||t.height;x(h.start)&&(a=h.start),t.fullSize?ei(t,n.left,a,i.outerWidth-n.right-n.left,o):ei(t,e.left+h.placed,a,s,o),h.start=a,h.placed+=s,a=t.bottom}else{const s=e.h*l,a=h.size||t.width;x(h.start)&&(o=h.start),t.fullSize?ei(t,o,n.top,a,i.outerHeight-n.bottom-n.top):ei(t,o,e.top+h.placed,a,s),h.start=o,h.placed+=s,o=t.right}}e.x=o,e.y=a}var si={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const n=y(t.options.layout.padding),o=Math.max(e-n.width,0),a=Math.max(i-n.height,0),r=function(t){const e=function(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:a,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return e}(t),i=Ge(e.filter(t=>t.box.fullSize),!0),s=Ge(Ye(e,"left"),!0),n=Ge(Ye(e,"right")),o=Ge(Ye(e,"top"),!0),a=Ge(Ye(e,"bottom")),r=Xe(e,"x"),h=Xe(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(h).concat(a).concat(r),chartArea:Ye(e,"chartArea"),vertical:s.concat(n).concat(h),horizontal:o.concat(a).concat(r)}}(t.boxes),l=r.vertical,c=r.horizontal;h(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const d=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),g=Object.assign({},n);qe(g,y(s));const p=Object.assign({maxPadding:g,w:o,h:a,x:n.left,y:n.top},n),f=Ke(l.concat(c),u);ti(r.fullSize,p,u,f),ti(l,p,u,f),ti(c,p,u,f)&&ti(l,p,u,f),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),ii(r.leftAndTop,p,u,f),p.x+=p.w,p.y+=p.h,ii(r.rightAndBottom,p,u,f),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},h(r.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class ni{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class oi extends ni{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ai="$chartjs",ri={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hi=t=>null===t||""===t;const li=!!Xt&&{passive:!0};function ci(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,li)}function di(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function ui(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||di(i.addedNodes,s),e=e&&!di(i.removedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function gi(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||di(i.removedNodes,s),e=e&&!di(i.addedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const pi=new Map;let fi=0;function mi(){const t=window.devicePixelRatio;t!==fi&&(fi=t,pi.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function xi(t,e,i){const s=t.canvas,n=s&&G(s);if(!n)return;const o=Gt((t,e)=>{const s=n.clientWidth;i(t,e),s<n.clientWidth&&i()},window),a=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)});return a.observe(n),function(t,e){pi.size||window.addEventListener("resize",mi),pi.set(t,e)}(t,o),a}function bi(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){pi.delete(t),pi.size||window.removeEventListener("resize",mi)}(t)}function _i(t,e,i){const s=t.canvas,n=Gt(e=>{null!==t.ctx&&i(function(t,e){const i=ri[t.type]||t.type,{x:s,y:n}=Y(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,li)}(s,e,n),n}class yi extends ni{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[ai]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",hi(n)){const e=Mt(t,"width");void 0!==e&&(t.width=e)}if(hi(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Mt(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[ai])return!1;const i=e[ai].initial;["height","width"].forEach(t=>{const s=i[t];n(s)?e.removeAttribute(t):e.setAttribute(t,s)});const s=i.style||{};return Object.keys(s).forEach(t=>{e.style[t]=s[t]}),e.width=e.width,delete e[ai],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:ui,detach:gi,resize:xi}[e]||_i;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:bi,detach:bi,resize:bi}[e]||ci)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return X(t,e,i,s)}isAttached(t){const e=t&&G(t);return!(!e||!e.isConnected)}}function vi(t){return!v()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?oi:yi}class Mi{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return bt(this.x)&&bt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}function wi(t,e){const i=t.options.ticks,s=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),o=Math.min(i.maxTicksLimit||s,s),a=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],r=a.length,h=a[0],l=a[r-1],c=[];if(r>o)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===a&&(e.push(t[n]),o++,a=i[o*s])}(e,c,a,r/o),c;const d=function(t,e,i){const s=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),n=e.length/i;if(!s)return Math.max(n,1);const o=Vt(s);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>n)return e}return Math.max(n,1)}(a,e,o);if(r>0){let t,i;const s=r>1?Math.round((l-h)/(r-1)):null;for(ki(e,c,d,n(s)?0:h-s,h),t=0,i=r-1;t<i;t++)ki(e,c,d,a[t],a[t+1]);return ki(e,c,d,l,n(s)?e.length:l+s),c}return ki(e,c,d),c}function ki(t,e,i,s,n){const o=M(s,0),a=Math.min(M(n,t.length),t.length);let r,h,l,c=0;for(i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),l=o;l<0;)c++,l=Math.round(o+c*i);for(h=Math.max(o,0);h<a;h++)h===l&&(e.push(t[h]),c++,l=Math.round(o+c*i))}const Si=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,Di=(t,e)=>Math.min(e||t,t);function Pi(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function Ai(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,a=t._endPixel,r=1e-6;let h,l=t.getPixelForTick(n);if(!(i&&(h=1===s?Math.max(l-o,a-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(n-1))/2,l+=n<e?h:-h,l<o-r||l>a+r)))return l}function Ci(t){return t.drawTicks?t.tickLength:0}function Li(t,e){if(!t.display)return 0;const i=st(t.font,e),s=y(t.padding);return(A(t.text)?t.text.length:1)*i.lineHeight+s.height}function Oi(t,e,i){let s=Et(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class Ti extends Mi{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=K(t,Number.POSITIVE_INFINITY),e=K(e,Number.NEGATIVE_INFINITY),i=K(i,Number.POSITIVE_INFINITY),s=K(s,Number.NEGATIVE_INFINITY),{min:K(t,i),max:K(e,s),minDefined:L(t),maxDefined:L(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let r=0,h=a.length;r<h;++r)e=a[r].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),o||(s=Math.max(s,e.max));return i=o&&i>s?s:i,s=n&&i>s?i:s,{min:K(i,K(s,i)),max:K(s,K(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){r(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=J(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a<this.ticks.length;this._convertTicksToLabels(r?Pi(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=wi(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){r(this.options.afterUpdate,[this])}beforeSetDimensions(){r(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){r(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),r(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){r(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=r(e.callback,[n.value,i,t],this)}afterTickToLabelConversion(){r(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){r(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Di(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,n=e.maxRotation;let o,a,r,h=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const l=this._getLabelSizes(),c=l.widest.width,d=l.highest.height,u=q(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-Ci(t.grid)-e.padding-Li(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),h=Z(Math.min(Math.asin(q((l.highest.height+6)/o,-1,1)),Math.asin(q(a/r,-1,1))-Math.asin(q(d/r,-1,1)))),h=Math.max(s,Math.min(n,h))),this.labelRotation=h}afterCalculateLabelRotation(){r(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){r(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=Li(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ci(n)+o):(t.height=this.maxHeight,t.width=Ci(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,h=T(this.labelRotation),l=Math.cos(h),c=Math.sin(h);if(a){const e=i.mirror?0:c*n.width+l*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:l*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,l)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,h="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?h?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){r(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)n(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Pi(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Di(e,i));let c,d,u,g,p,f,m,x,b,_,y,v=0,M=0;for(c=0;c<e;c+=l){if(g=t[c].label,p=this._resolveTickFontOptions(c),s.font=f=p.string,m=o[f]=o[f]||{data:{},gc:[]},x=p.lineHeight,b=_=0,n(g)||A(g)){if(A(g))for(d=0,u=g.length;d<u;++d)y=g[d],n(y)||A(y)||(b=Q(s,m.data,m.gc,b,y),_+=x)}else b=Q(s,m.data,m.gc,b,g),_=x;a.push(b),r.push(_),v=Math.max(b,v),M=Math.max(_,M)}!function(t,e){h(t,t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}})}(o,e);const w=a.indexOf(v),k=r.indexOf(M),S=t=>({width:a[t]||0,height:r[t]||0});return{first:S(0),last:S(e-1),widest:S(w),highest:S(k),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return tt(this._alignToPixels?et(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return m(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=(i=this.chart.getContext(),m(i,{scale:this,type:"scale"})));var i}_tickSize(){const t=this.options.ticks,e=T(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),o=t.autoSkipPadding||0,a=n?n.widest.width+o:0,r=n?n.highest.height+o:0;return this.isHorizontal()?r*i>a*s?a/i:r/s:r*s<a*i?r/i:a/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o,border:a}=s,r=n.offset,h=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=Ci(n),d=[],u=a.setContext(this.getContext()),g=u.display?u.width:0,p=g/2,f=function(t){return et(i,t,g)};let m,x,b,_,y,v,w,k,D,P,A,C;if("top"===o)m=f(this.bottom),v=this.bottom-c,k=m-p,P=f(t.top)+p,C=t.bottom;else if("bottom"===o)m=f(this.top),P=t.top,C=f(t.bottom)-p,v=m+p,k=this.top+c;else if("left"===o)m=f(this.right),y=this.right-c,w=m-p,D=f(t.left)+p,A=t.right;else if("right"===o)m=f(this.left),D=t.left,A=f(t.right)-p,y=m+p,w=this.left+c;else if("x"===e){if("center"===o)m=f((t.top+t.bottom)/2+.5);else if(S(o)){const t=Object.keys(o)[0],e=o[t];m=f(this.chart.scales[t].getPixelForValue(e))}P=t.top,C=t.bottom,v=m+p,k=v+c}else if("y"===e){if("center"===o)m=f((t.left+t.right)/2);else if(S(o)){const t=Object.keys(o)[0],e=o[t];m=f(this.chart.scales[t].getPixelForValue(e))}y=m-p,w=y-c,D=t.left,A=t.right}const L=M(s.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/L));for(x=0;x<l;x+=O){const t=this.getContext(x),e=n.setContext(t),s=a.setContext(t),o=e.lineWidth,l=e.color,c=s.dash||[],u=s.dashOffset,g=e.tickWidth,p=e.tickColor,f=e.tickBorderDash||[],m=e.tickBorderDashOffset;b=Ai(this,x,r),void 0!==b&&(_=et(i,b,o),h?y=w=D=A=_:v=k=P=C=_,d.push({tx1:y,ty1:v,tx2:w,ty2:k,x1:D,y1:P,x2:A,y2:C,width:o,color:l,borderDash:c,borderDashOffset:u,tickWidth:g,tickColor:p,tickBorderDash:f,tickBorderDashOffset:m}))}return this._ticksLength=l,this._borderValue=m,d}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:n}=i,o=this.isHorizontal(),a=this.ticks,{align:r,crossAlign:h,padding:l,mirror:c}=n,d=Ci(i.grid),u=d+l,g=c?-l:u,p=-T(this.labelRotation),f=[];let m,x,b,_,v,M,w,k,D,P,C,L,O="middle";if("top"===s)M=this.bottom-g,w=this._getXAxisLabelAlignment();else if("bottom"===s)M=this.top+g,w=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,v=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,v=t.x}else if("x"===e){if("center"===s)M=(t.top+t.bottom)/2+u;else if(S(s)){const t=Object.keys(s)[0],e=s[t];M=this.chart.scales[t].getPixelForValue(e)+u}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)v=(t.left+t.right)/2-u;else if(S(s)){const t=Object.keys(s)[0],e=s[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===r?O="top":"end"===r&&(O="bottom"));const E=this._getLabelSizes();for(m=0,x=a.length;m<x;++m){b=a[m],_=b.label;const t=n.setContext(this.getContext(m));k=this.getPixelForTick(m)+n.labelOffset,D=this._resolveTickFontOptions(m),P=D.lineHeight,C=A(_)?_.length:1;const e=C/2,i=t.color,r=t.textStrokeColor,l=t.textStrokeWidth;let d,u=w;if(o?(v=k,"inner"===w&&(u=m===x-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),L="top"===s?"near"===h||0!==p?-C*P+P/2:"center"===h?-E.highest.height/2-e*P+P:-E.highest.height+P/2:"near"===h||0!==p?P/2:"center"===h?E.highest.height/2-e*P:E.highest.height-C*P,c&&(L*=-1),0===p||t.showLabelBackdrop||(v+=P/2*Math.sin(p))):(M=k,L=(1-C)*P/2),t.showLabelBackdrop){const e=y(t.backdropPadding),i=E.heights[m],s=E.widths[m];let n=L-e.top,o=0-e.left;switch(O){case"middle":n-=i/2;break;case"bottom":n-=i}switch(w){case"center":o-=s/2;break;case"right":o-=s;break;case"inner":m===x-1?o-=s:m>0&&(o-=s/2)}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}f.push({label:_,font:D,textOffset:L,options:{rotation:p,color:i,strokeColor:r,strokeWidth:l,textAlign:u,textBaseline:O,translation:[v,M],backdrop:d}})}return f}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-T(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,h;return"left"===e?s?(h=this.right+n,"near"===i?r="left":"center"===i?(r="center",h+=a/2):(r="right",h+=a)):(h=this.right-o,"near"===i?r="right":"center"===i?(r="center",h-=a/2):(r="left",h=this.left)):"right"===e?s?(h=this.left+n,"near"===i?r="right":"center"===i?(r="center",h-=a/2):(r="left",h-=a)):(h=this.left+o,"near"===i?r="left":"center"===i?(r="center",h+=a/2):(r="right",h=this.right)):r="right",{textAlign:r,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,n=i.setContext(this.getContext()),o=i.display?n.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let h,l,c,d;this.isHorizontal()?(h=et(t,this.left,o)-o/2,l=et(t,this.right,a)+a/2,c=d=r):(c=et(t,this.top,o)-o/2,d=et(t,this.bottom,a)+a/2,h=l=r),e.save(),e.lineWidth=n.width,e.strokeStyle=n.color,e.beginPath(),e.moveTo(h,c),e.lineTo(l,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&g(e,i);const s=this.getLabelItems(t);for(const t of s){const i=t.options,s=t.font,n=t.label,o=t.textOffset;it(e,n,0,o,s,i)}i&&p(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const n=st(i.font),o=y(i.padding),a=i.align;let r=n.lineHeight/2;"bottom"===e||"center"===e||S(e)?(r+=o.bottom,A(i.text)&&(r+=n.lineHeight*(i.text.length-1))):r+=o.top;const{titleX:h,titleY:l,maxWidth:c,rotation:d}=function(t,e,i,s){const{top:n,left:o,bottom:a,right:r,chart:h}=t,{chartArea:l,scales:c}=h;let d,u,g,p=0;const f=a-n,m=r-o;if(t.isHorizontal()){if(u=Ct(s,o,r),S(i)){const t=Object.keys(i)[0],s=i[t];g=c[t].getPixelForValue(s)+f-e}else g="center"===i?(l.bottom+l.top)/2+f-e:Si(t,i,e);d=r-o}else{if(S(i)){const t=Object.keys(i)[0],s=i[t];u=c[t].getPixelForValue(s)-m+e}else u="center"===i?(l.left+l.right)/2-m+e:Si(t,i,e);g=Ct(s,a,n),p="left"===i?-xt:xt}return{titleX:u,titleY:g,maxWidth:d,rotation:p}}(this,r,e,a);it(t,i.text,0,0,n,{color:i.color,maxWidth:c,rotation:d,textAlign:Oi(a,e,s),textBaseline:"middle",translation:[h,l]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=M(t.grid&&t.grid.z,-1),s=M(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Ti.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return st(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ei{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(e){const i=Object.getPrototypeOf(e);let s;(function(t){return"id"in t&&"defaults"in t})(i)&&(s=this.register(i));const n=this.items,o=e.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in n||(n[o]=e,function(e,i,s){const n=wt(Object.create(null),[s?t.get(s):{},t.get(i),e.defaults]);t.set(i,n),e.defaultRoutes&&function(e,i){Object.keys(i).forEach(s=>{const n=s.split("."),o=n.pop(),a=[e].concat(n).join("."),r=i[s].split("."),h=r.pop(),l=r.join(".");t.route(a,o,l,h)})}(i,e.defaultRoutes);e.descriptors&&t.describe(i,e.descriptors)}(e,a,s),this.override&&t.override(e.id,e.overrides)),a}get(t){return this.items[t]}unregister(i){const s=this.items,n=i.id,o=this.scope;n in s&&delete s[n],o&&n in t[o]&&(delete t[o][n],this.override&&delete e[n])}}class Ri{constructor(){this.controllers=new Ei(xe,"datasets",!0),this.elements=new Ei(Mi,"elements"),this.plugins=new Ei(Object,"plugins"),this.scales=new Ei(Ti,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):h(e,e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){const s=nt(t);r(i["before"+s],[],i),e[t](i),r(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ii=new Ri;class zi{constructor(){this._init=void 0}notify(t,e,i,s){if("beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),void 0===this._init)return;const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin,o=t[i],a=[e,s,n.options];if(!1===r(o,a,t)&&s.cancelable)return!1}return!0}invalidate(){n(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=M(i.options&&i.options.plugins,{}),n=function(t){const e={},i=[],s=Object.keys(Ii.plugins.items);for(let t=0;t<s.length;t++)i.push(Ii.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==s||e?function(t,{plugins:e,localIds:i},s,n){const o=[],a=t.getContext();for(const r of e){const e=r.id,h=Fi(s[e],n);null!==h&&o.push({plugin:r,options:Vi(t.config,{plugin:r,local:i[e]},h,a)})}return o}(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Fi(t,e){return e||!1!==t?!0===t?{}:t:null}function Vi(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Bi(e,i){const s=t.datasets[e]||{};return((i.datasets||{})[e]||{}).indexAxis||i.indexAxis||s.indexAxis||"x"}function Ni(t){if("x"===t||"y"===t||"r"===t)return t}function Wi(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Hi(t,...e){if(Ni(t))return t;for(const i of e){const e=i.axis||Wi(i.position)||t.length>1&&Ni(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ji(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function $i(i,s){const n=e[i.type]||{scales:{}},o=s.scales||{},a=Bi(i.type,s),r=Object.create(null);return Object.keys(o).forEach(e=>{const s=o[e];if(!S(s))return console.error(`Invalid scale configuration for scale: ${e}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const h=Hi(e,s,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return ji(t,"x",i[0])||ji(t,"y",i[0])}return{}}(e,i),t.scales[s.type]),l=function(t,e){return t===e?"_index_":"_value_"}(h,a),c=n.scales||{};r[e]=C(Object.create(null),[{axis:h},s,c[h],c[l]])}),i.data.datasets.forEach(t=>{const n=t.type||i.type,a=t.indexAxis||Bi(n,s),h=(e[n]||{}).scales||{};Object.keys(h).forEach(e=>{const i=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(e,a),s=t[i+"AxisID"]||i;r[s]=r[s]||Object.create(null),C(r[s],[{axis:i},o[s],h[e]])})}),Object.keys(r).forEach(e=>{const i=r[e];C(i,[t.scales[i.type],t.scale])}),r}function Ui(t){const e=t.options||(t.options={});e.plugins=M(e.plugins,{}),e.scales=$i(t,e)}function Yi(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Xi=new Map,Gi=new Set;function Ki(t,e){let i=Xi.get(t);return i||(i=e(),Xi.set(t,i),Gi.add(i)),i}const Ji=(t,e,i)=>{const s=z(e,i);void 0!==s&&t.add(s)};class qi{constructor(t){this._config=function(t){return(t=t||{}).data=Yi(t.data),Ui(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Yi(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ui(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ki(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ki(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ki(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return Ki(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(i,s,n){const{options:o,type:a}=this,r=this._cachedScopes(i,n),h=r.get(s);if(h)return h;const l=new Set;s.forEach(s=>{i&&(l.add(i),s.forEach(t=>Ji(l,i,t))),s.forEach(t=>Ji(l,o,t)),s.forEach(t=>Ji(l,e[a]||{},t)),s.forEach(e=>Ji(l,t,e)),s.forEach(t=>Ji(l,w,t))});const c=Array.from(l);return 0===c.length&&c.push(Object.create(null)),Gi.has(s)&&r.set(s,c),c}chartOptionScopes(){const{options:i,type:s}=this;return[i,e[s]||{},t.datasets[s]||{},{type:s},t,w]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:a}=Zi(this._resolverCache,t,s);let r=o;if(function(t,e){const{isScriptable:i,isIndexable:s}=P(t);for(const n of e){const e=i(n),o=s(n),a=(o||e)&&t[n];if(e&&(c(a)||Qi(a))||o&&A(a))return!0}return!1}(o,e)){n.$shared=!1,i=c(i)?i():i;const e=this.createResolver(t,i,a);r=k(o,i,e)}for(const t of e)n[t]=r[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=Zi(this._resolverCache,t,i);return S(e)?k(n,e,void 0,s):n}}function Zi(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);if(!o){o={resolver:D(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(n,o)}return o}const Qi=t=>S(t)&&Object.getOwnPropertyNames(t).some(e=>c(t[e]));const ts=["top","bottom","left","right","chartArea"];function es(t,e){return"top"===t||"bottom"===t||-1===ts.indexOf(t)&&"x"===e}function is(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function ss(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),r(i&&i.onComplete,[t],e)}function ns(t){const e=t.chart,i=e.options.animation;r(i&&i.onProgress,[t],e)}function os(t){return v()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const as={},rs=t=>{const e=os(t);return Object.values(as).filter(t=>t.canvas===e).pop()};function hs(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class ls{static defaults=t;static instances=as;static overrides=e;static registry=Ii;static version="4.5.1";static getChart=rs;static register(...t){Ii.add(...t),cs()}static unregister(...t){Ii.remove(...t),cs()}constructor(t,e){const n=this.config=new qi(e),o=os(t),a=rs(o);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||vi(o)),this.platform.updateConfig(n);const h=this.platform.acquireContext(o,r.aspectRatio),l=h&&h.canvas,c=l&&l.height,d=l&&l.width;this.id=i(),this.ctx=h,this.canvas=l,this.width=d,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new zi,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=s(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],as[this.id]=this,h&&l?(ee.listen(this,"complete",ss),ee.listen(this,"progress",ns),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return n(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ii}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():o(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return a(this.canvas,this.ctx),this}stop(){return ee.stop(this),this}resize(t,e){ee.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,n),h=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,o(this,h,!0)&&(this.notifyPlugins("resize",{size:a}),r(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};h(t,(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let n=[];e&&(n=n.concat(Object.keys(e).map(t=>{const i=e[t],s=Hi(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),h(n,e=>{const n=e.options,o=n.id,a=Hi(o,n),r=M(n.type,e.dtype);void 0!==n.position&&es(n.position,a)===es(e.dposition)||(n.position=e.dposition),s[o]=!0;let h=null;if(o in i&&i[o].type===r)h=i[o];else{h=new(Ii.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(n,t)}),h(s,(t,e)=>{t||delete i[e]}),h(i,t=>{si.configure(this,t,t.options),si.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(is("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],i=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=i.length;s<n;s++){const n=i[s];let o=this.getDatasetMeta(s);const a=n.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(s),o=this.getDatasetMeta(s)),o.type=a,o.indexAxis=n.indexAxis||Bi(a,this.options),o.order=n.order||0,o.index=s,o.label=""+n.label,o.visible=this.isDatasetVisible(s),o.controller)o.controller.updateIndex(s),o.controller.linkScales();else{const i=Ii.getController(a),{datasetElementType:n,dataElementType:r}=t.datasets[a];Object.assign(i,{dataElementType:Ii.getElement(r),datasetElementType:n&&Ii.getElement(n)}),o.controller=new i(this,s),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){h(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||h(n,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(is("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){h(this.scales,t=>{si.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);l(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){hs(t,s,"_removeElements"===i?-n:n)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),s=i(0);for(let t=1;t<e;t++)if(!l(s,i(t)))return;return Array.from(s).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;si.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],h(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,c(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(ee.has(this)?this.attached&&!ee.running(this)&&ee.start(this):(this.draw(),ss({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=u(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(s&&g(e,s),t.controller.draw(),s&&p(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return f(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=$e.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=m(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);x(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update(e=>e.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ee.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),a(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete as[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};h(this.options.events,t=>i(t,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){h(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},h(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!b(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),h=_(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,h);i&&(this._lastEvent=null,r(n.onHover,[t,a,this],this),h&&r(n.onClick,[t,a,this],this));const c=!b(a,s);return(c||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function cs(){return h(ls.instances,t=>t._plugins.invalidate())}function ds(t,e,i,s){const n=(o=t.options.borderRadius,Qt(o,["outerStart","outerEnd","innerStart","innerEnd"]));var o;const a=(i-e)/2,r=Math.min(a,s*e/2),h=t=>{const e=(i-Math.min(a,t))*s/2;return q(t,0,Math.min(a,e))};return{outerStart:h(n.outerStart),outerEnd:h(n.outerEnd),innerStart:q(n.innerStart,0,r),innerEnd:q(n.innerEnd,0,r)}}function us(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function gs(t,e,i,s,n,o){const{x:a,y:r,startAngle:h,pixelMargin:l,innerRadius:c}=e,d=Math.max(e.outerRadius+s+i-l,0),u=c>0?c+s+i+l:0;let g=0;const p=n-h;if(s){const t=((c>0?c-s:0)+(d>0?d-s:0))/2;g=(p-(0!==t?p*t/(t+s):p))/2}const f=(p-Math.max(.001,p*d-i/U)/d)/2,m=h+f+g,x=n-f-g,{outerStart:b,outerEnd:_,innerStart:y,innerEnd:v}=ds(e,u,d,x-m),M=d-b,w=d-_,k=m+b/M,S=x-_/w,D=u+y,P=u+v,A=m+y/D,C=x-v/P;if(t.beginPath(),o){const e=(k+S)/2;if(t.arc(a,r,d,k,e),t.arc(a,r,d,e,S),_>0){const e=us(w,S,a,r);t.arc(e.x,e.y,_,S,x+xt)}const i=us(P,x,a,r);if(t.lineTo(i.x,i.y),v>0){const e=us(P,C,a,r);t.arc(e.x,e.y,v,x+xt,C+Math.PI)}const s=(x-v/u+(m+y/u))/2;if(t.arc(a,r,u,x-v/u,s,!0),t.arc(a,r,u,s,m+y/u,!0),y>0){const e=us(D,A,a,r);t.arc(e.x,e.y,y,A+Math.PI,m-xt)}const n=us(M,m,a,r);if(t.lineTo(n.x,n.y),b>0){const e=us(M,k,a,r);t.arc(e.x,e.y,b,m-xt,k)}}else{t.moveTo(a,r);const e=Math.cos(k)*d+a,i=Math.sin(k)*d+r;t.lineTo(e,i);const s=Math.cos(S)*d+a,n=Math.sin(S)*d+r;t.lineTo(s,n)}t.closePath()}function ps(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r,options:h}=e,{borderWidth:l,borderJoinStyle:c,borderDash:d,borderDashOffset:u,borderRadius:g}=h,p="inner"===h.borderAlign;if(!l)return;t.setLineDash(d||[]),t.lineDashOffset=u,p?(t.lineWidth=2*l,t.lineJoin=c||"round"):(t.lineWidth=l,t.lineJoin=c||"bevel");let f=e.endAngle;if(o){gs(t,e,i,s,f,n);for(let e=0;e<o;++e)t.stroke();isNaN(r)||(f=a+(r%N||N))}p&&function(t,e,i){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:h}=e;let l=n/r;t.beginPath(),t.arc(o,a,r,s-l,i+l),h>n?(l=n/h,t.arc(o,a,h,i+l,s-l,!0)):t.arc(o,a,n,i+xt,s-xt),t.closePath(),t.clip()}(t,e,f),h.selfJoin&&f-a>=U&&0===g&&"miter"!==c&&function(t,e,i){const{startAngle:s,x:n,y:o,outerRadius:a,innerRadius:r,options:h}=e,{borderWidth:l,borderJoinStyle:c}=h,d=Math.min(l/a,mt(s-i));if(t.beginPath(),t.arc(n,o,a-l/2,s+d/2,i-d/2),r>0){const e=Math.min(l/r,mt(s-i));t.arc(n,o,r+l/2,i-e/2,s+e/2,!0)}else{const e=Math.min(l/2,a*mt(s-i));if("round"===c)t.arc(n,o,e,i-U/2,s+U/2,!0);else if("bevel"===c){const a=2*e*e,r=-a*Math.cos(i+U/2)+n,h=-a*Math.sin(i+U/2)+o,l=a*Math.cos(s+U/2)+n,c=a*Math.sin(s+U/2)+o;t.lineTo(r,h),t.lineTo(l,c)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,f),o||(gs(t,e,i,s,f,n),t.stroke())}class fs extends Mi{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=ot(s,{x:t,y:e}),{startAngle:a,endAngle:r,innerRadius:h,outerRadius:l,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=M(c,r-a),g=at(n,a,r)&&a!==r,p=u>=N||g,f=kt(o,h+d,l+d);return p&&f}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:h}=this.options,l=(s+n)/2,c=(o+a+h+r)/2;return{x:e+Math.cos(l)*c,y:i+Math.sin(l)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>N?Math.floor(i/N):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const r=s*(1-Math.sin(Math.min(U,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r}=e;let h=e.endAngle;if(o){gs(t,e,i,s,h,n);for(let e=0;e<o;++e)t.fill();isNaN(r)||(h=a+(r%N||N))}gs(t,e,i,s,h,n),t.fill()}(t,this,r,n,o),ps(t,this,r,n,o),t.restore()}}function ms(t,e,i=e){t.lineCap=M(i.borderCapStyle,e.borderCapStyle),t.setLineDash(M(i.borderDash,e.borderDash)),t.lineDashOffset=M(i.borderDashOffset,e.borderDashOffset),t.lineJoin=M(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=M(i.borderWidth,e.borderWidth),t.strokeStyle=M(i.borderColor,e.borderColor)}function xs(t,e,i){t.lineTo(i.x,i.y)}function bs(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,h=Math.max(n,a),l=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:h,loop:e.loop,ilen:l<h&&!c?s+l-h:l-h}}function _s(t,e,i,s){const{points:n,options:o}=e,{count:a,start:r,loop:h,ilen:l}=bs(n,i,s),c=function(t){return t.stepped?Kt:t.tension||"monotone"===t.cubicInterpolationMode?Jt:xs}(o);let d,u,g,{move:p=!0,reverse:f}=s||{};for(d=0;d<=l;++d)u=n[(r+(f?l-d:d))%a],u.skip||(p?(t.moveTo(u.x,u.y),p=!1):c(t,g,u,f,o.stepped),g=u);return h&&(u=n[(r+(f?l:0))%a],c(t,g,u,f,o.stepped)),!!h}function ys(t,e,i,s){const n=e.points,{count:o,start:a,ilen:r}=bs(n,i,s),{move:h=!0,reverse:l}=s||{};let c,d,u,g,p,f,m=0,x=0;const b=t=>(a+(l?r-t:t))%o,_=()=>{g!==p&&(t.lineTo(m,p),t.lineTo(m,g),t.lineTo(m,f))};for(h&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<g?g=i:i>p&&(p=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,g=p=i),f=i}_()}function vs(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?ys:_s}const Ms="function"==typeof Path2D;function ws(t,e,i,s){Ms&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),ms(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=vs(e);for(const r of n)ms(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class ks extends Mi{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;rt(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=ht(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,o=lt(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],r=function(t){return t.stepped?St:t.tension||"monotone"===t.cubicInterpolationMode?Dt:Pt}(i);let h,l;for(h=0,l=o.length;h<l;++h){const{start:l,end:c}=o[h],d=n[l],u=n[c];if(d===u){a.push(d);continue}const g=r(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);g[e]=t[e],a.push(g)}return 1===a.length?a[0]:a}pathSegment(t,e,i){return vs(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=vs(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=n(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),ws(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Ss(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}class Ds extends Mi{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Ss(this,t,"x",e)}inYRange(t,e){return Ss(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!f(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ct(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Ps(t,e){const{x:i,y:s,base:n,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let r,h,l,c,d;return t.horizontal?(d=a/2,r=Math.min(i,n),h=Math.max(i,n),l=s-d,c=s+d):(d=o/2,r=i-d,h=i+d,l=Math.min(s,n),c=Math.max(s,n)),{left:r,top:l,right:h,bottom:c}}function As(t,e,i,s){return t?0:q(e,i,s)}function Cs(t){const e=Ps(t),i=e.right-e.left,s=e.bottom-e.top,n=function(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,o=Bt(s);return{t:As(n.top,o.top,0,i),r:As(n.right,o.right,0,e),b:As(n.bottom,o.bottom,0,i),l:As(n.left,o.left,0,e)}}(t,i/2,s/2),o=function(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,o=zt(n),a=Math.min(e,i),r=t.borderSkipped,h=s||S(n);return{topLeft:As(!h||r.top||r.left,o.topLeft,0,a),topRight:As(!h||r.top||r.right,o.topRight,0,a),bottomLeft:As(!h||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:As(!h||r.bottom||r.right,o.bottomRight,0,a)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function Ls(t,e,i,s){const n=null===e,o=null===i,a=t&&!(n&&o)&&Ps(t,s);return a&&(n||kt(e,a.left,a.right))&&(o||kt(i,a.top,a.bottom))}function Os(t,e){t.rect(e.x,e.y,e.w,e.h)}function Ts(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,a=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+a,radius:t.radius}}class Es extends Mi{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=Cs(this),a=(r=o.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?dt:Os;var r;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),a(t,Ts(o,e,n)),t.clip(),a(t,Ts(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Ts(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Ls(this,t,e,i)}inXRange(t,e){return Ls(this,t,null,e)}inYRange(t,e){return Ls(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}var Rs=Object.freeze({__proto__:null,ArcElement:fs,BarElement:Es,LineElement:ks,PointElement:Ds});const Is=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],zs=Is.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Fs(t){return Is[t%Is.length]}function Vs(t){return zs[t%zs.length]}function Bs(t){let e=0;return(i,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof Ae?e=function(t,e){return t.backgroundColor=t.data.map(()=>Fs(e++)),e}(i,e):n instanceof Le?e=function(t,e){return t.backgroundColor=t.data.map(()=>Vs(e++)),e}(i,e):n&&(e=function(t,e){return t.borderColor=Fs(e),t.backgroundColor=Vs(e),++e}(i,e))}}function Ns(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Ws={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,i,s){if(!s.enabled)return;const{data:{datasets:n},options:o}=e.config,{elements:a}=o,r=Ns(n)||(h=o)&&(h.borderColor||h.backgroundColor)||a&&Ns(a)||"rgba(0,0,0,0.1)"!==t.borderColor||"rgba(0,0,0,0.1)"!==t.backgroundColor;var h;if(!s.forceOverride&&r)return;const l=Bs(e);n.forEach(l)}};function Hs(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function js(t){t.data.datasets.forEach(t=>{Hs(t)})}var $s={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void js(t);const s=t.width;t.data.datasets.forEach((e,o)=>{const{_data:a,indexAxis:r}=e,h=t.getDatasetMeta(o),l=a||e.data;if("y"===ut([r,t.options.indexAxis]))return;if(!h.controller.supportsDecimation)return;const c=t.scales[h.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:d,count:u}=function(t,e){const i=e.length;let s,n=0;const{iScale:o}=t,{min:a,max:r,minDefined:h,maxDefined:l}=o.getUserBounds();return h&&(n=q(R(e,o.axis,a).lo,0,i-1)),s=l?q(R(e,o.axis,r).hi+1,n,i)-n:i-n,{start:n,count:s}}(h,l);if(u<=(i.threshold||4*s))return void Hs(e);let g;switch(n(a)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":g=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let h=0;const l=e+i-1;let c,d,u,g,p,f=e;for(a[h++]=t[f],c=0;c<o-2;c++){let s,n=0,o=0;const l=Math.floor((c+1)*r)+1+e,m=Math.min(Math.floor((c+2)*r)+1,i)+e,x=m-l;for(s=l;s<m;s++)n+=t[s].x,o+=t[s].y;n/=x,o/=x;const b=Math.floor(c*r)+1+e,_=Math.min(Math.floor((c+1)*r)+1,i)+e,{x:y,y:v}=t[f];for(u=g=-1,s=b;s<_;s++)g=.5*Math.abs((y-n)*(t[s].y-v)-(y-t[s].x)*(o-v)),g>u&&(u=g,d=t[s],p=s);a[h++]=d,f=p}return a[h++]=t[l],a}(l,d,u,s,i);break;case"min-max":g=function(t,e,i,s){let o,a,r,h,l,c,d,u,g,p,f=0,m=0;const x=[],b=e+i-1,_=t[e].x,y=t[b].x-_;for(o=e;o<e+i;++o){a=t[o],r=(a.x-_)/y*s,h=a.y;const e=0|r;if(e===l)h<g?(g=h,c=o):h>p&&(p=h,d=o),f=(m*f+a.x)/++m;else{const i=o-1;if(!n(c)&&!n(d)){const e=Math.min(c,d),s=Math.max(c,d);e!==u&&e!==i&&x.push({...t[e],x:f}),s!==u&&s!==i&&x.push({...t[s],x:f})}o>0&&i!==u&&x.push(t[i]),x.push(a),l=e,m=0,g=p=h,c=d=u=o}}return x}(l,d,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=g})},destroy(t){js(t)}};function Us(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=mt(n),o=mt(o)),{property:t,start:n,end:o}}function Ys(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Xs(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function Gs(t,e){let i=[],s=!1;return A(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=Ys(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))}),o}(t,e),i.length?new ks({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function Ks(t){return t&&!1!==t.fill}function Js(t,e,i){let s=t[e].fill;const n=[e];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!L(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function qs(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=M(i&&i.target,i);void 0===s&&(s=!!e.backgroundColor);if(!1===s||null===s)return!1;if(!0===s)return"origin";return s}(t);if(S(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return L(n)&&Math.floor(n)===n?function(t,e,i,s){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=s)return!1;return i}(s[0],e,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Zs(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:a,last:r,point:h}=Qs(o,e,"x");if(!(!h||a&&r))if(a)s.unshift(h);else if(t.push(h),!r)break}t.push(...s)}function Qs(t,e,i){const s=t.interpolate(e,i);if(!s)return{};const n=s[i],o=t.segments,a=t.points;let r=!1,h=!1;for(let t=0;t<o.length;t++){const e=o[t],s=a[e.start][i],l=a[e.end][i];if(kt(n,s,l)){r=n===s,h=n===l;break}}return{first:r,last:h,point:s}}class tn{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:n,radius:o}=this;return e=e||{start:0,end:N},t.arc(s,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function en(t){const{chart:e,fill:i,line:s}=t;if(L(i))return function(t,e){const i=t.getDatasetMeta(e),s=i&&t.isDatasetVisible(e);return s?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,a=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);r.push(Gs({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)Zs(n,a[t],r)}return new ks({points:n,options:{}})}(t);if("shape"===i)return!0;const n=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,o=s.reverse?e.max:e.min,a=function(t,e,i){let s;return s="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:S(t)?t.value:e.getBaseValue(),s}(i,e,o),r=[];if(s.grid.circular){const t=e.getPointPositionForValue(0,o);return new tn({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(a)})}for(let t=0;t<n;++t)r.push(e.getPointPositionForValue(t,a));return r}(t);return function(t){const{scale:e={},fill:i}=t,s=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:S(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(L(s)){const t=e.isHorizontal();return{x:t?s:null,y:t?null:s}}return null}(t)}(t);return n instanceof tn?n:Gs(n,s)}function sn(t,e,i){const s=en(e),{chart:n,index:o,line:a,scale:r,axis:h}=e,l=a.options,c=l.fill,d=l.backgroundColor,{above:f=d,below:m=d}=c||{},x=n.getDatasetMeta(o),b=u(n,x);s&&a.points.length&&(g(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r,clip:h}=e,l=i._loop?"angle":e.axis;t.save();let c=o;o!==n&&("x"===l?(nn(t,s,a.top),an(t,{line:i,target:s,color:n,scale:r,property:l,clip:h}),t.restore(),t.save(),nn(t,s,a.bottom)):"y"===l&&(on(t,s,a.left),an(t,{line:i,target:s,color:o,scale:r,property:l,clip:h}),t.restore(),t.save(),on(t,s,a.right),c=n));an(t,{line:i,target:s,color:c,scale:r,property:l,clip:h}),t.restore()}(t,{line:a,target:s,above:f,below:m,area:i,scale:r,axis:h,clip:b}),p(t))}function nn(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:h}=r,l=n[s],c=n[Ys(s,h,n)];o?(t.moveTo(l.x,l.y),o=!1):(t.lineTo(l.x,i),t.lineTo(l.x,l.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function on(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:h}=r,l=n[s],c=n[Ys(s,h,n)];o?(t.moveTo(l.x,l.y),o=!1):(t.lineTo(i,l.y),t.lineTo(l.x,l.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(i,c.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function an(t,e){const{line:i,target:s,property:n,color:o,scale:a,clip:r}=e,h=function(t,e,i){const s=t.segments,n=t.points,o=e.points,a=[];for(const t of s){let{start:s,end:r}=t;r=Ys(s,r,n);const h=Us(i,n[s],n[r],t.loop);if(!e.segments){a.push({source:t,target:h,start:n[s],end:n[r]});continue}const l=lt(e,h);for(const e of l){const s=Us(i,o[e.start],o[e.end],e.loop),r=Nt(t,n,s);for(const t of r)a.push({source:t,target:e,start:{[i]:Xs(h,s,"start",Math.max)},end:{[i]:Xs(h,s,"end",Math.min)}})}}return a}(i,s,n);for(const{source:e,target:l,start:c,end:d}of h){const{style:{backgroundColor:h=o}={}}=e,u=!0!==s;t.save(),t.fillStyle=h,rn(t,a,r,u&&Us(n,c,d)),t.beginPath();const g=!!i.pathSegment(t,e);let p;if(u){g?t.closePath():hn(t,s,d,n);const e=!!s.pathSegment(t,l,{move:g,reverse:!0});p=g&&e,p||hn(t,s,c,n)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function rn(t,e,i,s){const n=e.chart.chartArea,{property:o,start:a,end:r}=s||{};if("x"===o||"y"===o){let e,s,h,l;"x"===o?(e=a,s=n.top,h=r,l=n.bottom):(e=n.left,s=a,h=n.right,l=r),t.beginPath(),i&&(e=Math.max(e,i.left),h=Math.min(h,i.right),s=Math.max(s,i.top),l=Math.min(l,i.bottom)),t.rect(e,s,h-e,l-s),t.clip()}}function hn(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var ln={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,h;for(a=0;a<s;++a)o=t.getDatasetMeta(a),r=o.dataset,h=null,r&&r.options&&r instanceof ks&&(h={visible:t.isDatasetVisible(a),index:a,fill:qs(r,a,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=h,n.push(h);for(a=0;a<s;++a)h=n[a],h&&!1!==h.fill&&(h.fill=Js(n,a,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&sn(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;Ks(i)&&sn(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;Ks(s)&&"beforeDatasetDraw"===i.drawTime&&sn(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const cn=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class dn extends Mi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=r(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=st(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:r}=cn(i,n);let h,l;e.font=s.string,this.isHorizontal()?(h=this.maxWidth,l=this._fitRows(o,n,a,r)+10):(l=this.maxHeight,h=this._fitCols(o,s,a,r)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(l,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],h=this.lineWidths=[0],l=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-l;return this.legendItems.forEach((t,g)=>{const p=i+e/2+n.measureText(t.text).width;(0===g||h[h.length-1]+p+2*a>o)&&(c+=l,h[h.length-(g>0?0:1)]=0,u+=l,d++),r[g]={left:0,top:u,row:d,width:p,height:s},h[h.length-1]+=p+a}),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],h=this.columnSizes=[],l=o-t;let c=a,d=0,u=0,g=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:f,itemHeight:m}=function(t,e,i,s,n){const o=function(t,e,i,s){let n=t.text;n&&"string"!=typeof n&&(n=n.reduce((t,e)=>t.length>e.length?t:e));return e+i.size/2+s.measureText(n).width}(s,t,e,i),a=function(t,e,i){let s=t;"string"!=typeof e.text&&(s=un(e,i));return s}(n,s,e.lineHeight);return{itemWidth:o,itemHeight:a}}(i,e,n,t,s);o>0&&u+m+2*a>l&&(c+=d+a,h.push({width:d,height:u}),g+=d+a,p++,d=u=0),r[o]={left:g,top:u,col:p,width:f,height:m},d=Math.max(d,f),u+=m+a}),c+=d,h.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,o=At(n,this.left,this.width);if(this.isHorizontal()){let n=0,a=Ct(i,this.left+s,this.right-this.lineWidths[n]);for(const r of e)n!==r.row&&(n=r.row,a=Ct(i,this.left+s,this.right-this.lineWidths[n])),r.top+=this.top+t+s,r.left=o.leftForLtr(o.x(a),r.width),a+=r.width+s}else{let n=0,a=Ct(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const r of e)r.col!==n&&(n=r.col,a=Ct(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),r.top=a,r.left+=this.left+s,r.left=o.leftForLtr(o.x(r.left),r.width),a+=r.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;g(t,this),this._draw(),p(t)}}_draw(){const{options:e,columnSizes:i,lineWidths:s,ctx:n}=this,{align:o,labels:a}=e,r=t.color,h=At(e.rtl,this.left,this.width),l=st(a.font),{padding:c}=a,d=l.size,u=d/2;let g;this.drawTitle(),n.textAlign=h.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:m}=cn(a,d),x=this.isHorizontal(),b=this._computeTitleHeight();g=x?{x:Ct(o,this.left+c,this.right-s[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:Ct(o,this.top+b+c,this.bottom-i[0].height),line:0},Lt(this.ctx,e.textDirection);const _=m+c;this.legendItems.forEach((t,y)=>{n.strokeStyle=t.fontColor,n.fillStyle=t.fontColor;const v=n.measureText(t.text).width,w=h.textAlign(t.textAlign||(t.textAlign=a.textAlign)),k=p+u+v;let S=g.x,D=g.y;h.setWidth(this.width),x?y>0&&S+k+c>this.right&&(D=g.y+=_,g.line++,S=g.x=Ct(o,this.left+c,this.right-s[g.line])):y>0&&D+_>this.bottom&&(S=g.x=S+i[g.line].width+c,g.line++,D=g.y=Ct(o,this.top+b+c,this.bottom-i[g.line].height));if(function(t,e,i){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;n.save();const s=M(i.lineWidth,1);if(n.fillStyle=M(i.fillStyle,r),n.lineCap=M(i.lineCap,"butt"),n.lineDashOffset=M(i.lineDashOffset,0),n.lineJoin=M(i.lineJoin,"miter"),n.lineWidth=s,n.strokeStyle=M(i.strokeStyle,r),n.setLineDash(M(i.lineDash,[])),a.usePointStyle){const o={radius:f*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},r=h.xPlus(t,p/2);Wt(n,o,r,e+u,a.pointStyleWidth&&p)}else{const o=e+Math.max((d-f)/2,0),a=h.leftForLtr(t,p),r=zt(i.borderRadius);n.beginPath(),Object.values(r).some(t=>0!==t)?dt(n,{x:a,y:o,w:p,h:f,radius:r}):n.rect(a,o,p,f),n.fill(),0!==s&&n.stroke()}n.restore()}(h.x(S),D,t),S=Ot(w,S+p+u,x?S+k:this.right,e.rtl),function(t,e,i){it(n,i.text,t,e+m/2,l,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})}(h.x(S),D,t),x)g.x+=k+c;else if("string"!=typeof t.text){const e=l.lineHeight;g.y+=un(t,e)+c}else g.y+=_}),Tt(this.ctx,e.textDirection)}drawTitle(){const t=this.options,e=t.title,i=st(e.font),s=y(e.padding);if(!e.display)return;const n=At(t.rtl,this.left,this.width),o=this.ctx,a=e.position,r=i.size/2,h=s.top+r;let l,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+h,c=Ct(t.align,c,this.right-d);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);l=h+Ct(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Ct(a,c,c+d);o.textAlign=n.textAlign(Et(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,it(o,e.text,u,l,i)}_computeTitleHeight(){const t=this.options.title,e=st(t.font),i=y(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(kt(t,this.left,this.right)&&kt(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(s=n[i],kt(t,s.left,s.left+s.width)&&kt(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,a=(n=i,null!==(s=o)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);o&&!a&&r(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!a&&r(e.onHover,[t,i,this],this)}else i&&r(e.onClick,[t,i,this],this);var s,n}}function un(t,e){return e*(t.text?t.text.length:0)}var gn={id:"legend",_element:dn,start(t,e,i){const s=t.legend=new dn({ctx:t.ctx,options:i,chart:t});si.configure(t,s,i),si.addBox(t,s)},stop(t){si.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;si.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const h=t.controller.getStyle(i?0:void 0),l=y(h.borderWidth);return{text:e[t.index].label,fillStyle:h.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:h.borderColor,pointStyle:s||h.pointStyle,rotation:h.rotation,textAlign:n||h.textAlign,borderRadius:a&&(r||h.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class pn extends Mi{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=A(i.text)?i.text.length:1;this._padding=y(i.padding);const n=s*st(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:o}=this,a=o.align;let r,h,l,c=0;return this.isHorizontal()?(h=Ct(a,i,n),l=e+t,r=n-i):("left"===o.position?(h=i+t,l=Ct(a,s,e),c=-.5*U):(h=n-t,l=Ct(a,e,s),c=.5*U),r=s-e),{titleX:h,titleY:l,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=st(e.font),s=i.lineHeight/2+this._padding.top,{titleX:n,titleY:o,maxWidth:a,rotation:r}=this._drawArgs(s);it(t,e.text,0,0,i,{color:e.color,maxWidth:a,rotation:r,textAlign:Et(e.align),textBaseline:"middle",translation:[n,o]})}}var fn={id:"title",_element:pn,start(t,e,i){!function(t,e){const i=new pn({ctx:t.ctx,options:e,chart:t});si.configure(t,i,e),si.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;si.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;si.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const mn=new WeakMap;var xn={id:"subtitle",start(t,e,i){const s=new pn({ctx:t.ctx,options:i,chart:t});si.configure(t,s,i),si.addBox(t,s),mn.set(t,s)},stop(t){si.removeBox(t,mn.get(t)),mn.delete(t)},beforeUpdate(t,e,i){const s=mn.get(t);si.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const bn={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s.add(t.x),n+=t.y,++o}}if(0===o||0===s.size)return!1;return{x:[...s].reduce((t,e)=>t+e)/s.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,s,n,o=e.x,a=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=s.getCenterPoint(),i=Rt(e,t);i<r&&(r=i,n=s)}}if(n){const t=n.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function _n(t,e){return e&&(A(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function yn(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function vn(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Mn(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:a,boxHeight:r}=e,l=st(e.bodyFont),c=st(e.titleFont),d=st(e.footerFont),u=o.length,g=n.length,p=s.length,f=y(e.padding);let m=f.height,x=0,b=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){m+=p*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(b-p)*l.lineHeight+(b-1)*e.bodySpacing}g&&(m+=e.footerMarginTop+g*d.lineHeight+(g-1)*e.footerSpacing);let _=0;const v=function(t){x=Math.max(x,i.measureText(t).width+_)};return i.save(),i.font=c.string,h(t.title,v),i.font=l.string,h(t.beforeBody.concat(t.afterBody),v),_=e.displayColors?a+2+e.boxPadding:0,h(s,t=>{h(t.before,v),h(t.lines,v),h(t.after,v)}),_=0,i.font=d.string,h(t.footer,v),i.restore(),x+=f.width,{width:x,height:m}}function wn(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:h}}=t;let l="center";return"center"===s?l=n<=(r+h)/2?"left":"right":n<=o/2?l="left":n>=a-o/2&&(l="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(l,t,e,i)&&(l="center"),l}function kn(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||wn(t,e,i,s),yAlign:s}}function Sn(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:r,yAlign:h}=i,l=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:g}=zt(a);let p=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,r);const f=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,h,l);return"center"===h?"left"===r?p+=l:"right"===r&&(p-=l):"left"===r?p-=Math.max(c,u)+n:"right"===r&&(p+=Math.max(d,g)+n),{x:q(p,0,s.width-e.width),y:q(f,0,s.height-e.height)}}function Dn(t,e,i){const s=y(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function Pn(t){return _n([],yn(t))}function An(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const Cn={beforeTitle:It,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:It,beforeBody:It,beforeLabel:It,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return n(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:It,afterBody:It,beforeFooter:It,footer:It,afterFooter:It};function Ln(t,e,i,s){const n=t[e].call(i,s);return void 0===n?Cn[e].call(i,s):n}class On extends Mi{static positioners=bn;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new oe(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,m(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,s=Ln(i,"beforeTitle",this,t),n=Ln(i,"title",this,t),o=Ln(i,"afterTitle",this,t);let a=[];return a=_n(a,yn(s)),a=_n(a,yn(n)),a=_n(a,yn(o)),a}getBeforeBody(t,e){return Pn(Ln(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return h(t,t=>{const e={before:[],lines:[],after:[]},n=An(i,t);_n(e.before,yn(Ln(n,"beforeLabel",this,t))),_n(e.lines,Ln(n,"label",this,t)),_n(e.after,yn(Ln(n,"afterLabel",this,t))),s.push(e)}),s}getAfterBody(t,e){return Pn(Ln(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Ln(i,"beforeFooter",this,t),n=Ln(i,"footer",this,t),o=Ln(i,"afterFooter",this,t);let a=[];return a=_n(a,yn(s)),a=_n(a,yn(n)),a=_n(a,yn(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,l=[];for(a=0,r=e.length;a<r;++a)l.push(vn(this.chart,e[a]));return t.filter&&(l=l.filter((e,s,n)=>t.filter(e,s,n,i))),t.itemSort&&(l=l.sort((e,s)=>t.itemSort(e,s,i))),h(l,e=>{const i=An(t.callbacks,e);s.push(Ln(i,"labelColor",this,e)),n.push(Ln(i,"labelPointStyle",this,e)),o.push(Ln(i,"labelTextColor",this,e))}),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=bn[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Mn(this,i),a=Object.assign({},t,e),r=kn(this.chart,i,a),h=Sn(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:h,bottomLeft:l,bottomRight:c}=zt(a),{x:d,y:u}=t,{width:g,height:p}=e;let f,m,x,b,_,y;return"center"===n?(_=u+p/2,"left"===s?(f=d,m=f-o,b=_+o,y=_-o):(f=d+g,m=f+o,b=_-o,y=_+o),x=f):(m="left"===s?d+Math.max(r,l)+o:"right"===s?d+g-Math.max(h,c)-o:this.caretX,"top"===n?(b=u,_=b-o,f=m-o,x=m+o):(b=u+p,_=b+o,f=m+o,x=m-o),y=b),{x1:f,x2:m,x3:x,y1:b,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,a,r;if(n){const h=At(i.rtl,this.x,this.width);for(t.x=Dn(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",o=st(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,r=0;r<n;++r)e.fillText(s[r],h.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,r+1===n&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,n){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:r,boxWidth:h}=n,l=st(n.bodyFont),c=Dn(this,"left",n),d=s.x(c),u=r<l.lineHeight?(l.lineHeight-r)/2:0,g=e.y+u;if(n.usePointStyle){const e={radius:Math.min(h,r)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=s.leftForLtr(d,h)+h/2,l=g+r/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,ct(t,e,i,l),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,ct(t,e,i,l)}else{t.lineWidth=S(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=s.leftForLtr(d,h),i=s.leftForLtr(s.xPlus(d,1),h-2),a=zt(o.borderRadius);Object.values(a).some(t=>0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,dt(t,{x:e,y:g,w:h,h:r,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),dt(t,{x:i,y:g+1,w:h-2,h:r-2,radius:a}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,g,h,r),t.strokeRect(e,g,h,r),t.fillStyle=o.backgroundColor,t.fillRect(i,g+1,h-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:l,boxPadding:c}=i,d=st(i.bodyFont);let u=d.lineHeight,g=0;const p=At(i.rtl,this.x,this.width),f=function(i){e.fillText(i,p.x(t.x+g),t.y+u/2),t.y+=u+n},m=p.textAlign(o);let x,b,_,y,v,M,w;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=Dn(this,m,i),e.fillStyle=i.bodyColor,h(this.beforeBody,f),g=a&&"right"!==m?"center"===o?l/2+c:l+2+c:0,y=0,M=s.length;y<M;++y){for(x=s[y],b=this.labelTextColors[y],e.fillStyle=b,h(x.before,f),_=x.lines,a&&_.length&&(this._drawColorBox(e,t,y,p,i),u=Math.max(d.lineHeight,r)),v=0,w=_.length;v<w;++v)f(_[v]),u=d.lineHeight;h(x.after,f)}g=0,u=d.lineHeight,h(this.afterBody,f),t.y-=n}drawFooter(t,e,i){const s=this.footer,n=s.length;let o,a;if(n){const r=At(i.rtl,this.x,this.width);for(t.x=Dn(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=r.textAlign(i.footerAlign),e.textBaseline="middle",o=st(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<n;++a)e.fillText(s[a],r.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:o}=this,{x:a,y:r}=t,{width:h,height:l}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:g}=zt(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+c,r),"top"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+h-d,r),e.quadraticCurveTo(a+h,r,a+h,r+d),"center"===o&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(a+h,r+l-g),e.quadraticCurveTo(a+h,r+l,a+h-g,r+l),"bottom"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+u,r+l),e.quadraticCurveTo(a,r+l,a,r+l-u),"center"===o&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(a,r+c),e.quadraticCurveTo(a,r,a+c,r),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=bn[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Mn(this,t),a=Object.assign({},i,this._size),r=kn(e,t,a),h=Sn(t,a,r,e);s._to===h.x&&n._to===h.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=y(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),Lt(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),Tt(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),n=!b(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),r=e||!b(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=bn[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var Tn={id:"tooltip",_element:On,positioners:bn,afterInit(t,e,i){i&&(t.tooltip=new On({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Cn},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},En=Object.freeze({__proto__:null,Colors:Ws,Decimation:$s,Filler:ln,Legend:gn,SubTitle:xn,Title:fn,Tooltip:Tn});function Rn(t,e,i,s){const n=t.indexOf(e);if(-1===n)return((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}function In(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class zn extends Ti{static id="category";static defaults={ticks:{callback:In}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(n(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:q(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Rn(i,t,M(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return In.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Fn(t,e,{horizontal:i,minRotation:s}){const n=T(s),o=(i?Math.sin(n):Math.cos(n))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class Vn extends Ti{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return n(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,a=t=>n=i?n:t;if(t){const t=F(s),e=F(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(t,e){const i=[],{bounds:s,step:o,min:a,max:r,precision:h,count:l,maxTicks:c,maxDigits:d,includeBounds:u}=t,g=o||1,p=c-1,{min:f,max:m}=e,x=!n(a),b=!n(r),_=!n(l),y=(m-f)/(d+1);let v,M,w,k,S=Ht((m-f)/p/g)*g;if(S<1e-14&&!x&&!b)return[{value:f},{value:m}];k=Math.ceil(m/S)-Math.floor(f/S),k>p&&(S=Ht(k*S/p/g)*g),n(h)||(v=Math.pow(10,h),S=Math.ceil(S*v)/v),"ticks"===s?(M=Math.floor(f/S)*S,w=Math.ceil(m/S)*S):(M=f,w=m),x&&b&&o&&jt((r-a)/o,S/1e3)?(k=Math.round(Math.min((r-a)/S,c)),S=(r-a)/k,M=a,w=r):_?(M=x?a:M,w=b?r:w,k=l-1,S=(w-M)/k):(k=(w-M)/S,k=$t(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const D=Math.max(qt(S),qt(M));v=Math.pow(10,n(h)?D:h),M=Math.round(M*v)/v,w=Math.round(w*v)/v;let P=0;for(x&&(u&&M!==a?(i.push({value:a}),M<a&&P++,$t(Math.round((M+P*S)*v)/v,a,Fn(a,y,t))&&P++):M<a&&P++);P<k;++P){const t=Math.round((M+P*S)*v)/v;if(b&&t>r)break;i.push({value:t})}return b&&u&&w!==r?i.length&&$t(i[i.length-1].value,r,Fn(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&pt(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return W(t,this.chart.options.locale,this.options.ticks.format)}}class Bn extends Vn{static id="linear";static defaults={ticks:{callback:gt.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=L(t)?t:0,this.max=L(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=T(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Nn=t=>Math.floor(ft(t)),Wn=(t,e)=>Math.pow(10,Nn(t)+e);function Hn(t){return 1===t/Math.pow(10,Nn(t))}function jn(t,e,i){const s=Math.pow(10,i),n=Math.floor(t/s);return Math.ceil(e/s)-n}function $n(t,{min:e,max:i}){e=K(t.min,e);const s=[],n=Nn(e);let o=function(t,e){let i=Nn(e-t);for(;jn(t,e,i)>10;)i++;for(;jn(t,e,i)<10;)i--;return Math.min(i,Nn(t))}(e,i),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),h=n>o?Math.pow(10,n):0,l=Math.round((e-h)*a)/a,c=Math.floor((e-h)/r/10)*r*10;let d=Math.floor((l-c)/Math.pow(10,o)),u=K(t.min,Math.round((h+c+d*Math.pow(10,o))*a)/a);for(;u<i;)s.push({value:u,major:Hn(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),u=Math.round((h+c+d*Math.pow(10,o))*a)/a;const g=K(t.max,u);return s.push({value:g,major:Hn(g),significand:d}),s}class Un extends Ti{static id="logarithmic";static defaults={ticks:{callback:gt.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Vn.prototype.parse.apply(this,[t,e]);if(0!==i)return L(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=L(t)?Math.max(0,t):null,this.max=L(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!L(this._userMin)&&(this.min=t===Wn(this.min,0)?Wn(this.min,-1):Wn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,o=t=>s=e?s:t;i===s&&(i<=0?(n(1),o(10)):(n(Wn(i,-1)),o(Wn(s,1)))),i<=0&&n(Wn(s,-1)),s<=0&&o(Wn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=$n({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&pt(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":W(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ft(t),this._valueRange=ft(this.max)-ft(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ft(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Yn(e){const i=e.ticks;if(i.display&&e.display){const e=y(i.backdropPadding);return M(i.font&&i.font.size,t.font.size)+e.height}return 0}function Xn(t,e,i){return i=A(i)?i:[i],{w:Ut(t,e.string,i),h:i.length*e.lineHeight}}function Gn(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:t<s||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function Kn(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],n=[],o=t._pointLabels.length,a=t.options.pointLabels,r=a.centerPointLabels?U/o:0;for(let h=0;h<o;h++){const o=a.setContext(t.getPointLabelContext(h));n[h]=o.padding;const l=t.getPointPosition(h,t.drawingArea+n[h],r),c=st(o.font),d=Xn(t.ctx,c,t._pointLabels[h]);s[h]=d;const u=mt(t.getIndexAngle(h)+r),g=Math.round(Z(u));Jn(i,e,u,Gn(g,l.x,d.w,0,180),Gn(g,l.y,d.h,90,270))}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const s=[],n=t._pointLabels.length,o=t.options,{centerPointLabels:a,display:r}=o.pointLabels,h={extra:Yn(o)/2,additionalAngle:a?U/n:0};let l;for(let o=0;o<n;o++){h.padding=i[o],h.size=e[o];const n=qn(t,o,h);s.push(n),"auto"===r&&(n.visible=Zn(n,l),n.visible&&(l=n))}return s}(t,s,n)}function Jn(t,e,i,s,n){const o=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i));let r=0,h=0;s.start<e.l?(r=(e.l-s.start)/o,t.l=Math.min(t.l,e.l-r)):s.end>e.r&&(r=(s.end-e.r)/o,t.r=Math.max(t.r,e.r+r)),n.start<e.t?(h=(e.t-n.start)/a,t.t=Math.min(t.t,e.t-h)):n.end>e.b&&(h=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+h))}function qn(t,e,i){const s=t.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=i,h=t.getPointPosition(e,s+n+a,o),l=Math.round(Z(mt(h.angle+xt))),c=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(h.y,r.h,l),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(l),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(h.x,r.w,d);return{visible:!0,x:h.x,y:c,textAlign:d,left:u,top:c,right:u+r.w,bottom:c+r.h}}function Zn(t,e){if(!e)return!0;const{left:i,top:s,right:n,bottom:o}=t;return!(f({x:i,y:s},e)||f({x:i,y:o},e)||f({x:n,y:s},e)||f({x:n,y:o},e))}function Qn(t,e,i){const{left:s,top:o,right:a,bottom:r}=i,{backdropColor:h}=e;if(!n(h)){const i=zt(e.borderRadius),n=y(e.backdropPadding);t.fillStyle=h;const l=s-n.left,c=o-n.top,d=a-s+n.width,u=r-o+n.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),dt(t,{x:l,y:c,w:d,h:u,radius:i}),t.fill()):t.fillRect(l,c,d,u)}}function to(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,N);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;o<s;o++)i=t.getPointPosition(o,e),n.lineTo(i.x,i.y)}}class eo extends Vn{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:gt.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=y(Yn(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=L(t)&&!isNaN(t)?t:0,this.max=L(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Yn(this.options))}generateTickLabels(t){Vn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=r(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?Kn(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=N/(this._pointLabels.length||1),i=this.options.startAngle||0;return mt(t*e+T(i))}getDistanceFromCenterForValue(t){if(n(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(n(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return m(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-xt+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:n}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:n}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),to(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:n}=e,o=this._pointLabels.length;let a,r,h;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let n=e-1;n>=0;n--){const e=t._pointLabelItems[n];if(!e.visible)continue;const o=s.setContext(t.getPointLabelContext(n));Qn(i,o,e);const a=st(o.font),{x:r,y:h,textAlign:l}=e;it(i,t._pointLabels[n],r,h+a.lineHeight/2,a,{color:o.color,textAlign:l,textBaseline:"middle"})}}(this,o),s.display&&this.ticks.forEach((t,e)=>{if(0!==e||0===e&&this.min<0){r=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),a=s.setContext(i),h=n.setContext(i);!function(t,e,i,s,n){const o=t.ctx,a=e.circular,{color:r,lineWidth:h}=e;!a&&!s||!r||!h||i<0||(o.save(),o.strokeStyle=r,o.lineWidth=h,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),to(t,i,a,s),o.closePath(),o.stroke(),o.restore())}(this,a,r,o,h)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const s=i.setContext(this.getPointLabelContext(a)),{color:n,lineWidth:o}=s;o&&n&&(t.lineWidth=o,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,r=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),h=this.getPointPosition(a,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(h.x,h.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,a)=>{if(0===a&&this.min>=0&&!e.reverse)return;const r=i.setContext(this.getContext(a)),h=st(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[a].value),r.showLabelBackdrop){t.font=h.string,o=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=y(r.backdropPadding);t.fillRect(-o/2-e.left,-n-h.size/2-e.top,o+e.width,h.size+e.height)}it(t,s.label,0,-n,h,{color:r.color,strokeColor:r.textStrokeColor,strokeWidth:r.textStrokeWidth})}),t.restore()}drawTitle(){}}const io={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},so=Object.keys(io);function no(t,e){return t-e}function oo(t,e){if(n(e))return null;const i=t._adapter,{parser:s,round:o,isoWeekday:a}=t._parseOpts;let r=e;return"function"==typeof s&&(r=s(r)),L(r)||(r="string"==typeof s?i.parse(r,s):i.parse(r)),null===r?null:(o&&(r="week"!==o||!bt(a)&&!0!==a?i.startOf(r,o):i.startOf(r,"isoWeek",a)),+r)}function ao(t,e,i,s){const n=so.length;for(let o=so.indexOf(t);o<n-1;++o){const t=io[so[o]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return so[o]}return so[n-1]}function ro(t,e,i){if(i){if(i.length){const{lo:s,hi:n}=_t(i,e);t[i[s]>=e?i[s]:i[n]]=!0}}else t[e]=!0}function ho(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a<o;++a)r=e[a],n[r]=a,s.push({value:r,major:!1});return 0!==o&&i?function(t,e,i,s){const n=t._adapter,o=+n.startOf(e[0].value,s),a=e[e.length-1].value;let r,h;for(r=o;r<=a;r=+n.add(r,1,s))h=i[r],h>=0&&(e[h].major=!0);return e}(t,s,n,i):s}class lo extends Ti{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Fe._date(t.adapters.date);s.init(e),C(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:oo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();function r(t){o||isNaN(t.min)||(s=Math.min(s,t.min)),a||isNaN(t.max)||(n=Math.max(n,t.max))}o&&a||(r(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||r(this.getMinMax(!1))),s=L(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=L(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,o=this.max,a=O(s,n,o);return this._unit=e.unit||(i.autoSkip?ao(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,i,s,n){for(let o=so.length-1;o>=so.indexOf(i);o--){const i=so[o];if(io[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return so[i?so.indexOf(i):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=so.indexOf(t)+1,i=so.length;e<i;++e)if(io[so[e]].common)return so[e]}(this._unit):void 0,this.initOffsets(s),t.reverse&&a.reverse(),ho(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=q(s,0,o),n=q(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,o=n.unit||ao(n.minUnit,e,i,this._getLabelCapacity(e)),a=M(s.ticks.stepSize,1),r="week"===o&&n.isoWeekday,h=bt(r)||!0===r,l={};let c,d,u=e;if(h&&(u=+t.startOf(u,"isoWeek",r)),u=+t.startOf(u,h?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const g="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c<i;c=+t.add(c,a,o),d++)ro(l,c,g);return c!==i&&"ticks"!==s.bounds&&1!==d||ro(l,c,g),Object.keys(l).sort(no).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,s=this._unit,n=e||i[s];return this._adapter.format(t,n)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.ticks.callback;if(o)return r(o,[t,e,i],this);const a=n.time.displayFormats,h=this._unit,l=this._majorUnit,c=h&&a[h],d=l&&a[l],u=i[e],g=l&&d&&u&&u.major;return this._adapter.format(t,s||(g?d:c))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=T(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*n+a*o,h:i*o+a*n}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,ho(this,[t],this._majorUnit),s),o=this._getLabelSize(n),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(oo(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return E(t.sort(no))}}function co(t,e,i){let s,n,o,a,r=0,h=t.length-1;i?(e>=t[r].pos&&e<=t[h].pos&&({lo:r,hi:h}=R(t,"pos",e)),({pos:s,time:o}=t[r]),({pos:n,time:a}=t[h])):(e>=t[r].time&&e<=t[h].time&&({lo:r,hi:h}=R(t,"time",e)),({time:s,pos:o}=t[r]),({time:n,pos:a}=t[h]));const l=n-s;return l?o+(a-o)*(e-s)/l:o}class uo extends lo{static id="timeseries";static defaults=lo.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=co(e,this.min),this._tableRange=co(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,h,l;for(o=0,a=t.length;o<a;++o)h=t[o],h>=e&&h<=i&&s.push(h);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)l=s[o+1],r=s[o-1],h=s[o],Math.round((l+r)/2)!==h&&n.push({time:h,pos:o/(a-1)});return n}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort((t,e)=>t-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(co(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return co(this._table,i*this._tableRange+this._minPos,!0)}}var go=Object.freeze({__proto__:null,CategoryScale:zn,LinearScale:Bn,LogarithmicScale:Un,RadialLinearScale:eo,TimeScale:lo,TimeSeriesScale:uo});const po=[Re,Rs,En,go];export{ne as Animation,oe as Animations,fs as ArcElement,De as BarController,Es as BarElement,ni as BasePlatform,oi as BasicPlatform,Pe as BubbleController,zn as CategoryScale,ls as Chart,Ws as Colors,xe as DatasetController,$s as Decimation,yi as DomPlatform,Ae as DoughnutController,Mi as Element,ln as Filler,$e as Interaction,gn as Legend,Ce as LineController,ks as LineElement,Bn as LinearScale,Un as LogarithmicScale,Oe as PieController,Ds as PointElement,Le as PolarAreaController,Te as RadarController,eo as RadialLinearScale,Ti as Scale,Ee as ScatterController,xn as SubTitle,lo as TimeScale,uo as TimeSeriesScale,fn as Title,Tn as Tooltip,Fe as _adapters,vi as _detectPlatform,ee as animator,Re as controllers,Rs as elements,si as layouts,En as plugins,po as registerables,Ii as registry,go as scales};
8
- //# sourceMappingURL=chart.js.map