unleash-server 5.3.4 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. package/dist/lib/addons/slack-app-definition.js +8 -0
  2. package/dist/lib/addons/slack-app-definition.js.map +1 -1
  3. package/dist/lib/addons/slack-app.d.ts +1 -4
  4. package/dist/lib/addons/slack-app.js +46 -68
  5. package/dist/lib/addons/slack-app.js.map +1 -1
  6. package/dist/lib/addons/slack-app.test.js +12 -66
  7. package/dist/lib/addons/slack-app.test.js.map +1 -1
  8. package/dist/lib/create-config.js +1 -0
  9. package/dist/lib/create-config.js.map +1 -1
  10. package/dist/lib/db/access-store.d.ts +3 -1
  11. package/dist/lib/db/access-store.js +53 -0
  12. package/dist/lib/db/access-store.js.map +1 -1
  13. package/dist/lib/db/client-applications-store.d.ts +3 -1
  14. package/dist/lib/db/client-applications-store.js +73 -6
  15. package/dist/lib/db/client-applications-store.js.map +1 -1
  16. package/dist/lib/db/feature-environment-store.js +3 -0
  17. package/dist/lib/db/feature-environment-store.js.map +1 -1
  18. package/dist/lib/db/feature-strategy-store.d.ts +1 -0
  19. package/dist/lib/db/feature-strategy-store.js +21 -3
  20. package/dist/lib/db/feature-strategy-store.js.map +1 -1
  21. package/dist/lib/db/feature-strategy-store.test.js +40 -0
  22. package/dist/lib/db/feature-strategy-store.test.js.map +1 -1
  23. package/dist/lib/db/feature-toggle-client-store.js +5 -3
  24. package/dist/lib/db/feature-toggle-client-store.js.map +1 -1
  25. package/dist/lib/db/feature-toggle-store.d.ts +6 -1
  26. package/dist/lib/db/feature-toggle-store.js +37 -9
  27. package/dist/lib/db/feature-toggle-store.js.map +1 -1
  28. package/dist/lib/db/index.js +1 -1
  29. package/dist/lib/db/index.js.map +1 -1
  30. package/dist/lib/db/role-store.d.ts +3 -0
  31. package/dist/lib/db/role-store.js +21 -4
  32. package/dist/lib/db/role-store.js.map +1 -1
  33. package/dist/lib/features/access/createAccessService.js +2 -2
  34. package/dist/lib/features/access/createAccessService.js.map +1 -1
  35. package/dist/lib/features/change-request-access-service/change-request-access-read-model.d.ts +1 -0
  36. package/dist/lib/features/change-request-access-service/fake-change-request-access-read-model.d.ts +1 -0
  37. package/dist/lib/features/change-request-access-service/fake-change-request-access-read-model.js +3 -0
  38. package/dist/lib/features/change-request-access-service/fake-change-request-access-read-model.js.map +1 -1
  39. package/dist/lib/features/change-request-access-service/sql-change-request-access-read-model.d.ts +1 -0
  40. package/dist/lib/features/change-request-access-service/sql-change-request-access-read-model.js +10 -1
  41. package/dist/lib/features/change-request-access-service/sql-change-request-access-read-model.js.map +1 -1
  42. package/dist/lib/features/export-import-toggles/export-import-permissions.e2e.test.js +4 -0
  43. package/dist/lib/features/export-import-toggles/export-import-permissions.e2e.test.js.map +1 -1
  44. package/dist/lib/features/export-import-toggles/export-import-service.d.ts +2 -1
  45. package/dist/lib/features/export-import-toggles/export-import-service.js +30 -16
  46. package/dist/lib/features/export-import-toggles/export-import-service.js.map +1 -1
  47. package/dist/lib/features/export-import-toggles/export-import.e2e.test.js +24 -4
  48. package/dist/lib/features/export-import-toggles/export-import.e2e.test.js.map +1 -1
  49. package/dist/lib/features/export-import-toggles/import-context-validation.js +1 -1
  50. package/dist/lib/features/export-import-toggles/import-context-validation.js.map +1 -1
  51. package/dist/lib/features/export-import-toggles/import-toggles-store-type.d.ts +1 -0
  52. package/dist/lib/features/export-import-toggles/import-toggles-store.d.ts +1 -0
  53. package/dist/lib/features/export-import-toggles/import-toggles-store.js +8 -0
  54. package/dist/lib/features/export-import-toggles/import-toggles-store.js.map +1 -1
  55. package/dist/lib/features/export-import-toggles/import-validation-messages.d.ts +1 -1
  56. package/dist/lib/features/export-import-toggles/import-validation-messages.js +7 -1
  57. package/dist/lib/features/export-import-toggles/import-validation-messages.js.map +1 -1
  58. package/dist/lib/features/feature-toggle/createFeatureToggleService.js +9 -12
  59. package/dist/lib/features/feature-toggle/createFeatureToggleService.js.map +1 -1
  60. package/dist/lib/features/index.d.ts +1 -0
  61. package/dist/lib/features/index.js +1 -0
  62. package/dist/lib/features/index.js.map +1 -1
  63. package/dist/lib/features/playground/advanced-playground.test.js +57 -6
  64. package/dist/lib/features/playground/advanced-playground.test.js.map +1 -1
  65. package/dist/lib/features/playground/generateObjectCombinations.d.ts +2 -2
  66. package/dist/lib/features/playground/generateObjectCombinations.js +4 -1
  67. package/dist/lib/features/playground/generateObjectCombinations.js.map +1 -1
  68. package/dist/lib/features/playground/generateObjectCombinations.test.js +7 -6
  69. package/dist/lib/features/playground/generateObjectCombinations.test.js.map +1 -1
  70. package/dist/lib/features/playground/playground.js +1 -1
  71. package/dist/lib/features/playground/playground.js.map +1 -1
  72. package/dist/lib/features/segment/createSegmentService.d.ts +5 -0
  73. package/dist/lib/features/segment/createSegmentService.js +32 -0
  74. package/dist/lib/features/segment/createSegmentService.js.map +1 -0
  75. package/dist/lib/metrics.js +12 -0
  76. package/dist/lib/metrics.js.map +1 -1
  77. package/dist/lib/metrics.test.js +1 -1
  78. package/dist/lib/metrics.test.js.map +1 -1
  79. package/dist/lib/middleware/response-time-metrics.js +1 -1
  80. package/dist/lib/middleware/response-time-metrics.js.map +1 -1
  81. package/dist/lib/openapi/index.js +3 -1
  82. package/dist/lib/openapi/index.js.map +1 -1
  83. package/dist/lib/openapi/meta-schema-rules.test.js +2 -41
  84. package/dist/lib/openapi/meta-schema-rules.test.js.map +1 -1
  85. package/dist/lib/openapi/spec/admin-features-query-schema.d.ts +1 -0
  86. package/dist/lib/openapi/spec/admin-features-query-schema.js +1 -0
  87. package/dist/lib/openapi/spec/admin-features-query-schema.js.map +1 -1
  88. package/dist/lib/openapi/spec/advanced-playground-environment-feature-schema.d.ts +4 -1
  89. package/dist/lib/openapi/spec/advanced-playground-feature-schema.d.ts +8 -2
  90. package/dist/lib/openapi/spec/advanced-playground-request-schema.d.ts +1 -1
  91. package/dist/lib/openapi/spec/advanced-playground-response-schema.d.ts +17 -5
  92. package/dist/lib/openapi/spec/application-schema.d.ts +33 -1
  93. package/dist/lib/openapi/spec/application-schema.js +12 -1
  94. package/dist/lib/openapi/spec/application-schema.js.map +1 -1
  95. package/dist/lib/openapi/spec/application-usage-schema.d.ts +25 -0
  96. package/dist/lib/openapi/spec/application-usage-schema.js +27 -0
  97. package/dist/lib/openapi/spec/application-usage-schema.js.map +1 -0
  98. package/dist/lib/openapi/spec/applications-schema.d.ts +57 -1
  99. package/dist/lib/openapi/spec/applications-schema.js +4 -1
  100. package/dist/lib/openapi/spec/applications-schema.js.map +1 -1
  101. package/dist/lib/openapi/spec/bulk-metrics-schema.d.ts +18 -4
  102. package/dist/lib/openapi/spec/bulk-registration-schema.d.ts +6 -1
  103. package/dist/lib/openapi/spec/client-metrics-env-schema.d.ts +6 -2
  104. package/dist/lib/openapi/spec/client-metrics-env-schema.js +0 -1
  105. package/dist/lib/openapi/spec/client-metrics-env-schema.js.map +1 -1
  106. package/dist/lib/openapi/spec/client-metrics-schema.d.ts +6 -1
  107. package/dist/lib/openapi/spec/create-application-schema.d.ts +0 -1
  108. package/dist/lib/openapi/spec/create-application-schema.js +0 -1
  109. package/dist/lib/openapi/spec/create-application-schema.js.map +1 -1
  110. package/dist/lib/openapi/spec/create-context-field-schema.d.ts +68 -0
  111. package/dist/lib/openapi/spec/create-context-field-schema.js +19 -0
  112. package/dist/lib/openapi/spec/create-context-field-schema.js.map +1 -0
  113. package/dist/lib/openapi/spec/create-feature-schema.d.ts +1 -0
  114. package/dist/lib/openapi/spec/create-feature-schema.js +1 -0
  115. package/dist/lib/openapi/spec/create-feature-schema.js.map +1 -1
  116. package/dist/lib/openapi/spec/create-feature-strategy-schema.d.ts +0 -1
  117. package/dist/lib/openapi/spec/create-group-schema.d.ts +0 -1
  118. package/dist/lib/openapi/spec/create-group-schema.js +0 -1
  119. package/dist/lib/openapi/spec/create-group-schema.js.map +1 -1
  120. package/dist/lib/openapi/spec/create-invited-user-schema.d.ts +9 -0
  121. package/dist/lib/openapi/spec/create-invited-user-schema.js +9 -0
  122. package/dist/lib/openapi/spec/create-invited-user-schema.js.map +1 -1
  123. package/dist/lib/openapi/spec/create-strategy-variant-schema.d.ts +0 -1
  124. package/dist/lib/openapi/spec/create-strategy-variant-schema.js +0 -1
  125. package/dist/lib/openapi/spec/create-strategy-variant-schema.js.map +1 -1
  126. package/dist/lib/openapi/spec/create-user-response-schema.d.ts +2 -1
  127. package/dist/lib/openapi/spec/create-user-response-schema.js +1 -1
  128. package/dist/lib/openapi/spec/create-user-response-schema.js.map +1 -1
  129. package/dist/lib/openapi/spec/date-schema.d.ts +6 -1
  130. package/dist/lib/openapi/spec/date-schema.js +14 -1
  131. package/dist/lib/openapi/spec/date-schema.js.map +1 -1
  132. package/dist/lib/openapi/spec/environment-project-schema.d.ts +0 -2
  133. package/dist/lib/openapi/spec/environments-project-schema.d.ts +0 -2
  134. package/dist/lib/openapi/spec/event-schema.d.ts +1 -3
  135. package/dist/lib/openapi/spec/event-schema.js +0 -1
  136. package/dist/lib/openapi/spec/event-schema.js.map +1 -1
  137. package/dist/lib/openapi/spec/events-schema.d.ts +1 -3
  138. package/dist/lib/openapi/spec/export-query-schema.d.ts +0 -1
  139. package/dist/lib/openapi/spec/export-query-schema.js +0 -1
  140. package/dist/lib/openapi/spec/export-query-schema.js.map +1 -1
  141. package/dist/lib/openapi/spec/export-result-schema.d.ts +17 -1
  142. package/dist/lib/openapi/spec/feature-environment-metrics-schema.d.ts +6 -1
  143. package/dist/lib/openapi/spec/feature-environment-schema.d.ts +7 -0
  144. package/dist/lib/openapi/spec/feature-environment-schema.js +7 -0
  145. package/dist/lib/openapi/spec/feature-environment-schema.js.map +1 -1
  146. package/dist/lib/openapi/spec/feature-events-schema.d.ts +1 -3
  147. package/dist/lib/openapi/spec/feature-metrics-schema.d.ts +12 -2
  148. package/dist/lib/openapi/spec/feature-schema.d.ts +9 -1
  149. package/dist/lib/openapi/spec/feature-schema.js +2 -1
  150. package/dist/lib/openapi/spec/feature-schema.js.map +1 -1
  151. package/dist/lib/openapi/spec/feature-strategy-segment-schema.d.ts +5 -0
  152. package/dist/lib/openapi/spec/feature-strategy-segment-schema.js +5 -0
  153. package/dist/lib/openapi/spec/feature-strategy-segment-schema.js.map +1 -1
  154. package/dist/lib/openapi/spec/feature-usage-schema.d.ts +12 -2
  155. package/dist/lib/openapi/spec/features-schema.d.ts +16 -1
  156. package/dist/lib/openapi/spec/group-schema.d.ts +10 -2
  157. package/dist/lib/openapi/spec/group-schema.js +6 -0
  158. package/dist/lib/openapi/spec/group-schema.js.map +1 -1
  159. package/dist/lib/openapi/spec/group-user-model-schema.d.ts +2 -1
  160. package/dist/lib/openapi/spec/groups-schema.d.ts +14 -4
  161. package/dist/lib/openapi/spec/health-overview-schema.d.ts +16 -5
  162. package/dist/lib/openapi/spec/health-report-schema.d.ts +16 -5
  163. package/dist/lib/openapi/spec/import-toggles-schema.d.ts +34 -2
  164. package/dist/lib/openapi/spec/index.d.ts +3 -1
  165. package/dist/lib/openapi/spec/index.js +3 -1
  166. package/dist/lib/openapi/spec/index.js.map +1 -1
  167. package/dist/lib/openapi/spec/maintenance-schema.d.ts +2 -0
  168. package/dist/lib/openapi/spec/maintenance-schema.js +2 -0
  169. package/dist/lib/openapi/spec/maintenance-schema.js.map +1 -1
  170. package/dist/lib/openapi/spec/me-schema.d.ts +2 -1
  171. package/dist/lib/openapi/spec/patch-schema.d.ts +12 -1
  172. package/dist/lib/openapi/spec/patch-schema.js +12 -1
  173. package/dist/lib/openapi/spec/patch-schema.js.map +1 -1
  174. package/dist/lib/openapi/spec/patches-schema.d.ts +12 -1
  175. package/dist/lib/openapi/spec/playground-feature-schema.d.ts +3 -0
  176. package/dist/lib/openapi/spec/playground-request-schema.d.ts +1 -1
  177. package/dist/lib/openapi/spec/playground-response-schema.d.ts +8 -2
  178. package/dist/lib/openapi/spec/playground-segment-schema.d.ts +1 -0
  179. package/dist/lib/openapi/spec/playground-segment-schema.js +1 -0
  180. package/dist/lib/openapi/spec/playground-segment-schema.js.map +1 -1
  181. package/dist/lib/openapi/spec/playground-strategy-schema.d.ts +2 -0
  182. package/dist/lib/openapi/spec/playground-strategy-schema.js +1 -0
  183. package/dist/lib/openapi/spec/playground-strategy-schema.js.map +1 -1
  184. package/dist/lib/openapi/spec/profile-schema.d.ts +9 -1
  185. package/dist/lib/openapi/spec/project-environment-schema.d.ts +0 -2
  186. package/dist/lib/openapi/spec/project-overview-schema.d.ts +20 -6
  187. package/dist/lib/openapi/spec/project-overview-schema.js +4 -1
  188. package/dist/lib/openapi/spec/project-overview-schema.js.map +1 -1
  189. package/dist/lib/openapi/spec/project-schema.d.ts +4 -0
  190. package/dist/lib/openapi/spec/project-schema.js +4 -0
  191. package/dist/lib/openapi/spec/project-schema.js.map +1 -1
  192. package/dist/lib/openapi/spec/projects-schema.d.ts +6 -0
  193. package/dist/lib/openapi/spec/projects-schema.js +2 -0
  194. package/dist/lib/openapi/spec/projects-schema.js.map +1 -1
  195. package/dist/lib/openapi/spec/public-signup-token-schema.d.ts +3 -1
  196. package/dist/lib/openapi/spec/public-signup-token-schema.js +1 -0
  197. package/dist/lib/openapi/spec/public-signup-token-schema.js.map +1 -1
  198. package/dist/lib/openapi/spec/public-signup-tokens-schema.d.ts +5 -2
  199. package/dist/lib/openapi/spec/push-variants-schema.d.ts +3 -0
  200. package/dist/lib/openapi/spec/push-variants-schema.js +3 -0
  201. package/dist/lib/openapi/spec/push-variants-schema.js.map +1 -1
  202. package/dist/lib/openapi/spec/reset-password-schema.d.ts +4 -0
  203. package/dist/lib/openapi/spec/reset-password-schema.js +4 -0
  204. package/dist/lib/openapi/spec/reset-password-schema.js.map +1 -1
  205. package/dist/lib/openapi/spec/sdk-context-schema.d.ts +1 -1
  206. package/dist/lib/openapi/spec/sdk-context-schema.js +1 -1
  207. package/dist/lib/openapi/spec/sdk-context-schema.js.map +1 -1
  208. package/dist/lib/openapi/spec/search-events-schema.d.ts +2 -2
  209. package/dist/lib/openapi/spec/search-events-schema.js +1 -6
  210. package/dist/lib/openapi/spec/search-events-schema.js.map +1 -1
  211. package/dist/lib/openapi/spec/sort-order-schema.d.ts +4 -1
  212. package/dist/lib/openapi/spec/sort-order-schema.js +4 -1
  213. package/dist/lib/openapi/spec/sort-order-schema.js.map +1 -1
  214. package/dist/lib/openapi/spec/state-schema.d.ts +39 -3
  215. package/dist/lib/openapi/spec/state-schema.js +14 -2
  216. package/dist/lib/openapi/spec/state-schema.js.map +1 -1
  217. package/dist/lib/openapi/spec/toggle-maintenance-schema.d.ts +2 -0
  218. package/dist/lib/openapi/spec/toggle-maintenance-schema.js +2 -0
  219. package/dist/lib/openapi/spec/toggle-maintenance-schema.js.map +1 -1
  220. package/dist/lib/openapi/spec/token-string-list-schema.d.ts +0 -1
  221. package/dist/lib/openapi/spec/token-string-list-schema.js +0 -1
  222. package/dist/lib/openapi/spec/token-string-list-schema.js.map +1 -1
  223. package/dist/lib/openapi/spec/token-user-schema.d.ts +1 -1
  224. package/dist/lib/openapi/spec/token-user-schema.js +1 -1
  225. package/dist/lib/openapi/spec/token-user-schema.js.map +1 -1
  226. package/dist/lib/openapi/spec/{upsert-context-field-schema.d.ts → update-context-field-schema.d.ts} +19 -8
  227. package/dist/lib/openapi/spec/update-context-field-schema.js +44 -0
  228. package/dist/lib/openapi/spec/update-context-field-schema.js.map +1 -0
  229. package/dist/lib/openapi/spec/update-user-schema.d.ts +0 -1
  230. package/dist/lib/openapi/spec/update-user-schema.js +0 -1
  231. package/dist/lib/openapi/spec/update-user-schema.js.map +1 -1
  232. package/dist/lib/openapi/spec/user-schema.d.ts +2 -1
  233. package/dist/lib/openapi/spec/user-schema.js +2 -1
  234. package/dist/lib/openapi/spec/user-schema.js.map +1 -1
  235. package/dist/lib/openapi/spec/users-groups-base-schema.d.ts +33 -4
  236. package/dist/lib/openapi/spec/users-groups-base-schema.js +24 -0
  237. package/dist/lib/openapi/spec/users-groups-base-schema.js.map +1 -1
  238. package/dist/lib/openapi/spec/users-schema.d.ts +3 -2
  239. package/dist/lib/openapi/spec/users-schema.js +1 -1
  240. package/dist/lib/openapi/spec/users-schema.js.map +1 -1
  241. package/dist/lib/openapi/spec/users-search-schema.d.ts +3 -1
  242. package/dist/lib/openapi/spec/users-search-schema.js +1 -0
  243. package/dist/lib/openapi/spec/users-search-schema.js.map +1 -1
  244. package/dist/lib/openapi/spec/variants-schema.d.ts +1 -0
  245. package/dist/lib/openapi/spec/variants-schema.js +1 -0
  246. package/dist/lib/openapi/spec/variants-schema.js.map +1 -1
  247. package/dist/lib/openapi/util/openapi-tags.d.ts +18 -0
  248. package/dist/lib/openapi/util/openapi-tags.js +12 -0
  249. package/dist/lib/openapi/util/openapi-tags.js.map +1 -1
  250. package/dist/lib/routes/admin-api/api-token.d.ts +5 -0
  251. package/dist/lib/routes/admin-api/api-token.js +28 -0
  252. package/dist/lib/routes/admin-api/api-token.js.map +1 -1
  253. package/dist/lib/routes/admin-api/archive.js +4 -0
  254. package/dist/lib/routes/admin-api/archive.js.map +1 -1
  255. package/dist/lib/routes/admin-api/client-metrics.js +2 -1
  256. package/dist/lib/routes/admin-api/client-metrics.js.map +1 -1
  257. package/dist/lib/routes/admin-api/context.d.ts +4 -3
  258. package/dist/lib/routes/admin-api/context.js +3 -4
  259. package/dist/lib/routes/admin-api/context.js.map +1 -1
  260. package/dist/lib/routes/admin-api/feature-type.js +2 -2
  261. package/dist/lib/routes/admin-api/feature-type.js.map +1 -1
  262. package/dist/lib/routes/admin-api/instance-admin.js +2 -0
  263. package/dist/lib/routes/admin-api/instance-admin.js.map +1 -1
  264. package/dist/lib/routes/admin-api/maintenance.d.ts +2 -1
  265. package/dist/lib/routes/admin-api/maintenance.js.map +1 -1
  266. package/dist/lib/routes/admin-api/project/environments.js +1 -0
  267. package/dist/lib/routes/admin-api/project/environments.js.map +1 -1
  268. package/dist/lib/routes/admin-api/project/project-features.js +2 -1
  269. package/dist/lib/routes/admin-api/project/project-features.js.map +1 -1
  270. package/dist/lib/routes/admin-api/public-signup.js +2 -1
  271. package/dist/lib/routes/admin-api/public-signup.js.map +1 -1
  272. package/dist/lib/routes/admin-api/strategy.d.ts +1 -1
  273. package/dist/lib/routes/admin-api/strategy.js +2 -2
  274. package/dist/lib/routes/admin-api/strategy.js.map +1 -1
  275. package/dist/lib/routes/admin-api/tag-type.js +2 -2
  276. package/dist/lib/routes/admin-api/tag-type.js.map +1 -1
  277. package/dist/lib/routes/admin-api/user-admin.js +2 -1
  278. package/dist/lib/routes/admin-api/user-admin.js.map +1 -1
  279. package/dist/lib/routes/client-api/register.d.ts +1 -0
  280. package/dist/lib/routes/client-api/register.js +8 -0
  281. package/dist/lib/routes/client-api/register.js.map +1 -1
  282. package/dist/lib/routes/index.js +1 -0
  283. package/dist/lib/routes/index.js.map +1 -1
  284. package/dist/lib/routes/public-invite.js +2 -1
  285. package/dist/lib/routes/public-invite.js.map +1 -1
  286. package/dist/lib/segments/segment-service-interface.d.ts +2 -0
  287. package/dist/lib/server-impl.js +3 -1
  288. package/dist/lib/server-impl.js.map +1 -1
  289. package/dist/lib/services/access-service.d.ts +6 -3
  290. package/dist/lib/services/access-service.js +17 -5
  291. package/dist/lib/services/access-service.js.map +1 -1
  292. package/dist/lib/services/access-service.test.js +49 -3
  293. package/dist/lib/services/access-service.test.js.map +1 -1
  294. package/dist/lib/services/client-metrics/instance-service.js +5 -7
  295. package/dist/lib/services/client-metrics/instance-service.js.map +1 -1
  296. package/dist/lib/services/client-metrics/last-seen-service.d.ts +4 -0
  297. package/dist/lib/services/client-metrics/last-seen-service.js +4 -1
  298. package/dist/lib/services/client-metrics/last-seen-service.js.map +1 -1
  299. package/dist/lib/services/client-metrics/models.d.ts +2 -0
  300. package/dist/lib/services/client-metrics/schema.js +1 -0
  301. package/dist/lib/services/client-metrics/schema.js.map +1 -1
  302. package/dist/lib/services/feature-service-potentially-stale.test.js +0 -1
  303. package/dist/lib/services/feature-service-potentially-stale.test.js.map +1 -1
  304. package/dist/lib/services/feature-toggle-service.js +20 -30
  305. package/dist/lib/services/feature-toggle-service.js.map +1 -1
  306. package/dist/lib/services/index.js +1 -1
  307. package/dist/lib/services/index.js.map +1 -1
  308. package/dist/lib/services/instance-stats-service.d.ts +2 -0
  309. package/dist/lib/services/instance-stats-service.js +6 -1
  310. package/dist/lib/services/instance-stats-service.js.map +1 -1
  311. package/dist/lib/services/maintenance-service.js +1 -1
  312. package/dist/lib/services/maintenance-service.js.map +1 -1
  313. package/dist/lib/services/maintenance-service.test.js +1 -1
  314. package/dist/lib/services/maintenance-service.test.js.map +1 -1
  315. package/dist/lib/services/project-service.d.ts +2 -1
  316. package/dist/lib/services/project-service.js +3 -0
  317. package/dist/lib/services/project-service.js.map +1 -1
  318. package/dist/lib/services/segment-service.d.ts +8 -2
  319. package/dist/lib/services/segment-service.js +34 -3
  320. package/dist/lib/services/segment-service.js.map +1 -1
  321. package/dist/lib/services/user-service.js +3 -3
  322. package/dist/lib/services/user-service.js.map +1 -1
  323. package/dist/lib/services/version-service.d.ts +1 -0
  324. package/dist/lib/services/version-service.js +8 -1
  325. package/dist/lib/services/version-service.js.map +1 -1
  326. package/dist/lib/types/events.d.ts +2 -1
  327. package/dist/lib/types/events.js +4 -2
  328. package/dist/lib/types/events.js.map +1 -1
  329. package/dist/lib/types/experimental.d.ts +1 -1
  330. package/dist/lib/types/experimental.js +6 -5
  331. package/dist/lib/types/experimental.js.map +1 -1
  332. package/dist/lib/types/model.d.ts +2 -0
  333. package/dist/lib/types/model.js.map +1 -1
  334. package/dist/lib/types/option.d.ts +2 -0
  335. package/dist/lib/types/project.d.ts +7 -0
  336. package/dist/lib/types/stores/access-store.d.ts +9 -0
  337. package/dist/lib/types/stores/client-applications-store.d.ts +5 -0
  338. package/dist/lib/types/stores/context-field-store.d.ts +3 -3
  339. package/dist/lib/types/stores/feature-toggle-store.d.ts +2 -1
  340. package/dist/lib/types/stores/role-store.d.ts +3 -0
  341. package/dist/migrations/20230802092725-add-last-seen-column-to-feature-environments.d.ts +2 -0
  342. package/dist/migrations/20230802092725-add-last-seen-column-to-feature-environments.js +84 -0
  343. package/dist/migrations/20230802092725-add-last-seen-column-to-feature-environments.js.map +1 -0
  344. package/dist/migrations/20230802141830-add-feature-and-environment-last-seen-at-to-features-view.d.ts +2 -0
  345. package/dist/migrations/20230802141830-add-feature-and-environment-last-seen-at-to-features-view.js +83 -0
  346. package/dist/migrations/20230802141830-add-feature-and-environment-last-seen-at-to-features-view.js.map +1 -0
  347. package/dist/migrations/20230803061359-change-request-optional-feature.d.ts +2 -0
  348. package/dist/migrations/20230803061359-change-request-optional-feature.js +13 -0
  349. package/dist/migrations/20230803061359-change-request-optional-feature.js.map +1 -0
  350. package/dist/migrations/20230808104232-update-root-roles-descriptions.d.ts +2 -0
  351. package/dist/migrations/20230808104232-update-root-roles-descriptions.js +15 -0
  352. package/dist/migrations/20230808104232-update-root-roles-descriptions.js.map +1 -0
  353. package/dist/migrations/20230814095253-change-request-rejections.d.ts +2 -0
  354. package/dist/migrations/20230814095253-change-request-rejections.js +18 -0
  355. package/dist/migrations/20230814095253-change-request-rejections.js.map +1 -0
  356. package/dist/migrations/20230814115436-change-request-timzone-timestamps.d.ts +2 -0
  357. package/dist/migrations/20230814115436-change-request-timzone-timestamps.js +15 -0
  358. package/dist/migrations/20230814115436-change-request-timzone-timestamps.js.map +1 -0
  359. package/dist/migrations/20230815065908-change-request-approve-reject-permission.d.ts +2 -0
  360. package/dist/migrations/20230815065908-change-request-approve-reject-permission.js +12 -0
  361. package/dist/migrations/20230815065908-change-request-approve-reject-permission.js.map +1 -0
  362. package/dist/migrations/20230817095805-client-applications-usage-table.d.ts +2 -0
  363. package/dist/migrations/20230817095805-client-applications-usage-table.js +17 -0
  364. package/dist/migrations/20230817095805-client-applications-usage-table.js.map +1 -0
  365. package/dist/migrations/20230818124614-update-client-applications-usage-table.d.ts +2 -0
  366. package/dist/migrations/20230818124614-update-client-applications-usage-table.js +25 -0
  367. package/dist/migrations/20230818124614-update-client-applications-usage-table.js.map +1 -0
  368. package/dist/server-dev.js +3 -2
  369. package/dist/server-dev.js.map +1 -1
  370. package/dist/test/config/test-config.js +1 -0
  371. package/dist/test/config/test-config.js.map +1 -1
  372. package/dist/test/e2e/api/admin/api-token.auth.e2e.test.js +12 -84
  373. package/dist/test/e2e/api/admin/api-token.auth.e2e.test.js.map +1 -1
  374. package/dist/test/e2e/api/admin/api-token.e2e.test.js +10 -2
  375. package/dist/test/e2e/api/admin/api-token.e2e.test.js.map +1 -1
  376. package/dist/test/e2e/api/admin/metrics.e2e.test.js +30 -4
  377. package/dist/test/e2e/api/admin/metrics.e2e.test.js.map +1 -1
  378. package/dist/test/e2e/api/admin/project/features.e2e.test.js +14 -15
  379. package/dist/test/e2e/api/admin/project/features.e2e.test.js.map +1 -1
  380. package/dist/test/e2e/api/client/metricsV2.e2e.test.js +19 -5
  381. package/dist/test/e2e/api/client/metricsV2.e2e.test.js.map +1 -1
  382. package/dist/test/e2e/api/openapi/openapi.e2e.test.js +23 -0
  383. package/dist/test/e2e/api/openapi/openapi.e2e.test.js.map +1 -1
  384. package/dist/test/e2e/helpers/test-helper.js +11 -1
  385. package/dist/test/e2e/helpers/test-helper.js.map +1 -1
  386. package/dist/test/e2e/services/access-service.e2e.test.js +2 -2
  387. package/dist/test/e2e/services/access-service.e2e.test.js.map +1 -1
  388. package/dist/test/e2e/services/api-token-service.e2e.test.js +1 -1
  389. package/dist/test/e2e/services/api-token-service.e2e.test.js.map +1 -1
  390. package/dist/test/e2e/services/environment-service.test.js +2 -0
  391. package/dist/test/e2e/services/environment-service.test.js.map +1 -1
  392. package/dist/test/e2e/services/feature-toggle-service-v2.e2e.test.js +1 -1
  393. package/dist/test/e2e/services/feature-toggle-service-v2.e2e.test.js.map +1 -1
  394. package/dist/test/e2e/services/playground-service.test.js +1 -1
  395. package/dist/test/e2e/services/playground-service.test.js.map +1 -1
  396. package/dist/test/e2e/services/project-health-service.e2e.test.js +1 -1
  397. package/dist/test/e2e/services/project-health-service.e2e.test.js.map +1 -1
  398. package/dist/test/e2e/services/project-service.e2e.test.js +1 -1
  399. package/dist/test/e2e/services/project-service.e2e.test.js.map +1 -1
  400. package/dist/test/e2e/services/user-service.e2e.test.js +10 -0
  401. package/dist/test/e2e/services/user-service.e2e.test.js.map +1 -1
  402. package/dist/test/fixtures/access-service-mock.js +1 -0
  403. package/dist/test/fixtures/access-service-mock.js.map +1 -1
  404. package/dist/test/fixtures/fake-access-store.d.ts +3 -1
  405. package/dist/test/fixtures/fake-access-store.js +6 -0
  406. package/dist/test/fixtures/fake-access-store.js.map +1 -1
  407. package/dist/test/fixtures/fake-feature-toggle-store.d.ts +2 -1
  408. package/dist/test/fixtures/fake-feature-toggle-store.js +19 -6
  409. package/dist/test/fixtures/fake-feature-toggle-store.js.map +1 -1
  410. package/dist/test/fixtures/fake-project-store.d.ts +1 -1
  411. package/dist/test/fixtures/fake-role-store.d.ts +3 -0
  412. package/dist/test/fixtures/fake-role-store.js +6 -0
  413. package/dist/test/fixtures/fake-role-store.js.map +1 -1
  414. package/frontend/build/index.html +2 -2
  415. package/frontend/build/static/{AdvancedPlayground-48dddbf4.js → AdvancedPlayground-2d715a2c.js} +3 -3
  416. package/frontend/build/static/{CreateProject-c1b0f704.js → CreateProject-5b1090c2.js} +1 -1
  417. package/frontend/build/static/{Error-e6f7c2ee.js → Error-e44ea66b.js} +1 -1
  418. package/frontend/build/static/FeatureArchiveDialog-b47b18e8.js +10 -0
  419. package/frontend/build/static/{FeatureMetricsChart-81da0ce4.js → FeatureMetricsChart-36caeeb7.js} +2 -2
  420. package/frontend/build/static/FeatureViewLazyExport-49d56afd.js +7 -0
  421. package/frontend/build/static/LazyAdminExport-87c9ab51.js +35 -0
  422. package/frontend/build/static/LazyProjectExport-c4634b2a.js +17 -0
  423. package/frontend/build/static/{NetworkOverview-cd06e59f.js → NetworkOverview-c762698b.js} +64 -64
  424. package/frontend/build/static/{NetworkTraffic-ba933617.js → NetworkTraffic-c8d9eb9b.js} +1 -1
  425. package/frontend/build/static/RoleCell-d1aa8288.js +1 -0
  426. package/frontend/build/static/{StrategyItemContainer-88c18285.js → StrategyItemContainer-c7c352a4.js} +1 -1
  427. package/frontend/build/static/changeRequestProcess-f2469ef4.svg +61 -0
  428. package/frontend/build/static/{chartjs-adapter-date-fns.esm-799be047.js → chartjs-adapter-date-fns.esm-9c67372b.js} +6 -6
  429. package/frontend/build/static/{flowchart-elk-definition-170a3958-543f0844.js → flowchart-elk-definition-170a3958-5ea9fc56.js} +1 -1
  430. package/frontend/build/static/{index-88f1c682.js → index-1aaa8c27.js} +1 -1
  431. package/frontend/build/static/{index-aa638b65.js → index-670c9345.js} +1 -1
  432. package/frontend/build/static/index-b7003840.js +454 -0
  433. package/frontend/build/static/{is_dark-735e3a95.js → is_dark-b445e102.js} +1 -1
  434. package/frontend/build/static/{mindmap-definition-44684416-ac92f950.js → mindmap-definition-44684416-254e936e.js} +1 -1
  435. package/frontend/build/static/pro-enterprise-feature-badge-8ac467c3.svg +7 -0
  436. package/frontend/build/static/pro-enterprise-feature-badge-light-81a18f9b.svg +6 -0
  437. package/frontend/build/static/{timeline-definition-8e5a9bc6-6c09f608.js → timeline-definition-8e5a9bc6-24fd1725.js} +1 -1
  438. package/frontend/build/static/{unknownify-0b176a78.js → unknownify-ea4585e8.js} +1 -1
  439. package/frontend/build/static/usage-line-00d00632.svg +3 -0
  440. package/frontend/build/static/usage-rate-cb18f02b.svg +3 -0
  441. package/frontend/package.json +13 -13
  442. package/package.json +12 -13
  443. package/dist/lib/openapi/spec/upsert-context-field-schema.js +0 -35
  444. package/dist/lib/openapi/spec/upsert-context-field-schema.js.map +0 -1
  445. package/frontend/build/static/FeatureArchiveDialog-9ad60db1.js +0 -10
  446. package/frontend/build/static/FeatureViewLazyExport-58a3e977.js +0 -7
  447. package/frontend/build/static/LazyAdminExport-c98b11d7.js +0 -37
  448. package/frontend/build/static/LazyProjectExport-14db2e37.js +0 -16
  449. package/frontend/build/static/RoleCell-c534790e.js +0 -1
  450. package/frontend/build/static/changeRequestProcess-a532ab60.svg +0 -1
  451. package/frontend/build/static/index-1c4c68c3.js +0 -453
  452. package/frontend/build/static/pro-enterprise-feature-badge-8fab99c5.svg +0 -5
  453. package/frontend/build/static/pro-enterprise-feature-badge-light-0227af08.svg +0 -1
  454. /package/frontend/build/static/{index-770afaee.css → style-770afaee.css} +0 -0
@@ -1,22 +1,22 @@
1
- import{cC as A,ga as li,cE as ht,cF as z,gb as ci,gc as zs,gd as Bs,ge as xe,eD as Hs,cD as Pe,gf as Zr,gg as Jr,gh as Li,gi as Ns,gj as to,gk as eo,gl as io,gm as vn,gn as no,go as wn,gp as so,gq as ro,gr as oo,gs as ao,r as kt,ca as Ws,bH as lo,gt as co,gu as ho,gv as uo}from"./index-1c4c68c3.js";import{a as $i}from"./index-88f1c682.js";import{a as Vs}from"./index-aa638b65.js";var fo=36e5;function go(i,t){A(2,arguments);var e=ht(t);return li(i,e*fo)}function Mn(i,t){var e,n,s,r,o,a,l,c;A(1,arguments);var h=ci(),u=ht((e=(n=(s=(r=t==null?void 0:t.weekStartsOn)!==null&&r!==void 0?r:t==null||(o=t.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&s!==void 0?s:h.weekStartsOn)!==null&&n!==void 0?n:(l=h.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=z(i),f=d.getDay(),g=(f<u?7:0)+f-u;return d.setDate(d.getDate()-g),d.setHours(0,0,0,0),d}var po=6e4;function mo(i,t){A(2,arguments);var e=ht(t);return li(i,e*po)}function bo(i,t){A(2,arguments);var e=ht(t),n=e*3;return $i(i,n)}function yo(i,t){A(2,arguments);var e=ht(t);return li(i,e*1e3)}function xo(i,t){A(2,arguments);var e=ht(t),n=e*7;return Vs(i,n)}function _o(i,t){A(2,arguments);var e=ht(t);return $i(i,e*12)}function vo(i,t){A(2,arguments);var e=z(i),n=z(t),s=e.getFullYear()-n.getFullYear(),r=e.getMonth()-n.getMonth();return s*12+r}function wo(i,t){A(2,arguments);var e=z(i),n=z(t);return e.getFullYear()-n.getFullYear()}function hi(i,t){return A(2,arguments),z(i).getTime()-z(t).getTime()}var kn={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},Mo="trunc";function Ae(i){return i?kn[i]:kn[Mo]}function ko(i,t,e){A(2,arguments);var n=hi(i,t)/zs;return Ae(e==null?void 0:e.roundingMethod)(n)}function Po(i,t,e){A(2,arguments);var n=hi(i,t)/Bs;return Ae(e==null?void 0:e.roundingMethod)(n)}function js(i){A(1,arguments);var t=z(i);return t.setHours(23,59,59,999),t}function Ys(i){A(1,arguments);var t=z(i),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function So(i){A(1,arguments);var t=z(i);return js(t).getTime()===Ys(t).getTime()}function Us(i,t){A(2,arguments);var e=z(i),n=z(t),s=xe(e,n),r=Math.abs(vo(e,n)),o;if(r<1)o=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-s*r);var a=xe(e,n)===-s;So(z(i))&&r===1&&xe(i,n)===1&&(a=!1),o=s*(r-Number(a))}return o===0?0:o}function To(i,t,e){A(2,arguments);var n=Us(i,t)/3;return Ae(e==null?void 0:e.roundingMethod)(n)}function Oo(i,t,e){A(2,arguments);var n=hi(i,t)/1e3;return Ae(e==null?void 0:e.roundingMethod)(n)}function Co(i,t,e){A(2,arguments);var n=Hs(i,t)/7;return Ae(e==null?void 0:e.roundingMethod)(n)}function Do(i,t){A(2,arguments);var e=z(i),n=z(t),s=xe(e,n),r=Math.abs(wo(e,n));e.setFullYear(1584),n.setFullYear(1584);var o=xe(e,n)===-s,a=s*(r-Number(o));return a===0?0:a}function Ao(i){A(1,arguments);var t=z(i);return t.setSeconds(0,0),t}function Lo(i){A(1,arguments);var t=z(i),e=t.getMonth(),n=e-e%3;return t.setMonth(n,1),t.setHours(0,0,0,0),t}function Ro(i){A(1,arguments);var t=z(i);return t.setDate(1),t.setHours(0,0,0,0),t}function Eo(i){A(1,arguments);var t=z(i),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function Io(i){A(1,arguments);var t=z(i),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Fo(i){A(1,arguments);var t=z(i);return t.setMinutes(59,59,999),t}function zo(i,t){var e,n,s,r,o,a,l,c;A(1,arguments);var h=ci(),u=ht((e=(n=(s=(r=t==null?void 0:t.weekStartsOn)!==null&&r!==void 0?r:t==null||(o=t.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&s!==void 0?s:h.weekStartsOn)!==null&&n!==void 0?n:(l=h.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=z(i),f=d.getDay(),g=(f<u?-7:0)+6-(f-u);return d.setDate(d.getDate()+g),d.setHours(23,59,59,999),d}function Bo(i){A(1,arguments);var t=z(i);return t.setSeconds(59,999),t}function Ho(i){A(1,arguments);var t=z(i),e=t.getMonth(),n=e-e%3+3;return t.setMonth(n,0),t.setHours(23,59,59,999),t}function No(i){A(1,arguments);var t=z(i);return t.setMilliseconds(999),t}function Pn(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function Wo(i,t){if(i){if(typeof i=="string")return Pn(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Pn(i,t)}}function Sn(i,t){var e=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!e){if(Array.isArray(i)||(e=Wo(i))||t&&i&&typeof i.length=="number"){e&&(i=e);var n=0,s=function(){};return{s,n:function(){return n>=i.length?{done:!0}:{done:!1,value:i[n++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r=!0,o=!1,a;return{s:function(){e=e.call(i)},n:function(){var c=e.next();return r=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!r&&e.return!=null&&e.return()}finally{if(o)throw a}}}}function P(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Ri(i,t){return Ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},Ri(i,t)}function H(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),t&&Ri(i,t)}function Ge(i){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ge(i)}function Vo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jo(i,t){if(t&&(Pe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(i)}function N(i){var t=Vo();return function(){var n=Ge(i),s;if(t){var r=Ge(this).constructor;s=Reflect.construct(n,arguments,r)}else s=n.apply(this,arguments);return jo(this,s)}}function I(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Yo(i,t){if(Pe(i)!=="object"||i===null)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var n=e.call(i,t||"default");if(Pe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function $s(i){var t=Yo(i,"string");return Pe(t)==="symbol"?t:String(t)}function Tn(i,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,$s(n.key),n)}}function F(i,t,e){return t&&Tn(i.prototype,t),e&&Tn(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function k(i,t,e){return t=$s(t),t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Uo=10,Xs=function(){function i(){I(this,i),k(this,"priority",void 0),k(this,"subPriority",0)}return F(i,[{key:"validate",value:function(e,n){return!0}}]),i}(),$o=function(i){H(e,i);var t=N(e);function e(n,s,r,o,a){var l;return I(this,e),l=t.call(this),l.value=n,l.validateValue=s,l.setValue=r,l.priority=o,a&&(l.subPriority=a),l}return F(e,[{key:"validate",value:function(s,r){return this.validateValue(s,this.value,r)}},{key:"set",value:function(s,r,o){return this.setValue(s,r,this.value,o)}}]),e}(Xs),Xo=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",Uo),k(P(n),"subPriority",-1),n}return F(e,[{key:"set",value:function(s,r){if(r.timestampIsSet)return s;var o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}}]),e}(Xs),W=function(){function i(){I(this,i),k(this,"incompatibleTokens",void 0),k(this,"priority",void 0),k(this,"subPriority",void 0)}return F(i,[{key:"run",value:function(e,n,s,r){var o=this.parse(e,n,s,r);return o?{setter:new $o(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}},{key:"validate",value:function(e,n,s){return!0}}]),i}(),qo=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",140),k(P(n),"incompatibleTokens",["R","u","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"G":case"GG":case"GGG":return o.era(s,{width:"abbreviated"})||o.era(s,{width:"narrow"});case"GGGGG":return o.era(s,{width:"narrow"});case"GGGG":default:return o.era(s,{width:"wide"})||o.era(s,{width:"abbreviated"})||o.era(s,{width:"narrow"})}}},{key:"set",value:function(s,r,o){return r.era=o,s.setUTCFullYear(o,0,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),et={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Pt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function it(i,t){return i&&{value:t(i.value),rest:i.rest}}function Z(i,t){var e=t.match(i);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function St(i,t){var e=t.match(i);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var n=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:n*(s*zs+r*Bs+o*Zr),rest:t.slice(e[0].length)}}function qs(i){return Z(et.anyDigitsSigned,i)}function tt(i,t){switch(i){case 1:return Z(et.singleDigit,t);case 2:return Z(et.twoDigits,t);case 3:return Z(et.threeDigits,t);case 4:return Z(et.fourDigits,t);default:return Z(new RegExp("^\\d{1,"+i+"}"),t)}}function Ze(i,t){switch(i){case 1:return Z(et.singleDigitSigned,t);case 2:return Z(et.twoDigitsSigned,t);case 3:return Z(et.threeDigitsSigned,t);case 4:return Z(et.fourDigitsSigned,t);default:return Z(new RegExp("^-?\\d{1,"+i+"}"),t)}}function Xi(i){switch(i){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Ks(i,t){var e=t>0,n=e?t:1-t,s;if(n<=50)s=i||100;else{var r=n+50,o=Math.floor(r/100)*100,a=i>=r%100;s=i+o-(a?100:0)}return e?s:1-s}function Qs(i){return i%400===0||i%4===0&&i%100!==0}var Ko=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",130),k(P(n),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){var a=function(c){return{year:c,isTwoDigitYear:r==="yy"}};switch(r){case"y":return it(tt(4,s),a);case"yo":return it(o.ordinalNumber(s,{unit:"year"}),a);default:return it(tt(r.length,s),a)}}},{key:"validate",value:function(s,r){return r.isTwoDigitYear||r.year>0}},{key:"set",value:function(s,r,o){var a=s.getUTCFullYear();if(o.isTwoDigitYear){var l=Ks(o.year,a);return s.setUTCFullYear(l,0,1),s.setUTCHours(0,0,0,0),s}var c=!("era"in r)||r.era===1?o.year:1-o.year;return s.setUTCFullYear(c,0,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),Qo=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",130),k(P(n),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){var a=function(c){return{year:c,isTwoDigitYear:r==="YY"}};switch(r){case"Y":return it(tt(4,s),a);case"Yo":return it(o.ordinalNumber(s,{unit:"year"}),a);default:return it(tt(r.length,s),a)}}},{key:"validate",value:function(s,r){return r.isTwoDigitYear||r.year>0}},{key:"set",value:function(s,r,o,a){var l=Jr(s,a);if(o.isTwoDigitYear){var c=Ks(o.year,l);return s.setUTCFullYear(c,0,a.firstWeekContainsDate),s.setUTCHours(0,0,0,0),Li(s,a)}var h=!("era"in r)||r.era===1?o.year:1-o.year;return s.setUTCFullYear(h,0,a.firstWeekContainsDate),s.setUTCHours(0,0,0,0),Li(s,a)}}]),e}(W),Go=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",130),k(P(n),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r){return Ze(r==="R"?4:r.length,s)}},{key:"set",value:function(s,r,o){var a=new Date(0);return a.setUTCFullYear(o,0,4),a.setUTCHours(0,0,0,0),Ns(a)}}]),e}(W),Zo=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",130),k(P(n),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r){return Ze(r==="u"?4:r.length,s)}},{key:"set",value:function(s,r,o){return s.setUTCFullYear(o,0,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),Jo=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",120),k(P(n),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"Q":case"QQ":return tt(r.length,s);case"Qo":return o.ordinalNumber(s,{unit:"quarter"});case"QQQ":return o.quarter(s,{width:"abbreviated",context:"formatting"})||o.quarter(s,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(s,{width:"wide",context:"formatting"})||o.quarter(s,{width:"abbreviated",context:"formatting"})||o.quarter(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,r){return r>=1&&r<=4}},{key:"set",value:function(s,r,o){return s.setUTCMonth((o-1)*3,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),ta=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",120),k(P(n),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"q":case"qq":return tt(r.length,s);case"qo":return o.ordinalNumber(s,{unit:"quarter"});case"qqq":return o.quarter(s,{width:"abbreviated",context:"standalone"})||o.quarter(s,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(s,{width:"wide",context:"standalone"})||o.quarter(s,{width:"abbreviated",context:"standalone"})||o.quarter(s,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(s,r){return r>=1&&r<=4}},{key:"set",value:function(s,r,o){return s.setUTCMonth((o-1)*3,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),ea=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),k(P(n),"priority",110),n}return F(e,[{key:"parse",value:function(s,r,o){var a=function(c){return c-1};switch(r){case"M":return it(Z(et.month,s),a);case"MM":return it(tt(2,s),a);case"Mo":return it(o.ordinalNumber(s,{unit:"month"}),a);case"MMM":return o.month(s,{width:"abbreviated",context:"formatting"})||o.month(s,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(s,{width:"wide",context:"formatting"})||o.month(s,{width:"abbreviated",context:"formatting"})||o.month(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,r){return r>=0&&r<=11}},{key:"set",value:function(s,r,o){return s.setUTCMonth(o,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),ia=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",110),k(P(n),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){var a=function(c){return c-1};switch(r){case"L":return it(Z(et.month,s),a);case"LL":return it(tt(2,s),a);case"Lo":return it(o.ordinalNumber(s,{unit:"month"}),a);case"LLL":return o.month(s,{width:"abbreviated",context:"standalone"})||o.month(s,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(s,{width:"wide",context:"standalone"})||o.month(s,{width:"abbreviated",context:"standalone"})||o.month(s,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(s,r){return r>=0&&r<=11}},{key:"set",value:function(s,r,o){return s.setUTCMonth(o,1),s.setUTCHours(0,0,0,0),s}}]),e}(W);function na(i,t,e){A(2,arguments);var n=z(i),s=ht(t),r=to(n,e)-s;return n.setUTCDate(n.getUTCDate()-r*7),n}var sa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",100),k(P(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"w":return Z(et.week,s);case"wo":return o.ordinalNumber(s,{unit:"week"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=1&&r<=53}},{key:"set",value:function(s,r,o,a){return Li(na(s,o,a),a)}}]),e}(W);function ra(i,t){A(2,arguments);var e=z(i),n=ht(t),s=eo(e)-n;return e.setUTCDate(e.getUTCDate()-s*7),e}var oa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",100),k(P(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"I":return Z(et.week,s);case"Io":return o.ordinalNumber(s,{unit:"week"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=1&&r<=53}},{key:"set",value:function(s,r,o){return Ns(ra(s,o))}}]),e}(W),aa=[31,28,31,30,31,30,31,31,30,31,30,31],la=[31,29,31,30,31,30,31,31,30,31,30,31],ca=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"subPriority",1),k(P(n),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"d":return Z(et.date,s);case"do":return o.ordinalNumber(s,{unit:"date"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){var o=s.getUTCFullYear(),a=Qs(o),l=s.getUTCMonth();return a?r>=1&&r<=la[l]:r>=1&&r<=aa[l]}},{key:"set",value:function(s,r,o){return s.setUTCDate(o),s.setUTCHours(0,0,0,0),s}}]),e}(W),ha=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"subpriority",1),k(P(n),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"D":case"DD":return Z(et.dayOfYear,s);case"Do":return o.ordinalNumber(s,{unit:"date"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){var o=s.getUTCFullYear(),a=Qs(o);return a?r>=1&&r<=366:r>=1&&r<=365}},{key:"set",value:function(s,r,o){return s.setUTCMonth(0,o),s.setUTCHours(0,0,0,0),s}}]),e}(W);function qi(i,t,e){var n,s,r,o,a,l,c,h;A(2,arguments);var u=ci(),d=ht((n=(s=(r=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&s!==void 0?s:(c=u.locale)===null||c===void 0||(h=c.options)===null||h===void 0?void 0:h.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=z(i),g=ht(t),p=f.getUTCDay(),m=g%7,b=(m+7)%7,y=(b<d?7:0)+g-p;return f.setUTCDate(f.getUTCDate()+y),f}var ua=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"incompatibleTokens",["D","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"E":case"EE":case"EEE":return o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(s,{width:"wide",context:"formatting"})||o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,r){return r>=0&&r<=6}},{key:"set",value:function(s,r,o,a){return s=qi(s,o,a),s.setUTCHours(0,0,0,0),s}}]),e}(W),da=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o,a){var l=function(h){var u=Math.floor((h-1)/7)*7;return(h+a.weekStartsOn+6)%7+u};switch(r){case"e":case"ee":return it(tt(r.length,s),l);case"eo":return it(o.ordinalNumber(s,{unit:"day"}),l);case"eee":return o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"});case"eeeee":return o.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(s,{width:"wide",context:"formatting"})||o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,r){return r>=0&&r<=6}},{key:"set",value:function(s,r,o,a){return s=qi(s,o,a),s.setUTCHours(0,0,0,0),s}}]),e}(W),fa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o,a){var l=function(h){var u=Math.floor((h-1)/7)*7;return(h+a.weekStartsOn+6)%7+u};switch(r){case"c":case"cc":return it(tt(r.length,s),l);case"co":return it(o.ordinalNumber(s,{unit:"day"}),l);case"ccc":return o.day(s,{width:"abbreviated",context:"standalone"})||o.day(s,{width:"short",context:"standalone"})||o.day(s,{width:"narrow",context:"standalone"});case"ccccc":return o.day(s,{width:"narrow",context:"standalone"});case"cccccc":return o.day(s,{width:"short",context:"standalone"})||o.day(s,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(s,{width:"wide",context:"standalone"})||o.day(s,{width:"abbreviated",context:"standalone"})||o.day(s,{width:"short",context:"standalone"})||o.day(s,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(s,r){return r>=0&&r<=6}},{key:"set",value:function(s,r,o,a){return s=qi(s,o,a),s.setUTCHours(0,0,0,0),s}}]),e}(W);function ga(i,t){A(2,arguments);var e=ht(t);e%7===0&&(e=e-7);var n=1,s=z(i),r=s.getUTCDay(),o=e%7,a=(o+7)%7,l=(a<n?7:0)+e-r;return s.setUTCDate(s.getUTCDate()+l),s}var pa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){var a=function(c){return c===0?7:c};switch(r){case"i":case"ii":return tt(r.length,s);case"io":return o.ordinalNumber(s,{unit:"day"});case"iii":return it(o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"}),a);case"iiiii":return it(o.day(s,{width:"narrow",context:"formatting"}),a);case"iiiiii":return it(o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"}),a);case"iiii":default:return it(o.day(s,{width:"wide",context:"formatting"})||o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"}),a)}}},{key:"validate",value:function(s,r){return r>=1&&r<=7}},{key:"set",value:function(s,r,o){return s=ga(s,o),s.setUTCHours(0,0,0,0),s}}]),e}(W),ma=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",80),k(P(n),"incompatibleTokens",["b","B","H","k","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"a":case"aa":case"aaa":return o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(s,{width:"wide",context:"formatting"})||o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(s,r,o){return s.setUTCHours(Xi(o),0,0,0),s}}]),e}(W),ba=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",80),k(P(n),"incompatibleTokens",["a","B","H","k","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"b":case"bb":case"bbb":return o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(s,{width:"wide",context:"formatting"})||o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(s,r,o){return s.setUTCHours(Xi(o),0,0,0),s}}]),e}(W),ya=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",80),k(P(n),"incompatibleTokens",["a","b","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"B":case"BB":case"BBB":return o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(s,{width:"wide",context:"formatting"})||o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(s,r,o){return s.setUTCHours(Xi(o),0,0,0),s}}]),e}(W),xa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",70),k(P(n),"incompatibleTokens",["H","K","k","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"h":return Z(et.hour12h,s);case"ho":return o.ordinalNumber(s,{unit:"hour"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=1&&r<=12}},{key:"set",value:function(s,r,o){var a=s.getUTCHours()>=12;return a&&o<12?s.setUTCHours(o+12,0,0,0):!a&&o===12?s.setUTCHours(0,0,0,0):s.setUTCHours(o,0,0,0),s}}]),e}(W),_a=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",70),k(P(n),"incompatibleTokens",["a","b","h","K","k","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"H":return Z(et.hour23h,s);case"Ho":return o.ordinalNumber(s,{unit:"hour"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=0&&r<=23}},{key:"set",value:function(s,r,o){return s.setUTCHours(o,0,0,0),s}}]),e}(W),va=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",70),k(P(n),"incompatibleTokens",["h","H","k","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"K":return Z(et.hour11h,s);case"Ko":return o.ordinalNumber(s,{unit:"hour"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=0&&r<=11}},{key:"set",value:function(s,r,o){var a=s.getUTCHours()>=12;return a&&o<12?s.setUTCHours(o+12,0,0,0):s.setUTCHours(o,0,0,0),s}}]),e}(W),wa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",70),k(P(n),"incompatibleTokens",["a","b","h","H","K","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"k":return Z(et.hour24h,s);case"ko":return o.ordinalNumber(s,{unit:"hour"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=1&&r<=24}},{key:"set",value:function(s,r,o){var a=o<=24?o%24:o;return s.setUTCHours(a,0,0,0),s}}]),e}(W),Ma=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",60),k(P(n),"incompatibleTokens",["t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"m":return Z(et.minute,s);case"mo":return o.ordinalNumber(s,{unit:"minute"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=0&&r<=59}},{key:"set",value:function(s,r,o){return s.setUTCMinutes(o,0,0),s}}]),e}(W),ka=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",50),k(P(n),"incompatibleTokens",["t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"s":return Z(et.second,s);case"so":return o.ordinalNumber(s,{unit:"second"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=0&&r<=59}},{key:"set",value:function(s,r,o){return s.setUTCSeconds(o,0),s}}]),e}(W),Pa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",30),k(P(n),"incompatibleTokens",["t","T"]),n}return F(e,[{key:"parse",value:function(s,r){var o=function(l){return Math.floor(l*Math.pow(10,-r.length+3))};return it(tt(r.length,s),o)}},{key:"set",value:function(s,r,o){return s.setUTCMilliseconds(o),s}}]),e}(W),Sa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",10),k(P(n),"incompatibleTokens",["t","T","x"]),n}return F(e,[{key:"parse",value:function(s,r){switch(r){case"X":return St(Pt.basicOptionalMinutes,s);case"XX":return St(Pt.basic,s);case"XXXX":return St(Pt.basicOptionalSeconds,s);case"XXXXX":return St(Pt.extendedOptionalSeconds,s);case"XXX":default:return St(Pt.extended,s)}}},{key:"set",value:function(s,r,o){return r.timestampIsSet?s:new Date(s.getTime()-o)}}]),e}(W),Ta=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",10),k(P(n),"incompatibleTokens",["t","T","X"]),n}return F(e,[{key:"parse",value:function(s,r){switch(r){case"x":return St(Pt.basicOptionalMinutes,s);case"xx":return St(Pt.basic,s);case"xxxx":return St(Pt.basicOptionalSeconds,s);case"xxxxx":return St(Pt.extendedOptionalSeconds,s);case"xxx":default:return St(Pt.extended,s)}}},{key:"set",value:function(s,r,o){return r.timestampIsSet?s:new Date(s.getTime()-o)}}]),e}(W),Oa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",40),k(P(n),"incompatibleTokens","*"),n}return F(e,[{key:"parse",value:function(s){return qs(s)}},{key:"set",value:function(s,r,o){return[new Date(o*1e3),{timestampIsSet:!0}]}}]),e}(W),Ca=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",20),k(P(n),"incompatibleTokens","*"),n}return F(e,[{key:"parse",value:function(s){return qs(s)}},{key:"set",value:function(s,r,o){return[new Date(o),{timestampIsSet:!0}]}}]),e}(W),Da={G:new qo,y:new Ko,Y:new Qo,R:new Go,u:new Zo,Q:new Jo,q:new ta,M:new ea,L:new ia,w:new sa,I:new oa,d:new ca,D:new ha,E:new ua,e:new da,c:new fa,i:new pa,a:new ma,b:new ba,B:new ya,h:new xa,H:new _a,K:new va,k:new wa,m:new Ma,s:new ka,S:new Pa,X:new Sa,x:new Ta,t:new Oa,T:new Ca},Aa=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,La=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ra=/^'([^]*?)'?$/,Ea=/''/g,Ia=/\S/,Fa=/[a-zA-Z]/;function za(i,t,e,n){var s,r,o,a,l,c,h,u,d,f,g,p,m,b,y,_,v,x;A(3,arguments);var w=String(i),M=String(t),T=ci(),S=(s=(r=n==null?void 0:n.locale)!==null&&r!==void 0?r:T.locale)!==null&&s!==void 0?s:io;if(!S.match)throw new RangeError("locale must contain match property");var L=ht((o=(a=(l=(c=n==null?void 0:n.firstWeekContainsDate)!==null&&c!==void 0?c:n==null||(h=n.locale)===null||h===void 0||(u=h.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&l!==void 0?l:T.firstWeekContainsDate)!==null&&a!==void 0?a:(d=T.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(L>=1&&L<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var R=ht((g=(p=(m=(b=n==null?void 0:n.weekStartsOn)!==null&&b!==void 0?b:n==null||(y=n.locale)===null||y===void 0||(_=y.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&m!==void 0?m:T.weekStartsOn)!==null&&p!==void 0?p:(v=T.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&g!==void 0?g:0);if(!(R>=0&&R<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(M==="")return w===""?z(e):new Date(NaN);var D={firstWeekContainsDate:L,weekStartsOn:R,locale:S},K=[new Xo],rt=M.match(La).map(function(st){var U=st[0];if(U in vn){var ft=vn[U];return ft(st,S.formatLong)}return st}).join("").match(Aa),O=[],X=Sn(rt),Q;try{var Ct=function(){var U=Q.value;!(n!=null&&n.useAdditionalWeekYearTokens)&&no(U)&&wn(U,M,i),!(n!=null&&n.useAdditionalDayOfYearTokens)&&so(U)&&wn(U,M,i);var ft=U[0],ze=Da[ft];if(ze){var yn=ze.incompatibleTokens;if(Array.isArray(yn)){var xn=O.find(function(_n){return yn.includes(_n.token)||_n.token===ft});if(xn)throw new RangeError("The format string mustn't contain `".concat(xn.fullToken,"` and `").concat(U,"` at the same time"))}else if(ze.incompatibleTokens==="*"&&O.length>0)throw new RangeError("The format string mustn't contain `".concat(U,"` and any other token at the same time"));O.push({token:ft,fullToken:U});var xi=ze.run(w,U,S.match,D);if(!xi)return{v:new Date(NaN)};K.push(xi.setter),w=xi.rest}else{if(ft.match(Fa))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ft+"`");if(U==="''"?U="'":ft==="'"&&(U=Ba(U)),w.indexOf(U)===0)w=w.slice(U.length);else return{v:new Date(NaN)}}};for(X.s();!(Q=X.n()).done;){var ie=Ct();if(Pe(ie)==="object")return ie.v}}catch(st){X.e(st)}finally{X.f()}if(w.length>0&&Ia.test(w))return new Date(NaN);var Et=K.map(function(st){return st.priority}).sort(function(st,U){return U-st}).filter(function(st,U,ft){return ft.indexOf(st)===U}).map(function(st){return K.filter(function(U){return U.priority===st}).sort(function(U,ft){return ft.subPriority-U.subPriority})}).map(function(st){return st[0]}),It=z(e);if(isNaN(It.getTime()))return new Date(NaN);var dt=ro(It,oo(It)),Ft={},zt=Sn(Et),ne;try{for(zt.s();!(ne=zt.n()).done;){var se=ne.value;if(!se.validate(dt,D))return new Date(NaN);var Fe=se.set(dt,Ft,D);Array.isArray(Fe)?(dt=Fe[0],ao(Ft,Fe[1])):dt=Fe}}catch(st){zt.e(st)}finally{zt.f()}return dt}function Ba(i){return i.match(Ra)[1].replace(Ea,"'")}function Ha(i){A(1,arguments);var t=z(i);return t.setMinutes(0,0,0),t}function Na(i){A(1,arguments);var t=z(i);return t.setMilliseconds(0),t}/*!
1
+ import{cF as A,gn as li,cH as ht,cI as z,go as ci,gp as zs,gq as Bs,gr as xe,eP as Hs,cG as Pe,gs as Zr,gt as Jr,gu as Li,gv as Ns,gw as to,gx as eo,gy as io,gz as vn,gA as no,gB as wn,gC as so,gD as ro,gE as oo,gF as ao,r as kt,cc as Ws,bH as lo,gG as co,gH as ho,gI as uo}from"./index-b7003840.js";import{a as $i}from"./index-1aaa8c27.js";import{a as Vs}from"./index-670c9345.js";var fo=36e5;function go(i,t){A(2,arguments);var e=ht(t);return li(i,e*fo)}function Mn(i,t){var e,n,s,r,o,a,l,c;A(1,arguments);var h=ci(),u=ht((e=(n=(s=(r=t==null?void 0:t.weekStartsOn)!==null&&r!==void 0?r:t==null||(o=t.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&s!==void 0?s:h.weekStartsOn)!==null&&n!==void 0?n:(l=h.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=z(i),f=d.getDay(),g=(f<u?7:0)+f-u;return d.setDate(d.getDate()-g),d.setHours(0,0,0,0),d}var po=6e4;function mo(i,t){A(2,arguments);var e=ht(t);return li(i,e*po)}function bo(i,t){A(2,arguments);var e=ht(t),n=e*3;return $i(i,n)}function yo(i,t){A(2,arguments);var e=ht(t);return li(i,e*1e3)}function xo(i,t){A(2,arguments);var e=ht(t),n=e*7;return Vs(i,n)}function _o(i,t){A(2,arguments);var e=ht(t);return $i(i,e*12)}function vo(i,t){A(2,arguments);var e=z(i),n=z(t),s=e.getFullYear()-n.getFullYear(),r=e.getMonth()-n.getMonth();return s*12+r}function wo(i,t){A(2,arguments);var e=z(i),n=z(t);return e.getFullYear()-n.getFullYear()}function hi(i,t){return A(2,arguments),z(i).getTime()-z(t).getTime()}var kn={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},Mo="trunc";function Ae(i){return i?kn[i]:kn[Mo]}function ko(i,t,e){A(2,arguments);var n=hi(i,t)/zs;return Ae(e==null?void 0:e.roundingMethod)(n)}function Po(i,t,e){A(2,arguments);var n=hi(i,t)/Bs;return Ae(e==null?void 0:e.roundingMethod)(n)}function js(i){A(1,arguments);var t=z(i);return t.setHours(23,59,59,999),t}function Ys(i){A(1,arguments);var t=z(i),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function So(i){A(1,arguments);var t=z(i);return js(t).getTime()===Ys(t).getTime()}function Us(i,t){A(2,arguments);var e=z(i),n=z(t),s=xe(e,n),r=Math.abs(vo(e,n)),o;if(r<1)o=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-s*r);var a=xe(e,n)===-s;So(z(i))&&r===1&&xe(i,n)===1&&(a=!1),o=s*(r-Number(a))}return o===0?0:o}function To(i,t,e){A(2,arguments);var n=Us(i,t)/3;return Ae(e==null?void 0:e.roundingMethod)(n)}function Oo(i,t,e){A(2,arguments);var n=hi(i,t)/1e3;return Ae(e==null?void 0:e.roundingMethod)(n)}function Co(i,t,e){A(2,arguments);var n=Hs(i,t)/7;return Ae(e==null?void 0:e.roundingMethod)(n)}function Do(i,t){A(2,arguments);var e=z(i),n=z(t),s=xe(e,n),r=Math.abs(wo(e,n));e.setFullYear(1584),n.setFullYear(1584);var o=xe(e,n)===-s,a=s*(r-Number(o));return a===0?0:a}function Ao(i){A(1,arguments);var t=z(i);return t.setSeconds(0,0),t}function Lo(i){A(1,arguments);var t=z(i),e=t.getMonth(),n=e-e%3;return t.setMonth(n,1),t.setHours(0,0,0,0),t}function Ro(i){A(1,arguments);var t=z(i);return t.setDate(1),t.setHours(0,0,0,0),t}function Eo(i){A(1,arguments);var t=z(i),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function Io(i){A(1,arguments);var t=z(i),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Fo(i){A(1,arguments);var t=z(i);return t.setMinutes(59,59,999),t}function zo(i,t){var e,n,s,r,o,a,l,c;A(1,arguments);var h=ci(),u=ht((e=(n=(s=(r=t==null?void 0:t.weekStartsOn)!==null&&r!==void 0?r:t==null||(o=t.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&s!==void 0?s:h.weekStartsOn)!==null&&n!==void 0?n:(l=h.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=z(i),f=d.getDay(),g=(f<u?-7:0)+6-(f-u);return d.setDate(d.getDate()+g),d.setHours(23,59,59,999),d}function Bo(i){A(1,arguments);var t=z(i);return t.setSeconds(59,999),t}function Ho(i){A(1,arguments);var t=z(i),e=t.getMonth(),n=e-e%3+3;return t.setMonth(n,0),t.setHours(23,59,59,999),t}function No(i){A(1,arguments);var t=z(i);return t.setMilliseconds(999),t}function Pn(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function Wo(i,t){if(i){if(typeof i=="string")return Pn(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Pn(i,t)}}function Sn(i,t){var e=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!e){if(Array.isArray(i)||(e=Wo(i))||t&&i&&typeof i.length=="number"){e&&(i=e);var n=0,s=function(){};return{s,n:function(){return n>=i.length?{done:!0}:{done:!1,value:i[n++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r=!0,o=!1,a;return{s:function(){e=e.call(i)},n:function(){var c=e.next();return r=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!r&&e.return!=null&&e.return()}finally{if(o)throw a}}}}function P(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Ri(i,t){return Ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},Ri(i,t)}function H(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),t&&Ri(i,t)}function Qe(i){return Qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qe(i)}function Vo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jo(i,t){if(t&&(Pe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(i)}function N(i){var t=Vo();return function(){var n=Qe(i),s;if(t){var r=Qe(this).constructor;s=Reflect.construct(n,arguments,r)}else s=n.apply(this,arguments);return jo(this,s)}}function I(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Yo(i,t){if(Pe(i)!=="object"||i===null)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var n=e.call(i,t||"default");if(Pe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function $s(i){var t=Yo(i,"string");return Pe(t)==="symbol"?t:String(t)}function Tn(i,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,$s(n.key),n)}}function F(i,t,e){return t&&Tn(i.prototype,t),e&&Tn(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function k(i,t,e){return t=$s(t),t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Uo=10,Xs=function(){function i(){I(this,i),k(this,"priority",void 0),k(this,"subPriority",0)}return F(i,[{key:"validate",value:function(e,n){return!0}}]),i}(),$o=function(i){H(e,i);var t=N(e);function e(n,s,r,o,a){var l;return I(this,e),l=t.call(this),l.value=n,l.validateValue=s,l.setValue=r,l.priority=o,a&&(l.subPriority=a),l}return F(e,[{key:"validate",value:function(s,r){return this.validateValue(s,this.value,r)}},{key:"set",value:function(s,r,o){return this.setValue(s,r,this.value,o)}}]),e}(Xs),Xo=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",Uo),k(P(n),"subPriority",-1),n}return F(e,[{key:"set",value:function(s,r){if(r.timestampIsSet)return s;var o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}}]),e}(Xs),W=function(){function i(){I(this,i),k(this,"incompatibleTokens",void 0),k(this,"priority",void 0),k(this,"subPriority",void 0)}return F(i,[{key:"run",value:function(e,n,s,r){var o=this.parse(e,n,s,r);return o?{setter:new $o(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}},{key:"validate",value:function(e,n,s){return!0}}]),i}(),qo=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",140),k(P(n),"incompatibleTokens",["R","u","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"G":case"GG":case"GGG":return o.era(s,{width:"abbreviated"})||o.era(s,{width:"narrow"});case"GGGGG":return o.era(s,{width:"narrow"});case"GGGG":default:return o.era(s,{width:"wide"})||o.era(s,{width:"abbreviated"})||o.era(s,{width:"narrow"})}}},{key:"set",value:function(s,r,o){return r.era=o,s.setUTCFullYear(o,0,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),et={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Pt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function it(i,t){return i&&{value:t(i.value),rest:i.rest}}function Z(i,t){var e=t.match(i);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function St(i,t){var e=t.match(i);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var n=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:n*(s*zs+r*Bs+o*Zr),rest:t.slice(e[0].length)}}function qs(i){return Z(et.anyDigitsSigned,i)}function tt(i,t){switch(i){case 1:return Z(et.singleDigit,t);case 2:return Z(et.twoDigits,t);case 3:return Z(et.threeDigits,t);case 4:return Z(et.fourDigits,t);default:return Z(new RegExp("^\\d{1,"+i+"}"),t)}}function Ze(i,t){switch(i){case 1:return Z(et.singleDigitSigned,t);case 2:return Z(et.twoDigitsSigned,t);case 3:return Z(et.threeDigitsSigned,t);case 4:return Z(et.fourDigitsSigned,t);default:return Z(new RegExp("^-?\\d{1,"+i+"}"),t)}}function Xi(i){switch(i){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Ks(i,t){var e=t>0,n=e?t:1-t,s;if(n<=50)s=i||100;else{var r=n+50,o=Math.floor(r/100)*100,a=i>=r%100;s=i+o-(a?100:0)}return e?s:1-s}function Gs(i){return i%400===0||i%4===0&&i%100!==0}var Ko=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",130),k(P(n),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){var a=function(c){return{year:c,isTwoDigitYear:r==="yy"}};switch(r){case"y":return it(tt(4,s),a);case"yo":return it(o.ordinalNumber(s,{unit:"year"}),a);default:return it(tt(r.length,s),a)}}},{key:"validate",value:function(s,r){return r.isTwoDigitYear||r.year>0}},{key:"set",value:function(s,r,o){var a=s.getUTCFullYear();if(o.isTwoDigitYear){var l=Ks(o.year,a);return s.setUTCFullYear(l,0,1),s.setUTCHours(0,0,0,0),s}var c=!("era"in r)||r.era===1?o.year:1-o.year;return s.setUTCFullYear(c,0,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),Go=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",130),k(P(n),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){var a=function(c){return{year:c,isTwoDigitYear:r==="YY"}};switch(r){case"Y":return it(tt(4,s),a);case"Yo":return it(o.ordinalNumber(s,{unit:"year"}),a);default:return it(tt(r.length,s),a)}}},{key:"validate",value:function(s,r){return r.isTwoDigitYear||r.year>0}},{key:"set",value:function(s,r,o,a){var l=Jr(s,a);if(o.isTwoDigitYear){var c=Ks(o.year,l);return s.setUTCFullYear(c,0,a.firstWeekContainsDate),s.setUTCHours(0,0,0,0),Li(s,a)}var h=!("era"in r)||r.era===1?o.year:1-o.year;return s.setUTCFullYear(h,0,a.firstWeekContainsDate),s.setUTCHours(0,0,0,0),Li(s,a)}}]),e}(W),Qo=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",130),k(P(n),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r){return Ze(r==="R"?4:r.length,s)}},{key:"set",value:function(s,r,o){var a=new Date(0);return a.setUTCFullYear(o,0,4),a.setUTCHours(0,0,0,0),Ns(a)}}]),e}(W),Zo=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",130),k(P(n),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r){return Ze(r==="u"?4:r.length,s)}},{key:"set",value:function(s,r,o){return s.setUTCFullYear(o,0,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),Jo=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",120),k(P(n),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"Q":case"QQ":return tt(r.length,s);case"Qo":return o.ordinalNumber(s,{unit:"quarter"});case"QQQ":return o.quarter(s,{width:"abbreviated",context:"formatting"})||o.quarter(s,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(s,{width:"wide",context:"formatting"})||o.quarter(s,{width:"abbreviated",context:"formatting"})||o.quarter(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,r){return r>=1&&r<=4}},{key:"set",value:function(s,r,o){return s.setUTCMonth((o-1)*3,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),ta=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",120),k(P(n),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"q":case"qq":return tt(r.length,s);case"qo":return o.ordinalNumber(s,{unit:"quarter"});case"qqq":return o.quarter(s,{width:"abbreviated",context:"standalone"})||o.quarter(s,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(s,{width:"wide",context:"standalone"})||o.quarter(s,{width:"abbreviated",context:"standalone"})||o.quarter(s,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(s,r){return r>=1&&r<=4}},{key:"set",value:function(s,r,o){return s.setUTCMonth((o-1)*3,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),ea=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),k(P(n),"priority",110),n}return F(e,[{key:"parse",value:function(s,r,o){var a=function(c){return c-1};switch(r){case"M":return it(Z(et.month,s),a);case"MM":return it(tt(2,s),a);case"Mo":return it(o.ordinalNumber(s,{unit:"month"}),a);case"MMM":return o.month(s,{width:"abbreviated",context:"formatting"})||o.month(s,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(s,{width:"wide",context:"formatting"})||o.month(s,{width:"abbreviated",context:"formatting"})||o.month(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,r){return r>=0&&r<=11}},{key:"set",value:function(s,r,o){return s.setUTCMonth(o,1),s.setUTCHours(0,0,0,0),s}}]),e}(W),ia=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",110),k(P(n),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){var a=function(c){return c-1};switch(r){case"L":return it(Z(et.month,s),a);case"LL":return it(tt(2,s),a);case"Lo":return it(o.ordinalNumber(s,{unit:"month"}),a);case"LLL":return o.month(s,{width:"abbreviated",context:"standalone"})||o.month(s,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(s,{width:"wide",context:"standalone"})||o.month(s,{width:"abbreviated",context:"standalone"})||o.month(s,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(s,r){return r>=0&&r<=11}},{key:"set",value:function(s,r,o){return s.setUTCMonth(o,1),s.setUTCHours(0,0,0,0),s}}]),e}(W);function na(i,t,e){A(2,arguments);var n=z(i),s=ht(t),r=to(n,e)-s;return n.setUTCDate(n.getUTCDate()-r*7),n}var sa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",100),k(P(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"w":return Z(et.week,s);case"wo":return o.ordinalNumber(s,{unit:"week"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=1&&r<=53}},{key:"set",value:function(s,r,o,a){return Li(na(s,o,a),a)}}]),e}(W);function ra(i,t){A(2,arguments);var e=z(i),n=ht(t),s=eo(e)-n;return e.setUTCDate(e.getUTCDate()-s*7),e}var oa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",100),k(P(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"I":return Z(et.week,s);case"Io":return o.ordinalNumber(s,{unit:"week"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=1&&r<=53}},{key:"set",value:function(s,r,o){return Ns(ra(s,o))}}]),e}(W),aa=[31,28,31,30,31,30,31,31,30,31,30,31],la=[31,29,31,30,31,30,31,31,30,31,30,31],ca=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"subPriority",1),k(P(n),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"d":return Z(et.date,s);case"do":return o.ordinalNumber(s,{unit:"date"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){var o=s.getUTCFullYear(),a=Gs(o),l=s.getUTCMonth();return a?r>=1&&r<=la[l]:r>=1&&r<=aa[l]}},{key:"set",value:function(s,r,o){return s.setUTCDate(o),s.setUTCHours(0,0,0,0),s}}]),e}(W),ha=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"subpriority",1),k(P(n),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"D":case"DD":return Z(et.dayOfYear,s);case"Do":return o.ordinalNumber(s,{unit:"date"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){var o=s.getUTCFullYear(),a=Gs(o);return a?r>=1&&r<=366:r>=1&&r<=365}},{key:"set",value:function(s,r,o){return s.setUTCMonth(0,o),s.setUTCHours(0,0,0,0),s}}]),e}(W);function qi(i,t,e){var n,s,r,o,a,l,c,h;A(2,arguments);var u=ci(),d=ht((n=(s=(r=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&s!==void 0?s:(c=u.locale)===null||c===void 0||(h=c.options)===null||h===void 0?void 0:h.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=z(i),g=ht(t),p=f.getUTCDay(),m=g%7,b=(m+7)%7,y=(b<d?7:0)+g-p;return f.setUTCDate(f.getUTCDate()+y),f}var ua=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"incompatibleTokens",["D","i","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"E":case"EE":case"EEE":return o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(s,{width:"wide",context:"formatting"})||o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,r){return r>=0&&r<=6}},{key:"set",value:function(s,r,o,a){return s=qi(s,o,a),s.setUTCHours(0,0,0,0),s}}]),e}(W),da=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o,a){var l=function(h){var u=Math.floor((h-1)/7)*7;return(h+a.weekStartsOn+6)%7+u};switch(r){case"e":case"ee":return it(tt(r.length,s),l);case"eo":return it(o.ordinalNumber(s,{unit:"day"}),l);case"eee":return o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"});case"eeeee":return o.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(s,{width:"wide",context:"formatting"})||o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(s,r){return r>=0&&r<=6}},{key:"set",value:function(s,r,o,a){return s=qi(s,o,a),s.setUTCHours(0,0,0,0),s}}]),e}(W),fa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o,a){var l=function(h){var u=Math.floor((h-1)/7)*7;return(h+a.weekStartsOn+6)%7+u};switch(r){case"c":case"cc":return it(tt(r.length,s),l);case"co":return it(o.ordinalNumber(s,{unit:"day"}),l);case"ccc":return o.day(s,{width:"abbreviated",context:"standalone"})||o.day(s,{width:"short",context:"standalone"})||o.day(s,{width:"narrow",context:"standalone"});case"ccccc":return o.day(s,{width:"narrow",context:"standalone"});case"cccccc":return o.day(s,{width:"short",context:"standalone"})||o.day(s,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(s,{width:"wide",context:"standalone"})||o.day(s,{width:"abbreviated",context:"standalone"})||o.day(s,{width:"short",context:"standalone"})||o.day(s,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(s,r){return r>=0&&r<=6}},{key:"set",value:function(s,r,o,a){return s=qi(s,o,a),s.setUTCHours(0,0,0,0),s}}]),e}(W);function ga(i,t){A(2,arguments);var e=ht(t);e%7===0&&(e=e-7);var n=1,s=z(i),r=s.getUTCDay(),o=e%7,a=(o+7)%7,l=(a<n?7:0)+e-r;return s.setUTCDate(s.getUTCDate()+l),s}var pa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",90),k(P(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){var a=function(c){return c===0?7:c};switch(r){case"i":case"ii":return tt(r.length,s);case"io":return o.ordinalNumber(s,{unit:"day"});case"iii":return it(o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"}),a);case"iiiii":return it(o.day(s,{width:"narrow",context:"formatting"}),a);case"iiiiii":return it(o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"}),a);case"iiii":default:return it(o.day(s,{width:"wide",context:"formatting"})||o.day(s,{width:"abbreviated",context:"formatting"})||o.day(s,{width:"short",context:"formatting"})||o.day(s,{width:"narrow",context:"formatting"}),a)}}},{key:"validate",value:function(s,r){return r>=1&&r<=7}},{key:"set",value:function(s,r,o){return s=ga(s,o),s.setUTCHours(0,0,0,0),s}}]),e}(W),ma=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",80),k(P(n),"incompatibleTokens",["b","B","H","k","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"a":case"aa":case"aaa":return o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(s,{width:"wide",context:"formatting"})||o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(s,r,o){return s.setUTCHours(Xi(o),0,0,0),s}}]),e}(W),ba=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",80),k(P(n),"incompatibleTokens",["a","B","H","k","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"b":case"bb":case"bbb":return o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(s,{width:"wide",context:"formatting"})||o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(s,r,o){return s.setUTCHours(Xi(o),0,0,0),s}}]),e}(W),ya=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",80),k(P(n),"incompatibleTokens",["a","b","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"B":case"BB":case"BBB":return o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(s,{width:"wide",context:"formatting"})||o.dayPeriod(s,{width:"abbreviated",context:"formatting"})||o.dayPeriod(s,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(s,r,o){return s.setUTCHours(Xi(o),0,0,0),s}}]),e}(W),xa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",70),k(P(n),"incompatibleTokens",["H","K","k","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"h":return Z(et.hour12h,s);case"ho":return o.ordinalNumber(s,{unit:"hour"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=1&&r<=12}},{key:"set",value:function(s,r,o){var a=s.getUTCHours()>=12;return a&&o<12?s.setUTCHours(o+12,0,0,0):!a&&o===12?s.setUTCHours(0,0,0,0):s.setUTCHours(o,0,0,0),s}}]),e}(W),_a=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",70),k(P(n),"incompatibleTokens",["a","b","h","K","k","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"H":return Z(et.hour23h,s);case"Ho":return o.ordinalNumber(s,{unit:"hour"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=0&&r<=23}},{key:"set",value:function(s,r,o){return s.setUTCHours(o,0,0,0),s}}]),e}(W),va=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",70),k(P(n),"incompatibleTokens",["h","H","k","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"K":return Z(et.hour11h,s);case"Ko":return o.ordinalNumber(s,{unit:"hour"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=0&&r<=11}},{key:"set",value:function(s,r,o){var a=s.getUTCHours()>=12;return a&&o<12?s.setUTCHours(o+12,0,0,0):s.setUTCHours(o,0,0,0),s}}]),e}(W),wa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",70),k(P(n),"incompatibleTokens",["a","b","h","H","K","t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"k":return Z(et.hour24h,s);case"ko":return o.ordinalNumber(s,{unit:"hour"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=1&&r<=24}},{key:"set",value:function(s,r,o){var a=o<=24?o%24:o;return s.setUTCHours(a,0,0,0),s}}]),e}(W),Ma=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",60),k(P(n),"incompatibleTokens",["t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"m":return Z(et.minute,s);case"mo":return o.ordinalNumber(s,{unit:"minute"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=0&&r<=59}},{key:"set",value:function(s,r,o){return s.setUTCMinutes(o,0,0),s}}]),e}(W),ka=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",50),k(P(n),"incompatibleTokens",["t","T"]),n}return F(e,[{key:"parse",value:function(s,r,o){switch(r){case"s":return Z(et.second,s);case"so":return o.ordinalNumber(s,{unit:"second"});default:return tt(r.length,s)}}},{key:"validate",value:function(s,r){return r>=0&&r<=59}},{key:"set",value:function(s,r,o){return s.setUTCSeconds(o,0),s}}]),e}(W),Pa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",30),k(P(n),"incompatibleTokens",["t","T"]),n}return F(e,[{key:"parse",value:function(s,r){var o=function(l){return Math.floor(l*Math.pow(10,-r.length+3))};return it(tt(r.length,s),o)}},{key:"set",value:function(s,r,o){return s.setUTCMilliseconds(o),s}}]),e}(W),Sa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",10),k(P(n),"incompatibleTokens",["t","T","x"]),n}return F(e,[{key:"parse",value:function(s,r){switch(r){case"X":return St(Pt.basicOptionalMinutes,s);case"XX":return St(Pt.basic,s);case"XXXX":return St(Pt.basicOptionalSeconds,s);case"XXXXX":return St(Pt.extendedOptionalSeconds,s);case"XXX":default:return St(Pt.extended,s)}}},{key:"set",value:function(s,r,o){return r.timestampIsSet?s:new Date(s.getTime()-o)}}]),e}(W),Ta=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",10),k(P(n),"incompatibleTokens",["t","T","X"]),n}return F(e,[{key:"parse",value:function(s,r){switch(r){case"x":return St(Pt.basicOptionalMinutes,s);case"xx":return St(Pt.basic,s);case"xxxx":return St(Pt.basicOptionalSeconds,s);case"xxxxx":return St(Pt.extendedOptionalSeconds,s);case"xxx":default:return St(Pt.extended,s)}}},{key:"set",value:function(s,r,o){return r.timestampIsSet?s:new Date(s.getTime()-o)}}]),e}(W),Oa=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",40),k(P(n),"incompatibleTokens","*"),n}return F(e,[{key:"parse",value:function(s){return qs(s)}},{key:"set",value:function(s,r,o){return[new Date(o*1e3),{timestampIsSet:!0}]}}]),e}(W),Ca=function(i){H(e,i);var t=N(e);function e(){var n;I(this,e);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return n=t.call.apply(t,[this].concat(r)),k(P(n),"priority",20),k(P(n),"incompatibleTokens","*"),n}return F(e,[{key:"parse",value:function(s){return qs(s)}},{key:"set",value:function(s,r,o){return[new Date(o),{timestampIsSet:!0}]}}]),e}(W),Da={G:new qo,y:new Ko,Y:new Go,R:new Qo,u:new Zo,Q:new Jo,q:new ta,M:new ea,L:new ia,w:new sa,I:new oa,d:new ca,D:new ha,E:new ua,e:new da,c:new fa,i:new pa,a:new ma,b:new ba,B:new ya,h:new xa,H:new _a,K:new va,k:new wa,m:new Ma,s:new ka,S:new Pa,X:new Sa,x:new Ta,t:new Oa,T:new Ca},Aa=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,La=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ra=/^'([^]*?)'?$/,Ea=/''/g,Ia=/\S/,Fa=/[a-zA-Z]/;function za(i,t,e,n){var s,r,o,a,l,c,h,u,d,f,g,p,m,b,y,_,v,x;A(3,arguments);var w=String(i),M=String(t),T=ci(),S=(s=(r=n==null?void 0:n.locale)!==null&&r!==void 0?r:T.locale)!==null&&s!==void 0?s:io;if(!S.match)throw new RangeError("locale must contain match property");var L=ht((o=(a=(l=(c=n==null?void 0:n.firstWeekContainsDate)!==null&&c!==void 0?c:n==null||(h=n.locale)===null||h===void 0||(u=h.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&l!==void 0?l:T.firstWeekContainsDate)!==null&&a!==void 0?a:(d=T.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(L>=1&&L<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var R=ht((g=(p=(m=(b=n==null?void 0:n.weekStartsOn)!==null&&b!==void 0?b:n==null||(y=n.locale)===null||y===void 0||(_=y.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&m!==void 0?m:T.weekStartsOn)!==null&&p!==void 0?p:(v=T.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&g!==void 0?g:0);if(!(R>=0&&R<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(M==="")return w===""?z(e):new Date(NaN);var D={firstWeekContainsDate:L,weekStartsOn:R,locale:S},K=[new Xo],rt=M.match(La).map(function(st){var U=st[0];if(U in vn){var ft=vn[U];return ft(st,S.formatLong)}return st}).join("").match(Aa),O=[],X=Sn(rt),G;try{var Ct=function(){var U=G.value;!(n!=null&&n.useAdditionalWeekYearTokens)&&no(U)&&wn(U,M,i),!(n!=null&&n.useAdditionalDayOfYearTokens)&&so(U)&&wn(U,M,i);var ft=U[0],ze=Da[ft];if(ze){var yn=ze.incompatibleTokens;if(Array.isArray(yn)){var xn=O.find(function(_n){return yn.includes(_n.token)||_n.token===ft});if(xn)throw new RangeError("The format string mustn't contain `".concat(xn.fullToken,"` and `").concat(U,"` at the same time"))}else if(ze.incompatibleTokens==="*"&&O.length>0)throw new RangeError("The format string mustn't contain `".concat(U,"` and any other token at the same time"));O.push({token:ft,fullToken:U});var xi=ze.run(w,U,S.match,D);if(!xi)return{v:new Date(NaN)};K.push(xi.setter),w=xi.rest}else{if(ft.match(Fa))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ft+"`");if(U==="''"?U="'":ft==="'"&&(U=Ba(U)),w.indexOf(U)===0)w=w.slice(U.length);else return{v:new Date(NaN)}}};for(X.s();!(G=X.n()).done;){var ie=Ct();if(Pe(ie)==="object")return ie.v}}catch(st){X.e(st)}finally{X.f()}if(w.length>0&&Ia.test(w))return new Date(NaN);var Et=K.map(function(st){return st.priority}).sort(function(st,U){return U-st}).filter(function(st,U,ft){return ft.indexOf(st)===U}).map(function(st){return K.filter(function(U){return U.priority===st}).sort(function(U,ft){return ft.subPriority-U.subPriority})}).map(function(st){return st[0]}),It=z(e);if(isNaN(It.getTime()))return new Date(NaN);var dt=ro(It,oo(It)),Ft={},zt=Sn(Et),ne;try{for(zt.s();!(ne=zt.n()).done;){var se=ne.value;if(!se.validate(dt,D))return new Date(NaN);var Fe=se.set(dt,Ft,D);Array.isArray(Fe)?(dt=Fe[0],ao(Ft,Fe[1])):dt=Fe}}catch(st){zt.e(st)}finally{zt.f()}return dt}function Ba(i){return i.match(Ra)[1].replace(Ea,"'")}function Ha(i){A(1,arguments);var t=z(i);return t.setMinutes(0,0,0),t}function Na(i){A(1,arguments);var t=z(i);return t.setMilliseconds(0),t}/*!
3
3
  * Chart.js v3.9.1
4
4
  * https://www.chartjs.org
5
5
  * (c) 2022 Chart.js Contributors
6
6
  * Released under the MIT License
7
- */function Dt(){}const Wa=function(){let i=0;return function(){return i++}}();function V(i){return i===null||typeof i>"u"}function q(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function B(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}const ot=i=>(typeof i=="number"||i instanceof Number)&&isFinite(+i);function pt(i,t){return ot(i)?i:t}function C(i,t){return typeof i>"u"?t:i}const Va=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:i/t,Gs=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function $(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function j(i,t,e,n){let s,r,o;if(q(i))if(r=i.length,n)for(s=r-1;s>=0;s--)t.call(e,i[s],s);else for(s=0;s<r;s++)t.call(e,i[s],s);else if(B(i))for(o=Object.keys(i),r=o.length,s=0;s<r;s++)t.call(e,i[o[s]],o[s])}function Je(i,t){let e,n,s,r;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function ti(i){if(q(i))return i.map(ti);if(B(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=ti(i[e[s]]);return t}return i}function Zs(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function ja(i,t,e,n){if(!Zs(i))return;const s=t[i],r=e[i];B(s)&&B(r)?Se(s,r,n):t[i]=ti(r)}function Se(i,t,e){const n=q(t)?t:[t],s=n.length;if(!B(i))return i;e=e||{};const r=e.merger||ja;for(let o=0;o<s;++o){if(t=n[o],!B(t))continue;const a=Object.keys(t);for(let l=0,c=a.length;l<c;++l)r(a[l],i,t,e)}return i}function _e(i,t){return Se(i,t,{merger:Ya})}function Ya(i,t,e){if(!Zs(i))return;const n=t[i],s=e[i];B(n)&&B(s)?_e(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=ti(s))}const On={"":i=>i,x:i=>i.x,y:i=>i.y};function jt(i,t){return(On[t]||(On[t]=Ua(t)))(i)}function Ua(i){const t=$a(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function $a(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Ki(i){return i.charAt(0).toUpperCase()+i.slice(1)}const yt=i=>typeof i<"u",Yt=i=>typeof i=="function",Cn=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Xa(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const G=Math.PI,Y=2*G,qa=Y+G,ei=Number.POSITIVE_INFINITY,Ka=G/180,J=G/2,ue=G/4,Dn=G*2/3,mt=Math.log10,Ot=Math.sign;function An(i){const t=Math.round(i);i=ve(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(mt(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Qa(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function le(i){return!isNaN(parseFloat(i))&&isFinite(i)}function ve(i,t,e){return Math.abs(i-t)<e}function Ga(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Js(i,t,e){let n,s,r;for(n=0,s=i.length;n<s;n++)r=i[n][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function _t(i){return i*(G/180)}function Qi(i){return i*(180/G)}function Ln(i){if(!ot(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function tr(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let r=Math.atan2(n,e);return r<-.5*G&&(r+=Y),{angle:r,distance:s}}function Ei(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Za(i,t){return(i-t+qa)%Y-G}function xt(i){return(i%Y+Y)%Y}function Te(i,t,e,n){const s=xt(i),r=xt(t),o=xt(e),a=xt(r-s),l=xt(o-s),c=xt(s-r),h=xt(s-o);return s===r||s===o||n&&r===o||a>l&&c<h}function lt(i,t,e){return Math.max(t,Math.min(e,i))}function Ja(i){return lt(i,-32768,32767)}function Ht(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Gi(i,t,e){e=e||(o=>i[o]<t);let n=i.length-1,s=0,r;for(;n-s>1;)r=s+n>>1,e(r)?s=r:n=r;return{lo:s,hi:n}}const Qt=(i,t,e,n)=>Gi(i,e,n?s=>i[s][t]<=e:s=>i[s][t]<e),tl=(i,t,e)=>Gi(i,e,n=>i[n][t]>=e);function el(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const er=["push","pop","shift","splice","unshift"];function il(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),er.forEach(e=>{const n="_onData"+Ki(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...r)}),o}})})}function Rn(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(er.forEach(r=>{delete i[r]}),delete i._chartjs)}function ir(i){const t=new Set;let e,n;for(e=0,n=i.length;e<n;++e)t.add(i[e]);return t.size===n?i:Array.from(t)}const nr=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function sr(i,t,e){const n=e||(o=>Array.prototype.slice.call(o));let s=!1,r=[];return function(...o){r=n(o),s||(s=!0,nr.call(window,()=>{s=!1,i.apply(t,r)}))}}function nl(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Zi=i=>i==="start"?"left":i==="end"?"right":"center",at=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,sl=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function rr(i,t,e){const n=t.length;let s=0,r=n;if(i._sorted){const{iScale:o,_parsed:a}=i,l=o.axis,{min:c,max:h,minDefined:u,maxDefined:d}=o.getUserBounds();u&&(s=lt(Math.min(Qt(a,o.axis,c).lo,e?n:Qt(t,l,o.getPixelForValue(c)).lo),0,n-1)),d?r=lt(Math.max(Qt(a,o.axis,h,!0).hi+1,e?0:Qt(t,l,o.getPixelForValue(h),!0).hi+1),s,n)-s:r=n-s}return{start:s,count:r}}function or(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const r=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),r}const Be=i=>i===0||i===1,En=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*Y/e)),In=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*Y/e)+1,we={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*J)+1,easeOutSine:i=>Math.sin(i*J),easeInOutSine:i=>-.5*(Math.cos(G*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Be(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Be(i)?i:En(i,.075,.3),easeOutElastic:i=>Be(i)?i:In(i,.075,.3),easeInOutElastic(i){return Be(i)?i:i<.5?.5*En(i*2,.1125,.45):.5+.5*In(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-we.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?we.easeInBounce(i*2)*.5:we.easeOutBounce(i*2-1)*.5+.5};/*!
7
+ */function Dt(){}const Wa=function(){let i=0;return function(){return i++}}();function V(i){return i===null||typeof i>"u"}function q(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function B(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}const ot=i=>(typeof i=="number"||i instanceof Number)&&isFinite(+i);function pt(i,t){return ot(i)?i:t}function C(i,t){return typeof i>"u"?t:i}const Va=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:i/t,Qs=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function $(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function j(i,t,e,n){let s,r,o;if(q(i))if(r=i.length,n)for(s=r-1;s>=0;s--)t.call(e,i[s],s);else for(s=0;s<r;s++)t.call(e,i[s],s);else if(B(i))for(o=Object.keys(i),r=o.length,s=0;s<r;s++)t.call(e,i[o[s]],o[s])}function Je(i,t){let e,n,s,r;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function ti(i){if(q(i))return i.map(ti);if(B(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=ti(i[e[s]]);return t}return i}function Zs(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function ja(i,t,e,n){if(!Zs(i))return;const s=t[i],r=e[i];B(s)&&B(r)?Se(s,r,n):t[i]=ti(r)}function Se(i,t,e){const n=q(t)?t:[t],s=n.length;if(!B(i))return i;e=e||{};const r=e.merger||ja;for(let o=0;o<s;++o){if(t=n[o],!B(t))continue;const a=Object.keys(t);for(let l=0,c=a.length;l<c;++l)r(a[l],i,t,e)}return i}function _e(i,t){return Se(i,t,{merger:Ya})}function Ya(i,t,e){if(!Zs(i))return;const n=t[i],s=e[i];B(n)&&B(s)?_e(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=ti(s))}const On={"":i=>i,x:i=>i.x,y:i=>i.y};function jt(i,t){return(On[t]||(On[t]=Ua(t)))(i)}function Ua(i){const t=$a(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function $a(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Ki(i){return i.charAt(0).toUpperCase()+i.slice(1)}const yt=i=>typeof i<"u",Yt=i=>typeof i=="function",Cn=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Xa(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const Q=Math.PI,Y=2*Q,qa=Y+Q,ei=Number.POSITIVE_INFINITY,Ka=Q/180,J=Q/2,ue=Q/4,Dn=Q*2/3,mt=Math.log10,Ot=Math.sign;function An(i){const t=Math.round(i);i=ve(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(mt(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Ga(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function le(i){return!isNaN(parseFloat(i))&&isFinite(i)}function ve(i,t,e){return Math.abs(i-t)<e}function Qa(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Js(i,t,e){let n,s,r;for(n=0,s=i.length;n<s;n++)r=i[n][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function _t(i){return i*(Q/180)}function Gi(i){return i*(180/Q)}function Ln(i){if(!ot(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function tr(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let r=Math.atan2(n,e);return r<-.5*Q&&(r+=Y),{angle:r,distance:s}}function Ei(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Za(i,t){return(i-t+qa)%Y-Q}function xt(i){return(i%Y+Y)%Y}function Te(i,t,e,n){const s=xt(i),r=xt(t),o=xt(e),a=xt(r-s),l=xt(o-s),c=xt(s-r),h=xt(s-o);return s===r||s===o||n&&r===o||a>l&&c<h}function lt(i,t,e){return Math.max(t,Math.min(e,i))}function Ja(i){return lt(i,-32768,32767)}function Ht(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Qi(i,t,e){e=e||(o=>i[o]<t);let n=i.length-1,s=0,r;for(;n-s>1;)r=s+n>>1,e(r)?s=r:n=r;return{lo:s,hi:n}}const Gt=(i,t,e,n)=>Qi(i,e,n?s=>i[s][t]<=e:s=>i[s][t]<e),tl=(i,t,e)=>Qi(i,e,n=>i[n][t]>=e);function el(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const er=["push","pop","shift","splice","unshift"];function il(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),er.forEach(e=>{const n="_onData"+Ki(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...r)}),o}})})}function Rn(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(er.forEach(r=>{delete i[r]}),delete i._chartjs)}function ir(i){const t=new Set;let e,n;for(e=0,n=i.length;e<n;++e)t.add(i[e]);return t.size===n?i:Array.from(t)}const nr=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function sr(i,t,e){const n=e||(o=>Array.prototype.slice.call(o));let s=!1,r=[];return function(...o){r=n(o),s||(s=!0,nr.call(window,()=>{s=!1,i.apply(t,r)}))}}function nl(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Zi=i=>i==="start"?"left":i==="end"?"right":"center",at=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,sl=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function rr(i,t,e){const n=t.length;let s=0,r=n;if(i._sorted){const{iScale:o,_parsed:a}=i,l=o.axis,{min:c,max:h,minDefined:u,maxDefined:d}=o.getUserBounds();u&&(s=lt(Math.min(Gt(a,o.axis,c).lo,e?n:Gt(t,l,o.getPixelForValue(c)).lo),0,n-1)),d?r=lt(Math.max(Gt(a,o.axis,h,!0).hi+1,e?0:Gt(t,l,o.getPixelForValue(h),!0).hi+1),s,n)-s:r=n-s}return{start:s,count:r}}function or(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const r=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),r}const Be=i=>i===0||i===1,En=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*Y/e)),In=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*Y/e)+1,we={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*J)+1,easeOutSine:i=>Math.sin(i*J),easeInOutSine:i=>-.5*(Math.cos(Q*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Be(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Be(i)?i:En(i,.075,.3),easeOutElastic:i=>Be(i)?i:In(i,.075,.3),easeInOutElastic(i){return Be(i)?i:i<.5?.5*En(i*2,.1125,.45):.5+.5*In(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-we.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?we.easeInBounce(i*2)*.5:we.easeOutBounce(i*2-1)*.5+.5};/*!
8
8
  * @kurkle/color v0.2.1
9
9
  * https://github.com/kurkle/color#readme
10
10
  * (c) 2022 Jukka Kurkela
11
11
  * Released under the MIT License
12
- */function Le(i){return i+.5|0}const Nt=(i,t,e)=>Math.max(Math.min(i,e),t);function be(i){return Nt(Le(i*2.55),0,255)}function Vt(i){return Nt(Le(i*255),0,255)}function Rt(i){return Nt(Le(i/2.55)/100,0,1)}function Fn(i){return Nt(Le(i*100),0,100)}const gt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ii=[..."0123456789ABCDEF"],rl=i=>Ii[i&15],ol=i=>Ii[(i&240)>>4]+Ii[i&15],He=i=>(i&240)>>4===(i&15),al=i=>He(i.r)&&He(i.g)&&He(i.b)&&He(i.a);function ll(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&gt[i[1]]*17,g:255&gt[i[2]]*17,b:255&gt[i[3]]*17,a:t===5?gt[i[4]]*17:255}:(t===7||t===9)&&(e={r:gt[i[1]]<<4|gt[i[2]],g:gt[i[3]]<<4|gt[i[4]],b:gt[i[5]]<<4|gt[i[6]],a:t===9?gt[i[7]]<<4|gt[i[8]]:255})),e}const cl=(i,t)=>i<255?t(i):"";function hl(i){var t=al(i)?rl:ol;return i?"#"+t(i.r)+t(i.g)+t(i.b)+cl(i.a,t):void 0}const ul=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ar(i,t,e){const n=t*Math.min(e,1-e),s=(r,o=(r+i/30)%12)=>e-n*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function dl(i,t,e){const n=(s,r=(s+i/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function fl(i,t,e){const n=ar(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function gl(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function Ji(i){const e=i.r/255,n=i.g/255,s=i.b/255,r=Math.max(e,n,s),o=Math.min(e,n,s),a=(r+o)/2;let l,c,h;return r!==o&&(h=r-o,c=a>.5?h/(2-r-o):h/(r+o),l=gl(e,n,s,h,r),l=l*60+.5),[l|0,c||0,a]}function tn(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(Vt)}function en(i,t,e){return tn(ar,i,t,e)}function pl(i,t,e){return tn(fl,i,t,e)}function ml(i,t,e){return tn(dl,i,t,e)}function lr(i){return(i%360+360)%360}function bl(i){const t=ul.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?be(+t[5]):Vt(+t[5]));const s=lr(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?n=pl(s,r,o):t[1]==="hsv"?n=ml(s,r,o):n=en(s,r,o),{r:n[0],g:n[1],b:n[2],a:e}}function yl(i,t){var e=Ji(i);e[0]=lr(e[0]+t),e=en(e),i.r=e[0],i.g=e[1],i.b=e[2]}function xl(i){if(!i)return;const t=Ji(i),e=t[0],n=Fn(t[1]),s=Fn(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${Rt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const zn={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Bn={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function _l(){const i={},t=Object.keys(Bn),e=Object.keys(zn);let n,s,r,o,a;for(n=0;n<t.length;n++){for(o=a=t[n],s=0;s<e.length;s++)r=e[s],a=a.replace(r,zn[r]);r=parseInt(Bn[o],16),i[a]=[r>>16&255,r>>8&255,r&255]}return i}let Ne;function vl(i){Ne||(Ne=_l(),Ne.transparent=[0,0,0,0]);const t=Ne[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const wl=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ml(i){const t=wl.exec(i);let e=255,n,s,r;if(t){if(t[7]!==n){const o=+t[7];e=t[8]?be(o):Nt(o*255,0,255)}return n=+t[1],s=+t[3],r=+t[5],n=255&(t[2]?be(n):Nt(n,0,255)),s=255&(t[4]?be(s):Nt(s,0,255)),r=255&(t[6]?be(r):Nt(r,0,255)),{r:n,g:s,b:r,a:e}}}function kl(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Rt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const _i=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,re=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Pl(i,t,e){const n=re(Rt(i.r)),s=re(Rt(i.g)),r=re(Rt(i.b));return{r:Vt(_i(n+e*(re(Rt(t.r))-n))),g:Vt(_i(s+e*(re(Rt(t.g))-s))),b:Vt(_i(r+e*(re(Rt(t.b))-r))),a:i.a+e*(t.a-i.a)}}function We(i,t,e){if(i){let n=Ji(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=en(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function cr(i,t){return i&&Object.assign(t||{},i)}function Hn(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Vt(i[3]))):(t=cr(i,{r:0,g:0,b:0,a:1}),t.a=Vt(t.a)),t}function Sl(i){return i.charAt(0)==="r"?Ml(i):bl(i)}class ii{constructor(t){if(t instanceof ii)return t;const e=typeof t;let n;e==="object"?n=Hn(t):e==="string"&&(n=ll(t)||vl(t)||Sl(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=cr(this._rgb);return t&&(t.a=Rt(t.a)),t}set rgb(t){this._rgb=Hn(t)}rgbString(){return this._valid?kl(this._rgb):void 0}hexString(){return this._valid?hl(this._rgb):void 0}hslString(){return this._valid?xl(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,n.r=255&c*n.r+r*s.r+.5,n.g=255&c*n.g+r*s.g+.5,n.b=255&c*n.b+r*s.b+.5,n.a=o*n.a+(1-o)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=Pl(this._rgb,t._rgb,e)),this}clone(){return new ii(this.rgb)}alpha(t){return this._rgb.a=Vt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Le(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return We(this._rgb,2,t),this}darken(t){return We(this._rgb,2,-t),this}saturate(t){return We(this._rgb,1,t),this}desaturate(t){return We(this._rgb,1,-t),this}rotate(t){return yl(this._rgb,t),this}}function hr(i){return new ii(i)}function ur(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Nn(i){return ur(i)?i:hr(i)}function vi(i){return ur(i)?i:hr(i).saturate(.5).darken(.1).hexString()}const Jt=Object.create(null),Fi=Object.create(null);function Me(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const r=e[n];i=i[r]||(i[r]=Object.create(null))}return i}function wi(i,t,e){return typeof t=="string"?Se(Me(i,t),e):Se(Me(i,""),t)}class Tl{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,n)=>vi(n.backgroundColor),this.hoverBorderColor=(e,n)=>vi(n.borderColor),this.hoverColor=(e,n)=>vi(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return wi(this,t,e)}get(t){return Me(this,t)}describe(t,e){return wi(Fi,t,e)}override(t,e){return wi(Jt,t,e)}route(t,e,n,s){const r=Me(this,t),o=Me(this,n),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return B(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l}}})}}var E=new Tl({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Ol(i){return!i||V(i.size)||V(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ni(i,t,e,n,s){let r=t[s];return r||(r=t[s]=i.measureText(s).width,e.push(s)),r>n&&(n=r),n}function Cl(i,t,e,n){n=n||{};let s=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},r=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let o=0;const a=e.length;let l,c,h,u,d;for(l=0;l<a;l++)if(u=e[l],u!=null&&q(u)!==!0)o=ni(i,s,r,o,u);else if(q(u))for(c=0,h=u.length;c<h;c++)d=u[c],d!=null&&!q(d)&&(o=ni(i,s,r,o,d));i.restore();const f=r.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[r[l]];r.splice(0,f)}return o}function $t(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Wn(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function zi(i,t,e,n){dr(i,t,e,n,null)}function dr(i,t,e,n,s){let r,o,a,l,c,h;const u=t.pointStyle,d=t.rotation,f=t.radius;let g=(d||0)*Ka;if(u&&typeof u=="object"&&(r=u.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(g),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(f)||f<=0)){switch(i.beginPath(),u){default:s?i.ellipse(e,n,s/2,f,0,0,Y):i.arc(e,n,f,0,Y),i.closePath();break;case"triangle":i.moveTo(e+Math.sin(g)*f,n-Math.cos(g)*f),g+=Dn,i.lineTo(e+Math.sin(g)*f,n-Math.cos(g)*f),g+=Dn,i.lineTo(e+Math.sin(g)*f,n-Math.cos(g)*f),i.closePath();break;case"rectRounded":c=f*.516,l=f-c,o=Math.cos(g+ue)*l,a=Math.sin(g+ue)*l,i.arc(e-o,n-a,c,g-G,g-J),i.arc(e+a,n-o,c,g-J,g),i.arc(e+o,n+a,c,g,g+J),i.arc(e-a,n+o,c,g+J,g+G),i.closePath();break;case"rect":if(!d){l=Math.SQRT1_2*f,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}g+=ue;case"rectRot":o=Math.cos(g)*f,a=Math.sin(g)*f,i.moveTo(e-o,n-a),i.lineTo(e+a,n-o),i.lineTo(e+o,n+a),i.lineTo(e-a,n+o),i.closePath();break;case"crossRot":g+=ue;case"cross":o=Math.cos(g)*f,a=Math.sin(g)*f,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a),i.moveTo(e+a,n-o),i.lineTo(e-a,n+o);break;case"star":o=Math.cos(g)*f,a=Math.sin(g)*f,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a),i.moveTo(e+a,n-o),i.lineTo(e-a,n+o),g+=ue,o=Math.cos(g)*f,a=Math.sin(g)*f,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a),i.moveTo(e+a,n-o),i.lineTo(e-a,n+o);break;case"line":o=s?s/2:Math.cos(g)*f,a=Math.sin(g)*f,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(g)*f,n+Math.sin(g)*f);break}i.fill(),t.borderWidth>0&&i.stroke()}}function Oe(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function nn(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function sn(i){i.restore()}function Dl(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;i.lineTo(r,t.y),i.lineTo(r,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function Al(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function te(i,t,e,n,s,r={}){const o=q(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,Ll(i,r),l=0;l<o.length;++l)c=o[l],a&&(r.strokeColor&&(i.strokeStyle=r.strokeColor),V(r.strokeWidth)||(i.lineWidth=r.strokeWidth),i.strokeText(c,e,n,r.maxWidth)),i.fillText(c,e,n,r.maxWidth),Rl(i,e,n,c,r),n+=s.lineHeight;i.restore()}function Ll(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),V(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function Rl(i,t,e,n,s){if(s.strikethrough||s.underline){const r=i.measureText(n),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(o,h),i.lineTo(a,h),i.stroke()}}function Ce(i,t){const{x:e,y:n,w:s,h:r,radius:o}=t;i.arc(e+o.topLeft,n+o.topLeft,o.topLeft,-J,G,!0),i.lineTo(e,n+r-o.bottomLeft),i.arc(e+o.bottomLeft,n+r-o.bottomLeft,o.bottomLeft,G,J,!0),i.lineTo(e+s-o.bottomRight,n+r),i.arc(e+s-o.bottomRight,n+r-o.bottomRight,o.bottomRight,J,0,!0),i.lineTo(e+s,n+o.topRight),i.arc(e+s-o.topRight,n+o.topRight,o.topRight,0,-J,!0),i.lineTo(e+o.topLeft,n)}const El=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Il=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Fl(i,t){const e=(""+i).match(El);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const zl=i=>+i||0;function rn(i,t){const e={},n=B(t),s=n?Object.keys(t):t,r=B(i)?n?o=>C(i[o],i[t[o]]):o=>i[o]:()=>i;for(const o of s)e[o]=zl(r(o));return e}function fr(i){return rn(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Gt(i){return rn(i,["topLeft","topRight","bottomLeft","bottomRight"])}function ct(i){const t=fr(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function nt(i,t){i=i||{},t=t||E.font;let e=C(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=C(i.style,t.style);n&&!(""+n).match(Il)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:C(i.family,t.family),lineHeight:Fl(C(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:C(i.weight,t.weight),string:""};return s.string=Ol(s),s}function Ve(i,t,e,n){let s=!0,r,o,a;for(r=0,o=i.length;r<o;++r)if(a=i[r],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),e!==void 0&&q(a)&&(a=a[e%a.length],s=!1),a!==void 0))return n&&!s&&(n.cacheable=!1),a}function Bl(i,t,e){const{min:n,max:s}=i,r=Gs(t,(s-n)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(n,-Math.abs(r)),max:o(s,r)}}function Ut(i,t){return Object.assign(Object.create(i),t)}function on(i,t=[""],e=i,n,s=()=>i[0]){yt(n)||(n=br("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:n,_getTarget:s,override:o=>on([o,...i],t,e,n)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete i[0][a],!0},get(o,a){return pr(o,a,()=>$l(a,t,i,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(o,a){return jn(o).includes(a)},ownKeys(o){return jn(o)},set(o,a,l){const c=o._storage||(o._storage=s());return o[a]=c[a]=l,delete o._keys,!0}})}function ce(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:gr(i,n),setContext:r=>ce(i,r,e,n),override:r=>ce(i.override(r),t,e,n)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete i[o],!0},get(r,o,a){return pr(r,o,()=>Nl(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(i,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,o)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(r,o){return Reflect.has(i,o)},ownKeys(){return Reflect.ownKeys(i)},set(r,o,a){return i[o]=a,delete r[o],!0}})}function gr(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:Yt(e)?e:()=>e,isIndexable:Yt(n)?n:()=>n}}const Hl=(i,t)=>i?i+Ki(t):t,an=(i,t)=>B(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pr(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const n=e();return i[t]=n,n}function Nl(i,t,e){const{_proxy:n,_context:s,_subProxy:r,_descriptors:o}=i;let a=n[t];return Yt(a)&&o.isScriptable(t)&&(a=Wl(t,a,i,e)),q(a)&&a.length&&(a=Vl(t,a,i,o.isIndexable)),an(t,a)&&(a=ce(a,s,r&&r[t],o)),a}function Wl(i,t,e,n){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);return a.add(i),t=t(r,o||n),a.delete(i),an(i,t)&&(t=ln(s._scopes,s,i,t)),t}function Vl(i,t,e,n){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(yt(r.index)&&n(i))t=t[r.index%t.length];else if(B(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=ln(c,s,i,h);t.push(ce(u,r,o&&o[i],a))}}return t}function mr(i,t,e){return Yt(i)?i(t,e):i}const jl=(i,t)=>i===!0?t:typeof i=="string"?jt(t,i):void 0;function Yl(i,t,e,n,s){for(const r of t){const o=jl(e,r);if(o){i.add(o);const a=mr(o._fallback,e,s);if(yt(a)&&a!==e&&a!==n)return a}else if(o===!1&&yt(n)&&e!==n)return null}return!1}function ln(i,t,e,n){const s=t._rootScopes,r=mr(t._fallback,e,n),o=[...i,...s],a=new Set;a.add(n);let l=Vn(a,o,e,r||e,n);return l===null||yt(r)&&r!==e&&(l=Vn(a,o,r,l,n),l===null)?!1:on(Array.from(a),[""],s,r,()=>Ul(t,e,n))}function Vn(i,t,e,n,s){for(;e;)e=Yl(i,t,e,n,s);return e}function Ul(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return q(s)&&B(e)?e:s}function $l(i,t,e,n){let s;for(const r of t)if(s=br(Hl(r,i),e),yt(s))return an(i,s)?ln(e,n,i,s):s}function br(i,t){for(const e of t){if(!e)continue;const n=e[i];if(yt(n))return n}}function jn(i){let t=i._keys;return t||(t=i._keys=Xl(i._scopes)),t}function Xl(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function yr(i,t,e,n){const{iScale:s}=i,{key:r="r"}=this._parsing,o=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+e,h=t[c],o[a]={r:s.parse(jt(h,r),c)};return o}const ql=Number.EPSILON||1e-14,he=(i,t)=>t<i.length&&!i[t].skip&&i[t],xr=i=>i==="x"?"y":"x";function Kl(i,t,e,n){const s=i.skip?t:i,r=t,o=e.skip?t:e,a=Ei(r,s),l=Ei(o,r);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const u=n*c,d=n*h;return{previous:{x:r.x-u*(o.x-s.x),y:r.y-u*(o.y-s.y)},next:{x:r.x+d*(o.x-s.x),y:r.y+d*(o.y-s.y)}}}function Ql(i,t,e){const n=i.length;let s,r,o,a,l,c=he(i,0);for(let h=0;h<n-1;++h)if(l=c,c=he(i,h+1),!(!l||!c)){if(ve(t[h],0,ql)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],r=e[h+1]/t[h],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[h]=s*o*t[h],e[h+1]=r*o*t[h])}}function Gl(i,t,e="x"){const n=xr(e),s=i.length;let r,o,a,l=he(i,0);for(let c=0;c<s;++c){if(o=a,a=l,l=he(i,c+1),!a)continue;const h=a[e],u=a[n];o&&(r=(h-o[e])/3,a[`cp1${e}`]=h-r,a[`cp1${n}`]=u-r*t[c]),l&&(r=(l[e]-h)/3,a[`cp2${e}`]=h+r,a[`cp2${n}`]=u+r*t[c])}}function Zl(i,t="x"){const e=xr(t),n=i.length,s=Array(n).fill(0),r=Array(n);let o,a,l,c=he(i,0);for(o=0;o<n;++o)if(a=l,l=c,c=he(i,o+1),!!l){if(c){const h=c[t]-l[t];s[o]=h!==0?(c[e]-l[e])/h:0}r[o]=a?c?Ot(s[o-1])!==Ot(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Ql(i,s,r),Gl(i,r,t)}function je(i,t,e){return Math.max(Math.min(i,e),t)}function Jl(i,t){let e,n,s,r,o,a=Oe(i[0],t);for(e=0,n=i.length;e<n;++e)o=r,r=a,a=e<n-1&&Oe(i[e+1],t),r&&(s=i[e],o&&(s.cp1x=je(s.cp1x,t.left,t.right),s.cp1y=je(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=je(s.cp2x,t.left,t.right),s.cp2y=je(s.cp2y,t.top,t.bottom)))}function tc(i,t,e,n,s){let r,o,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Zl(i,s);else{let c=n?i[i.length-1]:i[0];for(r=0,o=i.length;r<o;++r)a=i[r],l=Kl(c,a,i[Math.min(r+1,o-(n?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Jl(i,e)}function _r(){return typeof window<"u"&&typeof document<"u"}function cn(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function si(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const ui=i=>window.getComputedStyle(i,null);function ec(i,t){return ui(i).getPropertyValue(t)}const ic=["top","right","bottom","left"];function Zt(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=ic[s];n[r]=parseFloat(i[t+"-"+r+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const nc=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function sc(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:r}=n;let o=!1,a,l;if(nc(s,r,i.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function qt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=ui(e),r=s.boxSizing==="border-box",o=Zt(s,"padding"),a=Zt(s,"border","width"),{x:l,y:c,box:h}=sc(i,e),u=o.left+(h&&a.left),d=o.top+(h&&a.top);let{width:f,height:g}=t;return r&&(f-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-u)/f*e.width/n),y:Math.round((c-d)/g*e.height/n)}}function rc(i,t,e){let n,s;if(t===void 0||e===void 0){const r=cn(i);if(!r)t=i.clientWidth,e=i.clientHeight;else{const o=r.getBoundingClientRect(),a=ui(r),l=Zt(a,"border","width"),c=Zt(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,n=si(a.maxWidth,r,"clientWidth"),s=si(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:n||ei,maxHeight:s||ei}}const Mi=i=>Math.round(i*10)/10;function oc(i,t,e,n){const s=ui(i),r=Zt(s,"margin"),o=si(s.maxWidth,i,"clientWidth")||ei,a=si(s.maxHeight,i,"clientHeight")||ei,l=rc(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const u=Zt(s,"border","width"),d=Zt(s,"padding");c-=d.width+u.width,h-=d.height+u.height}return c=Math.max(0,c-r.width),h=Math.max(0,n?Math.floor(c/n):h-r.height),c=Mi(Math.min(c,o,l.maxWidth)),h=Mi(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Mi(c/2)),{width:c,height:h}}function Yn(i,t,e){const n=t||1,s=Math.floor(i.height*n),r=Math.floor(i.width*n);i.height=s/n,i.width=r/n;const o=i.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${i.height}px`,o.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||o.height!==s||o.width!==r?(i.currentDevicePixelRatio=n,o.height=s,o.width=r,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const ac=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function Un(i,t){const e=ec(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Kt(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function lc(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function cc(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},r={x:t.cp1x,y:t.cp1y},o=Kt(i,s,e),a=Kt(s,r,e),l=Kt(r,t,e),c=Kt(o,a,e),h=Kt(a,l,e);return Kt(c,h,e)}const $n=new Map;function hc(i,t){t=t||{};const e=i+JSON.stringify(t);let n=$n.get(e);return n||(n=new Intl.NumberFormat(i,t),$n.set(e,n)),n}function Re(i,t,e){return hc(t,e).format(i)}const uc=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},dc=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function ae(i,t,e){return i?uc(t,e):dc()}function vr(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function wr(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Mr(i){return i==="angle"?{between:Te,compare:Za,normalize:xt}:{between:Ht,compare:(t,e)=>t-e,normalize:t=>t}}function Xn({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function fc(i,t,e){const{property:n,start:s,end:r}=e,{between:o,normalize:a}=Mr(n),l=t.length;let{start:c,end:h,loop:u}=i,d,f;if(u){for(c+=l,h+=l,d=0,f=l;d<f&&o(a(t[c%l][n]),s,r);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:i.style}}function gc(i,t,e){if(!e)return[i];const{property:n,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=Mr(n),{start:h,end:u,loop:d,style:f}=fc(i,t,e),g=[];let p=!1,m=null,b,y,_;const v=()=>l(s,_,b)&&a(s,_)!==0,x=()=>a(r,b)===0||l(r,_,b),w=()=>p||v(),M=()=>!p||x();for(let T=h,S=h;T<=u;++T)y=t[T%o],!y.skip&&(b=c(y[n]),b!==_&&(p=l(b,s,r),m===null&&w()&&(m=a(b,s)===0?T:S),m!==null&&M()&&(g.push(Xn({start:m,end:T,loop:d,count:o,style:f})),m=null),S=T,_=b));return m!==null&&g.push(Xn({start:m,end:u,loop:d,count:o,style:f})),g}function pc(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const r=gc(n[s],i.points,t);r.length&&e.push(...r)}return e}function mc(i,t,e,n){let s=0,r=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&i[r%t].skip;)r--;return r%=t,{start:s,end:r}}function bc(i,t,e,n){const s=i.length,r=[];let o=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?a.skip||(n=!1,r.push({start:t%s,end:(l-1)%s,loop:n}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:n}),r}function yc(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const r=!!i._loop,{start:o,end:a}=mc(e,s,r,n);if(n===!0)return qn(i,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!i._fullLoop&&o===0&&a===s-1;return qn(i,bc(e,o,l,c),e,t)}function qn(i,t,e,n){return!n||!n.setContext||!e?t:xc(i,t,e,n)}function xc(i,t,e,n){const s=i._chart.getContext(),r=Kn(i.options),{_datasetIndex:o,options:{spanGaps:a}}=i,l=e.length,c=[];let h=r,u=t[0].start,d=u;function f(g,p,m,b){const y=a?-1:1;if(g!==p){for(g+=l;e[g%l].skip;)g-=y;for(;e[p%l].skip;)p+=y;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),h=b,u=p%l)}}for(const g of t){u=a?u:g.start;let p=e[u%l],m;for(d=u+1;d<=g.end;d++){const b=e[d%l];m=Kn(n.setContext(Ut(s,{type:"segment",p0:p,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),_c(m,h)&&f(u,d-1,g.loop,h),p=b,h=m}u<d-1&&f(u,d-1,g.loop,h)}return c}function Kn(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function _c(i,t){return t&&JSON.stringify(i)!==JSON.stringify(t)}/*!
12
+ */function Le(i){return i+.5|0}const Nt=(i,t,e)=>Math.max(Math.min(i,e),t);function be(i){return Nt(Le(i*2.55),0,255)}function Vt(i){return Nt(Le(i*255),0,255)}function Rt(i){return Nt(Le(i/2.55)/100,0,1)}function Fn(i){return Nt(Le(i*100),0,100)}const gt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ii=[..."0123456789ABCDEF"],rl=i=>Ii[i&15],ol=i=>Ii[(i&240)>>4]+Ii[i&15],He=i=>(i&240)>>4===(i&15),al=i=>He(i.r)&&He(i.g)&&He(i.b)&&He(i.a);function ll(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&gt[i[1]]*17,g:255&gt[i[2]]*17,b:255&gt[i[3]]*17,a:t===5?gt[i[4]]*17:255}:(t===7||t===9)&&(e={r:gt[i[1]]<<4|gt[i[2]],g:gt[i[3]]<<4|gt[i[4]],b:gt[i[5]]<<4|gt[i[6]],a:t===9?gt[i[7]]<<4|gt[i[8]]:255})),e}const cl=(i,t)=>i<255?t(i):"";function hl(i){var t=al(i)?rl:ol;return i?"#"+t(i.r)+t(i.g)+t(i.b)+cl(i.a,t):void 0}const ul=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ar(i,t,e){const n=t*Math.min(e,1-e),s=(r,o=(r+i/30)%12)=>e-n*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function dl(i,t,e){const n=(s,r=(s+i/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function fl(i,t,e){const n=ar(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function gl(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function Ji(i){const e=i.r/255,n=i.g/255,s=i.b/255,r=Math.max(e,n,s),o=Math.min(e,n,s),a=(r+o)/2;let l,c,h;return r!==o&&(h=r-o,c=a>.5?h/(2-r-o):h/(r+o),l=gl(e,n,s,h,r),l=l*60+.5),[l|0,c||0,a]}function tn(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(Vt)}function en(i,t,e){return tn(ar,i,t,e)}function pl(i,t,e){return tn(fl,i,t,e)}function ml(i,t,e){return tn(dl,i,t,e)}function lr(i){return(i%360+360)%360}function bl(i){const t=ul.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?be(+t[5]):Vt(+t[5]));const s=lr(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?n=pl(s,r,o):t[1]==="hsv"?n=ml(s,r,o):n=en(s,r,o),{r:n[0],g:n[1],b:n[2],a:e}}function yl(i,t){var e=Ji(i);e[0]=lr(e[0]+t),e=en(e),i.r=e[0],i.g=e[1],i.b=e[2]}function xl(i){if(!i)return;const t=Ji(i),e=t[0],n=Fn(t[1]),s=Fn(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${Rt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const zn={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Bn={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function _l(){const i={},t=Object.keys(Bn),e=Object.keys(zn);let n,s,r,o,a;for(n=0;n<t.length;n++){for(o=a=t[n],s=0;s<e.length;s++)r=e[s],a=a.replace(r,zn[r]);r=parseInt(Bn[o],16),i[a]=[r>>16&255,r>>8&255,r&255]}return i}let Ne;function vl(i){Ne||(Ne=_l(),Ne.transparent=[0,0,0,0]);const t=Ne[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const wl=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ml(i){const t=wl.exec(i);let e=255,n,s,r;if(t){if(t[7]!==n){const o=+t[7];e=t[8]?be(o):Nt(o*255,0,255)}return n=+t[1],s=+t[3],r=+t[5],n=255&(t[2]?be(n):Nt(n,0,255)),s=255&(t[4]?be(s):Nt(s,0,255)),r=255&(t[6]?be(r):Nt(r,0,255)),{r:n,g:s,b:r,a:e}}}function kl(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Rt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const _i=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,re=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Pl(i,t,e){const n=re(Rt(i.r)),s=re(Rt(i.g)),r=re(Rt(i.b));return{r:Vt(_i(n+e*(re(Rt(t.r))-n))),g:Vt(_i(s+e*(re(Rt(t.g))-s))),b:Vt(_i(r+e*(re(Rt(t.b))-r))),a:i.a+e*(t.a-i.a)}}function We(i,t,e){if(i){let n=Ji(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=en(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function cr(i,t){return i&&Object.assign(t||{},i)}function Hn(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Vt(i[3]))):(t=cr(i,{r:0,g:0,b:0,a:1}),t.a=Vt(t.a)),t}function Sl(i){return i.charAt(0)==="r"?Ml(i):bl(i)}class ii{constructor(t){if(t instanceof ii)return t;const e=typeof t;let n;e==="object"?n=Hn(t):e==="string"&&(n=ll(t)||vl(t)||Sl(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=cr(this._rgb);return t&&(t.a=Rt(t.a)),t}set rgb(t){this._rgb=Hn(t)}rgbString(){return this._valid?kl(this._rgb):void 0}hexString(){return this._valid?hl(this._rgb):void 0}hslString(){return this._valid?xl(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,n.r=255&c*n.r+r*s.r+.5,n.g=255&c*n.g+r*s.g+.5,n.b=255&c*n.b+r*s.b+.5,n.a=o*n.a+(1-o)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=Pl(this._rgb,t._rgb,e)),this}clone(){return new ii(this.rgb)}alpha(t){return this._rgb.a=Vt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Le(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return We(this._rgb,2,t),this}darken(t){return We(this._rgb,2,-t),this}saturate(t){return We(this._rgb,1,t),this}desaturate(t){return We(this._rgb,1,-t),this}rotate(t){return yl(this._rgb,t),this}}function hr(i){return new ii(i)}function ur(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Nn(i){return ur(i)?i:hr(i)}function vi(i){return ur(i)?i:hr(i).saturate(.5).darken(.1).hexString()}const Jt=Object.create(null),Fi=Object.create(null);function Me(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const r=e[n];i=i[r]||(i[r]=Object.create(null))}return i}function wi(i,t,e){return typeof t=="string"?Se(Me(i,t),e):Se(Me(i,""),t)}class Tl{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,n)=>vi(n.backgroundColor),this.hoverBorderColor=(e,n)=>vi(n.borderColor),this.hoverColor=(e,n)=>vi(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return wi(this,t,e)}get(t){return Me(this,t)}describe(t,e){return wi(Fi,t,e)}override(t,e){return wi(Jt,t,e)}route(t,e,n,s){const r=Me(this,t),o=Me(this,n),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return B(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l}}})}}var E=new Tl({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Ol(i){return!i||V(i.size)||V(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ni(i,t,e,n,s){let r=t[s];return r||(r=t[s]=i.measureText(s).width,e.push(s)),r>n&&(n=r),n}function Cl(i,t,e,n){n=n||{};let s=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},r=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let o=0;const a=e.length;let l,c,h,u,d;for(l=0;l<a;l++)if(u=e[l],u!=null&&q(u)!==!0)o=ni(i,s,r,o,u);else if(q(u))for(c=0,h=u.length;c<h;c++)d=u[c],d!=null&&!q(d)&&(o=ni(i,s,r,o,d));i.restore();const f=r.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[r[l]];r.splice(0,f)}return o}function $t(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Wn(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function zi(i,t,e,n){dr(i,t,e,n,null)}function dr(i,t,e,n,s){let r,o,a,l,c,h;const u=t.pointStyle,d=t.rotation,f=t.radius;let g=(d||0)*Ka;if(u&&typeof u=="object"&&(r=u.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(g),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(f)||f<=0)){switch(i.beginPath(),u){default:s?i.ellipse(e,n,s/2,f,0,0,Y):i.arc(e,n,f,0,Y),i.closePath();break;case"triangle":i.moveTo(e+Math.sin(g)*f,n-Math.cos(g)*f),g+=Dn,i.lineTo(e+Math.sin(g)*f,n-Math.cos(g)*f),g+=Dn,i.lineTo(e+Math.sin(g)*f,n-Math.cos(g)*f),i.closePath();break;case"rectRounded":c=f*.516,l=f-c,o=Math.cos(g+ue)*l,a=Math.sin(g+ue)*l,i.arc(e-o,n-a,c,g-Q,g-J),i.arc(e+a,n-o,c,g-J,g),i.arc(e+o,n+a,c,g,g+J),i.arc(e-a,n+o,c,g+J,g+Q),i.closePath();break;case"rect":if(!d){l=Math.SQRT1_2*f,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}g+=ue;case"rectRot":o=Math.cos(g)*f,a=Math.sin(g)*f,i.moveTo(e-o,n-a),i.lineTo(e+a,n-o),i.lineTo(e+o,n+a),i.lineTo(e-a,n+o),i.closePath();break;case"crossRot":g+=ue;case"cross":o=Math.cos(g)*f,a=Math.sin(g)*f,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a),i.moveTo(e+a,n-o),i.lineTo(e-a,n+o);break;case"star":o=Math.cos(g)*f,a=Math.sin(g)*f,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a),i.moveTo(e+a,n-o),i.lineTo(e-a,n+o),g+=ue,o=Math.cos(g)*f,a=Math.sin(g)*f,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a),i.moveTo(e+a,n-o),i.lineTo(e-a,n+o);break;case"line":o=s?s/2:Math.cos(g)*f,a=Math.sin(g)*f,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(g)*f,n+Math.sin(g)*f);break}i.fill(),t.borderWidth>0&&i.stroke()}}function Oe(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function nn(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function sn(i){i.restore()}function Dl(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;i.lineTo(r,t.y),i.lineTo(r,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function Al(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function te(i,t,e,n,s,r={}){const o=q(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,Ll(i,r),l=0;l<o.length;++l)c=o[l],a&&(r.strokeColor&&(i.strokeStyle=r.strokeColor),V(r.strokeWidth)||(i.lineWidth=r.strokeWidth),i.strokeText(c,e,n,r.maxWidth)),i.fillText(c,e,n,r.maxWidth),Rl(i,e,n,c,r),n+=s.lineHeight;i.restore()}function Ll(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),V(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function Rl(i,t,e,n,s){if(s.strikethrough||s.underline){const r=i.measureText(n),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(o,h),i.lineTo(a,h),i.stroke()}}function Ce(i,t){const{x:e,y:n,w:s,h:r,radius:o}=t;i.arc(e+o.topLeft,n+o.topLeft,o.topLeft,-J,Q,!0),i.lineTo(e,n+r-o.bottomLeft),i.arc(e+o.bottomLeft,n+r-o.bottomLeft,o.bottomLeft,Q,J,!0),i.lineTo(e+s-o.bottomRight,n+r),i.arc(e+s-o.bottomRight,n+r-o.bottomRight,o.bottomRight,J,0,!0),i.lineTo(e+s,n+o.topRight),i.arc(e+s-o.topRight,n+o.topRight,o.topRight,0,-J,!0),i.lineTo(e+o.topLeft,n)}const El=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Il=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Fl(i,t){const e=(""+i).match(El);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const zl=i=>+i||0;function rn(i,t){const e={},n=B(t),s=n?Object.keys(t):t,r=B(i)?n?o=>C(i[o],i[t[o]]):o=>i[o]:()=>i;for(const o of s)e[o]=zl(r(o));return e}function fr(i){return rn(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Qt(i){return rn(i,["topLeft","topRight","bottomLeft","bottomRight"])}function ct(i){const t=fr(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function nt(i,t){i=i||{},t=t||E.font;let e=C(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=C(i.style,t.style);n&&!(""+n).match(Il)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:C(i.family,t.family),lineHeight:Fl(C(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:C(i.weight,t.weight),string:""};return s.string=Ol(s),s}function Ve(i,t,e,n){let s=!0,r,o,a;for(r=0,o=i.length;r<o;++r)if(a=i[r],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),e!==void 0&&q(a)&&(a=a[e%a.length],s=!1),a!==void 0))return n&&!s&&(n.cacheable=!1),a}function Bl(i,t,e){const{min:n,max:s}=i,r=Qs(t,(s-n)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(n,-Math.abs(r)),max:o(s,r)}}function Ut(i,t){return Object.assign(Object.create(i),t)}function on(i,t=[""],e=i,n,s=()=>i[0]){yt(n)||(n=br("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:n,_getTarget:s,override:o=>on([o,...i],t,e,n)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete i[0][a],!0},get(o,a){return pr(o,a,()=>$l(a,t,i,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(o,a){return jn(o).includes(a)},ownKeys(o){return jn(o)},set(o,a,l){const c=o._storage||(o._storage=s());return o[a]=c[a]=l,delete o._keys,!0}})}function ce(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:gr(i,n),setContext:r=>ce(i,r,e,n),override:r=>ce(i.override(r),t,e,n)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete i[o],!0},get(r,o,a){return pr(r,o,()=>Nl(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(i,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,o)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(r,o){return Reflect.has(i,o)},ownKeys(){return Reflect.ownKeys(i)},set(r,o,a){return i[o]=a,delete r[o],!0}})}function gr(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:Yt(e)?e:()=>e,isIndexable:Yt(n)?n:()=>n}}const Hl=(i,t)=>i?i+Ki(t):t,an=(i,t)=>B(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pr(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const n=e();return i[t]=n,n}function Nl(i,t,e){const{_proxy:n,_context:s,_subProxy:r,_descriptors:o}=i;let a=n[t];return Yt(a)&&o.isScriptable(t)&&(a=Wl(t,a,i,e)),q(a)&&a.length&&(a=Vl(t,a,i,o.isIndexable)),an(t,a)&&(a=ce(a,s,r&&r[t],o)),a}function Wl(i,t,e,n){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);return a.add(i),t=t(r,o||n),a.delete(i),an(i,t)&&(t=ln(s._scopes,s,i,t)),t}function Vl(i,t,e,n){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(yt(r.index)&&n(i))t=t[r.index%t.length];else if(B(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=ln(c,s,i,h);t.push(ce(u,r,o&&o[i],a))}}return t}function mr(i,t,e){return Yt(i)?i(t,e):i}const jl=(i,t)=>i===!0?t:typeof i=="string"?jt(t,i):void 0;function Yl(i,t,e,n,s){for(const r of t){const o=jl(e,r);if(o){i.add(o);const a=mr(o._fallback,e,s);if(yt(a)&&a!==e&&a!==n)return a}else if(o===!1&&yt(n)&&e!==n)return null}return!1}function ln(i,t,e,n){const s=t._rootScopes,r=mr(t._fallback,e,n),o=[...i,...s],a=new Set;a.add(n);let l=Vn(a,o,e,r||e,n);return l===null||yt(r)&&r!==e&&(l=Vn(a,o,r,l,n),l===null)?!1:on(Array.from(a),[""],s,r,()=>Ul(t,e,n))}function Vn(i,t,e,n,s){for(;e;)e=Yl(i,t,e,n,s);return e}function Ul(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return q(s)&&B(e)?e:s}function $l(i,t,e,n){let s;for(const r of t)if(s=br(Hl(r,i),e),yt(s))return an(i,s)?ln(e,n,i,s):s}function br(i,t){for(const e of t){if(!e)continue;const n=e[i];if(yt(n))return n}}function jn(i){let t=i._keys;return t||(t=i._keys=Xl(i._scopes)),t}function Xl(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function yr(i,t,e,n){const{iScale:s}=i,{key:r="r"}=this._parsing,o=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+e,h=t[c],o[a]={r:s.parse(jt(h,r),c)};return o}const ql=Number.EPSILON||1e-14,he=(i,t)=>t<i.length&&!i[t].skip&&i[t],xr=i=>i==="x"?"y":"x";function Kl(i,t,e,n){const s=i.skip?t:i,r=t,o=e.skip?t:e,a=Ei(r,s),l=Ei(o,r);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const u=n*c,d=n*h;return{previous:{x:r.x-u*(o.x-s.x),y:r.y-u*(o.y-s.y)},next:{x:r.x+d*(o.x-s.x),y:r.y+d*(o.y-s.y)}}}function Gl(i,t,e){const n=i.length;let s,r,o,a,l,c=he(i,0);for(let h=0;h<n-1;++h)if(l=c,c=he(i,h+1),!(!l||!c)){if(ve(t[h],0,ql)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],r=e[h+1]/t[h],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[h]=s*o*t[h],e[h+1]=r*o*t[h])}}function Ql(i,t,e="x"){const n=xr(e),s=i.length;let r,o,a,l=he(i,0);for(let c=0;c<s;++c){if(o=a,a=l,l=he(i,c+1),!a)continue;const h=a[e],u=a[n];o&&(r=(h-o[e])/3,a[`cp1${e}`]=h-r,a[`cp1${n}`]=u-r*t[c]),l&&(r=(l[e]-h)/3,a[`cp2${e}`]=h+r,a[`cp2${n}`]=u+r*t[c])}}function Zl(i,t="x"){const e=xr(t),n=i.length,s=Array(n).fill(0),r=Array(n);let o,a,l,c=he(i,0);for(o=0;o<n;++o)if(a=l,l=c,c=he(i,o+1),!!l){if(c){const h=c[t]-l[t];s[o]=h!==0?(c[e]-l[e])/h:0}r[o]=a?c?Ot(s[o-1])!==Ot(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Gl(i,s,r),Ql(i,r,t)}function je(i,t,e){return Math.max(Math.min(i,e),t)}function Jl(i,t){let e,n,s,r,o,a=Oe(i[0],t);for(e=0,n=i.length;e<n;++e)o=r,r=a,a=e<n-1&&Oe(i[e+1],t),r&&(s=i[e],o&&(s.cp1x=je(s.cp1x,t.left,t.right),s.cp1y=je(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=je(s.cp2x,t.left,t.right),s.cp2y=je(s.cp2y,t.top,t.bottom)))}function tc(i,t,e,n,s){let r,o,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Zl(i,s);else{let c=n?i[i.length-1]:i[0];for(r=0,o=i.length;r<o;++r)a=i[r],l=Kl(c,a,i[Math.min(r+1,o-(n?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Jl(i,e)}function _r(){return typeof window<"u"&&typeof document<"u"}function cn(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function si(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const ui=i=>window.getComputedStyle(i,null);function ec(i,t){return ui(i).getPropertyValue(t)}const ic=["top","right","bottom","left"];function Zt(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=ic[s];n[r]=parseFloat(i[t+"-"+r+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const nc=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function sc(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:r}=n;let o=!1,a,l;if(nc(s,r,i.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function qt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=ui(e),r=s.boxSizing==="border-box",o=Zt(s,"padding"),a=Zt(s,"border","width"),{x:l,y:c,box:h}=sc(i,e),u=o.left+(h&&a.left),d=o.top+(h&&a.top);let{width:f,height:g}=t;return r&&(f-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-u)/f*e.width/n),y:Math.round((c-d)/g*e.height/n)}}function rc(i,t,e){let n,s;if(t===void 0||e===void 0){const r=cn(i);if(!r)t=i.clientWidth,e=i.clientHeight;else{const o=r.getBoundingClientRect(),a=ui(r),l=Zt(a,"border","width"),c=Zt(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,n=si(a.maxWidth,r,"clientWidth"),s=si(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:n||ei,maxHeight:s||ei}}const Mi=i=>Math.round(i*10)/10;function oc(i,t,e,n){const s=ui(i),r=Zt(s,"margin"),o=si(s.maxWidth,i,"clientWidth")||ei,a=si(s.maxHeight,i,"clientHeight")||ei,l=rc(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const u=Zt(s,"border","width"),d=Zt(s,"padding");c-=d.width+u.width,h-=d.height+u.height}return c=Math.max(0,c-r.width),h=Math.max(0,n?Math.floor(c/n):h-r.height),c=Mi(Math.min(c,o,l.maxWidth)),h=Mi(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Mi(c/2)),{width:c,height:h}}function Yn(i,t,e){const n=t||1,s=Math.floor(i.height*n),r=Math.floor(i.width*n);i.height=s/n,i.width=r/n;const o=i.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${i.height}px`,o.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||o.height!==s||o.width!==r?(i.currentDevicePixelRatio=n,o.height=s,o.width=r,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const ac=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function Un(i,t){const e=ec(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Kt(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function lc(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function cc(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},r={x:t.cp1x,y:t.cp1y},o=Kt(i,s,e),a=Kt(s,r,e),l=Kt(r,t,e),c=Kt(o,a,e),h=Kt(a,l,e);return Kt(c,h,e)}const $n=new Map;function hc(i,t){t=t||{};const e=i+JSON.stringify(t);let n=$n.get(e);return n||(n=new Intl.NumberFormat(i,t),$n.set(e,n)),n}function Re(i,t,e){return hc(t,e).format(i)}const uc=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},dc=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function ae(i,t,e){return i?uc(t,e):dc()}function vr(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function wr(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Mr(i){return i==="angle"?{between:Te,compare:Za,normalize:xt}:{between:Ht,compare:(t,e)=>t-e,normalize:t=>t}}function Xn({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function fc(i,t,e){const{property:n,start:s,end:r}=e,{between:o,normalize:a}=Mr(n),l=t.length;let{start:c,end:h,loop:u}=i,d,f;if(u){for(c+=l,h+=l,d=0,f=l;d<f&&o(a(t[c%l][n]),s,r);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:i.style}}function gc(i,t,e){if(!e)return[i];const{property:n,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=Mr(n),{start:h,end:u,loop:d,style:f}=fc(i,t,e),g=[];let p=!1,m=null,b,y,_;const v=()=>l(s,_,b)&&a(s,_)!==0,x=()=>a(r,b)===0||l(r,_,b),w=()=>p||v(),M=()=>!p||x();for(let T=h,S=h;T<=u;++T)y=t[T%o],!y.skip&&(b=c(y[n]),b!==_&&(p=l(b,s,r),m===null&&w()&&(m=a(b,s)===0?T:S),m!==null&&M()&&(g.push(Xn({start:m,end:T,loop:d,count:o,style:f})),m=null),S=T,_=b));return m!==null&&g.push(Xn({start:m,end:u,loop:d,count:o,style:f})),g}function pc(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const r=gc(n[s],i.points,t);r.length&&e.push(...r)}return e}function mc(i,t,e,n){let s=0,r=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&i[r%t].skip;)r--;return r%=t,{start:s,end:r}}function bc(i,t,e,n){const s=i.length,r=[];let o=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?a.skip||(n=!1,r.push({start:t%s,end:(l-1)%s,loop:n}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:n}),r}function yc(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const r=!!i._loop,{start:o,end:a}=mc(e,s,r,n);if(n===!0)return qn(i,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!i._fullLoop&&o===0&&a===s-1;return qn(i,bc(e,o,l,c),e,t)}function qn(i,t,e,n){return!n||!n.setContext||!e?t:xc(i,t,e,n)}function xc(i,t,e,n){const s=i._chart.getContext(),r=Kn(i.options),{_datasetIndex:o,options:{spanGaps:a}}=i,l=e.length,c=[];let h=r,u=t[0].start,d=u;function f(g,p,m,b){const y=a?-1:1;if(g!==p){for(g+=l;e[g%l].skip;)g-=y;for(;e[p%l].skip;)p+=y;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),h=b,u=p%l)}}for(const g of t){u=a?u:g.start;let p=e[u%l],m;for(d=u+1;d<=g.end;d++){const b=e[d%l];m=Kn(n.setContext(Ut(s,{type:"segment",p0:p,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),_c(m,h)&&f(u,d-1,g.loop,h),p=b,h=m}u<d-1&&f(u,d-1,g.loop,h)}return c}function Kn(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function _c(i,t){return t&&JSON.stringify(i)!==JSON.stringify(t)}/*!
13
13
  * Chart.js v3.9.1
14
14
  * https://www.chartjs.org
15
15
  * (c) 2022 Chart.js Contributors
16
16
  * Released under the MIT License
17
- */class vc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=nr.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const r=n.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),r.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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((n,s)=>Math.max(n,s._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 n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var At=new vc;const Qn="transparent",wc={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=Nn(i||Qn),s=n.valid&&Nn(t||Qn);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Mc{constructor(t,e,n,s){const r=e[n];s=Ve([t.to,s,r,t.from]);const o=Ve([t.from,r,s]);this._active=!0,this._fn=t.fn||wc[t.type||typeof o],this._easing=we[t.easing]||we.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=n,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ve([t.to,e,s,t.from]),this._from=Ve([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<n),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/n%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}const kc=["x","y","borderWidth","radius","tension"],Pc=["color","borderColor","backgroundColor"];E.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Sc=Object.keys(E.animation);E.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:i=>i!=="onProgress"&&i!=="onComplete"&&i!=="fn"});E.set("animations",{colors:{type:"color",properties:Pc},numbers:{type:"number",properties:kc}});E.describe("animations",{_fallback:"animation"});E.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:i=>i|0}}}});class kr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!B(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const s=t[n];if(!B(s))return;const r={};for(const o of Sc)r[o]=s[o];(q(s.properties)&&s.properties||[n]).forEach(o=>{(o===n||!e.has(o))&&e.set(o,r)})})}_animateOptions(t,e){const n=e.options,s=Oc(t,n);if(!s)return[];const r=this._createAnimations(s,n);return n.$shared&&Tc(t.options.$animations,n).then(()=>{t.options=n},()=>{}),r}_createAnimations(t,e){const n=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let u=r[c];const d=n.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}r[c]=u=new Mc(d,t,c,h),s.push(u)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return At.add(this._chart,n),!0}}function Tc(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const r=i[n[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Oc(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Gn(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:n?r:s,end:n?s:r}}function Cc(i,t,e){if(e===!1)return!1;const n=Gn(i,e),s=Gn(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Dc(i){let t,e,n,s;return B(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Pr(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,r;for(s=0,r=n.length;s<r;++s)e.push(n[s].index);return e}function Zn(i,t,e,n={}){const s=i.keys,r=n.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(n.all)continue;break}c=i.values[l],ot(c)&&(r||t===0||Ot(t)===Ot(c))&&(t+=c)}return t}}function Ac(i){const t=Object.keys(i),e=new Array(t.length);let n,s,r;for(n=0,s=t.length;n<s;++n)r=t[n],e[n]={x:r,y:i[r]};return e}function Jn(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Lc(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Rc(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Ec(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function ts(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const r=i[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function es(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,h=Lc(r,o,n),u=t.length;let d;for(let f=0;f<u;++f){const g=t[f],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});d=b[c]=Ec(s,h,p),d[a]=m,d._top=ts(d,o,!0,n.type),d._bottom=ts(d,o,!1,n.type)}}function ki(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function Ic(i,t){return Ut(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Fc(i,t,e){return Ut(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function de(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const r=s._stacks;if(!r||r[n]===void 0||r[n][e]===void 0)return;delete r[n][e]}}}const Pi=i=>i==="reset"||i==="none",is=(i,t)=>t?i:Object.assign({},i),zc=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Pr(e,!0),values:null};class vt{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.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Jn(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&de(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(u,d,f,g)=>u==="x"?d:u==="r"?g:f,r=e.xAxisID=C(n.xAxisID,ki(t,"x")),o=e.yAxisID=C(n.yAxisID,ki(t,"y")),a=e.rAxisID=C(n.rAxisID,ki(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),h=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}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&&Rn(this._data,this),t._stacked&&de(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(B(e))this._data=Ac(e);else if(n!==e){if(n){Rn(n,this);const s=this._cachedMeta;de(s),s._parsed=[]}e&&Object.isExtensible(e)&&il(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,n=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=Jn(e.vScale,e),e.stack!==n.stack&&(s=!0,de(e),e.stack=n.stack),this._resyncElements(t),(s||r!==e._stacked)&&es(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:r,_stacked:o}=n,a=r.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,u,d;if(this._parsing===!1)n._parsed=s,n._sorted=!0,d=s;else{q(s[t])?d=this.parseArrayData(n,s,t,e):B(s[t])?d=this.parseObjectData(n,s,t,e):d=this.parsePrimitiveData(n,s,t,e);const f=()=>u[a]===null||c&&u[a]<c[a];for(h=0;h<e;++h)n._parsed[h+t]=u=d[h],l&&(f()&&(l=!1),c=u);n._sorted=l}o&&es(this,d)}parsePrimitiveData(t,e,n,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),h=r===o,u=new Array(s);let d,f,g;for(d=0,f=s;d<f;++d)g=d+n,u[d]={[a]:h||r.parse(c[g],g),[l]:o.parse(e[g],g)};return u}parseArrayData(t,e,n,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,h,u;for(l=0,c=s;l<c;++l)h=l+n,u=e[h],a[l]={x:r.parse(u[0],h),y:o.parse(u[1],h)};return a}parseObjectData(t,e,n,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,u,d,f;for(h=0,u=s;h<u;++h)d=h+n,f=e[d],c[h]={x:r.parse(jt(f,a),d),y:o.parse(jt(f,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:Pr(s,!0),values:e._stacks[t.axis]};return Zn(a,o,r.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const r=n[e.axis];let o=r===null?NaN:r;const a=s&&n._stacks[e.axis];s&&a&&(s.values=a,o=Zn(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,r=n._sorted&&t===n.iScale,o=s.length,a=this._getOtherScale(t),l=zc(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=Rc(a);let d,f;function g(){f=s[d];const p=f[a.axis];return!ot(f[t.axis])||h>p||u<p}for(d=0;d<o&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),r));++d);if(r){for(d=o-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],ot(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Dc(C(this.options.clip,Cc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,r,a,l),h=a;h<a+l;++h){const u=s[h];u.hidden||(u.active&&c?o.push(u):u.draw(t,r))}for(h=0;h<o.length;++h)o[h].draw(t,r)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=Fc(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Ic(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&yt(n);if(a)return is(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),f=Object.keys(E.elements[t]),g=()=>this.getContext(n,s),p=c.resolveNamedOptions(d,f,g,u);return p.$shared&&(p.$shared=l,r[o]=Object.freeze(is(p,l))),p}_resolveAnimations(t,e,n){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,n,e))}const c=new kr(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Pi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(n),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,n),{sharedOptions:r,includeOptions:o}}updateElement(t,e,n,s){Pi(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!Pi(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=n.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,n=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(r,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&de(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,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 n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}vt.defaults={};vt.prototype.datasetElementType=null;vt.prototype.dataElementType=null;function Bc(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,r=e.length;s<r;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=ir(n.sort((s,r)=>s-r))}return i._cache.$bar}function Hc(i){const t=i.iScale,e=Bc(t,i.type);let n=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(yt(a)&&(n=Math.min(n,Math.abs(o-a)||n)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return n}function Nc(i,t,e,n){const s=e.barThickness;let r,o;return V(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*n,o=1),{chunk:r/n,ratio:o,start:t.pixels[i]-r/2}}function Wc(i,t,e,n){const s=t.pixels,r=s[i];let o=i>0?s[i-1]:null,a=i<s.length-1?s[i+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/n,ratio:e.barPercentage,start:c}}function Vc(i,t,e,n){const s=e.parse(i[0],n),r=e.parse(i[1],n),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function Sr(i,t,e,n){return q(i)?Vc(i,t,e,n):t[e.axis]=e.parse(i,n),t}function ns(i,t,e,n){const s=i.iScale,r=i.vScale,o=s.getLabels(),a=s===r,l=[];let c,h,u,d;for(c=e,h=e+n;c<h;++c)d=t[c],u={},u[s.axis]=a||s.parse(o[c],c),l.push(Sr(d,u,r,c));return l}function Si(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function jc(i,t,e){return i!==0?Ot(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Yc(i){let t,e,n,s,r;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:n,reverse:t,top:s,bottom:r}}function Uc(i,t,e,n){let s=t.borderSkipped;const r={};if(!s){i.borderSkipped=r;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:h}=Yc(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=h:(r[ss(h,o,a,l)]=!0,s=c)),r[ss(s,o,a,l)]=!0,i.borderSkipped=r}function ss(i,t,e,n){return n?(i=$c(i,t,e),i=rs(i,e,t)):i=rs(i,t,e),i}function $c(i,t,e){return i===t?e:i===e?t:i}function rs(i,t,e){return i==="start"?t:i==="end"?e:i}function Xc(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class hn extends vt{parsePrimitiveData(t,e,n,s){return ns(t,e,n,s)}parseArrayData(t,e,n,s){return ns(t,e,n,s)}parseObjectData(t,e,n,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,h=o.axis==="x"?a:l,u=[];let d,f,g,p;for(d=n,f=n+s;d<f;++d)p=e[d],g={},g[r.axis]=r.parse(jt(p,c),d),u.push(Sr(jt(p,h),g,o,d));return u}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const r=n._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Si(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s);for(let f=e;f<e+n;f++){const g=this.getParsed(f),p=r||V(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,h),b=(g._stacks||{})[a.axis],y={horizontal:c,base:p.base,enableBorderRadius:!b||Si(g._custom)||o===b._top||o===b._bottom,x:c?p.head:m.center,y:c?m.center:p.head,height:c?m.size:Math.abs(p.size),width:c?Math.abs(p.size):m.size};d&&(y.options=u||this.resolveDataElementOptions(f,t[f].active?"active":s));const _=y.options||t[f].options;Uc(y,_,b,o),Xc(y,_,h.ratio),this.updateElement(t[f],f,y,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),r=n.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(V(h)||isNaN(h))return!0};for(const l of s)if(!(e!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));const a=t.barThickness;return{min:a||Hc(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n},options:{base:s,minBarLength:r}}=this,o=s||0,a=this.getParsed(t),l=a._custom,c=Si(l);let h=a[e.axis],u=0,d=n?this.applyStack(e,a,n):h,f,g;d!==h&&(u=d-h,d=h),c&&(h=l.barStart,d=l.barEnd-l.barStart,h!==0&&Ot(h)!==Ot(l.barEnd)&&(u=0),u+=h);const p=!V(s)&&!c?s:u;let m=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?f=e.getPixelForValue(u+d):f=m,g=f-m,Math.abs(g)<r){g=jc(g,e,o)*r,h===o&&(m-=g/2);const b=e.getPixelForDecimal(0),y=e.getPixelForDecimal(1),_=Math.min(b,y),v=Math.max(b,y);m=Math.max(Math.min(m,v),_),f=m+g}if(m===e.getPixelForValue(o)){const b=Ot(g)*e.getLineWidthForValue(o)/2;m+=b,g-=b}return{size:g,base:m,head:f,center:f+g/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,r=s.skipNull,o=C(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?Wc(t,e,s,c):Nc(t,e,s,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=h.start+h.chunk*u+h.chunk/2,l=Math.min(o,h.chunk*h.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&n[r].draw(this._ctx)}}hn.id="bar";hn.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};hn.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class un extends vt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){const r=super.parsePrimitiveData(t,e,n,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+n).radius;return r}parseArrayData(t,e,n,s){const r=super.parseArrayData(t,e,n,s);for(let o=0;o<r.length;o++){const a=e[n+o];r[o]._custom=C(a[2],this.resolveDataElementOptions(o+n).radius)}return r}parseObjectData(t,e,n,s){const r=super.parseObjectData(t,e,n,s);for(let o=0;o<r.length;o++){const a=e[n+o];r[o]._custom=C(a&&a.r&&+a.r,this.resolveDataElementOptions(o+n).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:s}=e,r=this.getParsed(t),o=n.getLabelForValue(r.x),a=s.getLabelForValue(r.y),l=r._custom;return{label:e.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=o.axis,u=a.axis;for(let d=e;d<e+n;d++){const f=t[d],g=!r&&this.getParsed(d),p={},m=p[h]=r?o.getPixelForDecimal(.5):o.getPixelForValue(g[h]),b=p[u]=r?a.getBasePixel():a.getPixelForValue(g[u]);p.skip=isNaN(m)||isNaN(b),c&&(p.options=l||this.resolveDataElementOptions(d,f.active?"active":s),r&&(p.options.radius=0)),this.updateElement(f,d,p,s)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=C(n&&n._custom,r),s}}un.id="bubble";un.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};un.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function qc(i,t,e){let n=1,s=1,r=0,o=0;if(t<Y){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),u=Math.cos(l),d=Math.sin(l),f=(_,v,x)=>Te(_,a,l,!0)?1:Math.max(v,v*e,x,x*e),g=(_,v,x)=>Te(_,a,l,!0)?-1:Math.min(v,v*e,x,x*e),p=f(0,c,u),m=f(J,h,d),b=g(G,c,u),y=g(G+J,h,d);n=(p-b)/2,s=(m-y)/2,r=-(p+b)/2,o=-(m+y)/2}return{ratioX:n,ratioY:s,offsetX:r,offsetY:o}}class Ee extends vt{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 n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let r=l=>+n[l];if(B(n[t])){const{key:l="value"}=this._parsing;r=c=>+jt(n[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return _t(this.options.rotation-90)}_getCircumference(){return _t(this.options.circumference)}_getRotationExtents(){let t=Y,e=-Y;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){const s=this.chart.getDatasetMeta(n).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-o)/2,0),l=Math.min(Va(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:g,offsetY:p}=qc(u,h,l),m=(n.width-o)/d,b=(n.height-o)/f,y=Math.max(Math.min(m,b)/2,0),_=Gs(this.options.radius,y),v=Math.max(_*l,0),x=(_-v)/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=p*_,s.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/Y)}updateElements(t,e,n,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,h=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=r&&c.animateScale,f=d?0:this.innerRadius,g=d?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(e,s);let b=this._getRotation(),y;for(y=0;y<e;++y)b+=this._circumference(y,r);for(y=e;y<e+n;++y){const _=this._circumference(y,r),v=t[y],x={x:h+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:g,innerRadius:f};m&&(x.options=p||this.resolveDataElementOptions(y,v.active?"active":s)),b+=_,this.updateElement(v,y,x,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(r))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Y*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],r=Re(e._parsed[t],n.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=n.data.datasets.length;s<r;++s)if(n.isDatasetVisible(s)){o=n.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const r=this.resolveDataElementOptions(n);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(C(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ee.id="doughnut";Ee.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"};Ee.descriptors={_scriptable:i=>i!=="spacing",_indexable:i=>i!=="spacing"};Ee.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((n,s)=>{const o=i.getDatasetMeta(0).controller.getStyle(s);return{text:n,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(s),index:s}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let t=i.label;const e=": "+i.formattedValue;return q(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};class di extends vt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=rr(e,s,o);this._drawStart=a,this._drawCount=l,or(e)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,n,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,s),d=o.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=le(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||s==="none";let y=e>0&&this.getParsed(e-1);for(let _=e;_<e+n;++_){const v=t[_],x=this.getParsed(_),w=b?v:{},M=V(x[f]),T=w[d]=o.getPixelForValue(x[d],_),S=w[f]=r||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,x,l):x[f],_);w.skip=isNaN(T)||isNaN(S)||M,w.stop=_>0&&Math.abs(x[d]-y[d])>m,p&&(w.parsed=x,w.raw=c.data[_]),u&&(w.options=h||this.resolveDataElementOptions(_,v.active?"active":s)),b||this.updateElement(v,_,w,s),y=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}di.id="line";di.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};di.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class dn extends vt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],r=Re(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,n,s){return yr.bind(this)(t,e,n,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((n,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*G;let f=d,g;const p=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,s,p);for(g=e;g<e+n;g++){const m=t[g];let b=f,y=f+this._computeAngle(g,s,p),_=o.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=y,r&&(l.animateScale&&(_=0),l.animateRotate&&(b=y=d));const v={x:h,y:u,innerRadius:0,outerRadius:_,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(g,m.active?"active":s)};this.updateElement(m,g,v,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?_t(this.resolveDataElementOptions(t,e).angle||n):0}}dn.id="polarArea";dn.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};dn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((n,s)=>{const o=i.getDatasetMeta(0).controller.getStyle(s);return{text:n,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(s),index:s}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Tr extends Ee{}Tr.id="pie";Tr.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class fn extends vt{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return yr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(n.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(n,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+n;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),h=r.getPointPositionForValue(a,this.getParsed(a).r),u=o?r.xCenter:h.x,d=o?r.yCenter:h.y,f={x:u,y:d,angle:h.angle,skip:isNaN(u)||isNaN(d),options:c};this.updateElement(l,a,f,s)}}}fn.id="radar";fn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};fn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class wt{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return le(this.x)&&le(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(r=>{s[r]=n[r]&&n[r].active()?n[r]._to:this[r]}),s}}wt.defaults={};wt.defaultRoutes=void 0;const Or={values(i){return q(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,r=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=Kc(i,e)}const o=mt(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Re(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=i/Math.pow(10,Math.floor(mt(i)));return n===1||n===2||n===5?Or.numeric.call(this,i,t,e):""}};function Kc(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var fi={formatters:Or};E.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:fi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});E.route("scale.ticks","color","","color");E.route("scale.grid","color","","borderColor");E.route("scale.grid","borderColor","","borderColor");E.route("scale.title","color","","color");E.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"});E.describe("scales",{_fallback:"scale"});E.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function Qc(i,t){const e=i.options.ticks,n=e.maxTicksLimit||Gc(i),s=e.major.enabled?Jc(t):[],r=s.length,o=s[0],a=s[r-1],l=[];if(r>n)return th(t,l,s,r/n),l;const c=Zc(s,t,n);if(r>0){let h,u;const d=r>1?Math.round((a-o)/(r-1)):null;for(Ye(t,l,c,V(d)?0:o-d,o),h=0,u=r-1;h<u;h++)Ye(t,l,c,s[h],s[h+1]);return Ye(t,l,c,a,V(d)?t.length:a+d),l}return Ye(t,l,c),l}function Gc(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function Zc(i,t,e){const n=eh(i),s=t.length/e;if(!n)return Math.max(s,1);const r=Qa(n);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function Jc(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function th(i,t,e,n){let s=0,r=e[0],o;for(n=Math.ceil(n),o=0;o<i.length;o++)o===r&&(t.push(i[o]),s++,r=e[s*n])}function Ye(i,t,e,n,s){const r=C(n,0),o=Math.min(C(s,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=r;h<0;)a++,h=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===h&&(t.push(i[c]),a++,h=Math.round(r+a*e))}function eh(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const ih=i=>i==="left"?"right":i==="right"?"left":i,os=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e;function as(i,t){const e=[],n=i.length/t,s=i.length;let r=0;for(;r<s;r+=n)e.push(i[Math.floor(r)]);return e}function nh(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),r=i._startPixel,o=i._endPixel,a=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-r,o-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function sh(i,t){j(i,e=>{const n=e.gc,s=n.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[n[r]];n.splice(0,s)}})}function fe(i){return i.drawTicks?i.tickLength:0}function ls(i,t){if(!i.display)return 0;const e=nt(i.font,t),n=ct(i.padding);return(q(i.text)?i.text.length:1)*e.lineHeight+n.height}function rh(i,t){return Ut(i,{scale:t,type:"scale"})}function oh(i,t,e){return Ut(i,{tick:e,index:t,type:"tick"})}function ah(i,t,e){let n=Zi(i);return(e&&t!=="right"||!e&&t==="right")&&(n=ih(n)),n}function lh(i,t,e,n){const{top:s,left:r,bottom:o,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let u=0,d,f,g;const p=o-s,m=a-r;if(i.isHorizontal()){if(f=at(n,r,a),B(e)){const b=Object.keys(e)[0],y=e[b];g=h[b].getPixelForValue(y)+p-t}else e==="center"?g=(c.bottom+c.top)/2+p-t:g=os(i,e,t);d=a-r}else{if(B(e)){const b=Object.keys(e)[0],y=e[b];f=h[b].getPixelForValue(y)-m+t}else e==="center"?f=(c.left+c.right)/2-m+t:f=os(i,e,t);g=at(n,o,s),u=e==="left"?-J:J}return{titleX:f,titleY:g,maxWidth:d,rotation:u}}class ee extends wt{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:n,_suggestedMax:s}=this;return t=pt(t,Number.POSITIVE_INFINITY),e=pt(e,Number.NEGATIVE_INFINITY),n=pt(n,Number.POSITIVE_INFINITY),s=pt(s,Number.NEGATIVE_INFINITY),{min:pt(t,n),max:pt(e,s),minDefined:ot(t),maxDefined:ot(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:n};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(n=Math.max(n,o.max));return e=r&&e>n?n:e,n=s&&e>n?e:n,{min:pt(e,pt(n,e)),max:pt(n,pt(e,n))}}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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Bl(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?as(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Qc(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){$(this.options.afterUpdate,[this])}beforeSetDimensions(){$(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(){$(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),$(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){$(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,r;for(n=0,s=t.length;n<s;n++)r=t[n],r.label=$(e.callback,[r.value,n,t],this)}afterTickToLabelConversion(){$(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){$(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=this.ticks.length,s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=lt(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),u+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-fe(t.grid)-e.padding-ls(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),o=Qi(Math.min(Math.asin(lt((h.highest.height+6)/a,-1,1)),Math.asin(lt(l/c,-1,1))-Math.asin(lt(d/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=ls(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=fe(r)+l):(t.height=this.maxHeight,t.width=fe(r)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=n.padding*2,g=_t(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const b=n.mirror?0:m*u.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=n.mirror?0:p*u.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,p)}}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,n,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,f=0;l?c?(d=s*t.width,f=n*e.height):(d=n*t.height,f=s*e.width):r==="start"?f=e.width:r==="end"?d=t.width:r!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+o)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;r==="start"?(h=0,u=t.height):r==="end"&&(h=e.height,u=0),this.paddingTop=h+o,this.paddingBottom=u+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(){$(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)V(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=as(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length)}return t}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:s}=this,r=[],o=[];let a=0,l=0,c,h,u,d,f,g,p,m,b,y,_;for(c=0;c<e;++c){if(d=t[c].label,f=this._resolveTickFontOptions(c),n.font=g=f.string,p=s[g]=s[g]||{data:{},gc:[]},m=f.lineHeight,b=y=0,!V(d)&&!q(d))b=ni(n,p.data,p.gc,b,d),y=m;else if(q(d))for(h=0,u=d.length;h<u;++h)_=d[h],!V(_)&&!q(_)&&(b=ni(n,p.data,p.gc,b,_),y+=m);r.push(b),o.push(y),a=Math.max(b,a),l=Math.max(y,l)}sh(s,e);const v=r.indexOf(a),x=o.indexOf(l),w=M=>({width:r[M]||0,height:o[M]||0});return{first:w(0),last:w(e-1),widest:w(v),highest:w(x),widths:r,heights:o}}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 Ja(this._alignToPixels?$t(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 n=e[t];return n.$context||(n.$context=oh(this.getContext(),t,n))}return this.$context||(this.$context=rh(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=_t(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:r,position:o}=s,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),u=fe(r),d=[],f=r.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,m=function(O){return $t(n,O,g)};let b,y,_,v,x,w,M,T,S,L,R,D;if(o==="top")b=m(this.bottom),w=this.bottom-u,T=b-p,L=m(t.top)+p,D=t.bottom;else if(o==="bottom")b=m(this.top),L=t.top,D=m(t.bottom)-p,w=b+p,T=this.top+u;else if(o==="left")b=m(this.right),x=this.right-u,M=b-p,S=m(t.left)+p,R=t.right;else if(o==="right")b=m(this.left),S=t.left,R=m(t.right)-p,x=b+p,M=this.left+u;else if(e==="x"){if(o==="center")b=m((t.top+t.bottom)/2+.5);else if(B(o)){const O=Object.keys(o)[0],X=o[O];b=m(this.chart.scales[O].getPixelForValue(X))}L=t.top,D=t.bottom,w=b+p,T=w+u}else if(e==="y"){if(o==="center")b=m((t.left+t.right)/2);else if(B(o)){const O=Object.keys(o)[0],X=o[O];b=m(this.chart.scales[O].getPixelForValue(X))}x=b-p,M=x-u,S=t.left,R=t.right}const K=C(s.ticks.maxTicksLimit,h),rt=Math.max(1,Math.ceil(h/K));for(y=0;y<h;y+=rt){const O=r.setContext(this.getContext(y)),X=O.lineWidth,Q=O.color,Ct=O.borderDash||[],ie=O.borderDashOffset,Et=O.tickWidth,It=O.tickColor,dt=O.tickBorderDash||[],Ft=O.tickBorderDashOffset;_=nh(this,y,a),_!==void 0&&(v=$t(n,_,X),l?x=M=S=R=v:w=T=L=D=v,d.push({tx1:x,ty1:w,tx2:M,ty2:T,x1:S,y1:L,x2:R,y2:D,width:X,color:Q,borderDash:Ct,borderDashOffset:ie,tickWidth:Et,tickColor:It,tickBorderDash:dt,tickBorderDashOffset:Ft}))}return this._ticksLength=h,this._borderValue=b,d}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:r}=n,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=r,d=fe(n.grid),f=d+h,g=u?-h:f,p=-_t(this.labelRotation),m=[];let b,y,_,v,x,w,M,T,S,L,R,D,K="middle";if(s==="top")w=this.bottom-g,M=this._getXAxisLabelAlignment();else if(s==="bottom")w=this.top+g,M=this._getXAxisLabelAlignment();else if(s==="left"){const O=this._getYAxisLabelAlignment(d);M=O.textAlign,x=O.x}else if(s==="right"){const O=this._getYAxisLabelAlignment(d);M=O.textAlign,x=O.x}else if(e==="x"){if(s==="center")w=(t.top+t.bottom)/2+f;else if(B(s)){const O=Object.keys(s)[0],X=s[O];w=this.chart.scales[O].getPixelForValue(X)+f}M=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")x=(t.left+t.right)/2-f;else if(B(s)){const O=Object.keys(s)[0],X=s[O];x=this.chart.scales[O].getPixelForValue(X)}M=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?K="top":l==="end"&&(K="bottom"));const rt=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){_=a[b],v=_.label;const O=r.setContext(this.getContext(b));T=this.getPixelForTick(b)+r.labelOffset,S=this._resolveTickFontOptions(b),L=S.lineHeight,R=q(v)?v.length:1;const X=R/2,Q=O.color,Ct=O.textStrokeColor,ie=O.textStrokeWidth;let Et=M;o?(x=T,M==="inner"&&(b===y-1?Et=this.options.reverse?"left":"right":b===0?Et=this.options.reverse?"right":"left":Et="center"),s==="top"?c==="near"||p!==0?D=-R*L+L/2:c==="center"?D=-rt.highest.height/2-X*L+L:D=-rt.highest.height+L/2:c==="near"||p!==0?D=L/2:c==="center"?D=rt.highest.height/2-X*L:D=rt.highest.height-R*L,u&&(D*=-1)):(w=T,D=(1-R)*L/2);let It;if(O.showLabelBackdrop){const dt=ct(O.backdropPadding),Ft=rt.heights[b],zt=rt.widths[b];let ne=w+D-dt.top,se=x-dt.left;switch(K){case"middle":ne-=Ft/2;break;case"bottom":ne-=Ft;break}switch(M){case"center":se-=zt/2;break;case"right":se-=zt;break}It={left:se,top:ne,width:zt+dt.width,height:Ft+dt.height,color:O.backdropColor}}m.push({rotation:p,label:v,font:S,color:Q,strokeColor:Ct,strokeWidth:ie,textOffset:D,textAlign:Et,textBaseline:K,translation:[x,w],backdrop:It})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-_t(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,h;return e==="left"?s?(h=this.right+r,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+r,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:n}}=this,s=n.setContext(this.getContext()),r=n.drawBorder?s.borderWidth:0;if(!r)return;const o=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,c,h,u;this.isHorizontal()?(l=$t(t,this.left,r)-r/2,c=$t(t,this.right,o)+o/2,h=u=a):(h=$t(t,this.top,r)-r/2,u=$t(t,this.bottom,o)+o/2,l=c=a),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(l,h),e.lineTo(c,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&nn(n,s);const r=this._labelItems||(this._labelItems=this._computeLabelItems(t));let o,a;for(o=0,a=r.length;o<a;++o){const l=r[o],c=l.font,h=l.label;l.backdrop&&(n.fillStyle=l.backdrop.color,n.fillRect(l.backdrop.left,l.backdrop.top,l.backdrop.width,l.backdrop.height));let u=l.textOffset;te(n,h,0,u,c,l)}s&&sn(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const r=nt(n.font),o=ct(n.padding),a=n.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||B(e)?(l+=o.bottom,q(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=o.top;const{titleX:c,titleY:h,maxWidth:u,rotation:d}=lh(this,l,e,a);te(t,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:d,textAlign:ah(a,e,s),textBaseline:"middle",translation:[c,h]})}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,n=C(t.grid&&t.grid.z,-1);return!this._isVisible()||this.draw!==ee.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:n,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return nt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ue{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;uh(e)&&(n=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,ch(t,o,n),this.override&&E.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in E[s]&&(delete E[s][n],this.override&&delete Jt[n])}}function ch(i,t,e){const n=Se(Object.create(null),[e?E.get(e):{},E.get(t),i.defaults]);E.set(t,n),i.defaultRoutes&&hh(t,i.defaultRoutes),i.descriptors&&E.describe(t,i.descriptors)}function hh(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),r=[i].concat(n).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");E.route(r,s,l,a)})}function uh(i){return"id"in i&&"defaults"in i}class dh{constructor(){this.controllers=new Ue(vt,"datasets",!0),this.elements=new Ue(wt,"elements"),this.plugins=new Ue(Object,"plugins"),this.scales=new Ue(ee,"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,n){[...e].forEach(s=>{const r=n||this._getRegistryForType(s);n||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):j(s,o=>{const a=n||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,n){const s=Ki(t);$(n["before"+s],[],n),e[t](n),$(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var Tt=new dh;class gn extends vt{update(t){const e=this._cachedMeta,{data:n=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=rr(e,n,s);if(this._drawStart=r,this._drawCount=o,or(e)&&(r=0,o=n.length),this.options.showLine){const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}this.updateElements(n,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=Tt.getElement("line")),super.addElements()}updateElements(t,e,n,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),u=this.getSharedOptions(h),d=this.includeOptions(s,u),f=o.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=le(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none";let _=e>0&&this.getParsed(e-1);for(let v=e;v<e+n;++v){const x=t[v],w=this.getParsed(v),M=y?x:{},T=V(w[g]),S=M[f]=o.getPixelForValue(w[f],v),L=M[g]=r||T?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,w,l):w[g],v);M.skip=isNaN(S)||isNaN(L)||T,M.stop=v>0&&Math.abs(w[f]-_[f])>b,m&&(M.parsed=w,M.raw=c.data[v]),d&&(M.options=u||this.resolveDataElementOptions(v,x.active?"active":s)),y||this.updateElement(x,v,M,s),_=w}this.updateSharedOptions(u,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}gn.id="scatter";gn.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};gn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(i){return"("+i.label+", "+i.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Xt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Bi{constructor(t){this.options=t||{}}init(t){}formats(){return Xt()}parse(t,e){return Xt()}format(t,e){return Xt()}add(t,e,n){return Xt()}diff(t,e,n){return Xt()}startOf(t,e,n){return Xt()}endOf(t,e){return Xt()}}Bi.override=function(i){Object.assign(Bi.prototype,i)};var Cr={_date:Bi};function fh(i,t,e,n){const{controller:s,data:r,_sorted:o}=i,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?tl:Qt;if(n){if(s._sharedOptions){const c=r[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const u=l(r,t,e-h),d=l(r,t,e+h);return{lo:u.lo,hi:d.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function Ie(i,t,e,n,s){const r=i.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:h}=r[a],{lo:u,hi:d}=fh(r[a],t,o,s);for(let f=u;f<=d;++f){const g=h[f];g.skip||n(g,c,f)}}}function gh(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const r=t?Math.abs(n.x-s.x):0,o=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function Ti(i,t,e,n,s){const r=[];return!s&&!i.isPointInArea(t)||Ie(i,e,t,function(a,l,c){!s&&!Oe(a,i.chartArea,0)||a.inRange(t.x,t.y,n)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function ph(i,t,e,n){let s=[];function r(o,a,l){const{startAngle:c,endAngle:h}=o.getProps(["startAngle","endAngle"],n),{angle:u}=tr(o,{x:t.x,y:t.y});Te(u,c,h)&&s.push({element:o,datasetIndex:a,index:l})}return Ie(i,e,t,r),s}function mh(i,t,e,n,s,r){let o=[];const a=gh(e);let l=Number.POSITIVE_INFINITY;function c(h,u,d){const f=h.inRange(t.x,t.y,s);if(n&&!f)return;const g=h.getCenterPoint(s);if(!(!!r||i.isPointInArea(g))&&!f)return;const m=a(t,g);m<l?(o=[{element:h,datasetIndex:u,index:d}],l=m):m===l&&o.push({element:h,datasetIndex:u,index:d})}return Ie(i,e,t,c),o}function Oi(i,t,e,n,s,r){return!r&&!i.isPointInArea(t)?[]:e==="r"&&!n?ph(i,t,e,s):mh(i,t,e,n,s,r)}function cs(i,t,e,n,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return Ie(i,e,t,(l,c,h)=>{l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:r}var bh={evaluateInteractionItems:Ie,modes:{index(i,t,e,n){const s=qt(t,i),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Ti(i,s,r,n,o):Oi(i,s,r,!1,n,o),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=qt(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Ti(i,s,r,n,o):Oi(i,s,r,!1,n,o);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,n){const s=qt(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;return Ti(i,s,r,n,o)},nearest(i,t,e,n){const s=qt(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;return Oi(i,s,r,e.intersect,n,o)},x(i,t,e,n){const s=qt(t,i);return cs(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=qt(t,i);return cs(i,s,"y",e.intersect,n)}}};const Dr=["left","top","right","bottom"];function ge(i,t){return i.filter(e=>e.pos===t)}function hs(i,t){return i.filter(e=>Dr.indexOf(e.pos)===-1&&e.box.axis===t)}function pe(i,t){return i.sort((e,n)=>{const s=t?n:e,r=t?e:n;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function yh(i){const t=[];let e,n,s,r,o,a;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function xh(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:r}=e;if(!n||!Dr.includes(s))continue;const o=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function _h(i,t){const e=xh(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=i.length;r<o;++r){a=i[r];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=h?h*s:l&&t.availableHeight)}return e}function vh(i){const t=yh(i),e=pe(t.filter(c=>c.box.fullSize),!0),n=pe(ge(t,"left"),!0),s=pe(ge(t,"right")),r=pe(ge(t,"top"),!0),o=pe(ge(t,"bottom")),a=hs(t,"x"),l=hs(t,"y");return{fullSize:e,leftAndTop:n.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ge(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function us(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Ar(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function wh(i,t,e,n){const{pos:s,box:r}=e,o=i.maxPadding;if(!B(s)){e.size&&(i[s]-=e.size);const u=n[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?r.height:r.width),e.size=u.size/u.count,i[s]+=e.size}r.getPadding&&Ar(o,r.getPadding());const a=Math.max(0,t.outerWidth-us(o,i,"left","right")),l=Math.max(0,t.outerHeight-us(o,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Mh(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function kh(i,t){const e=t.maxPadding;function n(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return n(i?["left","right"]:["top","bottom"])}function ye(i,t,e,n){const s=[];let r,o,a,l,c,h;for(r=0,o=i.length,c=0;r<o;++r){a=i[r],l=a.box,l.update(a.width||t.w,a.height||t.h,kh(a.horizontal,t));const{same:u,other:d}=wh(t,e,a,n);c|=u&&s.length,h=h||d,l.fullSize||s.push(a)}return c&&ye(s,t,e,n)||h}function $e(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function ds(i,t,e,n){const s=e.padding;let{x:r,y:o}=t;for(const a of i){const l=a.box,c=n[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const u=t.w*h,d=c.size||l.height;yt(c.start)&&(o=c.start),l.fullSize?$e(l,s.left,o,e.outerWidth-s.right-s.left,d):$e(l,t.left+c.placed,o,u,d),c.start=o,c.placed+=u,o=l.bottom}else{const u=t.h*h,d=c.size||l.width;yt(c.start)&&(r=c.start),l.fullSize?$e(l,r,s.top,d,e.outerHeight-s.bottom-s.top):$e(l,r,t.top+c.placed,d,u),c.start=r,c.placed+=u,r=l.right}}t.x=r,t.y=o}E.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var bt={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,n){if(!i)return;const s=ct(i.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=vh(i.boxes),l=a.vertical,c=a.horizontal;j(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),d=Object.assign({},s);Ar(d,ct(n));const f=Object.assign({maxPadding:d,w:r,h:o,x:s.left,y:s.top},s),g=_h(l.concat(c),u);ye(a.fullSize,f,u,g),ye(l,f,u,g),ye(c,f,u,g)&&ye(l,f,u,g),Mh(f),ds(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,ds(a.rightAndBottom,f,u,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},j(a.chartArea,p=>{const m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Lr{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Ph extends Lr{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Qe="$chartjs",Sh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fs=i=>i===null||i==="";function Th(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Qe]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",fs(s)){const r=Un(i,"width");r!==void 0&&(i.width=r)}if(fs(n))if(i.style.height==="")i.height=i.width/(t||2);else{const r=Un(i,"height");r!==void 0&&(i.height=r)}return i}const Rr=ac?{passive:!0}:!1;function Oh(i,t,e){i.addEventListener(t,e,Rr)}function Ch(i,t,e){i.canvas.removeEventListener(t,e,Rr)}function Dh(i,t){const e=Sh[i.type]||i.type,{x:n,y:s}=qt(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function ri(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Ah(i,t,e){const n=i.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||ri(a.addedNodes,n),o=o&&!ri(a.removedNodes,n);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Lh(i,t,e){const n=i.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||ri(a.removedNodes,n),o=o&&!ri(a.addedNodes,n);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const De=new Map;let gs=0;function Er(){const i=window.devicePixelRatio;i!==gs&&(gs=i,De.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Rh(i,t){De.size||window.addEventListener("resize",Er),De.set(i,t)}function Eh(i){De.delete(i),De.size||window.removeEventListener("resize",Er)}function Ih(i,t,e){const n=i.canvas,s=n&&cn(n);if(!s)return;const r=sr((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||r(c,h)});return o.observe(s),Rh(i,r),o}function Ci(i,t,e){e&&e.disconnect(),t==="resize"&&Eh(i)}function Fh(i,t,e){const n=i.canvas,s=sr(r=>{i.ctx!==null&&e(Dh(r,i))},i,r=>{const o=r[0];return[o,o.offsetX,o.offsetY]});return Oh(n,t,s),s}class zh extends Lr{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Th(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Qe])return!1;const n=e[Qe].initial;["height","width"].forEach(r=>{const o=n[r];V(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=n.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[Qe],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:Ah,detach:Lh,resize:Ih}[e]||Fh;s[e]=o(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:Ci,detach:Ci,resize:Ci}[e]||Ch)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return oc(t,e,n,s)}isAttached(t){const e=cn(t);return!!(e&&e.isConnected)}}function Bh(i){return!_r()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Ph:zh}class Hh{constructor(){this._init=[]}notify(t,e,n,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,n);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,n,s){s=s||{};for(const r of t){const o=r.plugin,a=o[n],l=[e,s,r.options];if($(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){V(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 n=t&&t.config,s=C(n.options&&n.options.plugins,{}),r=Nh(n);return s===!1&&!e?[]:Vh(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function Nh(i){const t={},e=[],n=Object.keys(Tt.plugins.items);for(let r=0;r<n.length;r++)e.push(Tt.getPlugin(n[r]));const s=i.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function Wh(i,t){return!t&&i===!1?null:i===!0?{}:i}function Vh(i,{plugins:t,localIds:e},n,s){const r=[],o=i.getContext();for(const a of t){const l=a.id,c=Wh(n[l],s);c!==null&&r.push({plugin:a,options:jh(i.config,{plugin:a,local:e[l]},c,o)})}return r}function jh(i,{plugin:t,local:e},n,s){const r=i.pluginScopeKeys(t),o=i.getOptionScopes(n,r);return e&&t.defaults&&o.push(t.defaults),i.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Hi(i,t){const e=E.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Yh(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Uh(i,t){return i===t?"_index_":"_value_"}function $h(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Ni(i,t){return i==="x"||i==="y"?i:t.axis||$h(t.position)||i.charAt(0).toLowerCase()}function Xh(i,t){const e=Jt[i.type]||{scales:{}},n=t.scales||{},s=Hi(i.type,t),r=Object.create(null),o=Object.create(null);return Object.keys(n).forEach(a=>{const l=n[a];if(!B(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Ni(a,l),h=Uh(c,s),u=e.scales||{};r[c]=r[c]||a,o[a]=_e(Object.create(null),[{axis:c},l,u[c],u[h]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,c=a.indexAxis||Hi(l,t),u=(Jt[l]||{}).scales||{};Object.keys(u).forEach(d=>{const f=Yh(d,c),g=a[f+"AxisID"]||r[f]||f;o[g]=o[g]||Object.create(null),_e(o[g],[{axis:f},n[g],u[d]])})}),Object.keys(o).forEach(a=>{const l=o[a];_e(l,[E.scales[l.type],E.scale])}),o}function Ir(i){const t=i.options||(i.options={});t.plugins=C(t.plugins,{}),t.scales=Xh(i,t)}function Fr(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function qh(i){return i=i||{},i.data=Fr(i.data),Ir(i),i}const ps=new Map,zr=new Set;function Xe(i,t){let e=ps.get(i);return e||(e=t(),ps.set(i,e),zr.add(e)),e}const me=(i,t,e)=>{const n=jt(t,e);n!==void 0&&i.add(n)};class Kh{constructor(t){this._config=qh(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=Fr(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(),Ir(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Xe(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Xe(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Xe(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return Xe(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:r}=this,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>me(l,t,u))),h.forEach(u=>me(l,s,u)),h.forEach(u=>me(l,Jt[r]||{},u)),h.forEach(u=>me(l,E,u)),h.forEach(u=>me(l,Fi,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),zr.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Jt[e]||{},E.datasets[e]||{},{type:e},E,Fi]}resolveNamedOptions(t,e,n,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=ms(this._resolverCache,t,s);let l=o;if(Gh(o,e)){r.$shared=!1,n=Yt(n)?n():n;const c=this.createResolver(t,n,a);l=ce(o,n,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,n=[""],s){const{resolver:r}=ms(this._resolverCache,t,n);return B(e)?ce(r,e,void 0,s):r}}function ms(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let r=n.get(s);return r||(r={resolver:on(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,r)),r}const Qh=i=>B(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||Yt(i[e]),!1);function Gh(i,t){const{isScriptable:e,isIndexable:n}=gr(i);for(const s of t){const r=e(s),o=n(s),a=(o||r)&&i[s];if(r&&(Yt(a)||Qh(a))||o&&q(a))return!0}return!1}var Zh="3.9.1";const Jh=["top","bottom","left","right","chartArea"];function bs(i,t){return i==="top"||i==="bottom"||Jh.indexOf(i)===-1&&t==="x"}function ys(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function xs(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),$(e&&e.onComplete,[i],t)}function tu(i){const t=i.chart,e=t.options.animation;$(e&&e.onProgress,[i],t)}function Br(i){return _r()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const oi={},Hr=i=>{const t=Br(i);return Object.values(oi).filter(e=>e.canvas===t).pop()};function eu(i,t,e){const n=Object.keys(i);for(const s of n){const r=+s;if(r>=t){const o=i[s];delete i[s],(e>0||r>t)&&(i[r+e]=o)}}}function iu(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}let gi=class{constructor(t,e){const n=this.config=new Kh(e),s=Br(t),r=Hr(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Bh(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Wa(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=o,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 Hh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=nl(u=>this.update(u),o.resizeDelay||0),this._dataChanges=[],oi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}At.listen(this,"complete",xs),At.listen(this,"progress",tu),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:r}=this;return V(t)?e&&r?r:s?n/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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Yn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Wn(this.canvas,this.ctx),this}stop(){return At.stop(this),this}resize(t,e){At.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Yn(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$(n.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};j(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=Ni(o,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),j(r,o=>{const a=o.options,l=a.id,c=Ni(l,a),h=C(a.type,o.dtype);(a.position===void 0||bs(a.position,c)!==bs(o.dposition))&&(a.position=o.dposition),s[l]=!0;let u=null;if(l in n&&n[l].type===h)u=n[l];else{const d=Tt.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(a,t)}),j(s,(o,a)=>{o||delete n[a]}),j(n,o=>{bt.configure(this,o,o.options),bt.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,r)=>s.index-r.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(ys("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const r=e[n];let o=this.getDatasetMeta(n);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=a,o.indexAxis=r.indexAxis||Hi(a,this.options),o.order=r.order||0,o.index=n,o.label=""+r.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const l=Tt.getController(a),{datasetElementType:c,dataElementType:h}=E.datasets[a];Object.assign(l.prototype,{dataElementType:Tt.getElement(h),datasetElementType:c&&Tt.getElement(c)}),o.controller=new l(this,n),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){j(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 n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:u}=this.getDatasetMeta(c),d=!s&&r.indexOf(u)===-1;u.buildOrUpdateElements(d),o=Math.max(+u.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),s||j(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ys("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){j(this.scales,t=>{bt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Cn(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:r}of e){const o=n==="_removeElements"?-r:r;eu(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=n(0);for(let r=1;r<e;r++)if(!Cn(s,n(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;bt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],j(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Yt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(At.has(this)?this.attached&&!At.running(this)&&At.start(this):(this.draw(),xs({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resize(n,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)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,n=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)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,n=t._clip,s=!n.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&nn(e,{left:n.left===!1?0:r.left-n.left,right:n.right===!1?this.width:r.right+n.right,top:n.top===!1?0:r.top-n.top,bottom:n.bottom===!1?this.height:r.bottom+n.bottom}),t.controller.draw(),s&&sn(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Oe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const r=bh.modes[e];return typeof r=="function"?r(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(r=>r&&r._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},n.push(s)),s}getContext(){return this.$context||(this.$context=Ut(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);yt(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(r,{visible:n}),this.update(a=>a.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(),At.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(),Wn(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete oi[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,n=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};j(this.options.events,r=>n(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",r),n("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){j(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},j(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Je(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const s=this.options.hover,r=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),o=r(e,t),a=n?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(r||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,n,o),l=Xa(t),c=iu(t,this._lastEvent,n,l);n&&(this._lastEvent=null,$(r.onHover,[t,a,this],this),l&&$(r.onClick,[t,a,this],this));const h=!Je(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}};const _s=()=>j(gi.instances,i=>i._plugins.invalidate()),Bt=!0;Object.defineProperties(gi,{defaults:{enumerable:Bt,value:E},instances:{enumerable:Bt,value:oi},overrides:{enumerable:Bt,value:Jt},registry:{enumerable:Bt,value:Tt},version:{enumerable:Bt,value:Zh},getChart:{enumerable:Bt,value:Hr},register:{enumerable:Bt,value:(...i)=>{Tt.add(...i),_s()}},unregister:{enumerable:Bt,value:(...i)=>{Tt.remove(...i),_s()}}});function Nr(i,t,e){const{startAngle:n,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;i.beginPath(),i.arc(r,o,a,n-c,e+c),l>s?(c=s/l,i.arc(r,o,l,e+c,n-c,!0)):i.arc(r,o,s,e+J,n-J),i.closePath(),i.clip()}function nu(i){return rn(i,["outerStart","outerEnd","innerStart","innerEnd"])}function su(i,t,e,n){const s=nu(i.options.borderRadius),r=(e-t)/2,o=Math.min(r,n*t/2),a=l=>{const c=(e-Math.min(r,l))*n/2;return lt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:lt(s.innerStart,0,o),innerEnd:lt(s.innerEnd,0,o)}}function oe(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Wi(i,t,e,n,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+n+e-c,0),d=h>0?h+n+e+c:0;let f=0;const g=s-l;if(n){const O=h>0?h-n:0,X=u>0?u-n:0,Q=(O+X)/2,Ct=Q!==0?g*Q/(Q+n):g;f=(g-Ct)/2}const p=Math.max(.001,g*u-e/G)/u,m=(g-p)/2,b=l+m+f,y=s-m-f,{outerStart:_,outerEnd:v,innerStart:x,innerEnd:w}=su(t,d,u,y-b),M=u-_,T=u-v,S=b+_/M,L=y-v/T,R=d+x,D=d+w,K=b+x/R,rt=y-w/D;if(i.beginPath(),r){if(i.arc(o,a,u,S,L),v>0){const Q=oe(T,L,o,a);i.arc(Q.x,Q.y,v,L,y+J)}const O=oe(D,y,o,a);if(i.lineTo(O.x,O.y),w>0){const Q=oe(D,rt,o,a);i.arc(Q.x,Q.y,w,y+J,rt+Math.PI)}if(i.arc(o,a,d,y-w/d,b+x/d,!0),x>0){const Q=oe(R,K,o,a);i.arc(Q.x,Q.y,x,K+Math.PI,b-J)}const X=oe(M,b,o,a);if(i.lineTo(X.x,X.y),_>0){const Q=oe(M,S,o,a);i.arc(Q.x,Q.y,_,b-J,S)}}else{i.moveTo(o,a);const O=Math.cos(S)*u+o,X=Math.sin(S)*u+a;i.lineTo(O,X);const Q=Math.cos(L)*u+o,Ct=Math.sin(L)*u+a;i.lineTo(Q,Ct)}i.closePath()}function ru(i,t,e,n,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Wi(i,t,e,n,o+Y,s);for(let c=0;c<r;++c)i.fill();isNaN(a)||(l=o+a%Y,a%Y===0&&(l+=Y))}return Wi(i,t,e,n,l,s),i.fill(),l}function ou(i,t,e){const{x:n,y:s,startAngle:r,pixelMargin:o,fullCircles:a}=t,l=Math.max(t.outerRadius-o,0),c=t.innerRadius+o;let h;for(e&&Nr(i,t,r+Y),i.beginPath(),i.arc(n,s,c,r+Y,r,!0),h=0;h<a;++h)i.stroke();for(i.beginPath(),i.arc(n,s,l,r,r+Y),h=0;h<a;++h)i.stroke()}function au(i,t,e,n,s,r){const{options:o}=t,{borderWidth:a,borderJoinStyle:l}=o,c=o.borderAlign==="inner";a&&(c?(i.lineWidth=a*2,i.lineJoin=l||"round"):(i.lineWidth=a,i.lineJoin=l||"bevel"),t.fullCircles&&ou(i,t,c),c&&Nr(i,t,s),Wi(i,t,e,n,s,r),i.stroke())}class pn extends wt{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,n){const s=this.getProps(["x","y"],n),{angle:r,distance:o}=tr(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=this.options.spacing/2,g=C(u,l-a)>=Y||Te(r,a,l),p=Ht(o,c+d,h+d);return g&&p}getCenterPoint(t){const{x:e,y:n,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(s+r)/2,u=(o+a+c+l)/2;return{x:e+Math.cos(h)*u,y:n+Math.sin(h)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,s=(e.offset||0)/2,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>Y?Math.floor(n/Y):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=G&&(a=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const l=ru(t,this,a,r,o);au(t,this,a,r,l,o),t.restore()}}pn.id="arc";pn.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};pn.defaultRoutes={backgroundColor:"backgroundColor"};function Wr(i,t,e=t){i.lineCap=C(e.borderCapStyle,t.borderCapStyle),i.setLineDash(C(e.borderDash,t.borderDash)),i.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),i.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=C(e.borderWidth,t.borderWidth),i.strokeStyle=C(e.borderColor,t.borderColor)}function lu(i,t,e){i.lineTo(e.x,e.y)}function cu(i){return i.stepped?Dl:i.tension||i.cubicInterpolationMode==="monotone"?Al:lu}function Vr(i,t,e={}){const n=i.length,{start:s=0,end:r=n-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),h=s<o&&r<o||s>a&&r>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function hu(i,t,e,n){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Vr(s,e,n),h=cu(r);let{move:u=!0,reverse:d}=n||{},f,g,p;for(f=0;f<=c;++f)g=s[(a+(d?c-f:f))%o],!g.skip&&(u?(i.moveTo(g.x,g.y),u=!1):h(i,p,g,d,r.stepped),p=g);return l&&(g=s[(a+(d?c:0))%o],h(i,p,g,d,r.stepped)),!!l}function uu(i,t,e,n){const s=t.points,{count:r,start:o,ilen:a}=Vr(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,u=0,d,f,g,p,m,b;const y=v=>(o+(c?a-v:v))%r,_=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(f=s[y(0)],i.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=s[y(d)],f.skip)continue;const v=f.x,x=f.y,w=v|0;w===g?(x<p?p=x:x>m&&(m=x),h=(u*h+v)/++u):(_(),i.lineTo(v,x),g=w,u=0,p=m=x),b=x}_()}function Vi(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?uu:hu}function du(i){return i.stepped?lc:i.tension||i.cubicInterpolationMode==="monotone"?cc:Kt}function fu(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),Wr(i,t.options),i.stroke(s)}function gu(i,t,e,n){const{segments:s,options:r}=t,o=Vi(t);for(const a of s)Wr(i,r,a.style),i.beginPath(),o(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const pu=typeof Path2D=="function";function mu(i,t,e,n){pu&&!t.options.segment?fu(i,t,e,n):gu(i,t,e,n)}class pi extends wt{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 n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;tc(this._points,n,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=yc(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,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],r=this.points,o=pc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=du(n);let c,h;for(c=0,h=o.length;c<h;++c){const{start:u,end:d}=o[c],f=r[u],g=r[d];if(f===g){a.push(f);continue}const p=Math.abs((s-f[e])/(g[e]-f[e])),m=l(f,g,p,n.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,n){return Vi(this)(t,this,e,n)}path(t,e,n){const s=this.segments,r=Vi(this);let o=this._loop;e=e||0,n=n||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+n-1});return!!o}draw(t,e,n,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),mu(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}pi.id="line";pi.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};pi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};pi.descriptors={_scriptable:!0,_indexable:i=>i!=="borderDash"&&i!=="fill"};function vs(i,t,e,n){const s=i.options,{[e]:r}=i.getProps([e],n);return Math.abs(t-r)<s.radius+s.hitRadius}class mn extends wt{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,n){const s=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return vs(this,t,"x",e)}inYRange(t,e){return vs(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!Oe(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,zi(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}mn.id="point";mn.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};mn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function jr(i,t){const{x:e,y:n,base:s,width:r,height:o}=i.getProps(["x","y","base","width","height"],t);let a,l,c,h,u;return i.horizontal?(u=o/2,a=Math.min(e,s),l=Math.max(e,s),c=n-u,h=n+u):(u=r/2,a=e-u,l=e+u,c=Math.min(n,s),h=Math.max(n,s)),{left:a,top:c,right:l,bottom:h}}function Wt(i,t,e,n){return i?0:lt(t,e,n)}function bu(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,r=fr(n);return{t:Wt(s.top,r.top,0,e),r:Wt(s.right,r.right,0,t),b:Wt(s.bottom,r.bottom,0,e),l:Wt(s.left,r.left,0,t)}}function yu(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,r=Gt(s),o=Math.min(t,e),a=i.borderSkipped,l=n||B(s);return{topLeft:Wt(!l||a.top||a.left,r.topLeft,0,o),topRight:Wt(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Wt(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Wt(!l||a.bottom||a.right,r.bottomRight,0,o)}}function xu(i){const t=jr(i),e=t.right-t.left,n=t.bottom-t.top,s=bu(i,e/2,n/2),r=yu(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function Di(i,t,e,n){const s=t===null,r=e===null,a=i&&!(s&&r)&&jr(i,n);return a&&(s||Ht(t,a.left,a.right))&&(r||Ht(e,a.top,a.bottom))}function _u(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function vu(i,t){i.rect(t.x,t.y,t.w,t.h)}function Ai(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,r=(i.x+i.w!==e.x+e.w?t:0)-n,o=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+r,h:i.h+o,radius:i.radius}}class bn extends wt{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:n,backgroundColor:s}}=this,{inner:r,outer:o}=xu(this),a=_u(o.radius)?Ce:vu;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,Ai(o,e,r)),t.clip(),a(t,Ai(r,-e,o)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,Ai(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return Di(this,t,e,n)}inXRange(t,e){return Di(this,t,null,e)}inYRange(t,e){return Di(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}bn.id="bar";bn.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};bn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};const ws=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},wu=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Ms extends wt{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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=$(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=nt(n.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ws(n,r);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(o,r,a,l)+10):(h=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let u=t;r.textAlign="left",r.textBaseline="middle";let d=-1,f=-h;return this.legendItems.forEach((g,p)=>{const m=n+e/2+r.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>o)&&(u+=h,c[c.length-(p>0?0:1)]=0,f+=h,d++),l[p]={left:0,top:f,row:d,width:m,height:s},c[c.length-1]+=m+a}),u}_fitCols(t,e,n,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=o-t;let u=a,d=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const y=n+e/2+r.measureText(m.text).width;b>0&&f+s+2*a>h&&(u+=d+a,c.push({width:d,height:f}),g+=d+a,p++,d=f=0),l[b]={left:g,top:f,col:p,width:y,height:s},d=Math.max(d,y),f+=s+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:r}}=this,o=ae(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=at(n,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=at(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=at(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=at(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;nn(t,this),this._draw(),sn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:r,labels:o}=t,a=E.color,l=ae(t.rtl,this.left,this.width),c=nt(o.font),{color:h,padding:u}=o,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=ws(o,d),y=function(M,T,S){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const L=C(S.lineWidth,1);if(s.fillStyle=C(S.fillStyle,a),s.lineCap=C(S.lineCap,"butt"),s.lineDashOffset=C(S.lineDashOffset,0),s.lineJoin=C(S.lineJoin,"miter"),s.lineWidth=L,s.strokeStyle=C(S.strokeStyle,a),s.setLineDash(C(S.lineDash,[])),o.usePointStyle){const R={radius:m*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:L},D=l.xPlus(M,p/2),K=T+f;dr(s,R,D,K,o.pointStyleWidth&&p)}else{const R=T+Math.max((d-m)/2,0),D=l.leftForLtr(M,p),K=Gt(S.borderRadius);s.beginPath(),Object.values(K).some(rt=>rt!==0)?Ce(s,{x:D,y:R,w:p,h:m,radius:K}):s.rect(D,R,p,m),s.fill(),L!==0&&s.stroke()}s.restore()},_=function(M,T,S){te(s,S.text,M,T+b/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},v=this.isHorizontal(),x=this._computeTitleHeight();v?g={x:at(r,this.left+u,this.right-n[0]),y:this.top+u+x,line:0}:g={x:this.left+u,y:at(r,this.top+x+u,this.bottom-e[0].height),line:0},vr(this.ctx,t.textDirection);const w=b+u;this.legendItems.forEach((M,T)=>{s.strokeStyle=M.fontColor||h,s.fillStyle=M.fontColor||h;const S=s.measureText(M.text).width,L=l.textAlign(M.textAlign||(M.textAlign=o.textAlign)),R=p+f+S;let D=g.x,K=g.y;l.setWidth(this.width),v?T>0&&D+R+u>this.right&&(K=g.y+=w,g.line++,D=g.x=at(r,this.left+u,this.right-n[g.line])):T>0&&K+w>this.bottom&&(D=g.x=D+e[g.line].width+u,g.line++,K=g.y=at(r,this.top+x+u,this.bottom-e[g.line].height));const rt=l.x(D);y(rt,K,M),D=sl(L,D+p+f,v?D+R:this.right,t.rtl),_(l.x(D),K,M),v?g.x+=R+u:g.y+=w}),wr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=nt(e.font),s=ct(e.padding);if(!e.display)return;const r=ae(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=n.size/2,c=s.top+l;let h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=at(t.align,u,this.right-d);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+at(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=at(a,u,u+d);o.textAlign=r.textAlign(Zi(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=n.string,te(o,e.text,f,h,n)}_computeTitleHeight(){const t=this.options.title,e=nt(t.font),n=ct(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,r;if(Ht(t,this.left,this.right)&&Ht(e,this.top,this.bottom)){for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(s=r[n],Ht(t,s.left,s.left+s.width)&&Ht(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!Mu(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=wu(s,n);s&&!r&&$(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!r&&$(e.onHover,[t,n,this],this)}else n&&$(e.onClick,[t,n,this],this)}}function Mu(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var ad={id:"legend",_element:Ms,start(i,t,e){const n=i.legend=new Ms({ctx:i.ctx,options:e,chart:i});bt.configure(i,n,e),bt.addBox(i,n)},stop(i){bt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;bt.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:r}}=i.legend.options;return i._getSortedDatasetMetas().map(o=>{const a=o.controller.getStyle(e?0:void 0),l=ct(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:n||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:o.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Yr extends wt{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 n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=q(n.text)?n.text.length:1;this._padding=ct(n.padding);const r=s*nt(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,h,u;return this.isHorizontal()?(h=at(a,n,r),u=e+t,c=r-n):(o.position==="left"?(h=n+t,u=at(a,s,e),l=G*-.5):(h=r-t,u=at(a,e,s),l=G*.5),c=s-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=nt(e.font),r=n.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);te(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Zi(e.align),textBaseline:"middle",translation:[o,a]})}}function ku(i,t){const e=new Yr({ctx:i.ctx,options:t,chart:i});bt.configure(i,e,t),bt.addBox(i,e),i.titleBlock=e}var ld={id:"title",_element:Yr,start(i,t,e){ku(i,e)},stop(i){const t=i.titleBlock;bt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;bt.configure(i,n,e),n.options=e},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 ke={average(i){if(!i.length)return!1;let t,e,n=0,s=0,r=0;for(t=0,e=i.length;t<e;++t){const o=i[t].element;if(o&&o.hasValue()){const a=o.tooltipPosition();n+=a.x,s+=a.y,++r}}return{x:n/r,y:s/r}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=i.length;r<o;++r){const l=i[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Ei(t,c);h<s&&(s=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function Mt(i,t){return t&&(q(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Lt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
17
+ */class vc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=nr.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const r=n.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),r.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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((n,s)=>Math.max(n,s._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 n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var At=new vc;const Gn="transparent",wc={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=Nn(i||Gn),s=n.valid&&Nn(t||Gn);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Mc{constructor(t,e,n,s){const r=e[n];s=Ve([t.to,s,r,t.from]);const o=Ve([t.from,r,s]);this._active=!0,this._fn=t.fn||wc[t.type||typeof o],this._easing=we[t.easing]||we.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=n,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ve([t.to,e,s,t.from]),this._from=Ve([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<n),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/n%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}const kc=["x","y","borderWidth","radius","tension"],Pc=["color","borderColor","backgroundColor"];E.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Sc=Object.keys(E.animation);E.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:i=>i!=="onProgress"&&i!=="onComplete"&&i!=="fn"});E.set("animations",{colors:{type:"color",properties:Pc},numbers:{type:"number",properties:kc}});E.describe("animations",{_fallback:"animation"});E.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:i=>i|0}}}});class kr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!B(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const s=t[n];if(!B(s))return;const r={};for(const o of Sc)r[o]=s[o];(q(s.properties)&&s.properties||[n]).forEach(o=>{(o===n||!e.has(o))&&e.set(o,r)})})}_animateOptions(t,e){const n=e.options,s=Oc(t,n);if(!s)return[];const r=this._createAnimations(s,n);return n.$shared&&Tc(t.options.$animations,n).then(()=>{t.options=n},()=>{}),r}_createAnimations(t,e){const n=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let u=r[c];const d=n.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}r[c]=u=new Mc(d,t,c,h),s.push(u)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return At.add(this._chart,n),!0}}function Tc(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const r=i[n[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Oc(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Qn(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:n?r:s,end:n?s:r}}function Cc(i,t,e){if(e===!1)return!1;const n=Qn(i,e),s=Qn(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Dc(i){let t,e,n,s;return B(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Pr(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,r;for(s=0,r=n.length;s<r;++s)e.push(n[s].index);return e}function Zn(i,t,e,n={}){const s=i.keys,r=n.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(n.all)continue;break}c=i.values[l],ot(c)&&(r||t===0||Ot(t)===Ot(c))&&(t+=c)}return t}}function Ac(i){const t=Object.keys(i),e=new Array(t.length);let n,s,r;for(n=0,s=t.length;n<s;++n)r=t[n],e[n]={x:r,y:i[r]};return e}function Jn(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Lc(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Rc(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Ec(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function ts(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const r=i[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function es(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,h=Lc(r,o,n),u=t.length;let d;for(let f=0;f<u;++f){const g=t[f],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});d=b[c]=Ec(s,h,p),d[a]=m,d._top=ts(d,o,!0,n.type),d._bottom=ts(d,o,!1,n.type)}}function ki(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function Ic(i,t){return Ut(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Fc(i,t,e){return Ut(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function de(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const r=s._stacks;if(!r||r[n]===void 0||r[n][e]===void 0)return;delete r[n][e]}}}const Pi=i=>i==="reset"||i==="none",is=(i,t)=>t?i:Object.assign({},i),zc=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Pr(e,!0),values:null};class vt{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.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Jn(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&de(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(u,d,f,g)=>u==="x"?d:u==="r"?g:f,r=e.xAxisID=C(n.xAxisID,ki(t,"x")),o=e.yAxisID=C(n.yAxisID,ki(t,"y")),a=e.rAxisID=C(n.rAxisID,ki(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),h=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}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&&Rn(this._data,this),t._stacked&&de(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(B(e))this._data=Ac(e);else if(n!==e){if(n){Rn(n,this);const s=this._cachedMeta;de(s),s._parsed=[]}e&&Object.isExtensible(e)&&il(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,n=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=Jn(e.vScale,e),e.stack!==n.stack&&(s=!0,de(e),e.stack=n.stack),this._resyncElements(t),(s||r!==e._stacked)&&es(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:r,_stacked:o}=n,a=r.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,u,d;if(this._parsing===!1)n._parsed=s,n._sorted=!0,d=s;else{q(s[t])?d=this.parseArrayData(n,s,t,e):B(s[t])?d=this.parseObjectData(n,s,t,e):d=this.parsePrimitiveData(n,s,t,e);const f=()=>u[a]===null||c&&u[a]<c[a];for(h=0;h<e;++h)n._parsed[h+t]=u=d[h],l&&(f()&&(l=!1),c=u);n._sorted=l}o&&es(this,d)}parsePrimitiveData(t,e,n,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),h=r===o,u=new Array(s);let d,f,g;for(d=0,f=s;d<f;++d)g=d+n,u[d]={[a]:h||r.parse(c[g],g),[l]:o.parse(e[g],g)};return u}parseArrayData(t,e,n,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,h,u;for(l=0,c=s;l<c;++l)h=l+n,u=e[h],a[l]={x:r.parse(u[0],h),y:o.parse(u[1],h)};return a}parseObjectData(t,e,n,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,u,d,f;for(h=0,u=s;h<u;++h)d=h+n,f=e[d],c[h]={x:r.parse(jt(f,a),d),y:o.parse(jt(f,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:Pr(s,!0),values:e._stacks[t.axis]};return Zn(a,o,r.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const r=n[e.axis];let o=r===null?NaN:r;const a=s&&n._stacks[e.axis];s&&a&&(s.values=a,o=Zn(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,r=n._sorted&&t===n.iScale,o=s.length,a=this._getOtherScale(t),l=zc(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=Rc(a);let d,f;function g(){f=s[d];const p=f[a.axis];return!ot(f[t.axis])||h>p||u<p}for(d=0;d<o&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),r));++d);if(r){for(d=o-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],ot(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Dc(C(this.options.clip,Cc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,r,a,l),h=a;h<a+l;++h){const u=s[h];u.hidden||(u.active&&c?o.push(u):u.draw(t,r))}for(h=0;h<o.length;++h)o[h].draw(t,r)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=Fc(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Ic(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&yt(n);if(a)return is(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),f=Object.keys(E.elements[t]),g=()=>this.getContext(n,s),p=c.resolveNamedOptions(d,f,g,u);return p.$shared&&(p.$shared=l,r[o]=Object.freeze(is(p,l))),p}_resolveAnimations(t,e,n){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,n,e))}const c=new kr(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Pi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(n),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,n),{sharedOptions:r,includeOptions:o}}updateElement(t,e,n,s){Pi(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!Pi(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=n.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,n=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(r,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&de(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,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 n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}vt.defaults={};vt.prototype.datasetElementType=null;vt.prototype.dataElementType=null;function Bc(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,r=e.length;s<r;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=ir(n.sort((s,r)=>s-r))}return i._cache.$bar}function Hc(i){const t=i.iScale,e=Bc(t,i.type);let n=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(yt(a)&&(n=Math.min(n,Math.abs(o-a)||n)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return n}function Nc(i,t,e,n){const s=e.barThickness;let r,o;return V(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*n,o=1),{chunk:r/n,ratio:o,start:t.pixels[i]-r/2}}function Wc(i,t,e,n){const s=t.pixels,r=s[i];let o=i>0?s[i-1]:null,a=i<s.length-1?s[i+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/n,ratio:e.barPercentage,start:c}}function Vc(i,t,e,n){const s=e.parse(i[0],n),r=e.parse(i[1],n),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function Sr(i,t,e,n){return q(i)?Vc(i,t,e,n):t[e.axis]=e.parse(i,n),t}function ns(i,t,e,n){const s=i.iScale,r=i.vScale,o=s.getLabels(),a=s===r,l=[];let c,h,u,d;for(c=e,h=e+n;c<h;++c)d=t[c],u={},u[s.axis]=a||s.parse(o[c],c),l.push(Sr(d,u,r,c));return l}function Si(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function jc(i,t,e){return i!==0?Ot(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Yc(i){let t,e,n,s,r;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:n,reverse:t,top:s,bottom:r}}function Uc(i,t,e,n){let s=t.borderSkipped;const r={};if(!s){i.borderSkipped=r;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:h}=Yc(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=h:(r[ss(h,o,a,l)]=!0,s=c)),r[ss(s,o,a,l)]=!0,i.borderSkipped=r}function ss(i,t,e,n){return n?(i=$c(i,t,e),i=rs(i,e,t)):i=rs(i,t,e),i}function $c(i,t,e){return i===t?e:i===e?t:i}function rs(i,t,e){return i==="start"?t:i==="end"?e:i}function Xc(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class hn extends vt{parsePrimitiveData(t,e,n,s){return ns(t,e,n,s)}parseArrayData(t,e,n,s){return ns(t,e,n,s)}parseObjectData(t,e,n,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,h=o.axis==="x"?a:l,u=[];let d,f,g,p;for(d=n,f=n+s;d<f;++d)p=e[d],g={},g[r.axis]=r.parse(jt(p,c),d),u.push(Sr(jt(p,h),g,o,d));return u}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const r=n._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Si(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s);for(let f=e;f<e+n;f++){const g=this.getParsed(f),p=r||V(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,h),b=(g._stacks||{})[a.axis],y={horizontal:c,base:p.base,enableBorderRadius:!b||Si(g._custom)||o===b._top||o===b._bottom,x:c?p.head:m.center,y:c?m.center:p.head,height:c?m.size:Math.abs(p.size),width:c?Math.abs(p.size):m.size};d&&(y.options=u||this.resolveDataElementOptions(f,t[f].active?"active":s));const _=y.options||t[f].options;Uc(y,_,b,o),Xc(y,_,h.ratio),this.updateElement(t[f],f,y,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),r=n.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(V(h)||isNaN(h))return!0};for(const l of s)if(!(e!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));const a=t.barThickness;return{min:a||Hc(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n},options:{base:s,minBarLength:r}}=this,o=s||0,a=this.getParsed(t),l=a._custom,c=Si(l);let h=a[e.axis],u=0,d=n?this.applyStack(e,a,n):h,f,g;d!==h&&(u=d-h,d=h),c&&(h=l.barStart,d=l.barEnd-l.barStart,h!==0&&Ot(h)!==Ot(l.barEnd)&&(u=0),u+=h);const p=!V(s)&&!c?s:u;let m=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?f=e.getPixelForValue(u+d):f=m,g=f-m,Math.abs(g)<r){g=jc(g,e,o)*r,h===o&&(m-=g/2);const b=e.getPixelForDecimal(0),y=e.getPixelForDecimal(1),_=Math.min(b,y),v=Math.max(b,y);m=Math.max(Math.min(m,v),_),f=m+g}if(m===e.getPixelForValue(o)){const b=Ot(g)*e.getLineWidthForValue(o)/2;m+=b,g-=b}return{size:g,base:m,head:f,center:f+g/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,r=s.skipNull,o=C(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?Wc(t,e,s,c):Nc(t,e,s,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=h.start+h.chunk*u+h.chunk/2,l=Math.min(o,h.chunk*h.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&n[r].draw(this._ctx)}}hn.id="bar";hn.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};hn.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class un extends vt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){const r=super.parsePrimitiveData(t,e,n,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+n).radius;return r}parseArrayData(t,e,n,s){const r=super.parseArrayData(t,e,n,s);for(let o=0;o<r.length;o++){const a=e[n+o];r[o]._custom=C(a[2],this.resolveDataElementOptions(o+n).radius)}return r}parseObjectData(t,e,n,s){const r=super.parseObjectData(t,e,n,s);for(let o=0;o<r.length;o++){const a=e[n+o];r[o]._custom=C(a&&a.r&&+a.r,this.resolveDataElementOptions(o+n).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:s}=e,r=this.getParsed(t),o=n.getLabelForValue(r.x),a=s.getLabelForValue(r.y),l=r._custom;return{label:e.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=o.axis,u=a.axis;for(let d=e;d<e+n;d++){const f=t[d],g=!r&&this.getParsed(d),p={},m=p[h]=r?o.getPixelForDecimal(.5):o.getPixelForValue(g[h]),b=p[u]=r?a.getBasePixel():a.getPixelForValue(g[u]);p.skip=isNaN(m)||isNaN(b),c&&(p.options=l||this.resolveDataElementOptions(d,f.active?"active":s),r&&(p.options.radius=0)),this.updateElement(f,d,p,s)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=C(n&&n._custom,r),s}}un.id="bubble";un.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};un.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function qc(i,t,e){let n=1,s=1,r=0,o=0;if(t<Y){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),u=Math.cos(l),d=Math.sin(l),f=(_,v,x)=>Te(_,a,l,!0)?1:Math.max(v,v*e,x,x*e),g=(_,v,x)=>Te(_,a,l,!0)?-1:Math.min(v,v*e,x,x*e),p=f(0,c,u),m=f(J,h,d),b=g(Q,c,u),y=g(Q+J,h,d);n=(p-b)/2,s=(m-y)/2,r=-(p+b)/2,o=-(m+y)/2}return{ratioX:n,ratioY:s,offsetX:r,offsetY:o}}class Ee extends vt{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 n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let r=l=>+n[l];if(B(n[t])){const{key:l="value"}=this._parsing;r=c=>+jt(n[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return _t(this.options.rotation-90)}_getCircumference(){return _t(this.options.circumference)}_getRotationExtents(){let t=Y,e=-Y;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){const s=this.chart.getDatasetMeta(n).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-o)/2,0),l=Math.min(Va(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:g,offsetY:p}=qc(u,h,l),m=(n.width-o)/d,b=(n.height-o)/f,y=Math.max(Math.min(m,b)/2,0),_=Qs(this.options.radius,y),v=Math.max(_*l,0),x=(_-v)/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=p*_,s.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/Y)}updateElements(t,e,n,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,h=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=r&&c.animateScale,f=d?0:this.innerRadius,g=d?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(e,s);let b=this._getRotation(),y;for(y=0;y<e;++y)b+=this._circumference(y,r);for(y=e;y<e+n;++y){const _=this._circumference(y,r),v=t[y],x={x:h+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:g,innerRadius:f};m&&(x.options=p||this.resolveDataElementOptions(y,v.active?"active":s)),b+=_,this.updateElement(v,y,x,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(r))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Y*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],r=Re(e._parsed[t],n.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=n.data.datasets.length;s<r;++s)if(n.isDatasetVisible(s)){o=n.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const r=this.resolveDataElementOptions(n);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(C(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ee.id="doughnut";Ee.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"};Ee.descriptors={_scriptable:i=>i!=="spacing",_indexable:i=>i!=="spacing"};Ee.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((n,s)=>{const o=i.getDatasetMeta(0).controller.getStyle(s);return{text:n,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(s),index:s}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let t=i.label;const e=": "+i.formattedValue;return q(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};class di extends vt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=rr(e,s,o);this._drawStart=a,this._drawCount=l,or(e)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,n,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,s),d=o.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=le(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||s==="none";let y=e>0&&this.getParsed(e-1);for(let _=e;_<e+n;++_){const v=t[_],x=this.getParsed(_),w=b?v:{},M=V(x[f]),T=w[d]=o.getPixelForValue(x[d],_),S=w[f]=r||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,x,l):x[f],_);w.skip=isNaN(T)||isNaN(S)||M,w.stop=_>0&&Math.abs(x[d]-y[d])>m,p&&(w.parsed=x,w.raw=c.data[_]),u&&(w.options=h||this.resolveDataElementOptions(_,v.active?"active":s)),b||this.updateElement(v,_,w,s),y=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}di.id="line";di.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};di.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class dn extends vt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],r=Re(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,n,s){return yr.bind(this)(t,e,n,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((n,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*Q;let f=d,g;const p=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,s,p);for(g=e;g<e+n;g++){const m=t[g];let b=f,y=f+this._computeAngle(g,s,p),_=o.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=y,r&&(l.animateScale&&(_=0),l.animateRotate&&(b=y=d));const v={x:h,y:u,innerRadius:0,outerRadius:_,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(g,m.active?"active":s)};this.updateElement(m,g,v,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?_t(this.resolveDataElementOptions(t,e).angle||n):0}}dn.id="polarArea";dn.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};dn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((n,s)=>{const o=i.getDatasetMeta(0).controller.getStyle(s);return{text:n,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(s),index:s}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Tr extends Ee{}Tr.id="pie";Tr.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class fn extends vt{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return yr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(n.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(n,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+n;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),h=r.getPointPositionForValue(a,this.getParsed(a).r),u=o?r.xCenter:h.x,d=o?r.yCenter:h.y,f={x:u,y:d,angle:h.angle,skip:isNaN(u)||isNaN(d),options:c};this.updateElement(l,a,f,s)}}}fn.id="radar";fn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};fn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class wt{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return le(this.x)&&le(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(r=>{s[r]=n[r]&&n[r].active()?n[r]._to:this[r]}),s}}wt.defaults={};wt.defaultRoutes=void 0;const Or={values(i){return q(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,r=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=Kc(i,e)}const o=mt(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Re(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=i/Math.pow(10,Math.floor(mt(i)));return n===1||n===2||n===5?Or.numeric.call(this,i,t,e):""}};function Kc(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var fi={formatters:Or};E.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:fi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});E.route("scale.ticks","color","","color");E.route("scale.grid","color","","borderColor");E.route("scale.grid","borderColor","","borderColor");E.route("scale.title","color","","color");E.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"});E.describe("scales",{_fallback:"scale"});E.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function Gc(i,t){const e=i.options.ticks,n=e.maxTicksLimit||Qc(i),s=e.major.enabled?Jc(t):[],r=s.length,o=s[0],a=s[r-1],l=[];if(r>n)return th(t,l,s,r/n),l;const c=Zc(s,t,n);if(r>0){let h,u;const d=r>1?Math.round((a-o)/(r-1)):null;for(Ye(t,l,c,V(d)?0:o-d,o),h=0,u=r-1;h<u;h++)Ye(t,l,c,s[h],s[h+1]);return Ye(t,l,c,a,V(d)?t.length:a+d),l}return Ye(t,l,c),l}function Qc(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function Zc(i,t,e){const n=eh(i),s=t.length/e;if(!n)return Math.max(s,1);const r=Ga(n);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function Jc(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function th(i,t,e,n){let s=0,r=e[0],o;for(n=Math.ceil(n),o=0;o<i.length;o++)o===r&&(t.push(i[o]),s++,r=e[s*n])}function Ye(i,t,e,n,s){const r=C(n,0),o=Math.min(C(s,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=r;h<0;)a++,h=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===h&&(t.push(i[c]),a++,h=Math.round(r+a*e))}function eh(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const ih=i=>i==="left"?"right":i==="right"?"left":i,os=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e;function as(i,t){const e=[],n=i.length/t,s=i.length;let r=0;for(;r<s;r+=n)e.push(i[Math.floor(r)]);return e}function nh(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),r=i._startPixel,o=i._endPixel,a=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-r,o-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function sh(i,t){j(i,e=>{const n=e.gc,s=n.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[n[r]];n.splice(0,s)}})}function fe(i){return i.drawTicks?i.tickLength:0}function ls(i,t){if(!i.display)return 0;const e=nt(i.font,t),n=ct(i.padding);return(q(i.text)?i.text.length:1)*e.lineHeight+n.height}function rh(i,t){return Ut(i,{scale:t,type:"scale"})}function oh(i,t,e){return Ut(i,{tick:e,index:t,type:"tick"})}function ah(i,t,e){let n=Zi(i);return(e&&t!=="right"||!e&&t==="right")&&(n=ih(n)),n}function lh(i,t,e,n){const{top:s,left:r,bottom:o,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let u=0,d,f,g;const p=o-s,m=a-r;if(i.isHorizontal()){if(f=at(n,r,a),B(e)){const b=Object.keys(e)[0],y=e[b];g=h[b].getPixelForValue(y)+p-t}else e==="center"?g=(c.bottom+c.top)/2+p-t:g=os(i,e,t);d=a-r}else{if(B(e)){const b=Object.keys(e)[0],y=e[b];f=h[b].getPixelForValue(y)-m+t}else e==="center"?f=(c.left+c.right)/2-m+t:f=os(i,e,t);g=at(n,o,s),u=e==="left"?-J:J}return{titleX:f,titleY:g,maxWidth:d,rotation:u}}class ee extends wt{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:n,_suggestedMax:s}=this;return t=pt(t,Number.POSITIVE_INFINITY),e=pt(e,Number.NEGATIVE_INFINITY),n=pt(n,Number.POSITIVE_INFINITY),s=pt(s,Number.NEGATIVE_INFINITY),{min:pt(t,n),max:pt(e,s),minDefined:ot(t),maxDefined:ot(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:n};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(n=Math.max(n,o.max));return e=r&&e>n?n:e,n=s&&e>n?e:n,{min:pt(e,pt(n,e)),max:pt(n,pt(e,n))}}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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Bl(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?as(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Gc(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){$(this.options.afterUpdate,[this])}beforeSetDimensions(){$(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(){$(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),$(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){$(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,r;for(n=0,s=t.length;n<s;n++)r=t[n],r.label=$(e.callback,[r.value,n,t],this)}afterTickToLabelConversion(){$(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){$(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=this.ticks.length,s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=lt(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),u+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-fe(t.grid)-e.padding-ls(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),o=Gi(Math.min(Math.asin(lt((h.highest.height+6)/a,-1,1)),Math.asin(lt(l/c,-1,1))-Math.asin(lt(d/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=ls(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=fe(r)+l):(t.height=this.maxHeight,t.width=fe(r)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=n.padding*2,g=_t(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const b=n.mirror?0:m*u.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=n.mirror?0:p*u.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,p)}}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,n,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,f=0;l?c?(d=s*t.width,f=n*e.height):(d=n*t.height,f=s*e.width):r==="start"?f=e.width:r==="end"?d=t.width:r!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+o)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;r==="start"?(h=0,u=t.height):r==="end"&&(h=e.height,u=0),this.paddingTop=h+o,this.paddingBottom=u+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(){$(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)V(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=as(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length)}return t}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:s}=this,r=[],o=[];let a=0,l=0,c,h,u,d,f,g,p,m,b,y,_;for(c=0;c<e;++c){if(d=t[c].label,f=this._resolveTickFontOptions(c),n.font=g=f.string,p=s[g]=s[g]||{data:{},gc:[]},m=f.lineHeight,b=y=0,!V(d)&&!q(d))b=ni(n,p.data,p.gc,b,d),y=m;else if(q(d))for(h=0,u=d.length;h<u;++h)_=d[h],!V(_)&&!q(_)&&(b=ni(n,p.data,p.gc,b,_),y+=m);r.push(b),o.push(y),a=Math.max(b,a),l=Math.max(y,l)}sh(s,e);const v=r.indexOf(a),x=o.indexOf(l),w=M=>({width:r[M]||0,height:o[M]||0});return{first:w(0),last:w(e-1),widest:w(v),highest:w(x),widths:r,heights:o}}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 Ja(this._alignToPixels?$t(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 n=e[t];return n.$context||(n.$context=oh(this.getContext(),t,n))}return this.$context||(this.$context=rh(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=_t(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:r,position:o}=s,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),u=fe(r),d=[],f=r.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,m=function(O){return $t(n,O,g)};let b,y,_,v,x,w,M,T,S,L,R,D;if(o==="top")b=m(this.bottom),w=this.bottom-u,T=b-p,L=m(t.top)+p,D=t.bottom;else if(o==="bottom")b=m(this.top),L=t.top,D=m(t.bottom)-p,w=b+p,T=this.top+u;else if(o==="left")b=m(this.right),x=this.right-u,M=b-p,S=m(t.left)+p,R=t.right;else if(o==="right")b=m(this.left),S=t.left,R=m(t.right)-p,x=b+p,M=this.left+u;else if(e==="x"){if(o==="center")b=m((t.top+t.bottom)/2+.5);else if(B(o)){const O=Object.keys(o)[0],X=o[O];b=m(this.chart.scales[O].getPixelForValue(X))}L=t.top,D=t.bottom,w=b+p,T=w+u}else if(e==="y"){if(o==="center")b=m((t.left+t.right)/2);else if(B(o)){const O=Object.keys(o)[0],X=o[O];b=m(this.chart.scales[O].getPixelForValue(X))}x=b-p,M=x-u,S=t.left,R=t.right}const K=C(s.ticks.maxTicksLimit,h),rt=Math.max(1,Math.ceil(h/K));for(y=0;y<h;y+=rt){const O=r.setContext(this.getContext(y)),X=O.lineWidth,G=O.color,Ct=O.borderDash||[],ie=O.borderDashOffset,Et=O.tickWidth,It=O.tickColor,dt=O.tickBorderDash||[],Ft=O.tickBorderDashOffset;_=nh(this,y,a),_!==void 0&&(v=$t(n,_,X),l?x=M=S=R=v:w=T=L=D=v,d.push({tx1:x,ty1:w,tx2:M,ty2:T,x1:S,y1:L,x2:R,y2:D,width:X,color:G,borderDash:Ct,borderDashOffset:ie,tickWidth:Et,tickColor:It,tickBorderDash:dt,tickBorderDashOffset:Ft}))}return this._ticksLength=h,this._borderValue=b,d}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:r}=n,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=r,d=fe(n.grid),f=d+h,g=u?-h:f,p=-_t(this.labelRotation),m=[];let b,y,_,v,x,w,M,T,S,L,R,D,K="middle";if(s==="top")w=this.bottom-g,M=this._getXAxisLabelAlignment();else if(s==="bottom")w=this.top+g,M=this._getXAxisLabelAlignment();else if(s==="left"){const O=this._getYAxisLabelAlignment(d);M=O.textAlign,x=O.x}else if(s==="right"){const O=this._getYAxisLabelAlignment(d);M=O.textAlign,x=O.x}else if(e==="x"){if(s==="center")w=(t.top+t.bottom)/2+f;else if(B(s)){const O=Object.keys(s)[0],X=s[O];w=this.chart.scales[O].getPixelForValue(X)+f}M=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")x=(t.left+t.right)/2-f;else if(B(s)){const O=Object.keys(s)[0],X=s[O];x=this.chart.scales[O].getPixelForValue(X)}M=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?K="top":l==="end"&&(K="bottom"));const rt=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){_=a[b],v=_.label;const O=r.setContext(this.getContext(b));T=this.getPixelForTick(b)+r.labelOffset,S=this._resolveTickFontOptions(b),L=S.lineHeight,R=q(v)?v.length:1;const X=R/2,G=O.color,Ct=O.textStrokeColor,ie=O.textStrokeWidth;let Et=M;o?(x=T,M==="inner"&&(b===y-1?Et=this.options.reverse?"left":"right":b===0?Et=this.options.reverse?"right":"left":Et="center"),s==="top"?c==="near"||p!==0?D=-R*L+L/2:c==="center"?D=-rt.highest.height/2-X*L+L:D=-rt.highest.height+L/2:c==="near"||p!==0?D=L/2:c==="center"?D=rt.highest.height/2-X*L:D=rt.highest.height-R*L,u&&(D*=-1)):(w=T,D=(1-R)*L/2);let It;if(O.showLabelBackdrop){const dt=ct(O.backdropPadding),Ft=rt.heights[b],zt=rt.widths[b];let ne=w+D-dt.top,se=x-dt.left;switch(K){case"middle":ne-=Ft/2;break;case"bottom":ne-=Ft;break}switch(M){case"center":se-=zt/2;break;case"right":se-=zt;break}It={left:se,top:ne,width:zt+dt.width,height:Ft+dt.height,color:O.backdropColor}}m.push({rotation:p,label:v,font:S,color:G,strokeColor:Ct,strokeWidth:ie,textOffset:D,textAlign:Et,textBaseline:K,translation:[x,w],backdrop:It})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-_t(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,h;return e==="left"?s?(h=this.right+r,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+r,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:n}}=this,s=n.setContext(this.getContext()),r=n.drawBorder?s.borderWidth:0;if(!r)return;const o=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,c,h,u;this.isHorizontal()?(l=$t(t,this.left,r)-r/2,c=$t(t,this.right,o)+o/2,h=u=a):(h=$t(t,this.top,r)-r/2,u=$t(t,this.bottom,o)+o/2,l=c=a),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(l,h),e.lineTo(c,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&nn(n,s);const r=this._labelItems||(this._labelItems=this._computeLabelItems(t));let o,a;for(o=0,a=r.length;o<a;++o){const l=r[o],c=l.font,h=l.label;l.backdrop&&(n.fillStyle=l.backdrop.color,n.fillRect(l.backdrop.left,l.backdrop.top,l.backdrop.width,l.backdrop.height));let u=l.textOffset;te(n,h,0,u,c,l)}s&&sn(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const r=nt(n.font),o=ct(n.padding),a=n.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||B(e)?(l+=o.bottom,q(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=o.top;const{titleX:c,titleY:h,maxWidth:u,rotation:d}=lh(this,l,e,a);te(t,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:d,textAlign:ah(a,e,s),textBaseline:"middle",translation:[c,h]})}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,n=C(t.grid&&t.grid.z,-1);return!this._isVisible()||this.draw!==ee.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:n,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return nt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ue{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;uh(e)&&(n=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,ch(t,o,n),this.override&&E.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in E[s]&&(delete E[s][n],this.override&&delete Jt[n])}}function ch(i,t,e){const n=Se(Object.create(null),[e?E.get(e):{},E.get(t),i.defaults]);E.set(t,n),i.defaultRoutes&&hh(t,i.defaultRoutes),i.descriptors&&E.describe(t,i.descriptors)}function hh(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),r=[i].concat(n).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");E.route(r,s,l,a)})}function uh(i){return"id"in i&&"defaults"in i}class dh{constructor(){this.controllers=new Ue(vt,"datasets",!0),this.elements=new Ue(wt,"elements"),this.plugins=new Ue(Object,"plugins"),this.scales=new Ue(ee,"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,n){[...e].forEach(s=>{const r=n||this._getRegistryForType(s);n||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):j(s,o=>{const a=n||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,n){const s=Ki(t);$(n["before"+s],[],n),e[t](n),$(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var Tt=new dh;class gn extends vt{update(t){const e=this._cachedMeta,{data:n=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=rr(e,n,s);if(this._drawStart=r,this._drawCount=o,or(e)&&(r=0,o=n.length),this.options.showLine){const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}this.updateElements(n,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=Tt.getElement("line")),super.addElements()}updateElements(t,e,n,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),u=this.getSharedOptions(h),d=this.includeOptions(s,u),f=o.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=le(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none";let _=e>0&&this.getParsed(e-1);for(let v=e;v<e+n;++v){const x=t[v],w=this.getParsed(v),M=y?x:{},T=V(w[g]),S=M[f]=o.getPixelForValue(w[f],v),L=M[g]=r||T?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,w,l):w[g],v);M.skip=isNaN(S)||isNaN(L)||T,M.stop=v>0&&Math.abs(w[f]-_[f])>b,m&&(M.parsed=w,M.raw=c.data[v]),d&&(M.options=u||this.resolveDataElementOptions(v,x.active?"active":s)),y||this.updateElement(x,v,M,s),_=w}this.updateSharedOptions(u,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}gn.id="scatter";gn.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};gn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(i){return"("+i.label+", "+i.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Xt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Bi{constructor(t){this.options=t||{}}init(t){}formats(){return Xt()}parse(t,e){return Xt()}format(t,e){return Xt()}add(t,e,n){return Xt()}diff(t,e,n){return Xt()}startOf(t,e,n){return Xt()}endOf(t,e){return Xt()}}Bi.override=function(i){Object.assign(Bi.prototype,i)};var Cr={_date:Bi};function fh(i,t,e,n){const{controller:s,data:r,_sorted:o}=i,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?tl:Gt;if(n){if(s._sharedOptions){const c=r[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const u=l(r,t,e-h),d=l(r,t,e+h);return{lo:u.lo,hi:d.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function Ie(i,t,e,n,s){const r=i.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:h}=r[a],{lo:u,hi:d}=fh(r[a],t,o,s);for(let f=u;f<=d;++f){const g=h[f];g.skip||n(g,c,f)}}}function gh(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const r=t?Math.abs(n.x-s.x):0,o=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function Ti(i,t,e,n,s){const r=[];return!s&&!i.isPointInArea(t)||Ie(i,e,t,function(a,l,c){!s&&!Oe(a,i.chartArea,0)||a.inRange(t.x,t.y,n)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function ph(i,t,e,n){let s=[];function r(o,a,l){const{startAngle:c,endAngle:h}=o.getProps(["startAngle","endAngle"],n),{angle:u}=tr(o,{x:t.x,y:t.y});Te(u,c,h)&&s.push({element:o,datasetIndex:a,index:l})}return Ie(i,e,t,r),s}function mh(i,t,e,n,s,r){let o=[];const a=gh(e);let l=Number.POSITIVE_INFINITY;function c(h,u,d){const f=h.inRange(t.x,t.y,s);if(n&&!f)return;const g=h.getCenterPoint(s);if(!(!!r||i.isPointInArea(g))&&!f)return;const m=a(t,g);m<l?(o=[{element:h,datasetIndex:u,index:d}],l=m):m===l&&o.push({element:h,datasetIndex:u,index:d})}return Ie(i,e,t,c),o}function Oi(i,t,e,n,s,r){return!r&&!i.isPointInArea(t)?[]:e==="r"&&!n?ph(i,t,e,s):mh(i,t,e,n,s,r)}function cs(i,t,e,n,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return Ie(i,e,t,(l,c,h)=>{l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:r}var bh={evaluateInteractionItems:Ie,modes:{index(i,t,e,n){const s=qt(t,i),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Ti(i,s,r,n,o):Oi(i,s,r,!1,n,o),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=qt(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Ti(i,s,r,n,o):Oi(i,s,r,!1,n,o);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,n){const s=qt(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;return Ti(i,s,r,n,o)},nearest(i,t,e,n){const s=qt(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;return Oi(i,s,r,e.intersect,n,o)},x(i,t,e,n){const s=qt(t,i);return cs(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=qt(t,i);return cs(i,s,"y",e.intersect,n)}}};const Dr=["left","top","right","bottom"];function ge(i,t){return i.filter(e=>e.pos===t)}function hs(i,t){return i.filter(e=>Dr.indexOf(e.pos)===-1&&e.box.axis===t)}function pe(i,t){return i.sort((e,n)=>{const s=t?n:e,r=t?e:n;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function yh(i){const t=[];let e,n,s,r,o,a;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function xh(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:r}=e;if(!n||!Dr.includes(s))continue;const o=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function _h(i,t){const e=xh(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=i.length;r<o;++r){a=i[r];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=h?h*s:l&&t.availableHeight)}return e}function vh(i){const t=yh(i),e=pe(t.filter(c=>c.box.fullSize),!0),n=pe(ge(t,"left"),!0),s=pe(ge(t,"right")),r=pe(ge(t,"top"),!0),o=pe(ge(t,"bottom")),a=hs(t,"x"),l=hs(t,"y");return{fullSize:e,leftAndTop:n.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ge(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function us(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Ar(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function wh(i,t,e,n){const{pos:s,box:r}=e,o=i.maxPadding;if(!B(s)){e.size&&(i[s]-=e.size);const u=n[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?r.height:r.width),e.size=u.size/u.count,i[s]+=e.size}r.getPadding&&Ar(o,r.getPadding());const a=Math.max(0,t.outerWidth-us(o,i,"left","right")),l=Math.max(0,t.outerHeight-us(o,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Mh(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function kh(i,t){const e=t.maxPadding;function n(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return n(i?["left","right"]:["top","bottom"])}function ye(i,t,e,n){const s=[];let r,o,a,l,c,h;for(r=0,o=i.length,c=0;r<o;++r){a=i[r],l=a.box,l.update(a.width||t.w,a.height||t.h,kh(a.horizontal,t));const{same:u,other:d}=wh(t,e,a,n);c|=u&&s.length,h=h||d,l.fullSize||s.push(a)}return c&&ye(s,t,e,n)||h}function $e(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function ds(i,t,e,n){const s=e.padding;let{x:r,y:o}=t;for(const a of i){const l=a.box,c=n[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const u=t.w*h,d=c.size||l.height;yt(c.start)&&(o=c.start),l.fullSize?$e(l,s.left,o,e.outerWidth-s.right-s.left,d):$e(l,t.left+c.placed,o,u,d),c.start=o,c.placed+=u,o=l.bottom}else{const u=t.h*h,d=c.size||l.width;yt(c.start)&&(r=c.start),l.fullSize?$e(l,r,s.top,d,e.outerHeight-s.bottom-s.top):$e(l,r,t.top+c.placed,d,u),c.start=r,c.placed+=u,r=l.right}}t.x=r,t.y=o}E.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var bt={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,n){if(!i)return;const s=ct(i.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=vh(i.boxes),l=a.vertical,c=a.horizontal;j(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),d=Object.assign({},s);Ar(d,ct(n));const f=Object.assign({maxPadding:d,w:r,h:o,x:s.left,y:s.top},s),g=_h(l.concat(c),u);ye(a.fullSize,f,u,g),ye(l,f,u,g),ye(c,f,u,g)&&ye(l,f,u,g),Mh(f),ds(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,ds(a.rightAndBottom,f,u,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},j(a.chartArea,p=>{const m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Lr{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Ph extends Lr{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ge="$chartjs",Sh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fs=i=>i===null||i==="";function Th(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Ge]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",fs(s)){const r=Un(i,"width");r!==void 0&&(i.width=r)}if(fs(n))if(i.style.height==="")i.height=i.width/(t||2);else{const r=Un(i,"height");r!==void 0&&(i.height=r)}return i}const Rr=ac?{passive:!0}:!1;function Oh(i,t,e){i.addEventListener(t,e,Rr)}function Ch(i,t,e){i.canvas.removeEventListener(t,e,Rr)}function Dh(i,t){const e=Sh[i.type]||i.type,{x:n,y:s}=qt(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function ri(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Ah(i,t,e){const n=i.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||ri(a.addedNodes,n),o=o&&!ri(a.removedNodes,n);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Lh(i,t,e){const n=i.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||ri(a.removedNodes,n),o=o&&!ri(a.addedNodes,n);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const De=new Map;let gs=0;function Er(){const i=window.devicePixelRatio;i!==gs&&(gs=i,De.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Rh(i,t){De.size||window.addEventListener("resize",Er),De.set(i,t)}function Eh(i){De.delete(i),De.size||window.removeEventListener("resize",Er)}function Ih(i,t,e){const n=i.canvas,s=n&&cn(n);if(!s)return;const r=sr((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||r(c,h)});return o.observe(s),Rh(i,r),o}function Ci(i,t,e){e&&e.disconnect(),t==="resize"&&Eh(i)}function Fh(i,t,e){const n=i.canvas,s=sr(r=>{i.ctx!==null&&e(Dh(r,i))},i,r=>{const o=r[0];return[o,o.offsetX,o.offsetY]});return Oh(n,t,s),s}class zh extends Lr{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Th(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Ge])return!1;const n=e[Ge].initial;["height","width"].forEach(r=>{const o=n[r];V(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=n.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[Ge],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:Ah,detach:Lh,resize:Ih}[e]||Fh;s[e]=o(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:Ci,detach:Ci,resize:Ci}[e]||Ch)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return oc(t,e,n,s)}isAttached(t){const e=cn(t);return!!(e&&e.isConnected)}}function Bh(i){return!_r()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Ph:zh}class Hh{constructor(){this._init=[]}notify(t,e,n,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,n);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,n,s){s=s||{};for(const r of t){const o=r.plugin,a=o[n],l=[e,s,r.options];if($(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){V(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 n=t&&t.config,s=C(n.options&&n.options.plugins,{}),r=Nh(n);return s===!1&&!e?[]:Vh(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function Nh(i){const t={},e=[],n=Object.keys(Tt.plugins.items);for(let r=0;r<n.length;r++)e.push(Tt.getPlugin(n[r]));const s=i.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function Wh(i,t){return!t&&i===!1?null:i===!0?{}:i}function Vh(i,{plugins:t,localIds:e},n,s){const r=[],o=i.getContext();for(const a of t){const l=a.id,c=Wh(n[l],s);c!==null&&r.push({plugin:a,options:jh(i.config,{plugin:a,local:e[l]},c,o)})}return r}function jh(i,{plugin:t,local:e},n,s){const r=i.pluginScopeKeys(t),o=i.getOptionScopes(n,r);return e&&t.defaults&&o.push(t.defaults),i.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Hi(i,t){const e=E.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Yh(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Uh(i,t){return i===t?"_index_":"_value_"}function $h(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Ni(i,t){return i==="x"||i==="y"?i:t.axis||$h(t.position)||i.charAt(0).toLowerCase()}function Xh(i,t){const e=Jt[i.type]||{scales:{}},n=t.scales||{},s=Hi(i.type,t),r=Object.create(null),o=Object.create(null);return Object.keys(n).forEach(a=>{const l=n[a];if(!B(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Ni(a,l),h=Uh(c,s),u=e.scales||{};r[c]=r[c]||a,o[a]=_e(Object.create(null),[{axis:c},l,u[c],u[h]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,c=a.indexAxis||Hi(l,t),u=(Jt[l]||{}).scales||{};Object.keys(u).forEach(d=>{const f=Yh(d,c),g=a[f+"AxisID"]||r[f]||f;o[g]=o[g]||Object.create(null),_e(o[g],[{axis:f},n[g],u[d]])})}),Object.keys(o).forEach(a=>{const l=o[a];_e(l,[E.scales[l.type],E.scale])}),o}function Ir(i){const t=i.options||(i.options={});t.plugins=C(t.plugins,{}),t.scales=Xh(i,t)}function Fr(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function qh(i){return i=i||{},i.data=Fr(i.data),Ir(i),i}const ps=new Map,zr=new Set;function Xe(i,t){let e=ps.get(i);return e||(e=t(),ps.set(i,e),zr.add(e)),e}const me=(i,t,e)=>{const n=jt(t,e);n!==void 0&&i.add(n)};class Kh{constructor(t){this._config=qh(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=Fr(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(),Ir(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Xe(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Xe(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Xe(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return Xe(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:r}=this,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>me(l,t,u))),h.forEach(u=>me(l,s,u)),h.forEach(u=>me(l,Jt[r]||{},u)),h.forEach(u=>me(l,E,u)),h.forEach(u=>me(l,Fi,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),zr.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Jt[e]||{},E.datasets[e]||{},{type:e},E,Fi]}resolveNamedOptions(t,e,n,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=ms(this._resolverCache,t,s);let l=o;if(Qh(o,e)){r.$shared=!1,n=Yt(n)?n():n;const c=this.createResolver(t,n,a);l=ce(o,n,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,n=[""],s){const{resolver:r}=ms(this._resolverCache,t,n);return B(e)?ce(r,e,void 0,s):r}}function ms(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let r=n.get(s);return r||(r={resolver:on(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,r)),r}const Gh=i=>B(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||Yt(i[e]),!1);function Qh(i,t){const{isScriptable:e,isIndexable:n}=gr(i);for(const s of t){const r=e(s),o=n(s),a=(o||r)&&i[s];if(r&&(Yt(a)||Gh(a))||o&&q(a))return!0}return!1}var Zh="3.9.1";const Jh=["top","bottom","left","right","chartArea"];function bs(i,t){return i==="top"||i==="bottom"||Jh.indexOf(i)===-1&&t==="x"}function ys(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function xs(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),$(e&&e.onComplete,[i],t)}function tu(i){const t=i.chart,e=t.options.animation;$(e&&e.onProgress,[i],t)}function Br(i){return _r()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const oi={},Hr=i=>{const t=Br(i);return Object.values(oi).filter(e=>e.canvas===t).pop()};function eu(i,t,e){const n=Object.keys(i);for(const s of n){const r=+s;if(r>=t){const o=i[s];delete i[s],(e>0||r>t)&&(i[r+e]=o)}}}function iu(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}let gi=class{constructor(t,e){const n=this.config=new Kh(e),s=Br(t),r=Hr(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Bh(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Wa(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=o,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 Hh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=nl(u=>this.update(u),o.resizeDelay||0),this._dataChanges=[],oi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}At.listen(this,"complete",xs),At.listen(this,"progress",tu),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:r}=this;return V(t)?e&&r?r:s?n/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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Yn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Wn(this.canvas,this.ctx),this}stop(){return At.stop(this),this}resize(t,e){At.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Yn(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$(n.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};j(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=Ni(o,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),j(r,o=>{const a=o.options,l=a.id,c=Ni(l,a),h=C(a.type,o.dtype);(a.position===void 0||bs(a.position,c)!==bs(o.dposition))&&(a.position=o.dposition),s[l]=!0;let u=null;if(l in n&&n[l].type===h)u=n[l];else{const d=Tt.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(a,t)}),j(s,(o,a)=>{o||delete n[a]}),j(n,o=>{bt.configure(this,o,o.options),bt.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,r)=>s.index-r.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(ys("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const r=e[n];let o=this.getDatasetMeta(n);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=a,o.indexAxis=r.indexAxis||Hi(a,this.options),o.order=r.order||0,o.index=n,o.label=""+r.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const l=Tt.getController(a),{datasetElementType:c,dataElementType:h}=E.datasets[a];Object.assign(l.prototype,{dataElementType:Tt.getElement(h),datasetElementType:c&&Tt.getElement(c)}),o.controller=new l(this,n),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){j(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 n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:u}=this.getDatasetMeta(c),d=!s&&r.indexOf(u)===-1;u.buildOrUpdateElements(d),o=Math.max(+u.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),s||j(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ys("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){j(this.scales,t=>{bt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Cn(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:r}of e){const o=n==="_removeElements"?-r:r;eu(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=n(0);for(let r=1;r<e;r++)if(!Cn(s,n(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;bt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],j(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Yt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(At.has(this)?this.attached&&!At.running(this)&&At.start(this):(this.draw(),xs({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resize(n,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)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,n=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)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,n=t._clip,s=!n.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&nn(e,{left:n.left===!1?0:r.left-n.left,right:n.right===!1?this.width:r.right+n.right,top:n.top===!1?0:r.top-n.top,bottom:n.bottom===!1?this.height:r.bottom+n.bottom}),t.controller.draw(),s&&sn(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Oe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const r=bh.modes[e];return typeof r=="function"?r(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(r=>r&&r._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},n.push(s)),s}getContext(){return this.$context||(this.$context=Ut(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);yt(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(r,{visible:n}),this.update(a=>a.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(),At.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(),Wn(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete oi[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,n=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};j(this.options.events,r=>n(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",r),n("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){j(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},j(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Je(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const s=this.options.hover,r=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),o=r(e,t),a=n?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(r||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,n,o),l=Xa(t),c=iu(t,this._lastEvent,n,l);n&&(this._lastEvent=null,$(r.onHover,[t,a,this],this),l&&$(r.onClick,[t,a,this],this));const h=!Je(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}};const _s=()=>j(gi.instances,i=>i._plugins.invalidate()),Bt=!0;Object.defineProperties(gi,{defaults:{enumerable:Bt,value:E},instances:{enumerable:Bt,value:oi},overrides:{enumerable:Bt,value:Jt},registry:{enumerable:Bt,value:Tt},version:{enumerable:Bt,value:Zh},getChart:{enumerable:Bt,value:Hr},register:{enumerable:Bt,value:(...i)=>{Tt.add(...i),_s()}},unregister:{enumerable:Bt,value:(...i)=>{Tt.remove(...i),_s()}}});function Nr(i,t,e){const{startAngle:n,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;i.beginPath(),i.arc(r,o,a,n-c,e+c),l>s?(c=s/l,i.arc(r,o,l,e+c,n-c,!0)):i.arc(r,o,s,e+J,n-J),i.closePath(),i.clip()}function nu(i){return rn(i,["outerStart","outerEnd","innerStart","innerEnd"])}function su(i,t,e,n){const s=nu(i.options.borderRadius),r=(e-t)/2,o=Math.min(r,n*t/2),a=l=>{const c=(e-Math.min(r,l))*n/2;return lt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:lt(s.innerStart,0,o),innerEnd:lt(s.innerEnd,0,o)}}function oe(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Wi(i,t,e,n,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+n+e-c,0),d=h>0?h+n+e+c:0;let f=0;const g=s-l;if(n){const O=h>0?h-n:0,X=u>0?u-n:0,G=(O+X)/2,Ct=G!==0?g*G/(G+n):g;f=(g-Ct)/2}const p=Math.max(.001,g*u-e/Q)/u,m=(g-p)/2,b=l+m+f,y=s-m-f,{outerStart:_,outerEnd:v,innerStart:x,innerEnd:w}=su(t,d,u,y-b),M=u-_,T=u-v,S=b+_/M,L=y-v/T,R=d+x,D=d+w,K=b+x/R,rt=y-w/D;if(i.beginPath(),r){if(i.arc(o,a,u,S,L),v>0){const G=oe(T,L,o,a);i.arc(G.x,G.y,v,L,y+J)}const O=oe(D,y,o,a);if(i.lineTo(O.x,O.y),w>0){const G=oe(D,rt,o,a);i.arc(G.x,G.y,w,y+J,rt+Math.PI)}if(i.arc(o,a,d,y-w/d,b+x/d,!0),x>0){const G=oe(R,K,o,a);i.arc(G.x,G.y,x,K+Math.PI,b-J)}const X=oe(M,b,o,a);if(i.lineTo(X.x,X.y),_>0){const G=oe(M,S,o,a);i.arc(G.x,G.y,_,b-J,S)}}else{i.moveTo(o,a);const O=Math.cos(S)*u+o,X=Math.sin(S)*u+a;i.lineTo(O,X);const G=Math.cos(L)*u+o,Ct=Math.sin(L)*u+a;i.lineTo(G,Ct)}i.closePath()}function ru(i,t,e,n,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Wi(i,t,e,n,o+Y,s);for(let c=0;c<r;++c)i.fill();isNaN(a)||(l=o+a%Y,a%Y===0&&(l+=Y))}return Wi(i,t,e,n,l,s),i.fill(),l}function ou(i,t,e){const{x:n,y:s,startAngle:r,pixelMargin:o,fullCircles:a}=t,l=Math.max(t.outerRadius-o,0),c=t.innerRadius+o;let h;for(e&&Nr(i,t,r+Y),i.beginPath(),i.arc(n,s,c,r+Y,r,!0),h=0;h<a;++h)i.stroke();for(i.beginPath(),i.arc(n,s,l,r,r+Y),h=0;h<a;++h)i.stroke()}function au(i,t,e,n,s,r){const{options:o}=t,{borderWidth:a,borderJoinStyle:l}=o,c=o.borderAlign==="inner";a&&(c?(i.lineWidth=a*2,i.lineJoin=l||"round"):(i.lineWidth=a,i.lineJoin=l||"bevel"),t.fullCircles&&ou(i,t,c),c&&Nr(i,t,s),Wi(i,t,e,n,s,r),i.stroke())}class pn extends wt{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,n){const s=this.getProps(["x","y"],n),{angle:r,distance:o}=tr(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=this.options.spacing/2,g=C(u,l-a)>=Y||Te(r,a,l),p=Ht(o,c+d,h+d);return g&&p}getCenterPoint(t){const{x:e,y:n,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(s+r)/2,u=(o+a+c+l)/2;return{x:e+Math.cos(h)*u,y:n+Math.sin(h)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,s=(e.offset||0)/2,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>Y?Math.floor(n/Y):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=Q&&(a=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const l=ru(t,this,a,r,o);au(t,this,a,r,l,o),t.restore()}}pn.id="arc";pn.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};pn.defaultRoutes={backgroundColor:"backgroundColor"};function Wr(i,t,e=t){i.lineCap=C(e.borderCapStyle,t.borderCapStyle),i.setLineDash(C(e.borderDash,t.borderDash)),i.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),i.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=C(e.borderWidth,t.borderWidth),i.strokeStyle=C(e.borderColor,t.borderColor)}function lu(i,t,e){i.lineTo(e.x,e.y)}function cu(i){return i.stepped?Dl:i.tension||i.cubicInterpolationMode==="monotone"?Al:lu}function Vr(i,t,e={}){const n=i.length,{start:s=0,end:r=n-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),h=s<o&&r<o||s>a&&r>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function hu(i,t,e,n){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Vr(s,e,n),h=cu(r);let{move:u=!0,reverse:d}=n||{},f,g,p;for(f=0;f<=c;++f)g=s[(a+(d?c-f:f))%o],!g.skip&&(u?(i.moveTo(g.x,g.y),u=!1):h(i,p,g,d,r.stepped),p=g);return l&&(g=s[(a+(d?c:0))%o],h(i,p,g,d,r.stepped)),!!l}function uu(i,t,e,n){const s=t.points,{count:r,start:o,ilen:a}=Vr(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,u=0,d,f,g,p,m,b;const y=v=>(o+(c?a-v:v))%r,_=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(f=s[y(0)],i.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=s[y(d)],f.skip)continue;const v=f.x,x=f.y,w=v|0;w===g?(x<p?p=x:x>m&&(m=x),h=(u*h+v)/++u):(_(),i.lineTo(v,x),g=w,u=0,p=m=x),b=x}_()}function Vi(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?uu:hu}function du(i){return i.stepped?lc:i.tension||i.cubicInterpolationMode==="monotone"?cc:Kt}function fu(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),Wr(i,t.options),i.stroke(s)}function gu(i,t,e,n){const{segments:s,options:r}=t,o=Vi(t);for(const a of s)Wr(i,r,a.style),i.beginPath(),o(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const pu=typeof Path2D=="function";function mu(i,t,e,n){pu&&!t.options.segment?fu(i,t,e,n):gu(i,t,e,n)}class pi extends wt{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 n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;tc(this._points,n,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=yc(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,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],r=this.points,o=pc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=du(n);let c,h;for(c=0,h=o.length;c<h;++c){const{start:u,end:d}=o[c],f=r[u],g=r[d];if(f===g){a.push(f);continue}const p=Math.abs((s-f[e])/(g[e]-f[e])),m=l(f,g,p,n.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,n){return Vi(this)(t,this,e,n)}path(t,e,n){const s=this.segments,r=Vi(this);let o=this._loop;e=e||0,n=n||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+n-1});return!!o}draw(t,e,n,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),mu(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}pi.id="line";pi.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};pi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};pi.descriptors={_scriptable:!0,_indexable:i=>i!=="borderDash"&&i!=="fill"};function vs(i,t,e,n){const s=i.options,{[e]:r}=i.getProps([e],n);return Math.abs(t-r)<s.radius+s.hitRadius}class mn extends wt{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,n){const s=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return vs(this,t,"x",e)}inYRange(t,e){return vs(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!Oe(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,zi(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}mn.id="point";mn.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};mn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function jr(i,t){const{x:e,y:n,base:s,width:r,height:o}=i.getProps(["x","y","base","width","height"],t);let a,l,c,h,u;return i.horizontal?(u=o/2,a=Math.min(e,s),l=Math.max(e,s),c=n-u,h=n+u):(u=r/2,a=e-u,l=e+u,c=Math.min(n,s),h=Math.max(n,s)),{left:a,top:c,right:l,bottom:h}}function Wt(i,t,e,n){return i?0:lt(t,e,n)}function bu(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,r=fr(n);return{t:Wt(s.top,r.top,0,e),r:Wt(s.right,r.right,0,t),b:Wt(s.bottom,r.bottom,0,e),l:Wt(s.left,r.left,0,t)}}function yu(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,r=Qt(s),o=Math.min(t,e),a=i.borderSkipped,l=n||B(s);return{topLeft:Wt(!l||a.top||a.left,r.topLeft,0,o),topRight:Wt(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Wt(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Wt(!l||a.bottom||a.right,r.bottomRight,0,o)}}function xu(i){const t=jr(i),e=t.right-t.left,n=t.bottom-t.top,s=bu(i,e/2,n/2),r=yu(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function Di(i,t,e,n){const s=t===null,r=e===null,a=i&&!(s&&r)&&jr(i,n);return a&&(s||Ht(t,a.left,a.right))&&(r||Ht(e,a.top,a.bottom))}function _u(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function vu(i,t){i.rect(t.x,t.y,t.w,t.h)}function Ai(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,r=(i.x+i.w!==e.x+e.w?t:0)-n,o=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+r,h:i.h+o,radius:i.radius}}class bn extends wt{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:n,backgroundColor:s}}=this,{inner:r,outer:o}=xu(this),a=_u(o.radius)?Ce:vu;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,Ai(o,e,r)),t.clip(),a(t,Ai(r,-e,o)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,Ai(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return Di(this,t,e,n)}inXRange(t,e){return Di(this,t,null,e)}inYRange(t,e){return Di(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}bn.id="bar";bn.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};bn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};const ws=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},wu=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Ms extends wt{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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=$(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=nt(n.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ws(n,r);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(o,r,a,l)+10):(h=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let u=t;r.textAlign="left",r.textBaseline="middle";let d=-1,f=-h;return this.legendItems.forEach((g,p)=>{const m=n+e/2+r.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>o)&&(u+=h,c[c.length-(p>0?0:1)]=0,f+=h,d++),l[p]={left:0,top:f,row:d,width:m,height:s},c[c.length-1]+=m+a}),u}_fitCols(t,e,n,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=o-t;let u=a,d=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const y=n+e/2+r.measureText(m.text).width;b>0&&f+s+2*a>h&&(u+=d+a,c.push({width:d,height:f}),g+=d+a,p++,d=f=0),l[b]={left:g,top:f,col:p,width:y,height:s},d=Math.max(d,y),f+=s+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:r}}=this,o=ae(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=at(n,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=at(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=at(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=at(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;nn(t,this),this._draw(),sn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:r,labels:o}=t,a=E.color,l=ae(t.rtl,this.left,this.width),c=nt(o.font),{color:h,padding:u}=o,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=ws(o,d),y=function(M,T,S){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const L=C(S.lineWidth,1);if(s.fillStyle=C(S.fillStyle,a),s.lineCap=C(S.lineCap,"butt"),s.lineDashOffset=C(S.lineDashOffset,0),s.lineJoin=C(S.lineJoin,"miter"),s.lineWidth=L,s.strokeStyle=C(S.strokeStyle,a),s.setLineDash(C(S.lineDash,[])),o.usePointStyle){const R={radius:m*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:L},D=l.xPlus(M,p/2),K=T+f;dr(s,R,D,K,o.pointStyleWidth&&p)}else{const R=T+Math.max((d-m)/2,0),D=l.leftForLtr(M,p),K=Qt(S.borderRadius);s.beginPath(),Object.values(K).some(rt=>rt!==0)?Ce(s,{x:D,y:R,w:p,h:m,radius:K}):s.rect(D,R,p,m),s.fill(),L!==0&&s.stroke()}s.restore()},_=function(M,T,S){te(s,S.text,M,T+b/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},v=this.isHorizontal(),x=this._computeTitleHeight();v?g={x:at(r,this.left+u,this.right-n[0]),y:this.top+u+x,line:0}:g={x:this.left+u,y:at(r,this.top+x+u,this.bottom-e[0].height),line:0},vr(this.ctx,t.textDirection);const w=b+u;this.legendItems.forEach((M,T)=>{s.strokeStyle=M.fontColor||h,s.fillStyle=M.fontColor||h;const S=s.measureText(M.text).width,L=l.textAlign(M.textAlign||(M.textAlign=o.textAlign)),R=p+f+S;let D=g.x,K=g.y;l.setWidth(this.width),v?T>0&&D+R+u>this.right&&(K=g.y+=w,g.line++,D=g.x=at(r,this.left+u,this.right-n[g.line])):T>0&&K+w>this.bottom&&(D=g.x=D+e[g.line].width+u,g.line++,K=g.y=at(r,this.top+x+u,this.bottom-e[g.line].height));const rt=l.x(D);y(rt,K,M),D=sl(L,D+p+f,v?D+R:this.right,t.rtl),_(l.x(D),K,M),v?g.x+=R+u:g.y+=w}),wr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=nt(e.font),s=ct(e.padding);if(!e.display)return;const r=ae(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=n.size/2,c=s.top+l;let h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=at(t.align,u,this.right-d);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+at(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=at(a,u,u+d);o.textAlign=r.textAlign(Zi(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=n.string,te(o,e.text,f,h,n)}_computeTitleHeight(){const t=this.options.title,e=nt(t.font),n=ct(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,r;if(Ht(t,this.left,this.right)&&Ht(e,this.top,this.bottom)){for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(s=r[n],Ht(t,s.left,s.left+s.width)&&Ht(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!Mu(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=wu(s,n);s&&!r&&$(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!r&&$(e.onHover,[t,n,this],this)}else n&&$(e.onClick,[t,n,this],this)}}function Mu(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var ad={id:"legend",_element:Ms,start(i,t,e){const n=i.legend=new Ms({ctx:i.ctx,options:e,chart:i});bt.configure(i,n,e),bt.addBox(i,n)},stop(i){bt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;bt.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:r}}=i.legend.options;return i._getSortedDatasetMetas().map(o=>{const a=o.controller.getStyle(e?0:void 0),l=ct(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:n||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:o.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Yr extends wt{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 n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=q(n.text)?n.text.length:1;this._padding=ct(n.padding);const r=s*nt(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,h,u;return this.isHorizontal()?(h=at(a,n,r),u=e+t,c=r-n):(o.position==="left"?(h=n+t,u=at(a,s,e),l=Q*-.5):(h=r-t,u=at(a,e,s),l=Q*.5),c=s-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=nt(e.font),r=n.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);te(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Zi(e.align),textBaseline:"middle",translation:[o,a]})}}function ku(i,t){const e=new Yr({ctx:i.ctx,options:t,chart:i});bt.configure(i,e,t),bt.addBox(i,e),i.titleBlock=e}var ld={id:"title",_element:Yr,start(i,t,e){ku(i,e)},stop(i){const t=i.titleBlock;bt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;bt.configure(i,n,e),n.options=e},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 ke={average(i){if(!i.length)return!1;let t,e,n=0,s=0,r=0;for(t=0,e=i.length;t<e;++t){const o=i[t].element;if(o&&o.hasValue()){const a=o.tooltipPosition();n+=a.x,s+=a.y,++r}}return{x:n/r,y:s/r}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=i.length;r<o;++r){const l=i[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Ei(t,c);h<s&&(s=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function Mt(i,t){return t&&(q(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Lt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
18
18
  `)>-1?i.split(`
19
- `):i}function Pu(i,t){const{element:e,datasetIndex:n,index:s}=t,r=i.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:i,label:o,parsed:r.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function ks(i,t){const e=i.chart.ctx,{body:n,footer:s,title:r}=i,{boxWidth:o,boxHeight:a}=t,l=nt(t.bodyFont),c=nt(t.titleFont),h=nt(t.footerFont),u=r.length,d=s.length,f=n.length,g=ct(t.padding);let p=g.height,m=0,b=n.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let y=0;const _=function(v){m=Math.max(m,e.measureText(v).width+y)};return e.save(),e.font=c.string,j(i.title,_),e.font=l.string,j(i.beforeBody.concat(i.afterBody),_),y=t.displayColors?o+2+t.boxPadding:0,j(n,v=>{j(v.before,_),j(v.lines,_),j(v.after,_)}),y=0,e.font=h.string,j(i.footer,_),e.restore(),m+=g.width,{width:m,height:p}}function Su(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function Tu(i,t,e,n){const{x:s,width:r}=n,o=e.caretSize+e.caretPadding;if(i==="left"&&s+r+o>t.width||i==="right"&&s-r-o<0)return!0}function Ou(i,t,e,n){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=i;let c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Tu(c,i,t,e)&&(c="center"),c}function Ps(i,t,e){const n=e.yAlign||t.yAlign||Su(i,e);return{xAlign:e.xAlign||t.xAlign||Ou(i,t,e,n),yAlign:n}}function Cu(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Du(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function Ss(i,t,e,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=i,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=Gt(o);let g=Cu(t,a);const p=Du(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,d)+s:a==="right"&&(g+=Math.max(u,f)+s),{x:lt(g,0,n.width-t.width),y:lt(p,0,n.height-t.height)}}function qe(i,t,e){const n=ct(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function Ts(i){return Mt([],Lt(i))}function Au(i,t,e){return Ut(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Os(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}class ji extends wt{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||t._chart,this._chart=this.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,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,r=new kr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Au(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=n.beforeTitle.apply(this,[t]),r=n.title.apply(this,[t]),o=n.afterTitle.apply(this,[t]);let a=[];return a=Mt(a,Lt(s)),a=Mt(a,Lt(r)),a=Mt(a,Lt(o)),a}getBeforeBody(t,e){return Ts(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:n}=e,s=[];return j(t,r=>{const o={before:[],lines:[],after:[]},a=Os(n,r);Mt(o.before,Lt(a.beforeLabel.call(this,r))),Mt(o.lines,a.label.call(this,r)),Mt(o.after,Lt(a.afterLabel.call(this,r))),s.push(o)}),s}getAfterBody(t,e){return Ts(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:n}=e,s=n.beforeFooter.apply(this,[t]),r=n.footer.apply(this,[t]),o=n.afterFooter.apply(this,[t]);let a=[];return a=Mt(a,Lt(s)),a=Mt(a,Lt(r)),a=Mt(a,Lt(o)),a}_createItems(t){const e=this._active,n=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Pu(this.chart,e[l]));return t.filter&&(a=a.filter((h,u,d)=>t.filter(h,u,d,n))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,n))),j(a,h=>{const u=Os(t.callbacks,h);s.push(u.labelColor.call(this,h)),r.push(u.labelPointStyle.call(this,h)),o.push(u.labelTextColor.call(this,h))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=ke[n.position].call(this,s,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const l=this._size=ks(this,n),c=Object.assign({},a,l),h=Ps(this.chart,n,c),u=Ss(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const r=this.getCaretPosition(t,n,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=Gt(a),{x:d,y:f}=t,{width:g,height:p}=e;let m,b,y,_,v,x;return r==="center"?(v=f+p/2,s==="left"?(m=d,b=m-o,_=v+o,x=v-o):(m=d+g,b=m+o,_=v-o,x=v+o),y=m):(s==="left"?b=d+Math.max(l,h)+o:s==="right"?b=d+g-Math.max(c,u)-o:b=this.caretX,r==="top"?(_=f,v=_-o,m=b-o,y=b+o):(_=f+p,v=_+o,m=b+o,y=b-o),x=_),{x1:m,x2:b,x3:y,y1:_,y2:v,y3:x}}drawTitle(t,e,n){const s=this.title,r=s.length;let o,a,l;if(r){const c=ae(n.rtl,this.x,this.width);for(t.x=qe(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",o=nt(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,s,r){const o=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c,boxPadding:h}=r,u=nt(r.bodyFont),d=qe(this,"left",r),f=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=s.leftForLtr(f,c)+c/2,y=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,zi(t,m,b,y),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,zi(t,m,b,y)}else{t.lineWidth=B(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 m=s.leftForLtr(f,c-h),b=s.leftForLtr(s.xPlus(f,1),c-h-2),y=Gt(o.borderRadius);Object.values(y).some(_=>_!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Ce(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ce(t,{x:b,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=n,u=nt(n.bodyFont);let d=u.lineHeight,f=0;const g=ae(n.rtl,this.x,this.width),p=function(T){e.fillText(T,g.x(t.x+f),t.y+d/2),t.y+=d+r},m=g.textAlign(o);let b,y,_,v,x,w,M;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=qe(this,m,n),e.fillStyle=n.bodyColor,j(this.beforeBody,p),f=a&&m!=="right"?o==="center"?c/2+h:c+2+h:0,v=0,w=s.length;v<w;++v){for(b=s[v],y=this.labelTextColors[v],e.fillStyle=y,j(b.before,p),_=b.lines,a&&_.length&&(this._drawColorBox(e,t,v,g,n),d=Math.max(u.lineHeight,l)),x=0,M=_.length;x<M;++x)p(_[x]),d=u.lineHeight;j(b.after,p)}f=0,d=u.lineHeight,j(this.afterBody,p),t.y-=r}drawFooter(t,e,n){const s=this.footer,r=s.length;let o,a;if(r){const l=ae(n.rtl,this.x,this.width);for(t.x=qe(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",o=nt(n.footerFont),e.fillStyle=n.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:h}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=Gt(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+u,l),o==="top"&&this.drawCaret(t,e,n,s),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),o==="center"&&r==="right"&&this.drawCaret(t,e,n,s),e.lineTo(a+c,l+h-g),e.quadraticCurveTo(a+c,l+h,a+c-g,l+h),o==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),o==="center"&&r==="left"&&this.drawCaret(t,e,n,s),e.lineTo(a,l+u),e.quadraticCurveTo(a,l,a+u,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,r=n&&n.y;if(s||r){const o=ke[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=ks(this,t),l=Object.assign({},o,this._size),c=Ps(e,t,l),h=Ss(t,l,c,e);(s._to!==h.x||r._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=ct(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=n,this.drawBackground(r,t,s,e),vr(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),wr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Je(n,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,n),a=this._positionChanged(o,t),l=e||!Je(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e;const o=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:n,caretY:s,options:r}=this,o=ke[r.position].call(this,t,e);return o!==!1&&(n!==o.x||s!==o.y)}}ji.positioners=ke;var cd={id:"tooltip",_element:ji,positioners:ke,afterInit(i,t,e){e&&(i.tooltip=new ji({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",e)===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.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:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.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:{beforeTitle:Dt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:Dt,beforeBody:Dt,beforeLabel:Dt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return V(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.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(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Dt,afterBody:Dt,beforeFooter:Dt,footer:Dt,afterFooter:Dt}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Lu=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Ru(i,t,e,n){const s=i.indexOf(t);if(s===-1)return Lu(i,t,e,n);const r=i.lastIndexOf(t);return s!==r?e:s}const Eu=(i,t)=>i===null?null:lt(Math.round(i),0,t);class Yi extends ee{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:r}of e)n[s]===r&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(V(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:Ru(n,t,C(e,t),this._addedLabels),Eu(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?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}}Yi.id="category";Yi.defaults={ticks:{callback:Yi.prototype.getLabelForValue}};function Iu(i,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=i,f=r||1,g=h-1,{min:p,max:m}=t,b=!V(o),y=!V(a),_=!V(c),v=(m-p)/(u+1);let x=An((m-p)/g/f)*f,w,M,T,S;if(x<1e-14&&!b&&!y)return[{value:p},{value:m}];S=Math.ceil(m/x)-Math.floor(p/x),S>g&&(x=An(S*x/g/f)*f),V(l)||(w=Math.pow(10,l),x=Math.ceil(x*w)/w),s==="ticks"?(M=Math.floor(p/x)*x,T=Math.ceil(m/x)*x):(M=p,T=m),b&&y&&r&&Ga((a-o)/r,x/1e3)?(S=Math.round(Math.min((a-o)/x,h)),x=(a-o)/S,M=o,T=a):_?(M=b?o:M,T=y?a:T,S=c-1,x=(T-M)/S):(S=(T-M)/x,ve(S,Math.round(S),x/1e3)?S=Math.round(S):S=Math.ceil(S));const L=Math.max(Ln(x),Ln(M));w=Math.pow(10,V(l)?L:l),M=Math.round(M*w)/w,T=Math.round(T*w)/w;let R=0;for(b&&(d&&M!==o?(e.push({value:o}),M<o&&R++,ve(Math.round((M+R*x)*w)/w,o,Cs(o,v,i))&&R++):M<o&&R++);R<S;++R)e.push({value:Math.round((M+R*x)*w)/w});return y&&d&&T!==a?e.length&&ve(e[e.length-1].value,a,Cs(a,v,i))?e[e.length-1].value=a:e.push({value:a}):(!y||T===a)&&e.push({value:T}),e}function Cs(i,t,{horizontal:e,minRotation:n}){const s=_t(n),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+i).length;return Math.min(t/r,o)}class ai extends ee{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 V(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=n?r:l;if(t){const l=Ot(s),c=Ot(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,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:e.includeBounds!==!1},r=this._range||this,o=Iu(s,r);return t.bounds==="ticks"&&Js(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Re(t,this.chart.options.locale,this.options.ticks.format)}}class Ur extends ai{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ot(t)?t:0,this.max=ot(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=_t(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Ur.id="linear";Ur.defaults={ticks:{callback:fi.formatters.numeric}};function Ds(i){return i/Math.pow(10,Math.floor(mt(i)))===1}function Fu(i,t){const e=Math.floor(mt(t.max)),n=Math.ceil(t.max/Math.pow(10,e)),s=[];let r=pt(i.min,Math.pow(10,Math.floor(mt(t.min)))),o=Math.floor(mt(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:r,major:Ds(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o<e||o===e&&a<n);const c=pt(i.max,r);return s.push({value:c,major:Ds(r)}),s}class $r extends ee{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=ai.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return ot(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ot(t)?Math.max(0,t):null,this.max=ot(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const r=l=>n=t?n:l,o=l=>s=e?s:l,a=(l,c)=>Math.pow(10,Math.floor(mt(l))+c);n===s&&(n<=0?(r(1),o(10)):(r(a(n,-1)),o(a(s,1)))),n<=0&&r(a(s,-1)),s<=0&&o(a(n,1)),this._zero&&this.min!==this._suggestedMin&&n===a(this.min,0)&&r(a(n,-1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=Fu(e,this);return t.bounds==="ticks"&&Js(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":Re(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=mt(t),this._valueRange=mt(this.max)-mt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(mt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}$r.id="logarithmic";$r.defaults={ticks:{callback:fi.formatters.logarithmic,major:{enabled:!0}}};function Ui(i){const t=i.ticks;if(t.display&&i.display){const e=ct(t.backdropPadding);return C(t.font&&t.font.size,E.font.size)+e.height}return 0}function zu(i,t,e){return e=q(e)?e:[e],{w:Cl(i,t.string,e),h:e.length*t.lineHeight}}function As(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function Bu(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],r=i._pointLabels.length,o=i.options.pointLabels,a=o.centerPointLabels?G/r:0;for(let l=0;l<r;l++){const c=o.setContext(i.getPointLabelContext(l));s[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+s[l],a),u=nt(c.font),d=zu(i.ctx,u,i._pointLabels[l]);n[l]=d;const f=xt(i.getIndexAngle(l)+a),g=Math.round(Qi(f)),p=As(g,h.x,d.w,0,180),m=As(g,h.y,d.h,90,270);Hu(e,t,f,p,m)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Nu(i,n,s)}function Hu(i,t,e,n,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;n.start<t.l?(a=(t.l-n.start)/r,i.l=Math.min(i.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/r,i.r=Math.max(i.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,i.b=Math.max(i.b,t.b+l))}function Nu(i,t,e){const n=[],s=i._pointLabels.length,r=i.options,o=Ui(r)/2,a=i.drawingArea,l=r.pointLabels.centerPointLabels?G/s:0;for(let c=0;c<s;c++){const h=i.getPointPosition(c,a+o+e[c],l),u=Math.round(Qi(xt(h.angle+J))),d=t[c],f=ju(h.y,d.h,u),g=Wu(u),p=Vu(h.x,d.w,g);n.push({x:h.x,y:f,textAlign:g,left:p,top:f,right:p+d.w,bottom:f+d.h})}return n}function Wu(i){return i===0||i===180?"center":i<180?"left":"right"}function Vu(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function ju(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function Yu(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const r=n.setContext(i.getPointLabelContext(s)),o=nt(r.font),{x:a,y:l,textAlign:c,left:h,top:u,right:d,bottom:f}=i._pointLabelItems[s],{backdropColor:g}=r;if(!V(g)){const p=Gt(r.borderRadius),m=ct(r.backdropPadding);e.fillStyle=g;const b=h-m.left,y=u-m.top,_=d-h+m.width,v=f-u+m.height;Object.values(p).some(x=>x!==0)?(e.beginPath(),Ce(e,{x:b,y,w:_,h:v,radius:p}),e.fill()):e.fillRect(b,y,_,v)}te(e,i._pointLabels[s],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function Xr(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,Y);else{let r=i.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<n;o++)r=i.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function Uu(i,t,e,n){const s=i.ctx,r=t.circular,{color:o,lineWidth:a}=t;!r&&!n||!o||!a||e<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(t.borderDash),s.lineDashOffset=t.borderDashOffset,s.beginPath(),Xr(i,e,r,n),s.closePath(),s.stroke(),s.restore())}function $u(i,t,e){return Ut(i,{label:e,index:t,type:"pointLabel"})}class mi extends ai{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=ct(Ui(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ot(t)&&!isNaN(t)?t:0,this.max=ot(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ui(this.options))}generateTickLabels(t){ai.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=$(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?Bu(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=Y/(this._pointLabels.length||1),n=this.options.startAngle||0;return xt(t*e+_t(n))}getDistanceFromCenterForValue(t){if(V(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(V(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 n=e[t];return $u(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-J+n;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:n,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),Xr(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s}=e,r=this._pointLabels.length;let o,a,l;if(e.pointLabels.display&&Yu(this,r),s.display&&this.ticks.forEach((c,h)=>{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);const u=s.setContext(this.getContext(h-1));Uu(this,u,a,r)}}),n.display){for(t.save(),o=r-1;o>=0;o--){const c=n.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:u}=c;!u||!h||(t.lineWidth=u,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=nt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const u=ct(c.backdropPadding);t.fillRect(-o/2-u.left,-r-h.size/2-u.top,o+u.width,h.size+u.height)}te(t,a.label,0,-r,h,{color:c.color})}),t.restore()}drawTitle(){}}mi.id="radialLinear";mi.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:fi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}};mi.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};mi.descriptors={angleLines:{_fallback:"grid"}};const bi={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}},ut=Object.keys(bi);function Xu(i,t){return i-t}function Ls(i,t){if(V(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:r}=i._parseOpts;let o=t;return typeof n=="function"&&(o=n(o)),ot(o)||(o=typeof n=="string"?e.parse(o,n):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(le(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function Rs(i,t,e,n){const s=ut.length;for(let r=ut.indexOf(i);r<s-1;++r){const o=bi[ut[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=n)return ut[r]}return ut[s-1]}function qu(i,t,e,n,s){for(let r=ut.length-1;r>=ut.indexOf(e);r--){const o=ut[r];if(bi[o].common&&i._adapter.diff(s,n,o)>=t-1)return o}return ut[e?ut.indexOf(e):0]}function Ku(i){for(let t=ut.indexOf(i)+1,e=ut.length;t<e;++t)if(bi[ut[t]].common)return ut[t]}function Es(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=Gi(e,t),r=e[n]>=t?e[n]:e[s];i[r]=!0}}function Qu(i,t,e,n){const s=i._adapter,r=+s.startOf(t[0].value,n),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,n))l=e[a],l>=0&&(t[l].major=!0);return t}function Is(i,t,e){const n=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,n.push({value:a,major:!1});return r===0||!e?n:Qu(i,n,s,e)}class yi extends ee{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 n=t.time||(t.time={}),s=this._adapter=new Cr._date(t.adapters.date);s.init(e),_e(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Ls(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=ot(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),r=ot(r)&&!isNaN(r)?r:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=el(s,r,o);return this._unit=e.unit||(n.autoSkip?Rs(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):qu(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Ku(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Is(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t){let e=0,n=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=lt(e,0,o),n=lt(n,0,o),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,r=s.time,o=r.unit||Rs(r.minUnit,e,n,this._getLabelCapacity(e)),a=C(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=le(l)||l===!0,h={};let u=e,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":o),t.diff(n,e,o)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+o);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+t.add(d,a,o),f++)Es(h,d,g);return(d===n||s.bounds==="ticks"||f===1)&&Es(h,d,g),Object.keys(h).sort((p,m)=>p-m).map(p=>+p)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,s){const r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],h=l&&o[l],u=n[e],d=l&&h&&u&&u.major,f=this._adapter.format(t,s||(d?h:c)),g=r.ticks.callback;return g?$(g,[f,e,n],this):f}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=_t(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*r+a*o,h:n*o+a*r}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,r=this._tickFormatFunction(t,0,Is(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(Ls(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ir(t.sort(Xu))}}yi.id="time";yi.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function Ke(i,t,e){let n=0,s=i.length-1,r,o,a,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=Qt(i,"pos",t)),{pos:r,time:a}=i[n],{pos:o,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=Qt(i,"time",t)),{time:r,pos:a}=i[n],{time:o,pos:l}=i[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class qr extends yi{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=Ke(e,this.min),this._tableRange=Ke(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],r=[];let o,a,l,c,h;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,a=s.length;o<a;++o)h=s[o+1],l=s[o-1],c=s[o],Math.round((h+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Ke(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Ke(this._table,n*this._tableRange+this._minPos,!0)}}qr.id="timeseries";qr.defaults=yi.defaults;const Kr="label";function Fs(i,t){typeof i=="function"?i(t):i&&(i.current=t)}function Gu(i,t){Object.assign(i.options,t)}function Qr(i,t){i.labels=t}function Gr(i,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Kr;const n=[];i.datasets=t.map(s=>{const r=i.datasets.find(o=>o[e]===s[e]);return!r||!s.data||n.includes(r)?{...s}:(n.push(r),Object.assign(r,s),r)})}function Zu(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kr;const e={labels:[],datasets:[]};return Qr(e,i.labels),Gr(e,i.datasets,t),e}function Ju(i,t){let{height:e=150,width:n=300,redraw:s=!1,datasetIdKey:r,type:o,data:a,options:l,plugins:c=[],fallbackContent:h,updateMode:u,...d}=i;const f=kt.useRef(null),g=kt.useRef(),p=()=>{f.current&&(g.current=new gi(f.current,{type:o,data:Zu(a,r),options:l&&{...l},plugins:c}),Fs(t,g.current))},m=()=>{Fs(t,null),g.current&&(g.current.destroy(),g.current=null)};return kt.useEffect(()=>{!s&&g.current&&l&&Gu(g.current,l)},[s,l]),kt.useEffect(()=>{!s&&g.current&&Qr(g.current.config.data,a.labels)},[s,a.labels]),kt.useEffect(()=>{!s&&g.current&&a.datasets&&Gr(g.current.config.data,a.datasets,r)},[s,a.datasets]),kt.useEffect(()=>{g.current&&(s?(m(),setTimeout(p)):g.current.update(u))},[s,l,a.labels,a.datasets,u]),kt.useEffect(()=>{g.current&&(m(),setTimeout(p))},[o]),kt.useEffect(()=>(p(),()=>m()),[]),Ws.createElement("canvas",Object.assign({ref:f,role:"img",height:e,width:n},d),h)}const td=kt.forwardRef(Ju);function ed(i,t){return gi.register(t),kt.forwardRef((e,n)=>Ws.createElement(td,Object.assign({},e,{ref:n,type:i})))}const hd=ed("line",di);/*!
19
+ `):i}function Pu(i,t){const{element:e,datasetIndex:n,index:s}=t,r=i.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:i,label:o,parsed:r.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function ks(i,t){const e=i.chart.ctx,{body:n,footer:s,title:r}=i,{boxWidth:o,boxHeight:a}=t,l=nt(t.bodyFont),c=nt(t.titleFont),h=nt(t.footerFont),u=r.length,d=s.length,f=n.length,g=ct(t.padding);let p=g.height,m=0,b=n.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let y=0;const _=function(v){m=Math.max(m,e.measureText(v).width+y)};return e.save(),e.font=c.string,j(i.title,_),e.font=l.string,j(i.beforeBody.concat(i.afterBody),_),y=t.displayColors?o+2+t.boxPadding:0,j(n,v=>{j(v.before,_),j(v.lines,_),j(v.after,_)}),y=0,e.font=h.string,j(i.footer,_),e.restore(),m+=g.width,{width:m,height:p}}function Su(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function Tu(i,t,e,n){const{x:s,width:r}=n,o=e.caretSize+e.caretPadding;if(i==="left"&&s+r+o>t.width||i==="right"&&s-r-o<0)return!0}function Ou(i,t,e,n){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=i;let c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Tu(c,i,t,e)&&(c="center"),c}function Ps(i,t,e){const n=e.yAlign||t.yAlign||Su(i,e);return{xAlign:e.xAlign||t.xAlign||Ou(i,t,e,n),yAlign:n}}function Cu(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Du(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function Ss(i,t,e,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=i,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=Qt(o);let g=Cu(t,a);const p=Du(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,d)+s:a==="right"&&(g+=Math.max(u,f)+s),{x:lt(g,0,n.width-t.width),y:lt(p,0,n.height-t.height)}}function qe(i,t,e){const n=ct(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function Ts(i){return Mt([],Lt(i))}function Au(i,t,e){return Ut(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Os(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}class ji extends wt{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||t._chart,this._chart=this.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,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,r=new kr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Au(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=n.beforeTitle.apply(this,[t]),r=n.title.apply(this,[t]),o=n.afterTitle.apply(this,[t]);let a=[];return a=Mt(a,Lt(s)),a=Mt(a,Lt(r)),a=Mt(a,Lt(o)),a}getBeforeBody(t,e){return Ts(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:n}=e,s=[];return j(t,r=>{const o={before:[],lines:[],after:[]},a=Os(n,r);Mt(o.before,Lt(a.beforeLabel.call(this,r))),Mt(o.lines,a.label.call(this,r)),Mt(o.after,Lt(a.afterLabel.call(this,r))),s.push(o)}),s}getAfterBody(t,e){return Ts(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:n}=e,s=n.beforeFooter.apply(this,[t]),r=n.footer.apply(this,[t]),o=n.afterFooter.apply(this,[t]);let a=[];return a=Mt(a,Lt(s)),a=Mt(a,Lt(r)),a=Mt(a,Lt(o)),a}_createItems(t){const e=this._active,n=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Pu(this.chart,e[l]));return t.filter&&(a=a.filter((h,u,d)=>t.filter(h,u,d,n))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,n))),j(a,h=>{const u=Os(t.callbacks,h);s.push(u.labelColor.call(this,h)),r.push(u.labelPointStyle.call(this,h)),o.push(u.labelTextColor.call(this,h))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=ke[n.position].call(this,s,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const l=this._size=ks(this,n),c=Object.assign({},a,l),h=Ps(this.chart,n,c),u=Ss(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const r=this.getCaretPosition(t,n,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=Qt(a),{x:d,y:f}=t,{width:g,height:p}=e;let m,b,y,_,v,x;return r==="center"?(v=f+p/2,s==="left"?(m=d,b=m-o,_=v+o,x=v-o):(m=d+g,b=m+o,_=v-o,x=v+o),y=m):(s==="left"?b=d+Math.max(l,h)+o:s==="right"?b=d+g-Math.max(c,u)-o:b=this.caretX,r==="top"?(_=f,v=_-o,m=b-o,y=b+o):(_=f+p,v=_+o,m=b+o,y=b-o),x=_),{x1:m,x2:b,x3:y,y1:_,y2:v,y3:x}}drawTitle(t,e,n){const s=this.title,r=s.length;let o,a,l;if(r){const c=ae(n.rtl,this.x,this.width);for(t.x=qe(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",o=nt(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,s,r){const o=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c,boxPadding:h}=r,u=nt(r.bodyFont),d=qe(this,"left",r),f=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=s.leftForLtr(f,c)+c/2,y=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,zi(t,m,b,y),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,zi(t,m,b,y)}else{t.lineWidth=B(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 m=s.leftForLtr(f,c-h),b=s.leftForLtr(s.xPlus(f,1),c-h-2),y=Qt(o.borderRadius);Object.values(y).some(_=>_!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Ce(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ce(t,{x:b,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=n,u=nt(n.bodyFont);let d=u.lineHeight,f=0;const g=ae(n.rtl,this.x,this.width),p=function(T){e.fillText(T,g.x(t.x+f),t.y+d/2),t.y+=d+r},m=g.textAlign(o);let b,y,_,v,x,w,M;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=qe(this,m,n),e.fillStyle=n.bodyColor,j(this.beforeBody,p),f=a&&m!=="right"?o==="center"?c/2+h:c+2+h:0,v=0,w=s.length;v<w;++v){for(b=s[v],y=this.labelTextColors[v],e.fillStyle=y,j(b.before,p),_=b.lines,a&&_.length&&(this._drawColorBox(e,t,v,g,n),d=Math.max(u.lineHeight,l)),x=0,M=_.length;x<M;++x)p(_[x]),d=u.lineHeight;j(b.after,p)}f=0,d=u.lineHeight,j(this.afterBody,p),t.y-=r}drawFooter(t,e,n){const s=this.footer,r=s.length;let o,a;if(r){const l=ae(n.rtl,this.x,this.width);for(t.x=qe(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",o=nt(n.footerFont),e.fillStyle=n.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:h}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=Qt(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+u,l),o==="top"&&this.drawCaret(t,e,n,s),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),o==="center"&&r==="right"&&this.drawCaret(t,e,n,s),e.lineTo(a+c,l+h-g),e.quadraticCurveTo(a+c,l+h,a+c-g,l+h),o==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),o==="center"&&r==="left"&&this.drawCaret(t,e,n,s),e.lineTo(a,l+u),e.quadraticCurveTo(a,l,a+u,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,r=n&&n.y;if(s||r){const o=ke[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=ks(this,t),l=Object.assign({},o,this._size),c=Ps(e,t,l),h=Ss(t,l,c,e);(s._to!==h.x||r._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=ct(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=n,this.drawBackground(r,t,s,e),vr(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),wr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Je(n,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,n),a=this._positionChanged(o,t),l=e||!Je(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e;const o=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:n,caretY:s,options:r}=this,o=ke[r.position].call(this,t,e);return o!==!1&&(n!==o.x||s!==o.y)}}ji.positioners=ke;var cd={id:"tooltip",_element:ji,positioners:ke,afterInit(i,t,e){e&&(i.tooltip=new ji({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",e)===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.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:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.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:{beforeTitle:Dt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:Dt,beforeBody:Dt,beforeLabel:Dt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return V(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.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(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Dt,afterBody:Dt,beforeFooter:Dt,footer:Dt,afterFooter:Dt}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Lu=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Ru(i,t,e,n){const s=i.indexOf(t);if(s===-1)return Lu(i,t,e,n);const r=i.lastIndexOf(t);return s!==r?e:s}const Eu=(i,t)=>i===null?null:lt(Math.round(i),0,t);class Yi extends ee{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:r}of e)n[s]===r&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(V(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:Ru(n,t,C(e,t),this._addedLabels),Eu(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?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}}Yi.id="category";Yi.defaults={ticks:{callback:Yi.prototype.getLabelForValue}};function Iu(i,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=i,f=r||1,g=h-1,{min:p,max:m}=t,b=!V(o),y=!V(a),_=!V(c),v=(m-p)/(u+1);let x=An((m-p)/g/f)*f,w,M,T,S;if(x<1e-14&&!b&&!y)return[{value:p},{value:m}];S=Math.ceil(m/x)-Math.floor(p/x),S>g&&(x=An(S*x/g/f)*f),V(l)||(w=Math.pow(10,l),x=Math.ceil(x*w)/w),s==="ticks"?(M=Math.floor(p/x)*x,T=Math.ceil(m/x)*x):(M=p,T=m),b&&y&&r&&Qa((a-o)/r,x/1e3)?(S=Math.round(Math.min((a-o)/x,h)),x=(a-o)/S,M=o,T=a):_?(M=b?o:M,T=y?a:T,S=c-1,x=(T-M)/S):(S=(T-M)/x,ve(S,Math.round(S),x/1e3)?S=Math.round(S):S=Math.ceil(S));const L=Math.max(Ln(x),Ln(M));w=Math.pow(10,V(l)?L:l),M=Math.round(M*w)/w,T=Math.round(T*w)/w;let R=0;for(b&&(d&&M!==o?(e.push({value:o}),M<o&&R++,ve(Math.round((M+R*x)*w)/w,o,Cs(o,v,i))&&R++):M<o&&R++);R<S;++R)e.push({value:Math.round((M+R*x)*w)/w});return y&&d&&T!==a?e.length&&ve(e[e.length-1].value,a,Cs(a,v,i))?e[e.length-1].value=a:e.push({value:a}):(!y||T===a)&&e.push({value:T}),e}function Cs(i,t,{horizontal:e,minRotation:n}){const s=_t(n),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+i).length;return Math.min(t/r,o)}class ai extends ee{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 V(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=n?r:l;if(t){const l=Ot(s),c=Ot(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,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:e.includeBounds!==!1},r=this._range||this,o=Iu(s,r);return t.bounds==="ticks"&&Js(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Re(t,this.chart.options.locale,this.options.ticks.format)}}class Ur extends ai{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ot(t)?t:0,this.max=ot(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=_t(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Ur.id="linear";Ur.defaults={ticks:{callback:fi.formatters.numeric}};function Ds(i){return i/Math.pow(10,Math.floor(mt(i)))===1}function Fu(i,t){const e=Math.floor(mt(t.max)),n=Math.ceil(t.max/Math.pow(10,e)),s=[];let r=pt(i.min,Math.pow(10,Math.floor(mt(t.min)))),o=Math.floor(mt(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:r,major:Ds(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o<e||o===e&&a<n);const c=pt(i.max,r);return s.push({value:c,major:Ds(r)}),s}class $r extends ee{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=ai.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return ot(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ot(t)?Math.max(0,t):null,this.max=ot(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const r=l=>n=t?n:l,o=l=>s=e?s:l,a=(l,c)=>Math.pow(10,Math.floor(mt(l))+c);n===s&&(n<=0?(r(1),o(10)):(r(a(n,-1)),o(a(s,1)))),n<=0&&r(a(s,-1)),s<=0&&o(a(n,1)),this._zero&&this.min!==this._suggestedMin&&n===a(this.min,0)&&r(a(n,-1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=Fu(e,this);return t.bounds==="ticks"&&Js(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":Re(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=mt(t),this._valueRange=mt(this.max)-mt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(mt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}$r.id="logarithmic";$r.defaults={ticks:{callback:fi.formatters.logarithmic,major:{enabled:!0}}};function Ui(i){const t=i.ticks;if(t.display&&i.display){const e=ct(t.backdropPadding);return C(t.font&&t.font.size,E.font.size)+e.height}return 0}function zu(i,t,e){return e=q(e)?e:[e],{w:Cl(i,t.string,e),h:e.length*t.lineHeight}}function As(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function Bu(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],r=i._pointLabels.length,o=i.options.pointLabels,a=o.centerPointLabels?Q/r:0;for(let l=0;l<r;l++){const c=o.setContext(i.getPointLabelContext(l));s[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+s[l],a),u=nt(c.font),d=zu(i.ctx,u,i._pointLabels[l]);n[l]=d;const f=xt(i.getIndexAngle(l)+a),g=Math.round(Gi(f)),p=As(g,h.x,d.w,0,180),m=As(g,h.y,d.h,90,270);Hu(e,t,f,p,m)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Nu(i,n,s)}function Hu(i,t,e,n,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;n.start<t.l?(a=(t.l-n.start)/r,i.l=Math.min(i.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/r,i.r=Math.max(i.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,i.b=Math.max(i.b,t.b+l))}function Nu(i,t,e){const n=[],s=i._pointLabels.length,r=i.options,o=Ui(r)/2,a=i.drawingArea,l=r.pointLabels.centerPointLabels?Q/s:0;for(let c=0;c<s;c++){const h=i.getPointPosition(c,a+o+e[c],l),u=Math.round(Gi(xt(h.angle+J))),d=t[c],f=ju(h.y,d.h,u),g=Wu(u),p=Vu(h.x,d.w,g);n.push({x:h.x,y:f,textAlign:g,left:p,top:f,right:p+d.w,bottom:f+d.h})}return n}function Wu(i){return i===0||i===180?"center":i<180?"left":"right"}function Vu(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function ju(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function Yu(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const r=n.setContext(i.getPointLabelContext(s)),o=nt(r.font),{x:a,y:l,textAlign:c,left:h,top:u,right:d,bottom:f}=i._pointLabelItems[s],{backdropColor:g}=r;if(!V(g)){const p=Qt(r.borderRadius),m=ct(r.backdropPadding);e.fillStyle=g;const b=h-m.left,y=u-m.top,_=d-h+m.width,v=f-u+m.height;Object.values(p).some(x=>x!==0)?(e.beginPath(),Ce(e,{x:b,y,w:_,h:v,radius:p}),e.fill()):e.fillRect(b,y,_,v)}te(e,i._pointLabels[s],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function Xr(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,Y);else{let r=i.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<n;o++)r=i.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function Uu(i,t,e,n){const s=i.ctx,r=t.circular,{color:o,lineWidth:a}=t;!r&&!n||!o||!a||e<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(t.borderDash),s.lineDashOffset=t.borderDashOffset,s.beginPath(),Xr(i,e,r,n),s.closePath(),s.stroke(),s.restore())}function $u(i,t,e){return Ut(i,{label:e,index:t,type:"pointLabel"})}class mi extends ai{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=ct(Ui(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ot(t)&&!isNaN(t)?t:0,this.max=ot(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ui(this.options))}generateTickLabels(t){ai.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=$(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?Bu(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=Y/(this._pointLabels.length||1),n=this.options.startAngle||0;return xt(t*e+_t(n))}getDistanceFromCenterForValue(t){if(V(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(V(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 n=e[t];return $u(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-J+n;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:n,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),Xr(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s}=e,r=this._pointLabels.length;let o,a,l;if(e.pointLabels.display&&Yu(this,r),s.display&&this.ticks.forEach((c,h)=>{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);const u=s.setContext(this.getContext(h-1));Uu(this,u,a,r)}}),n.display){for(t.save(),o=r-1;o>=0;o--){const c=n.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:u}=c;!u||!h||(t.lineWidth=u,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=nt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const u=ct(c.backdropPadding);t.fillRect(-o/2-u.left,-r-h.size/2-u.top,o+u.width,h.size+u.height)}te(t,a.label,0,-r,h,{color:c.color})}),t.restore()}drawTitle(){}}mi.id="radialLinear";mi.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:fi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}};mi.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};mi.descriptors={angleLines:{_fallback:"grid"}};const bi={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}},ut=Object.keys(bi);function Xu(i,t){return i-t}function Ls(i,t){if(V(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:r}=i._parseOpts;let o=t;return typeof n=="function"&&(o=n(o)),ot(o)||(o=typeof n=="string"?e.parse(o,n):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(le(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function Rs(i,t,e,n){const s=ut.length;for(let r=ut.indexOf(i);r<s-1;++r){const o=bi[ut[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=n)return ut[r]}return ut[s-1]}function qu(i,t,e,n,s){for(let r=ut.length-1;r>=ut.indexOf(e);r--){const o=ut[r];if(bi[o].common&&i._adapter.diff(s,n,o)>=t-1)return o}return ut[e?ut.indexOf(e):0]}function Ku(i){for(let t=ut.indexOf(i)+1,e=ut.length;t<e;++t)if(bi[ut[t]].common)return ut[t]}function Es(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=Qi(e,t),r=e[n]>=t?e[n]:e[s];i[r]=!0}}function Gu(i,t,e,n){const s=i._adapter,r=+s.startOf(t[0].value,n),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,n))l=e[a],l>=0&&(t[l].major=!0);return t}function Is(i,t,e){const n=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,n.push({value:a,major:!1});return r===0||!e?n:Gu(i,n,s,e)}class yi extends ee{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 n=t.time||(t.time={}),s=this._adapter=new Cr._date(t.adapters.date);s.init(e),_e(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Ls(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=ot(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),r=ot(r)&&!isNaN(r)?r:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=el(s,r,o);return this._unit=e.unit||(n.autoSkip?Rs(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):qu(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Ku(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Is(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t){let e=0,n=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=lt(e,0,o),n=lt(n,0,o),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,r=s.time,o=r.unit||Rs(r.minUnit,e,n,this._getLabelCapacity(e)),a=C(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=le(l)||l===!0,h={};let u=e,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":o),t.diff(n,e,o)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+o);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+t.add(d,a,o),f++)Es(h,d,g);return(d===n||s.bounds==="ticks"||f===1)&&Es(h,d,g),Object.keys(h).sort((p,m)=>p-m).map(p=>+p)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,s){const r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],h=l&&o[l],u=n[e],d=l&&h&&u&&u.major,f=this._adapter.format(t,s||(d?h:c)),g=r.ticks.callback;return g?$(g,[f,e,n],this):f}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=_t(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*r+a*o,h:n*o+a*r}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,r=this._tickFormatFunction(t,0,Is(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(Ls(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ir(t.sort(Xu))}}yi.id="time";yi.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function Ke(i,t,e){let n=0,s=i.length-1,r,o,a,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=Gt(i,"pos",t)),{pos:r,time:a}=i[n],{pos:o,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=Gt(i,"time",t)),{time:r,pos:a}=i[n],{time:o,pos:l}=i[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class qr extends yi{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=Ke(e,this.min),this._tableRange=Ke(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],r=[];let o,a,l,c,h;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,a=s.length;o<a;++o)h=s[o+1],l=s[o-1],c=s[o],Math.round((h+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Ke(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Ke(this._table,n*this._tableRange+this._minPos,!0)}}qr.id="timeseries";qr.defaults=yi.defaults;const Kr="label";function Fs(i,t){typeof i=="function"?i(t):i&&(i.current=t)}function Qu(i,t){Object.assign(i.options,t)}function Gr(i,t){i.labels=t}function Qr(i,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Kr;const n=[];i.datasets=t.map(s=>{const r=i.datasets.find(o=>o[e]===s[e]);return!r||!s.data||n.includes(r)?{...s}:(n.push(r),Object.assign(r,s),r)})}function Zu(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kr;const e={labels:[],datasets:[]};return Gr(e,i.labels),Qr(e,i.datasets,t),e}function Ju(i,t){let{height:e=150,width:n=300,redraw:s=!1,datasetIdKey:r,type:o,data:a,options:l,plugins:c=[],fallbackContent:h,updateMode:u,...d}=i;const f=kt.useRef(null),g=kt.useRef(),p=()=>{f.current&&(g.current=new gi(f.current,{type:o,data:Zu(a,r),options:l&&{...l},plugins:c}),Fs(t,g.current))},m=()=>{Fs(t,null),g.current&&(g.current.destroy(),g.current=null)};return kt.useEffect(()=>{!s&&g.current&&l&&Qu(g.current,l)},[s,l]),kt.useEffect(()=>{!s&&g.current&&Gr(g.current.config.data,a.labels)},[s,a.labels]),kt.useEffect(()=>{!s&&g.current&&a.datasets&&Qr(g.current.config.data,a.datasets,r)},[s,a.datasets]),kt.useEffect(()=>{g.current&&(s?(m(),setTimeout(p)):g.current.update(u))},[s,l,a.labels,a.datasets,u]),kt.useEffect(()=>{g.current&&(m(),setTimeout(p))},[o]),kt.useEffect(()=>(p(),()=>m()),[]),Ws.createElement("canvas",Object.assign({ref:f,role:"img",height:e,width:n},d),h)}const td=kt.forwardRef(Ju);function ed(i,t){return gi.register(t),kt.forwardRef((e,n)=>Ws.createElement(td,Object.assign({},e,{ref:n,type:i})))}const hd=ed("line",di);/*!
20
20
  * chartjs-adapter-date-fns v3.0.0
21
21
  * https://www.chartjs.org
22
22
  * (c) 2022 chartjs-adapter-date-fns Contributors