plutonium 0.64.0 → 0.65.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.
- checksums.yaml +4 -4
- data/.claude/skills/plutonium/SKILL.md +4 -1
- data/.claude/skills/plutonium-app/SKILL.md +14 -0
- data/.claude/skills/plutonium-dashboard/SKILL.md +161 -0
- data/.claude/skills/plutonium-resource/SKILL.md +94 -14
- data/.claude/skills/plutonium-ui/SKILL.md +22 -1
- data/CHANGELOG.md +59 -0
- data/CLAUDE.md +282 -210
- data/SECURITY.md +1 -1
- data/app/assets/plutonium-charts.js +20604 -0
- data/app/assets/plutonium-charts.js.map +7 -0
- data/app/assets/plutonium-charts.min.js +41 -0
- data/app/assets/plutonium-charts.min.js.map +7 -0
- data/app/assets/plutonium.css +1 -1
- data/app/assets/plutonium.js +794 -629
- data/app/assets/plutonium.js.map +4 -4
- data/app/assets/plutonium.min.js +48 -48
- data/app/assets/plutonium.min.js.map +4 -4
- data/app/views/plutonium/_flash_alerts.html.erb +2 -2
- data/app/views/plutonium/_resource_header.html.erb +2 -2
- data/app/views/plutonium/_resource_sidebar.html.erb +11 -2
- data/app/views/plutonium/_toast.html.erb +2 -2
- data/app/views/rodauth/_login_form.html.erb +1 -1
- data/app/views/rodauth/_password_visibility.html.erb +1 -1
- data/app/views/rodauth/add_recovery_codes.html.erb +2 -2
- data/app/views/rodauth/change_login.html.erb +2 -2
- data/app/views/rodauth/create_account.html.erb +4 -4
- data/app/views/rodauth/reset_password_request.html.erb +1 -1
- data/app/views/rodauth/verify_account_resend.html.erb +1 -1
- data/app/views/rodauth/webauthn_remove.html.erb +1 -1
- data/config/brakeman.ignore +4 -4
- data/config/initializers/rabl.rb +0 -40
- data/config/locales/en/api_client.yml +22 -0
- data/config/locales/en/async.yml +34 -0
- data/config/locales/en/dashboard.yml +25 -0
- data/config/locales/en/invites.yml +37 -0
- data/config/locales/en/js.yml +40 -0
- data/config/locales/en/kanban.yml +28 -0
- data/config/locales/en/plutonium.yml +26 -0
- data/config/locales/en/positioning.yml +14 -0
- data/config/locales/en/profile.yml +29 -0
- data/config/locales/en/resource.yml +60 -0
- data/config/locales/en/ui.yml +93 -0
- data/config/locales/en/wizard.yml +46 -0
- data/docs/.vitepress/config.ts +34 -1
- data/docs/.vitepress/theme/components/HomeHero.vue +1 -1
- data/docs/.vitepress/theme/components/HomeInTheBox.vue +14 -0
- data/docs/.vitepress/theme/custom.css +34 -377
- data/docs/blog/introducing-plutonium-dashboards.md +175 -0
- data/docs/blog/introducing-plutonium-i18n.md +91 -0
- data/docs/blog/introducing-plutonium.md +4 -5
- data/docs/blog/whats-new-async-kanban-wizards.md +1 -1
- data/docs/guides/dashboards.md +300 -0
- data/docs/guides/index.md +1 -0
- data/docs/guides/kanban.md +2 -2
- data/docs/public/images/blog/dashboards-card-error.png +0 -0
- data/docs/public/images/blog/dashboards-loading.png +0 -0
- data/docs/public/images/blog/dashboards-overview.png +0 -0
- data/docs/public/images/blog/dashboards-sidebar.png +0 -0
- data/docs/public/images/blog/i18n-es-admin.png +0 -0
- data/docs/public/images/guides/dashboard-card-error.png +0 -0
- data/docs/public/images/guides/dashboard-loading.png +0 -0
- data/docs/public/images/guides/dashboard-overview.png +0 -0
- data/docs/public/images/guides/dashboard-sidebar.png +0 -0
- data/docs/reference/app/generators.md +2 -2
- data/docs/reference/app/portals.md +2 -0
- data/docs/reference/configuration.md +84 -27
- data/docs/reference/dashboard/dsl.md +123 -0
- data/docs/reference/dashboard/index.md +35 -0
- data/docs/reference/dashboard/registration.md +76 -0
- data/docs/reference/i18n.md +239 -0
- data/docs/reference/index.md +10 -1
- data/docs/reference/kanban/dsl.md +1 -1
- data/docs/reference/kanban/positioning.md +2 -2
- data/docs/reference/resource/actions.md +1 -1
- data/docs/reference/resource/definition.md +96 -18
- data/docs/reference/resource/export.md +5 -1
- data/docs/reference/resource/index.md +2 -0
- data/docs/reference/{positioning.md → resource/positioning.md} +2 -1
- data/docs/reference/resource/query.md +2 -0
- data/docs/reference/ui/assets.md +8 -0
- data/docs/reference/ui/displays.md +5 -8
- data/docs/reference/ui/index.md +1 -1
- data/docs/reference/wizard/dsl.md +2 -2
- data/esbuild.config.js +5 -2
- data/gemfiles/rails_7.gemfile.lock +2 -2
- data/gemfiles/rails_8.1.gemfile.lock +1 -1
- data/lib/active_model/validations/array_validator.rb +1 -1
- data/lib/active_model/validations/attached_validator.rb +1 -1
- data/lib/active_model/validations/url_validator.rb +2 -2
- data/lib/generators/pu/core/assets/assets_generator.rb +36 -21
- data/lib/generators/pu/core/assets/templates/postcss.config.js +1 -1
- data/lib/generators/pu/core/update/update_generator.rb +3 -2
- data/lib/generators/pu/dashboard/dashboard_generator.rb +96 -0
- data/lib/generators/pu/dashboard/templates/dashboard.rb.tt +25 -0
- data/lib/generators/pu/docker/install/install_generator.rb +58 -0
- data/lib/generators/pu/docker/install/templates/Dockerfile.dev.tt +18 -3
- data/lib/generators/pu/docker/install/templates/Dockerfile.tt +20 -5
- data/lib/generators/pu/docker/install/templates/{docker-compose.yml → docker-compose.yml.tt} +1 -1
- data/lib/generators/pu/gem/dotenv/dotenv_generator.rb +1 -1
- data/lib/generators/pu/invites/invitable_generator.rb +18 -1
- data/lib/generators/pu/lib/plutonium_generators/concerns/actions.rb +0 -95
- data/lib/generators/pu/lib/plutonium_generators/concerns/js_package_manager.rb +146 -0
- data/lib/generators/pu/lib/plutonium_generators/generator.rb +1 -17
- data/lib/generators/pu/pkg/package/package_generator.rb +1 -0
- data/lib/generators/pu/pkg/package/templates/config/locales/en.yml.tt +28 -0
- data/lib/generators/pu/pkg/portal/portal_generator.rb +1 -0
- data/lib/generators/pu/pkg/portal/templates/config/locales/en.yml.tt +30 -0
- data/lib/generators/pu/res/scaffold/scaffold_generator.rb +0 -8
- data/lib/generators/pu/rodauth/concerns/feature_selector.rb +0 -18
- data/lib/plutonium/action/base.rb +27 -3
- data/lib/plutonium/action/interactive.rb +17 -4
- data/lib/plutonium/api_client/concerns/create_api_client.rb +12 -11
- data/lib/plutonium/api_client/concerns/disable_api_client.rb +3 -3
- data/lib/plutonium/auth/sequel_adapter.rb +1 -1
- data/lib/plutonium/configuration.rb +5 -0
- data/lib/plutonium/core/controller.rb +25 -1
- data/lib/plutonium/core/controllers/authorizable.rb +1 -1
- data/lib/plutonium/dashboard/base.rb +114 -0
- data/lib/plutonium/dashboard/card.rb +200 -0
- data/lib/plutonium/dashboard/controller.rb +101 -0
- data/lib/plutonium/dashboard/dsl.rb +104 -0
- data/lib/plutonium/dashboard/register.rb +40 -0
- data/lib/plutonium/dashboard/route_resolution.rb +30 -0
- data/lib/plutonium/dashboard.rb +42 -0
- data/lib/plutonium/definition/actions.rb +6 -1
- data/lib/plutonium/definition/base.rb +41 -3
- data/lib/plutonium/definition/index_views.rb +1 -1
- data/lib/plutonium/definition/positioning.rb +1 -1
- data/lib/plutonium/definition/presentable.rb +2 -2
- data/lib/plutonium/helpers/assets_helper.rb +15 -2
- data/lib/plutonium/helpers/display_helper.rb +10 -2
- data/lib/plutonium/interaction/async/context.rb +6 -8
- data/lib/plutonium/interaction/async/executor.rb +6 -7
- data/lib/plutonium/interaction/async/run.rb +2 -2
- data/lib/plutonium/interaction/async/run_definition.rb +1 -1
- data/lib/plutonium/interaction/base.rb +2 -0
- data/lib/plutonium/interaction/concerns/dispatchable.rb +15 -3
- data/lib/plutonium/invites/concerns/cancel_invite.rb +3 -3
- data/lib/plutonium/invites/concerns/invite_token.rb +25 -7
- data/lib/plutonium/invites/concerns/invite_user.rb +10 -5
- data/lib/plutonium/invites/concerns/resend_invite.rb +4 -4
- data/lib/plutonium/invites/controller.rb +11 -11
- data/lib/plutonium/kanban/column.rb +13 -3
- data/lib/plutonium/kanban/dsl.rb +7 -4
- data/lib/plutonium/models/has_cents.rb +1 -1
- data/lib/plutonium/profile/security_section.rb +10 -18
- data/lib/plutonium/query/filter.rb +10 -1
- data/lib/plutonium/query/filters/association.rb +27 -2
- data/lib/plutonium/query/filters/boolean.rb +4 -4
- data/lib/plutonium/query/filters/date.rb +4 -17
- data/lib/plutonium/query/filters/date_range.rb +2 -2
- data/lib/plutonium/query/filters/select.rb +10 -1
- data/lib/plutonium/query/filters/text.rb +9 -12
- data/lib/plutonium/railtie.rb +17 -0
- data/lib/plutonium/resource/controller.rb +10 -5
- data/lib/plutonium/resource/controllers/crud_actions.rb +17 -20
- data/lib/plutonium/resource/controllers/export_csv.rb +19 -9
- data/lib/plutonium/resource/controllers/kanban_actions.rb +16 -16
- data/lib/plutonium/resource/controllers/position_actions.rb +5 -5
- data/lib/plutonium/resource/controllers/typeahead.rb +24 -1
- data/lib/plutonium/resource/query_object.rb +30 -3
- data/lib/plutonium/routing/dashboard_registration.rb +137 -0
- data/lib/plutonium/routing/resource_registration.rb +5 -0
- data/lib/plutonium/routing/route_set_extensions.rb +2 -1
- data/lib/plutonium/translation.rb +227 -0
- data/lib/plutonium/ui/actions_dropdown.rb +2 -2
- data/lib/plutonium/ui/breadcrumbs.rb +3 -3
- data/lib/plutonium/ui/color_mode_selector.rb +1 -1
- data/lib/plutonium/ui/component/behaviour.rb +46 -0
- data/lib/plutonium/ui/component/methods.rb +4 -0
- data/lib/plutonium/ui/dashboard/board.rb +80 -0
- data/lib/plutonium/ui/dashboard/card.rb +127 -0
- data/lib/plutonium/ui/dashboard/chart.rb +43 -0
- data/lib/plutonium/ui/dashboard/custom.rb +32 -0
- data/lib/plutonium/ui/dashboard/frame.rb +25 -0
- data/lib/plutonium/ui/dashboard/metric.rb +137 -0
- data/lib/plutonium/ui/dashboard/skeleton.rb +40 -0
- data/lib/plutonium/ui/display/components/attachment.rb +1 -1
- data/lib/plutonium/ui/display/components/badge.rb +7 -1
- data/lib/plutonium/ui/display/components/boolean.rb +2 -2
- data/lib/plutonium/ui/display/resource.rb +23 -16
- data/lib/plutonium/ui/export_button.rb +3 -3
- data/lib/plutonium/ui/form/components/key_value_store.rb +5 -5
- data/lib/plutonium/ui/form/components/password.rb +2 -2
- data/lib/plutonium/ui/form/components/resource_select.rb +27 -0
- data/lib/plutonium/ui/form/components/secure_association.rb +2 -0
- data/lib/plutonium/ui/form/components/uppy.rb +11 -3
- data/lib/plutonium/ui/form/concerns/renders_nested_resource_fields.rb +1 -1
- data/lib/plutonium/ui/form/concerns/renders_repeater_row_controls.rb +5 -4
- data/lib/plutonium/ui/form/concerns/renders_structured_inputs.rb +1 -1
- data/lib/plutonium/ui/form/query.rb +8 -8
- data/lib/plutonium/ui/form/resource.rb +54 -26
- data/lib/plutonium/ui/frame_navigator_panel.rb +4 -4
- data/lib/plutonium/ui/grid/card.rb +3 -3
- data/lib/plutonium/ui/grid/resource.rb +3 -3
- data/lib/plutonium/ui/interaction/async/run_progress.rb +6 -6
- data/lib/plutonium/ui/interaction/async/running_banner.rb +2 -2
- data/lib/plutonium/ui/kanban/column.rb +6 -6
- data/lib/plutonium/ui/layout/base.rb +19 -1
- data/lib/plutonium/ui/layout/header.rb +1 -1
- data/lib/plutonium/ui/layout/icon_rail.rb +4 -4
- data/lib/plutonium/ui/layout/rodauth_layout.rb +1 -1
- data/lib/plutonium/ui/layout/sidebar.rb +1 -1
- data/lib/plutonium/ui/layout/topbar.rb +2 -2
- data/lib/plutonium/ui/modal/base.rb +4 -4
- data/lib/plutonium/ui/nav_grid_menu.rb +1 -1
- data/lib/plutonium/ui/nav_user.rb +2 -2
- data/lib/plutonium/ui/page/base.rb +10 -2
- data/lib/plutonium/ui/page/dashboard.rb +54 -0
- data/lib/plutonium/ui/page/edit.rb +3 -3
- data/lib/plutonium/ui/page/interactive_action.rb +2 -2
- data/lib/plutonium/ui/page/new.rb +3 -3
- data/lib/plutonium/ui/page/show.rb +2 -2
- data/lib/plutonium/ui/page/wizard.rb +22 -16
- data/lib/plutonium/ui/page/wizard_chooser.rb +10 -10
- data/lib/plutonium/ui/page/wizard_completed.rb +2 -2
- data/lib/plutonium/ui/skeleton_table.rb +1 -1
- data/lib/plutonium/ui/table/base.rb +2 -2
- data/lib/plutonium/ui/table/components/attachment.rb +1 -1
- data/lib/plutonium/ui/table/components/bulk_actions_toolbar.rb +19 -3
- data/lib/plutonium/ui/table/components/drag_handle.rb +3 -3
- data/lib/plutonium/ui/table/components/filter_form.rb +11 -10
- data/lib/plutonium/ui/table/components/filter_pills.rb +4 -4
- data/lib/plutonium/ui/table/components/pagy_info.rb +61 -17
- data/lib/plutonium/ui/table/components/pagy_pagination.rb +9 -5
- data/lib/plutonium/ui/table/components/row_actions_dropdown.rb +1 -1
- data/lib/plutonium/ui/table/components/scopes_bar.rb +6 -2
- data/lib/plutonium/ui/table/components/scopes_pills.rb +3 -3
- data/lib/plutonium/ui/table/components/selection_column.rb +1 -1
- data/lib/plutonium/ui/table/components/toolbar.rb +2 -2
- data/lib/plutonium/ui/table/components/view_switcher.rb +12 -8
- data/lib/plutonium/ui/table/resource.rb +53 -17
- data/lib/plutonium/ui/wizard/review.rb +7 -7
- data/lib/plutonium/ui/wizard/stepper.rb +1 -1
- data/lib/plutonium/ui/wizard/summary_display.rb +6 -0
- data/lib/plutonium/version.rb +1 -1
- data/lib/plutonium/wizard/base.rb +2 -0
- data/lib/plutonium/wizard/driving.rb +8 -2
- data/lib/plutonium/wizard/dsl.rb +4 -2
- data/lib/plutonium/wizard/field_importer.rb +1 -8
- data/lib/plutonium/wizard/review_step.rb +8 -1
- data/lib/plutonium/wizard/step.rb +14 -3
- data/package.json +4 -2
- data/plutonium.gemspec +4 -1
- data/postcss-gem-import.cjs +34 -0
- data/postcss-gem-import.js +3 -28
- data/src/css/components.css +91 -0
- data/src/css/slim_select.css +0 -38
- data/src/css/tokens.css +24 -0
- data/src/js/controllers/attachment_input_controller.js +15 -6
- data/src/js/controllers/chart_controller.js +162 -0
- data/src/js/controllers/clipboard_controller.js +3 -2
- data/src/js/controllers/dirty_form_guard_controller.js +4 -3
- data/src/js/controllers/easymde_controller.js +3 -0
- data/src/js/controllers/filter_panel_controller.js +15 -6
- data/src/js/controllers/flatpickr_controller.js +8 -0
- data/src/js/controllers/frame_refresh_controller.js +59 -0
- data/src/js/controllers/intl_tel_input_controller.js +5 -0
- data/src/js/controllers/register_controllers.js +4 -0
- data/src/js/controllers/slim_select_controller.js +79 -176
- data/src/js/core.js +9 -1
- data/src/js/i18n.js +69 -0
- data/src/js/plutonium-charts.js +15 -0
- data/src/js/turbo/turbo_confirm.js +5 -3
- metadata +64 -16
- data/.yarnrc.yml +0 -8
- data/config/initializers/hotwire_turbo_monkey_patches.rb +0 -12
- data/lib/generators/pu/field/input/input_generator.rb +0 -32
- data/lib/generators/pu/field/input/templates/input.rb.tt +0 -15
- data/lib/generators/pu/lib/plutonium_generators/concerns/config.rb +0 -39
- data/lib/generators/pu/lib/plutonium_generators/concerns/serializer.rb +0 -39
- data/lib/generators/pu/lib/plutonium_generators/installer.rb +0 -205
- data/lib/generators/pu/res/scaffold/templates/presenter.rb.tt +0 -13
- data/lib/generators/pu/res/scaffold/templates/query_object.rb.tt +0 -17
- data/public/plutonium-assets/application.js +0 -31419
- data/public/plutonium-assets/plutonium.ico +0 -0
- data/yarn.lock +0 -6858
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
(()=>{function Gt(n){return Object.prototype.toString.call(n)==="[object Array]"}function ks(n){return n instanceof Function}function Ln(n){return Object.prototype.toString.call(n)==="[object Object]"&&!ks(n)&&n instanceof Object}function vs(n,t){for(var e in t)e!=="__proto__"&&(Ln(t[e])||Gt(t[e])?(Ln(t[e])&&!Ln(n[e])&&(n[e]={}),Gt(t[e])&&!Gt(n[e])&&(n[e]=[]),vs(n[e],t[e])):t[e]!==void 0&&(n[e]=t[e]))}function Q(n,t){var e={};return vs(e,n),vs(e,t),e}var qc=/^(\d\d\d\d)(?:-)?(\d\d)(?:-)?(\d\d)$/i;function $c(n){for(var t=0;t<n.length;t++)for(var e=n[t].data,i=0;i<e.length;i++)if(e[i][1]<0)return!0;return!1}function Rt(n){return""+n}function Ot(n){return parseFloat(n)}function Dt(n){if(n instanceof Date)return n;if(typeof n=="number")return new Date(n*1e3);var t=Rt(n),e=t.match(qc);if(e){var i=parseInt(e[1],10),s=parseInt(e[2],10)-1,o=parseInt(e[3],10);return new Date(i,s,o)}else{var r=t.replace(/ /,"T").replace(" ","").replace("UTC","Z");return new Date(Date.parse(r)||t)}}function Ds(n){if(Gt(n))return n;var t=[];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.push([e,n[e]]);return t}function en(n,t,e,i,s,o,r,a){return function(l,c,u){var h=l.data,d=Q({},n);return d=Q(d,u||{}),(l.singleSeriesFormat||"legend"in c)&&t(d,c.legend,l.singleSeriesFormat),c.title&&e(d,c.title),"min"in c?i(d,c.min):$c(h)||i(d,0),c.max&&s(d,c.max),"stacked"in c&&o(d,c.stacked),c.colors&&(d.colors=c.colors),c.xtitle&&r(d,c.xtitle),c.ytitle&&a(d,c.ytitle),d=Q(d,c.library||{}),d}}function Xc(n,t){return n[0].getTime()-t[0].getTime()}function Os(n,t){return n[0]-t[0]}function gr(n,t){return n-t}function Me(n,t){for(var e=0;e<n.length;e++)if(!t(n[e]))return!1;return!0}function Uc(n){return n==="day"||n==="week"||n==="month"||n==="year"}function mr(n,t){if(t===void 0&&(t=!1),n.length===0)return null;var e=Me(n,function(c){return c.getMilliseconds()===0&&c.getSeconds()===0});if(!e)return null;var i=Me(n,function(c){return c.getMinutes()===0});if(!i)return"minute";var s=Me(n,function(c){return c.getHours()===0});if(!s)return"hour";if(t)return"day";var o=Me(n,function(c){return c.getDate()===1});if(!o){var r=n[0].getDay(),a=Me(n,function(c){return c.getDay()===r});return a?"week":"day"}var l=Me(n,function(c){return c.getMonth()===0});return l?"year":"month"}function _s(n){return!isNaN(Dt(n))&&Rt(n).length>=6}function Gc(n){return typeof n=="number"}var ur=["bytes","KB","MB","GB","TB","PB","EB"];function wt(n,t,e,i){n=n||"",e.prefix&&(t<0&&(t=t*-1,n+="-"),n+=e.prefix);var s=e.suffix||"",o=e.precision,r=e.round;if(e.byteScale){var a=t>=0;a||(t*=-1);var l=i?e.byteScale:t,c;l>=1152921504606847e3?(t/=1152921504606847e3,c=6):l>=0x4000000000000?(t/=0x4000000000000,c=5):l>=1099511627776?(t/=1099511627776,c=4):l>=1073741824?(t/=1073741824,c=3):l>=1048576?(t/=1048576,c=2):l>=1024?(t/=1024,c=1):c=0,o===void 0&&r===void 0&&(t>=1023.5&&c<ur.length-1&&(t=1,c+=1),o=t>=1e3?4:3),s=" "+ur[c],a||(t*=-1)}if(o!==void 0&&r!==void 0)throw Error("Use either round or precision, not both");if(!i&&(o!==void 0&&(t=t.toPrecision(o),e.zeros||(t=parseFloat(t))),r!==void 0))if(r<0){var u=Math.pow(10,-1*r);t=parseInt((1*t/u).toFixed(0))*u}else t=t.toFixed(r),e.zeros||(t=parseFloat(t));if(e.thousands||e.decimal){t=Rt(t);var h=t.split(".");t=h[0],e.thousands&&(t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.thousands)),h.length>1&&(t+=(e.decimal||".")+h[1])}return n+t+s}function hr(n,t,e){return e in t?t[e]:e in n.options?n.options[e]:null}var Ps={maintainAspectRatio:!1,animation:!1,plugins:{legend:{},tooltip:{displayColors:!1,callbacks:{}},title:{font:{size:20},color:"#333"}},interaction:{}},br={scales:{y:{ticks:{maxTicksLimit:4},title:{font:{size:16},color:"#333"},grid:{}},x:{grid:{drawOnChartArea:!1},title:{font:{size:16},color:"#333"},time:{},ticks:{}}}},xr=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"];function Ss(n,t,e){t!==void 0?(n.plugins.legend.display=!!t,t&&t!==!0&&(n.plugins.legend.position=t)):e&&(n.plugins.legend.display=!1)}function Cs(n,t){n.plugins.title.display=!0,n.plugins.title.text=t}function Qc(n,t){t!==null&&(n.scales.y.min=Ot(t))}function Kc(n,t){n.scales.y.max=Ot(t)}function Zc(n,t){t!==null&&(n.scales.x.min=Ot(t))}function Jc(n,t){n.scales.x.max=Ot(t)}function yr(n,t){n.scales.x.stacked=!!t,n.scales.y.stacked=!!t}function _r(n,t){n.scales.x.title.display=!0,n.scales.x.title.text=t}function wr(n,t){n.scales.y.title.display=!0,n.scales.y.title.text=t}function dr(n,t){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return e?"rgba("+parseInt(e[1],16)+", "+parseInt(e[2],16)+", "+parseInt(e[3],16)+", "+t+")":n}function Ut(n){return n!=null}function tu(n,t,e){var i=Math.ceil(n.element.offsetWidth/4/t.labels.length);i>25?i=25:i<10&&(i=10),e.scales.x.ticks.callback||(e.scales.x.ticks.callback=function(s){return s=Rt(this.getLabelForValue(s)),s.length>i?s.substring(0,i-2)+"...":s})}function eu(n){for(var t=1,e=nu(n);e>=1024;)t*=1024,e/=1024;return t}function In(n,t,e){var i={thousands:n.options.thousands,decimal:n.options.decimal},s=Q({prefix:n.options.prefix,suffix:n.options.suffix,precision:n.options.precision,round:n.options.round,zeros:n.options.zeros},i);if(n.options.bytes){var o=n.data;e==="pie"&&(o=[{data:o}]),s.byteScale=eu(o)}if(e!=="pie"){var r=t.scales.y;e==="bar"&&(r=t.scales.x),s.byteScale&&(r.ticks.stepSize||(r.ticks.stepSize=s.byteScale/2),r.ticks.maxTicksLimit||(r.ticks.maxTicksLimit=4)),r.ticks.callback||(r.ticks.callback=function(l){return wt("",l,s,!0)}),(e==="scatter"||e==="bubble")&&!t.scales.x.ticks.callback&&(t.scales.x.ticks.callback=function(l){return wt("",l,i,!0)})}if(!t.plugins.tooltip.callbacks.label)if(e==="scatter")t.plugins.tooltip.callbacks.label=function(l){var c=l.dataset.label||"";c&&(c+=": ");var u=l.parsed;return c+"("+wt("",u.x,i)+", "+wt("",u.y,s)+")"};else if(e==="bubble")t.plugins.tooltip.callbacks.label=function(l){var c=l.dataset.label||"";c&&(c+=": ");var u=l.raw;return c+"("+wt("",u.x,i)+", "+wt("",u.y,s)+", "+wt("",u.v,i)+")"};else if(e==="pie")t.plugins.tooltip.callbacks.label=function(l){return wt("",l.parsed,s)};else{var a=e==="bar"?"x":"y";t.plugins.tooltip.callbacks.label=function(l){if(l.parsed[a]!==null){var c=l.dataset.label||"";return c&&(c+=": "),wt(c,l.parsed[a],s)}}}(e==="line"||e==="area")&&n.xtype==="number"&&(t.scales.x.ticks.callback||(t.scales.x.ticks.callback=function(l){return Rt(l)}),t.plugins.tooltip.callbacks.title||(t.plugins.tooltip.callbacks.title=function(l){return Rt(l[0].parsed.x)}))}function nu(n){for(var t=0,e=0;e<n.length;e++)for(var i=n[e].data,s=0;s<i.length;s++){var o=Math.abs(i[s][1]);o>t&&(t=o)}return t}function iu(n){for(var t=0,e=0;e<n.length;e++)for(var i=n[e].data,s=0;s<i.length;s++){var o=i[s][2];o>t&&(t=o)}return t}var Ts=en(Q(Ps,br),Ss,Cs,Qc,Kc,yr,_r,wr);function su(n){for(var t=n.data,e={},i=[],s=[],o=[],r=0;r<t.length;r++)for(var a=t[r].data,l=0;l<a.length;l++){var c=a[l],u=n.xtype==="datetime"?c[0].getTime():c[0];e[u]||(e[u]=new Array(t.length),i.push(u)),e[u][r]=c[1]}(n.xtype==="datetime"||n.xtype==="number")&&i.sort(gr);for(var h=0;h<t.length;h++)o.push([]);for(var d=0;d<i.length;d++){var f=i[d],p=n.xtype==="datetime"?new Date(f):f;s.push(p);for(var g=e[f],m=0;m<t.length;m++){var b=g[m];o[m].push(b===void 0?null:b)}}return{labels:s,values:o}}function ou(n){for(var t=n.data,e=[],i=iu(t),s=0;s<t.length;s++){for(var o=t[s].data,r=[],a=0;a<o.length;a++){var l=o[a];r.push({x:l[0],y:l[1],r:l[2]*20/i,v:l[2]})}e.push(r)}return{labels:[],values:e}}function ru(n){for(var t=n.data,e=[],i=0;i<t.length;i++){var s=t[i].data;s.sort(Os);for(var o=[],r=0;r<s.length;r++){var a=s[r];o.push({x:a[0],y:a[1]})}e.push(o)}return{labels:[],values:e}}function au(n,t){return t==="bubble"?ou(n):n.xtype==="number"&&t!=="bar"&&t!=="column"?ru(n):su(n)}function As(n,t,e){for(var i=au(n,e),s=i.labels,o=i.values,r=n.data,a=[],l=n.options.colors||xr,c=0;c<r.length;c++){var u=r[c],h=void 0,d=void 0;if(n.options.colors&&n.singleSeriesFormat&&(e==="bar"||e==="column")&&!u.color&&Gt(n.options.colors)&&!Gt(n.options.colors[0])){h=l,d=[];for(var f=0;f<l.length;f++)d[f]=dr(h[f],.5)}else h=u.color||l[c],d=e!=="line"?dr(h,.5):h;var p={label:u.name||"",data:o[c],fill:e==="area",borderColor:h,backgroundColor:d,borderWidth:2},g=e==="line"||e==="area"||e==="scatter"||e==="bubble";g&&(p.pointBackgroundColor=h,p.pointHoverBackgroundColor=h,p.pointHitRadius=50),e==="bubble"&&(p.pointBackgroundColor=d,p.pointHoverBackgroundColor=d,p.pointHoverBorderWidth=2),u.stack&&(p.stack=u.stack);var m=hr(n,u,"curve");m===!1?p.tension=0:g&&(p.tension=.4);var b=hr(n,u,"points");b===!1&&(p.pointRadius=0,p.pointHoverRadius=0),p=Q(p,n.options.dataset||{}),p=Q(p,u.library||{}),p=Q(p,u.dataset||{}),a.push(p)}var x=n.options.xmin,w=n.options.xmax;if(n.xtype==="datetime"?(Ut(x)&&(t.scales.x.min=Dt(x).getTime()),Ut(w)&&(t.scales.x.max=Dt(w).getTime())):n.xtype==="number"&&(Ut(x)&&(t.scales.x.min=x),Ut(w)&&(t.scales.x.max=w)),n.xtype==="datetime"){var _=mr(s);if(s.length===0&&(Ut(x)&&s.push(Dt(x)),Ut(w)&&s.push(Dt(w))),s.length>0){for(var y=(Ut(x)?Dt(x):s[0]).getTime(),v=(Ut(w)?Dt(w):s[0]).getTime(),k=1;k<s.length;k++){var D=s[k].getTime();D<y&&(y=D),D>v&&(v=D)}var P=(v-y)/(86400*1e3);if(!t.scales.x.time.unit){var S;if(_==="year"||P>365*10?(t.scales.x.time.unit="year",S=365):_==="month"||P>300?(t.scales.x.time.unit="month",S=30):_==="week"||_==="day"||P>10?(t.scales.x.time.unit="day",S=1):_==="hour"||P>.5?(t.scales.x.time.displayFormats={hour:"MMM d, h a"},t.scales.x.time.unit="hour",S=1/24):_==="minute"&&(t.scales.x.time.displayFormats={minute:"h:mm a"},t.scales.x.time.unit="minute",S=1/24/60),S&&P>0){var T=n.element.offsetWidth;if(T>0){var E=Math.ceil(P/S/(T/100));_==="week"&&S===1&&(E=Math.ceil(E/7)*7),t.scales.x.ticks.stepSize=E}}}t.scales.x.time.tooltipFormat||(_==="year"?t.scales.x.time.tooltipFormat="yyyy":_==="month"?t.scales.x.time.tooltipFormat="MMM yyyy":_==="week"||_==="day"?t.scales.x.time.tooltipFormat="PP":_==="hour"?t.scales.x.time.tooltipFormat="MMM d, h a":_==="minute"&&(t.scales.x.time.tooltipFormat="h:mm a"))}}return{labels:s,datasets:a}}var Pt=function(t){this.name="chartjs",this.library=t};Pt.prototype.renderLineChart=function(t,e){e||(e="line");var i={},s=Ts(t,Q(i,t.options));In(t,s,e);var o=As(t,s,e);t.xtype==="number"?(s.scales.x.type=s.scales.x.type||"linear",s.scales.x.position=s.scales.x.position||"bottom"):s.scales.x.type=t.xtype==="string"?"category":"time",this.drawChart(t,"line",o,s)};Pt.prototype.renderPieChart=function(t){var e=Q({},Ps);t.options.donut&&(e.cutout="50%"),"legend"in t.options&&Ss(e,t.options.legend),t.options.title&&Cs(e,t.options.title),e=Q(e,t.options.library||{}),In(t,e,"pie");for(var i=[],s=[],o=0;o<t.data.length;o++){var r=t.data[o];i.push(r[0]),s.push(r[1])}var a={data:s,backgroundColor:t.options.colors||xr};a=Q(a,t.options.dataset||{});var l={labels:i,datasets:[a]};this.drawChart(t,"pie",l,e)};Pt.prototype.renderColumnChart=function(t,e){var i;if(e==="bar"){var s=Q(Ps,br);s.indexAxis="y",s.scales.x.grid.drawOnChartArea=!0,s.scales.y.grid.drawOnChartArea=!1,delete s.scales.y.ticks.maxTicksLimit,i=en(s,Ss,Cs,Zc,Jc,yr,_r,wr)(t,t.options)}else i=Ts(t,t.options);In(t,i,e);var o=As(t,i,"column");e!=="bar"&&tu(t,o,i),"mode"in i.interaction||(i.interaction.mode="index"),this.drawChart(t,"bar",o,i)};Pt.prototype.renderAreaChart=function(t){this.renderLineChart(t,"area")};Pt.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")};Pt.prototype.renderScatterChart=function(t,e){e=e||"scatter";var i=Ts(t,t.options);In(t,i,e),"showLine"in i||(i.showLine=!1);var s=As(t,i,e);i.scales.x.type=i.scales.x.type||"linear",i.scales.x.position=i.scales.x.position||"bottom","mode"in i.interaction||(i.interaction.mode="nearest"),this.drawChart(t,e,s,i)};Pt.prototype.renderBubbleChart=function(t){this.renderScatterChart(t,"bubble")};Pt.prototype.destroy=function(t){t.chart&&t.chart.destroy()};Pt.prototype.drawChart=function(t,e,i,s){if(this.destroy(t),!t.destroyed){var o={type:e,data:i,options:s};t.options.code&&window.console.log("new Chart(ctx, "+JSON.stringify(o)+");"),t.element.innerHTML="<canvas></canvas>";var r=t.element.getElementsByTagName("CANVAS")[0];t.chart=new this.library(r,o)}};var vr={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!1},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},area:{},series:{marker:{}}},time:{useUTC:!1}};function Mr(n,t,e){t!==void 0?(n.legend.enabled=!!t,t&&t!==!0&&(t==="top"||t==="bottom"?n.legend.verticalAlign=t:(n.legend.layout="vertical",n.legend.verticalAlign="middle",n.legend.align=t))):e&&(n.legend.enabled=!1)}function kr(n,t){n.title.text=t}function lu(n,t){n.yAxis.min=t}function cu(n,t){n.yAxis.max=t}function uu(n,t){var e=t?t===!0?"normal":t:null;n.plotOptions.series.stacking=e,n.plotOptions.area.stacking=e,n.plotOptions.areaspline.stacking=e}function hu(n,t){n.xAxis.title.text=t}function du(n,t){n.yAxis.title.text=t}var Ls=en(vr,Mr,kr,lu,cu,uu,hu,du);function Es(n,t,e){var i={prefix:n.options.prefix,suffix:n.options.suffix,thousands:n.options.thousands,decimal:n.options.decimal,precision:n.options.precision,round:n.options.round,zeros:n.options.zeros};e!=="pie"&&!Gt(t.yAxis)&&!t.yAxis.labels.formatter&&(t.yAxis.labels.formatter=function(){return wt("",this.value,i)}),!t.tooltip.pointFormatter&&!t.tooltip.pointFormat&&(t.tooltip.pointFormatter=function(){return'<span style="color:'+this.color+'">\u25CF</span> '+wt(this.series.name+": <b>",this.y,i)+"</b><br/>"})}var Nt=function(t){this.name="highcharts",this.library=t};Nt.prototype.renderLineChart=function(t,e){e=e||"spline";var i={};e==="areaspline"&&(i={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),t.options.curve===!1&&(e==="areaspline"?e="area":e==="spline"&&(e="line"));var s=Ls(t,t.options,i);t.xtype==="number"?s.xAxis.type=s.xAxis.type||"linear":s.xAxis.type=t.xtype==="string"?"category":"datetime",s.chart.type||(s.chart.type=e),Es(t,s,e);for(var o=t.data,r=0;r<o.length;r++){o[r].name=o[r].name||"Value";var a=o[r].data;if(t.xtype==="datetime")for(var l=0;l<a.length;l++)a[l][0]=a[l][0].getTime();else t.xtype==="number"&&a.sort(Os);o[r].marker={symbol:"circle"},t.options.points===!1&&(o[r].marker.enabled=!1)}this.drawChart(t,o,s)};Nt.prototype.renderScatterChart=function(t){var e=Ls(t,t.options,{});e.chart.type="scatter",this.drawChart(t,t.data,e)};Nt.prototype.renderPieChart=function(t){var e=Q(vr,{});t.options.colors&&(e.colors=t.options.colors),t.options.donut&&(e.plotOptions={pie:{innerSize:"50%"}}),"legend"in t.options&&Mr(e,t.options.legend),t.options.title&&kr(e,t.options.title);var i=Q(e,t.options.library||{});Es(t,i,"pie");var s=[{type:"pie",name:t.options.label||"Value",data:t.data}];this.drawChart(t,s,i)};Nt.prototype.renderColumnChart=function(t,e){e=e||"column";var i=t.data,s=Ls(t,t.options),o=[],r=[];s.chart.type=e,Es(t,s,e);for(var a=0;a<i.length;a++)for(var l=i[a],c=0;c<l.data.length;c++){var u=l.data[c];o[u[0]]||(o[u[0]]=new Array(i.length),r.push(u[0])),o[u[0]][a]=u[1]}t.xtype==="number"&&r.sort(gr),s.xAxis.categories=r;for(var h=[],d=0;d<i.length;d++){for(var f=[],p=0;p<r.length;p++)f.push(o[r[p]][d]||0);var g={name:i[d].name||"Value",data:f};i[d].stack&&(g.stack=i[d].stack),h.push(g)}this.drawChart(t,h,s)};Nt.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")};Nt.prototype.renderAreaChart=function(t){this.renderLineChart(t,"areaspline")};Nt.prototype.destroy=function(t){t.chart&&t.chart.destroy()};Nt.prototype.drawChart=function(t,e,i){this.destroy(t),!t.destroyed&&(i.chart.renderTo=t.element.id,i.series=e,t.options.code&&window.console.log("new Highcharts.Chart("+JSON.stringify(i)+");"),t.chart=new this.library.Chart(i))};var fr={},En=[],nn={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}};function Fs(n,t,e){if(t!==void 0){var i;t?t===!0?i="right":i=t:i="none",n.legend.position=i}else e&&(n.legend.position="none")}function Is(n,t){n.title=t,n.titleTextStyle={color:"#333",fontSize:"20px"}}function fu(n,t){n.vAxis.viewWindow.min=t}function pu(n,t){n.vAxis.viewWindow.max=t}function gu(n,t){n.hAxis.viewWindow.min=t}function mu(n,t){n.hAxis.viewWindow.max=t}function Dr(n,t){n.isStacked=t||!1}function Or(n,t){n.hAxis.title=t,n.hAxis.titleTextStyle.italic=!1}function Pr(n,t){n.vAxis.title=t,n.vAxis.titleTextStyle.italic=!1}var Rn=en(nn,Fs,Is,fu,pu,Dr,Or,Pr);function bu(n){window.attachEvent?window.attachEvent("onresize",n):window.addEventListener&&window.addEventListener("resize",n,!0),n()}var ct=function(t){this.name="google",this.library=t};ct.prototype.renderLineChart=function(t){var e=this;this.waitForLoaded(t,function(){var i={};t.options.curve===!1&&(i.curveType="none"),t.options.points===!1&&(i.pointSize=0);var s=Rn(t,t.options,i),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"LineChart",o,s)})};ct.prototype.renderPieChart=function(t){var e=this;this.waitForLoaded(t,function(){var i={chartArea:{top:"10%",height:"80%"},legend:{}};t.options.colors&&(i.colors=t.options.colors),t.options.donut&&(i.pieHole=.5),"legend"in t.options&&Fs(i,t.options.legend),t.options.title&&Is(i,t.options.title);var s=Q(Q(nn,i),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number","Value"),o.addRows(t.data),e.drawChart(t,"PieChart",o,s)})};ct.prototype.renderColumnChart=function(t){var e=this;this.waitForLoaded(t,function(){var i=Rn(t,t.options),s=e.createDataTable(t.data,t.xtype);e.drawChart(t,"ColumnChart",s,i)})};ct.prototype.renderBarChart=function(t){var e=this;this.waitForLoaded(t,function(){var i={hAxis:{gridlines:{color:"#ccc"}}},s=en(nn,Fs,Is,gu,mu,Dr,Or,Pr)(t,t.options,i),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"BarChart",o,s)})};ct.prototype.renderAreaChart=function(t){var e=this;this.waitForLoaded(t,function(){var i={isStacked:!0,pointSize:0,areaOpacity:.5},s=Rn(t,t.options,i),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"AreaChart",o,s)})};ct.prototype.renderGeoChart=function(t){var e=this;this.waitForLoaded(t,"geochart",function(){var i={legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}},s=Q(Q(nn,i),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number",t.options.label||"Value"),o.addRows(t.data),e.drawChart(t,"GeoChart",o,s)})};ct.prototype.renderScatterChart=function(t){var e=this;this.waitForLoaded(t,function(){for(var i={},s=Rn(t,t.options,i),o=t.data,r=[],a=0;a<o.length;a++){o[a].name=o[a].name||"Value";for(var l=o[a].data,c=0;c<l.length;c++){var u=new Array(o.length+1);u[0]=l[c][0],u[a+1]=l[c][1],r.push(u)}}var h=new e.library.visualization.DataTable;h.addColumn("number","");for(var d=0;d<o.length;d++)h.addColumn("number",o[d].name);h.addRows(r),e.drawChart(t,"ScatterChart",h,s)})};ct.prototype.renderTimeline=function(t){var e=this;this.waitForLoaded(t,"timeline",function(){var i={legend:"none"};t.options.colors&&(i.colors=t.options.colors);var s=Q(Q(nn,i),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn({type:"string",id:"Name"}),o.addColumn({type:"date",id:"Start"}),o.addColumn({type:"date",id:"End"}),o.addRows(t.data),t.element.style.lineHeight="normal",e.drawChart(t,"Timeline",o,s)})};ct.prototype.destroy=function(t){t.chart&&t.chart.clearChart()};ct.prototype.drawChart=function(t,e,i,s){this.destroy(t),!t.destroyed&&(t.options.code&&window.console.log("var data = new google.visualization.DataTable("+i.toJSON()+`);
|
|
2
|
+
var chart = new google.visualization.`+e+`(element);
|
|
3
|
+
chart.draw(data, `+JSON.stringify(s)+");"),t.chart=new this.library.visualization[e](t.element),bu(function(){t.chart.draw(i,s)}))};ct.prototype.waitForLoaded=function(t,e,i){var s=this;if(i||(i=e,e="corechart"),En.push({pack:e,callback:i}),fr[e])this.runCallbacks();else{fr[e]=!0;var o={packages:[e],callback:function(){s.runCallbacks()}},r=t.__config();r.language&&(o.language=r.language),e==="geochart"&&r.mapsApiKey&&(o.mapsApiKey=r.mapsApiKey),this.library.charts.load("current",o)}};ct.prototype.runCallbacks=function(){for(var t=0;t<En.length;t++){var e=En[t],i=this.library.visualization&&(e.pack==="corechart"&&this.library.visualization.LineChart||e.pack==="timeline"&&this.library.visualization.Timeline||e.pack==="geochart"&&this.library.visualization.GeoChart);i&&(e.callback(),En.splice(t,1),t--)}};ct.prototype.createDataTable=function(t,e){for(var i=[],s=[],o=0;o<t.length;o++){var r=t[o];t[o].name=t[o].name||"Value";for(var a=0;a<r.data.length;a++){var l=r.data[a],c=e==="datetime"?l[0].getTime():l[0];i[c]||(i[c]=new Array(t.length),s.push(c)),i[c][o]=l[1]}}for(var u=[],h=[],d=0;d<s.length;d++){var f=s[d],p=void 0;e==="datetime"?(p=new Date(f),h.push(p)):p=f,u.push([p].concat(i[f]))}var g=!0;if(e==="datetime"){u.sort(Xc);var m=mr(h,!0);g=Uc(m)}else if(e==="number"){u.sort(Os);for(var b=0;b<u.length;b++)u[b][0]=Rt(u[b][0]);e="string"}var x=new this.library.visualization.DataTable;e=e==="datetime"&&g?"date":e,x.addColumn(e,"");for(var w=0;w<t.length;w++)x.addColumn("number",t[w].name);return x.addRows(u),x};var ce=[];function xu(n){if(n){if(n.product==="Highcharts")return Nt;if(n.charts)return ct;if(ks(n))return Pt}throw new Error("Unknown adapter")}function Je(n){for(var t=xu(n),e=0;e<ce.length;e++)if(ce[e].library===n)return;ce.push(new t(n))}function yu(){"Chart"in window&&Je(window.Chart),"Highcharts"in window&&Je(window.Highcharts),window.google&&window.google.charts&&Je(window.google)}function _u(n,t){var e="render"+n,i=t.options.adapter;yu();for(var s=0;s<ce.length;s++){var o=ce[s];if((!i||i===o.name)&&ks(o[e]))return t.adapter=o.name,t.__adapterObject=o,o[e](t)}throw ce.length>0?new Error("No charting library found for "+n):new Error("No charting libraries found - be sure to include one before your charts")}var R={charts:{},configure:function(n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(R.config[t]=n[t])},setDefaultOptions:function(n){R.options=n},eachChart:function(n){for(var t in R.charts)Object.prototype.hasOwnProperty.call(R.charts,t)&&n(R.charts[t])},destroyAll:function(){for(var n in R.charts)Object.prototype.hasOwnProperty.call(R.charts,n)&&(R.charts[n].destroy(),delete R.charts[n])},config:{},options:{},adapters:ce,addAdapter:Je,use:function(n){return Je(n),R}};function wu(n){for(var t=[],e=0;e<n.length;e++)t.push([Ot(n[e][0]),Ot(n[e][1]),Ot(n[e][2])]);return t}function vu(n,t){if(t==="bubble")return wu(n);var e;t==="number"?e=Ot:t==="datetime"?e=Dt:e=Rt;for(var i=[],s=0;s<n.length;s++)i.push([e(n[s][0]),Ot(n[s][1])]);return i}function Mu(n,t,e){return Cr(n)?(e.xmin||e.xmax)&&(!e.xmin||_s(e.xmin))&&(!e.xmax||_s(e.xmax))?"datetime":"number":pr(n,Gc)?"number":!t&&pr(n,_s)?"datetime":"string"}function pr(n,t){for(var e=0;e<n.length;e++)for(var i=Ds(n[e].data),s=0;s<i.length;s++)if(!t(i[s][0]))return!1;return!0}function ku(n){for(var t=[],e=0;e<n.length;e++){var i={};for(var s in n[e])Object.prototype.hasOwnProperty.call(n[e],s)&&(i[s]=n[e][s]);t.push(i)}return t}function ke(n,t,e){var i=n.options,s=n.rawData;n.singleSeriesFormat=!Gt(s)||!Ln(s[0]),n.singleSeriesFormat&&(s=[{name:i.label,data:s}]),s=ku(s);for(var o=0;o<s.length;o++)s[o].data=Ds(s[o].data);n.xtype=t||(i.discrete?"string":Mu(s,e,i));for(var r=0;r<s.length;r++)s[r].data=vu(s[r].data,n.xtype);return s}function Sr(n){for(var t=Ds(n.rawData),e=0;e<t.length;e++)t[e]=[Rt(t[e][0]),Ot(t[e][1])];return t}function Cr(n,t){if(t==="PieChart"||t==="GeoChart"||t==="Timeline")return n.length===0;for(var e=0;e<n.length;e++)if(n[e].data.length>0)return!1;return!0}function Du(n){var t=n.options.download;t===!0?t={}:typeof t=="string"&&(t={filename:t});var e=document.createElement("a");e.download=t.filename||"chart.png",e.style.position="absolute",e.style.top="20px",e.style.right="20px",e.style.zIndex=1e3,e.style.lineHeight="20px",e.target="_blank";var i=document.createElement("img"),s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path fill="#CCCCCC" d="M344 240h-56L287.1 152c0-13.25-10.75-24-24-24h-16C234.7 128 223.1 138.8 223.1 152L224 240h-56c-9.531 0-18.16 5.656-22 14.38C142.2 263.1 143.9 273.3 150.4 280.3l88.75 96C243.7 381.2 250.1 384 256.8 384c7.781-.3125 13.25-2.875 17.75-7.844l87.25-96c6.406-7.031 8.031-17.19 4.188-25.88S353.5 240 344 240zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"/></svg>';i.src="data:image/svg+xml;utf8,"+encodeURIComponent(s),i.alt="Download",i.style.width="20px",i.style.height="20px",i.style.border="none",e.appendChild(i);var o=n.element;o.style.position="relative",n.__downloadAttached=!0,n.__enterEvent=o.addEventListener("mouseover",function(r){var a=r.relatedTarget;(!a||a!==this&&!this.contains(a))&&n.options.download&&(e.href=n.toImage(t),o.appendChild(e))}),n.__leaveEvent=o.addEventListener("mouseout",function(r){var a=r.relatedTarget;(!a||a!==this&&!this.contains(a))&&e.parentNode&&e.parentNode.removeChild(e)})}var Tr=[],Ms=0,Ou=4;function Pu(n,t,e){Tr.push([n,t,e]),Rs()}function Rs(){if(Ms<Ou){var n=Tr.shift();n&&(Ms++,Cu(n[0],n[1],n[2]),Rs())}}function Su(){Ms--,Rs()}function Cu(n,t,e){var i=new XMLHttpRequest;i.open("GET",n,!0),i.setRequestHeader("Content-Type","application/json"),i.onload=function(){Su(),i.status===200?t(JSON.parse(i.responseText)):e(i.statusText)},i.send()}function Ns(n,t){n.textContent=t}function Fn(n,t,e){e||(t="Error Loading Chart: "+t),Ns(n,t),n.style.color="#ff0000"}function ws(n){try{n.__render()}catch(t){throw Fn(n.element,t.message),t}}function tn(n,t,e){if(e&&n.options.loading&&(typeof t=="string"||typeof t=="function")&&Ns(n.element,n.options.loading),typeof t=="string")Pu(t,function(i){n.rawData=i,ws(n)},function(i){Fn(n.element,i)});else if(typeof t=="function")try{t(function(i){n.rawData=i,ws(n)},function(i){Fn(n.element,i,!0)})}catch(i){Fn(n.element,i,!0)}else n.rawData=t,ws(n)}function Tu(n,t){if(Cr(t.data,n)){var e=t.options.empty||t.options.messages&&t.options.messages.empty||"No data";Ns(t.element,e)}else _u(n,t),t.options.download&&!t.__downloadAttached&&t.adapter==="chartjs"&&Du(t)}function Au(n){if(typeof n=="string"){var t=n;if(n=document.getElementById(n),!n)throw new Error("No element with id "+t)}return n}var q=function(t,e,i){this.element=Au(t),this.options=Q(R.options,i||{}),this.dataSource=e,this.element.id&&(R.charts[this.element.id]=this),tn(this,e,!0),this.options.refresh&&this.startRefresh()};q.prototype.getElement=function(){return this.element};q.prototype.getDataSource=function(){return this.dataSource};q.prototype.getData=function(){return this.data};q.prototype.getOptions=function(){return this.options};q.prototype.getChartObject=function(){return this.chart};q.prototype.getAdapter=function(){return this.adapter};q.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),tn(this,t,!0)};q.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()};q.prototype.redraw=function(){tn(this,this.rawData)};q.prototype.refreshData=function(){if(typeof this.dataSource=="string"){var t=this.dataSource.indexOf("?")===-1?"?":"&",e=this.dataSource+t+"_="+new Date().getTime();tn(this,e)}else typeof this.dataSource=="function"&&tn(this,this.dataSource)};q.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&typeof this.dataSource!="string"&&typeof this.dataSource!="function")throw new Error("Data source must be a URL or callback for refresh");if(!this.intervalId)if(e)this.intervalId=setInterval(function(){t.refreshData()},e*1e3);else throw new Error("No refresh interval")};q.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)};q.prototype.toImage=function(t){if(this.adapter==="chartjs")if(t&&t.background&&t.background!=="transparent"){var e=this.chart.canvas,i=this.chart.ctx,s=document.createElement("canvas"),o=s.getContext("2d");return s.width=i.canvas.width,s.height=i.canvas.height,o.fillStyle=t.background,o.fillRect(0,0,s.width,s.height),o.drawImage(e,0,0),s.toDataURL("image/png")}else return this.chart.toBase64Image();else throw new Error("Feature only available for Chart.js")};q.prototype.destroy=function(){this.destroyed=!0,this.stopRefresh(),this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&this.element.removeEventListener("mouseover",this.__enterEvent),this.__leaveEvent&&this.element.removeEventListener("mouseout",this.__leaveEvent)};q.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=Q(R.options,t),e&&(this.stopRefresh(),this.startRefresh())};q.prototype.__render=function(){this.data=this.__processData(),Tu(this.__chartName(),this)};q.prototype.__config=function(){return R.config};var Lu=(function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this)},t.prototype.__chartName=function(){return"LineChart"},t})(q),Eu=(function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return Sr(this)},t.prototype.__chartName=function(){return"PieChart"},t})(q),Fu=(function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this,null,!0)},t.prototype.__chartName=function(){return"ColumnChart"},t})(q),Iu=(function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this,null,!0)},t.prototype.__chartName=function(){return"BarChart"},t})(q),Ru=(function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this)},t.prototype.__chartName=function(){return"AreaChart"},t})(q),Nu=(function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return Sr(this)},t.prototype.__chartName=function(){return"GeoChart"},t})(q),zu=(function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this,"number")},t.prototype.__chartName=function(){return"ScatterChart"},t})(q),Wu=(function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this,"bubble")},t.prototype.__chartName=function(){return"BubbleChart"},t})(q),Bu=(function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){for(var i=this.rawData,s=0;s<i.length;s++)i[s][1]=Dt(i[s][1]),i[s][2]=Dt(i[s][2]);return i},t.prototype.__chartName=function(){return"Timeline"},t})(q);R.LineChart=Lu;R.PieChart=Eu;R.ColumnChart=Fu;R.BarChart=Iu;R.AreaChart=Ru;R.GeoChart=Nu;R.ScatterChart=zu;R.BubbleChart=Wu;R.Timeline=Bu;typeof window<"u"&&!window.Chartkick&&(window.Chartkick=R,document.addEventListener("turbolinks:before-render",function(){R.config.autoDestroy!==!1&&R.destroyAll()}),document.addEventListener("turbo:before-render",function(){R.config.autoDestroy!==!1&&R.destroyAll()}),setTimeout(function(){window.dispatchEvent(new Event("chartkick:load"))},0));R.default=R;function rn(n){return n+.5|0}var Qt=(n,t,e)=>Math.max(Math.min(n,e),t);function sn(n){return Qt(rn(n*2.55),0,255)}function Kt(n){return Qt(rn(n*255),0,255)}function zt(n){return Qt(rn(n/2.55)/100,0,1)}function Ar(n){return Qt(rn(n*100),0,100)}var mt={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},Ws=[..."0123456789ABCDEF"],Hu=n=>Ws[n&15],Yu=n=>Ws[(n&240)>>4]+Ws[n&15],Nn=n=>(n&240)>>4===(n&15),Vu=n=>Nn(n.r)&&Nn(n.g)&&Nn(n.b)&&Nn(n.a);function ju(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&mt[n[1]]*17,g:255&mt[n[2]]*17,b:255&mt[n[3]]*17,a:t===5?mt[n[4]]*17:255}:(t===7||t===9)&&(e={r:mt[n[1]]<<4|mt[n[2]],g:mt[n[3]]<<4|mt[n[4]],b:mt[n[5]]<<4|mt[n[6]],a:t===9?mt[n[7]]<<4|mt[n[8]]:255})),e}var qu=(n,t)=>n<255?t(n):"";function $u(n){var t=Vu(n)?Hu:Yu;return n?"#"+t(n.r)+t(n.g)+t(n.b)+qu(n.a,t):void 0}var Xu=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ir(n,t,e){let i=t*Math.min(e,1-e),s=(o,r=(o+n/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Uu(n,t,e){let i=(s,o=(s+n/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Gu(n,t,e){let i=Ir(n,1,.5),s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function Qu(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function Bs(n){let e=n.r/255,i=n.g/255,s=n.b/255,o=Math.max(e,i,s),r=Math.min(e,i,s),a=(o+r)/2,l,c,u;return o!==r&&(u=o-r,c=a>.5?u/(2-o-r):u/(o+r),l=Qu(e,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function Hs(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Kt)}function Ys(n,t,e){return Hs(Ir,n,t,e)}function Ku(n,t,e){return Hs(Gu,n,t,e)}function Zu(n,t,e){return Hs(Uu,n,t,e)}function Rr(n){return(n%360+360)%360}function Ju(n){let t=Xu.exec(n),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?sn(+t[5]):Kt(+t[5]));let s=Rr(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=Ku(s,o,r):t[1]==="hsv"?i=Zu(s,o,r):i=Ys(s,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function th(n,t){var e=Bs(n);e[0]=Rr(e[0]+t),e=Ys(e),n.r=e[0],n.g=e[1],n.b=e[2]}function eh(n){if(!n)return;let t=Bs(n),e=t[0],i=Ar(t[1]),s=Ar(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${zt(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}var Lr={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"},Er={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 nh(){let n={},t=Object.keys(Er),e=Object.keys(Lr),i,s,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],s=0;s<e.length;s++)o=e[s],a=a.replace(o,Lr[o]);o=parseInt(Er[r],16),n[a]=[o>>16&255,o>>8&255,o&255]}return n}var zn;function ih(n){zn||(zn=nh(),zn.transparent=[0,0,0,0]);let t=zn[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var sh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function oh(n){let t=sh.exec(n),e=255,i,s,o;if(t){if(t[7]!==i){let r=+t[7];e=t[8]?sn(r):Qt(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?sn(i):Qt(i,0,255)),s=255&(t[4]?sn(s):Qt(s,0,255)),o=255&(t[6]?sn(o):Qt(o,0,255)),{r:i,g:s,b:o,a:e}}}function rh(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${zt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}var zs=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,De=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function ah(n,t,e){let i=De(zt(n.r)),s=De(zt(n.g)),o=De(zt(n.b));return{r:Kt(zs(i+e*(De(zt(t.r))-i))),g:Kt(zs(s+e*(De(zt(t.g))-s))),b:Kt(zs(o+e*(De(zt(t.b))-o))),a:n.a+e*(t.a-n.a)}}function Wn(n,t,e){if(n){let i=Bs(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Ys(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Nr(n,t){return n&&Object.assign(t||{},n)}function Fr(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Kt(n[3]))):(t=Nr(n,{r:0,g:0,b:0,a:1}),t.a=Kt(t.a)),t}function lh(n){return n.charAt(0)==="r"?oh(n):Ju(n)}var on=class n{constructor(t){if(t instanceof n)return t;let e=typeof t,i;e==="object"?i=Fr(t):e==="string"&&(i=ju(t)||ih(t)||lh(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Nr(this._rgb);return t&&(t.a=zt(t.a)),t}set rgb(t){this._rgb=Fr(t)}rgbString(){return this._valid?rh(this._rgb):void 0}hexString(){return this._valid?$u(this._rgb):void 0}hslString(){return this._valid?eh(this._rgb):void 0}mix(t,e){if(t){let i=this.rgb,s=t.rgb,o,r=e===o?.5:e,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=ah(this._rgb,t._rgb,e)),this}clone(){return new n(this.rgb)}alpha(t){return this._rgb.a=Kt(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=rn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Wn(this._rgb,2,t),this}darken(t){return Wn(this._rgb,2,-t),this}saturate(t){return Wn(this._rgb,1,t),this}desaturate(t){return Wn(this._rgb,1,-t),this}rotate(t){return th(this._rgb,t),this}};function Tt(){}var Ur=(()=>{let n=0;return()=>n++})();function F(n){return n==null}function $(n){if(Array.isArray&&Array.isArray(n))return!0;let t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function I(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function K(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function ut(n,t){return K(n)?n:t}function C(n,t){return typeof n>"u"?t:n}var Gr=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,$s=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function j(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function H(n,t,e,i){let s,o,r;if($(n))if(o=n.length,i)for(s=o-1;s>=0;s--)t.call(e,n[s],s);else for(s=0;s<o;s++)t.call(e,n[s],s);else if(I(n))for(r=Object.keys(n),o=r.length,s=0;s<o;s++)t.call(e,n[r[s]],r[s])}function cn(n,t){let e,i,s,o;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Vn(n){if($(n))return n.map(Vn);if(I(n)){let t=Object.create(null),e=Object.keys(n),i=e.length,s=0;for(;s<i;++s)t[e[s]]=Vn(n[e[s]]);return t}return n}function Qr(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function ch(n,t,e,i){if(!Qr(n))return;let s=t[n],o=e[n];I(s)&&I(o)?Pe(s,o,i):t[n]=Vn(o)}function Pe(n,t,e){let i=$(t)?t:[t],s=i.length;if(!I(n))return n;e=e||{};let o=e.merger||ch,r;for(let a=0;a<s;++a){if(r=i[a],!I(r))continue;let l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],n,r,e)}return n}function Ce(n,t){return Pe(n,t,{merger:uh})}function uh(n,t,e){if(!Qr(n))return;let i=t[n],s=e[n];I(i)&&I(s)?Ce(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Vn(s))}var zr={"":n=>n,x:n=>n.x,y:n=>n.y};function hh(n){let t=n.split("."),e=[],i="";for(let s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function dh(n){let t=hh(n);return e=>{for(let i of t){if(i==="")break;e=e&&e[i]}return e}}function Ht(n,t){return(zr[t]||(zr[t]=dh(t)))(n)}function Xn(n){return n.charAt(0).toUpperCase()+n.slice(1)}var Te=n=>typeof n<"u",Wt=n=>typeof n=="function",Xs=(n,t)=>{if(n.size!==t.size)return!1;for(let e of n)if(!t.has(e))return!1;return!0};function Kr(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}var W=Math.PI,X=2*W,fh=X+W,jn=Number.POSITIVE_INFINITY,ph=W/180,Z=W/2,ue=W/4,Wr=W*2/3,Bt=Math.log10,vt=Math.sign;function Ae(n,t,e){return Math.abs(n-t)<e}function Us(n){let t=Math.round(n);n=Ae(n,t,n/1e3)?t:n;let e=Math.pow(10,Math.floor(Bt(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Zr(n){let t=[],e=Math.sqrt(n),i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function gh(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function fe(n){return!gh(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function Jr(n,t){let e=Math.round(n);return e-t<=n&&e+t>=n}function Gs(n,t,e){let i,s,o;for(i=0,s=n.length;i<s;i++)o=n[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function bt(n){return n*(W/180)}function Un(n){return n*(180/W)}function Qs(n){if(!K(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Ks(n,t){let e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i),o=Math.atan2(i,e);return o<-.5*W&&(o+=X),{angle:o,distance:s}}function qn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function mh(n,t){return(n-t+fh)%X-W}function it(n){return(n%X+X)%X}function Le(n,t,e,i){let s=it(n),o=it(t),r=it(e),a=it(o-s),l=it(r-s),c=it(s-o),u=it(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function et(n,t,e){return Math.max(t,Math.min(e,n))}function ta(n){return et(n,-32768,32767)}function At(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Gn(n,t,e){e=e||(r=>n[r]<t);let i=n.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,e(o)?s=o:i=o;return{lo:s,hi:i}}var St=(n,t,e,i)=>Gn(n,e,i?s=>{let o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),ea=(n,t,e)=>Gn(n,e,i=>n[i][t]>=e);function na(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}var ia=["push","pop","shift","splice","unshift"];function sa(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ia.forEach(e=>{let i="_onData"+Xn(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Zs(n,t){let e=n._chartjs;if(!e)return;let i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(ia.forEach(o=>{delete n[o]}),delete n._chartjs)}function Js(n){let t=new Set(n);return t.size===n.length?n:Array.from(t)}var to=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function eo(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,to.call(window,()=>{i=!1,n.apply(t,e)}))}}function oa(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}var Qn=n=>n==="start"?"left":n==="end"?"right":"center",st=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,ra=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function no(n,t,e){let i=t.length,s=0,o=i;if(n._sorted){let{iScale:r,vScale:a,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=r.axis,{min:h,max:d,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(s=Math.min(St(l,u,h).lo,e?i:St(t,u,r.getPixelForValue(h)).lo),c){let g=l.slice(0,s+1).reverse().findIndex(m=>!F(m[a.axis]));s-=Math.max(0,g)}s=et(s,0,i-1)}if(p){let g=Math.max(St(l,r.axis,d,!0).hi+1,e?0:St(t,u,r.getPixelForValue(d),!0).hi+1);if(c){let m=l.slice(g-1).findIndex(b=>!F(b[a.axis]));g+=Math.max(0,m)}o=et(g,s,i)-s}else o=i-s}return{start:s,count:o}}function io(n){let{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;let o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),o}var Bn=n=>n===0||n===1,Br=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*X/e)),Hr=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*X/e)+1,Oe={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Z)+1,easeOutSine:n=>Math.sin(n*Z),easeInOutSine:n=>-.5*(Math.cos(W*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Bn(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Bn(n)?n:Br(n,.075,.3),easeOutElastic:n=>Bn(n)?n:Hr(n,.075,.3),easeInOutElastic(n){return Bn(n)?n:n<.5?.5*Br(n*2,.1125,.45):.5+.5*Hr(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Oe.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Oe.easeInBounce(n*2)*.5:Oe.easeOutBounce(n*2-1)*.5+.5};function so(n){if(n&&typeof n=="object"){let t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function oo(n){return so(n)?n:new on(n)}function Vs(n){return so(n)?n:new on(n).saturate(.5).darken(.1).hexString()}var bh=["x","y","borderWidth","radius","tension"],xh=["color","borderColor","backgroundColor"];function yh(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:xh},numbers:{type:"number",properties:bh}}),n.describe("animations",{_fallback:"animation"}),n.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:t=>t|0}}}})}function _h(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Yr=new Map;function wh(n,t){t=t||{};let e=n+JSON.stringify(t),i=Yr.get(e);return i||(i=new Intl.NumberFormat(n,t),Yr.set(e,i)),i}function Ee(n,t,e){return wh(t,e).format(n)}var aa={values(n){return $(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";let i=this.chart.options.locale,s,o=n;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=vh(n,e)}let r=Bt(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ee(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";let i=e[t].significand||n/Math.pow(10,Math.floor(Bt(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?aa.numeric.call(this,n,t,e):""}};function vh(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var un={formatters:aa};function Mh(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width: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:un.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}var te=Object.create(null),Kn=Object.create(null);function an(n,t){if(!t)return n;let e=t.split(".");for(let i=0,s=e.length;i<s;++i){let o=e[i];n=n[o]||(n[o]=Object.create(null))}return n}function js(n,t,e){return typeof t=="string"?Pe(an(n,t),e):Pe(an(n,""),t)}var qs=class{constructor(t,e){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=i=>i.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=(i,s)=>Vs(s.backgroundColor),this.hoverBorderColor=(i,s)=>Vs(s.borderColor),this.hoverColor=(i,s)=>Vs(s.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),this.apply(e)}set(t,e){return js(this,t,e)}get(t){return an(this,t)}describe(t,e){return js(Kn,t,e)}override(t,e){return js(te,t,e)}route(t,e,i,s){let o=an(this,t),r=an(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[a],c=r[s];return I(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}},U=new qs({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[yh,_h,Mh]);function kh(n){return!n||F(n.size)||F(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ln(n,t,e,i,s){let o=t[s];return o||(o=t[s]=n.measureText(s).width,e.push(s)),o>i&&(i=o),i}function la(n,t,e,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let r=0,a=e.length,l,c,u,h,d;for(l=0;l<a;l++)if(h=e[l],h!=null&&!$(h))r=ln(n,s,o,r,h);else if($(h))for(c=0,u=h.length;c<u;c++)d=h[c],d!=null&&!$(d)&&(r=ln(n,s,o,r,d));n.restore();let f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return r}function ee(n,t,e){let i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function ro(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Zn(n,t,e,i){ao(n,t,e,i,null)}function ao(n,t,e,i,s){let o,r,a,l,c,u,h,d,f=t.pointStyle,p=t.rotation,g=t.radius,m=(p||0)*ph;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(m),n.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),f){default:s?n.ellipse(e,i,s/2,g,0,0,X):n.arc(e,i,g,0,X),n.closePath();break;case"triangle":u=s?s/2:g,n.moveTo(e+Math.sin(m)*u,i-Math.cos(m)*g),m+=Wr,n.lineTo(e+Math.sin(m)*u,i-Math.cos(m)*g),m+=Wr,n.lineTo(e+Math.sin(m)*u,i-Math.cos(m)*g),n.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(m+ue)*l,h=Math.cos(m+ue)*(s?s/2-c:l),a=Math.sin(m+ue)*l,d=Math.sin(m+ue)*(s?s/2-c:l),n.arc(e-h,i-a,c,m-W,m-Z),n.arc(e+d,i-r,c,m-Z,m),n.arc(e+h,i+a,c,m,m+Z),n.arc(e-d,i+r,c,m+Z,m+W),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}m+=ue;case"rectRot":h=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(s?s/2:g),n.moveTo(e-h,i-a),n.lineTo(e+d,i-r),n.lineTo(e+h,i+a),n.lineTo(e-d,i+r),n.closePath();break;case"crossRot":m+=ue;case"cross":h=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(s?s/2:g),n.moveTo(e-h,i-a),n.lineTo(e+h,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r);break;case"star":h=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(s?s/2:g),n.moveTo(e-h,i-a),n.lineTo(e+h,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r),m+=ue,h=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(s?s/2:g),n.moveTo(e-h,i-a),n.lineTo(e+h,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r);break;case"line":r=s?s/2:Math.cos(m)*g,a=Math.sin(m)*g,n.moveTo(e-r,i-a),n.lineTo(e+r,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(m)*(s?s/2:g),i+Math.sin(m)*g);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ct(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function hn(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function dn(n){n.restore()}function ca(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){let o=(t.x+e.x)/2;n.lineTo(o,t.y),n.lineTo(o,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function ua(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Dh(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),F(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Oh(n,t,e,i,s){if(s.strikethrough||s.underline){let o=n.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(r,u),n.lineTo(a,u),n.stroke()}}function Ph(n,t){let e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ne(n,t,e,i,s,o={}){let r=$(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(n.save(),n.font=s.string,Dh(n,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Ph(n,o.backdrop),a&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),F(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(c,e,i,o.maxWidth)),n.fillText(c,e,i,o.maxWidth),Oh(n,e,i,c,o),i+=Number(s.lineHeight);n.restore()}function Fe(n,t){let{x:e,y:i,w:s,h:o,radius:r}=t;n.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*W,W,!0),n.lineTo(e,i+o-r.bottomLeft),n.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,W,Z,!0),n.lineTo(e+s-r.bottomRight,i+o),n.arc(e+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,Z,0,!0),n.lineTo(e+s,i+r.topRight),n.arc(e+s-r.topRight,i+r.topRight,r.topRight,0,-Z,!0),n.lineTo(e+r.topLeft,i)}var Sh=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ch=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Th(n,t){let e=(""+n).match(Sh);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}var Ah=n=>+n||0;function Jn(n,t){let e={},i=I(t),s=i?Object.keys(t):t,o=I(n)?i?r=>C(n[r],n[t[r]]):r=>n[r]:()=>n;for(let r of s)e[r]=Ah(o(r));return e}function lo(n){return Jn(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ie(n){return Jn(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ot(n){let t=lo(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function tt(n,t){n=n||{},t=t||U.font;let e=C(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=C(n.style,t.style);i&&!(""+i).match(Ch)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let s={family:C(n.family,t.family),lineHeight:Th(C(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:C(n.weight,t.weight),string:""};return s.string=kh(s),s}function Ie(n,t,e,i){let s=!0,o,r,a;for(o=0,r=n.length;o<r;++o)if(a=n[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),e!==void 0&&$(a)&&(a=a[e%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function ha(n,t,e){let{min:i,max:s}=n,o=$s(t,(s-i)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function Yt(n,t){return Object.assign(Object.create(n),t)}function ti(n,t=[""],e,i,s=()=>n[0]){let o=e||n;typeof i>"u"&&(i=pa("_fallback",n));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>ti([a,...n],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return da(a,l,()=>Wh(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return jr(a).includes(l)},ownKeys(a){return jr(a)},set(a,l,c){let u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function de(n,t,e,i){let s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:co(n,i),setContext:o=>de(n,o,e,i),override:o=>de(n.override(o),t,e,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete n[r],!0},get(o,r,a){return da(o,r,()=>Eh(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(n,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,r)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,r){return Reflect.has(n,r)},ownKeys(){return Reflect.ownKeys(n)},set(o,r,a){return n[r]=a,delete o[r],!0}})}function co(n,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:Wt(e)?e:()=>e,isIndexable:Wt(i)?i:()=>i}}var Lh=(n,t)=>n?n+Xn(t):t,uo=(n,t)=>I(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function da(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];let i=e();return n[t]=i,i}function Eh(n,t,e){let{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=n,a=i[t];return Wt(a)&&r.isScriptable(t)&&(a=Fh(t,a,n,e)),$(a)&&a.length&&(a=Ih(t,a,n,r.isIndexable)),uo(t,a)&&(a=de(a,s,o&&o[t],r)),a}function Fh(n,t,e,i){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(o,r||i);return a.delete(n),uo(n,l)&&(l=ho(s._scopes,s,n,l)),l}function Ih(n,t,e,i){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(n))return t[o.index%t.length];if(I(t[0])){let l=t,c=s._scopes.filter(u=>u!==l);t=[];for(let u of l){let h=ho(c,s,n,u);t.push(de(h,o,r&&r[n],a))}}return t}function fa(n,t,e){return Wt(n)?n(t,e):n}var Rh=(n,t)=>n===!0?t:typeof n=="string"?Ht(t,n):void 0;function Nh(n,t,e,i,s){for(let o of t){let r=Rh(e,o);if(r){n.add(r);let a=fa(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function ho(n,t,e,i){let s=t._rootScopes,o=fa(t._fallback,e,i),r=[...n,...s],a=new Set;a.add(i);let l=Vr(a,r,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=Vr(a,r,o,l,i),l===null)?!1:ti(Array.from(a),[""],s,o,()=>zh(t,e,i))}function Vr(n,t,e,i,s){for(;e;)e=Nh(n,t,e,i,s);return e}function zh(n,t,e){let i=n._getTarget();t in i||(i[t]={});let s=i[t];return $(s)&&I(e)?e:s||{}}function Wh(n,t,e,i){let s;for(let o of t)if(s=pa(Lh(o,n),e),typeof s<"u")return uo(n,s)?ho(e,i,n,s):s}function pa(n,t){for(let e of t){if(!e)continue;let i=e[n];if(typeof i<"u")return i}}function jr(n){let t=n._keys;return t||(t=n._keys=Bh(n._scopes)),t}function Bh(n){let t=new Set;for(let e of n)for(let i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function fo(n,t,e,i){let{iScale:s}=n,{key:o="r"}=this._parsing,r=new Array(i),a,l,c,u;for(a=0,l=i;a<l;++a)c=a+e,u=t[c],r[a]={r:s.parse(Ht(u,o),c)};return r}var Hh=Number.EPSILON||1e-14,Se=(n,t)=>t<n.length&&!n[t].skip&&n[t],ga=n=>n==="x"?"y":"x";function Yh(n,t,e,i){let s=n.skip?t:n,o=t,r=e.skip?t:e,a=qn(o,s),l=qn(r,o),c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;let h=i*c,d=i*u;return{previous:{x:o.x-h*(r.x-s.x),y:o.y-h*(r.y-s.y)},next:{x:o.x+d*(r.x-s.x),y:o.y+d*(r.y-s.y)}}}function Vh(n,t,e){let i=n.length,s,o,r,a,l,c=Se(n,0);for(let u=0;u<i-1;++u)if(l=c,c=Se(n,u+1),!(!l||!c)){if(Ae(t[u],0,Hh)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],o=e[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[u]=s*r*t[u],e[u+1]=o*r*t[u])}}function jh(n,t,e="x"){let i=ga(e),s=n.length,o,r,a,l=Se(n,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Se(n,c+1),!a)continue;let u=a[e],h=a[i];r&&(o=(u-r[e])/3,a[`cp1${e}`]=u-o,a[`cp1${i}`]=h-o*t[c]),l&&(o=(l[e]-u)/3,a[`cp2${e}`]=u+o,a[`cp2${i}`]=h+o*t[c])}}function qh(n,t="x"){let e=ga(t),i=n.length,s=Array(i).fill(0),o=Array(i),r,a,l,c=Se(n,0);for(r=0;r<i;++r)if(a=l,l=c,c=Se(n,r+1),!!l){if(c){let u=c[t]-l[t];s[r]=u!==0?(c[e]-l[e])/u:0}o[r]=a?c?vt(s[r-1])!==vt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Vh(n,s,o),jh(n,o,t)}function Hn(n,t,e){return Math.max(Math.min(n,e),t)}function $h(n,t){let e,i,s,o,r,a=Ct(n[0],t);for(e=0,i=n.length;e<i;++e)r=o,o=a,a=e<i-1&&Ct(n[e+1],t),o&&(s=n[e],r&&(s.cp1x=Hn(s.cp1x,t.left,t.right),s.cp1y=Hn(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Hn(s.cp2x,t.left,t.right),s.cp2y=Hn(s.cp2y,t.top,t.bottom)))}function ma(n,t,e,i,s){let o,r,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")qh(n,s);else{let c=i?n[n.length-1]:n[0];for(o=0,r=n.length;o<r;++o)a=n[o],l=Yh(c,a,n[Math.min(o+1,r-(i?0:1))%r],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&&$h(n,e)}function ei(){return typeof window<"u"&&typeof document<"u"}function ni(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function $n(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}var ii=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Xh(n,t){return ii(n).getPropertyValue(t)}var Uh=["top","right","bottom","left"];function he(n,t,e){let i={};e=e?"-"+e:"";for(let s=0;s<4;s++){let o=Uh[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var Gh=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Qh(n,t){let e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i,r=!1,a,l;if(Gh(s,o,n.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function se(n,t){if("native"in n)return n;let{canvas:e,currentDevicePixelRatio:i}=t,s=ii(e),o=s.boxSizing==="border-box",r=he(s,"padding"),a=he(s,"border","width"),{x:l,y:c,box:u}=Qh(n,e),h=r.left+(u&&a.left),d=r.top+(u&&a.top),{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-h)/f*e.width/i),y:Math.round((c-d)/p*e.height/i)}}function Kh(n,t,e){let i,s;if(t===void 0||e===void 0){let o=n&&ni(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{let r=o.getBoundingClientRect(),a=ii(o),l=he(a,"border","width"),c=he(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,i=$n(a.maxWidth,o,"clientWidth"),s=$n(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||jn,maxHeight:s||jn}}var Jt=n=>Math.round(n*10)/10;function ba(n,t,e,i){let s=ii(n),o=he(s,"margin"),r=$n(s.maxWidth,n,"clientWidth")||jn,a=$n(s.maxHeight,n,"clientHeight")||jn,l=Kh(n,t,e),{width:c,height:u}=l;if(s.boxSizing==="content-box"){let d=he(s,"border","width"),f=he(s,"padding");c-=f.width+d.width,u-=f.height+d.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=Jt(Math.min(c,r,l.maxWidth)),u=Jt(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Jt(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Jt(Math.floor(u*i))),{width:c,height:u}}function po(n,t,e){let i=t||1,s=Jt(n.height*i),o=Jt(n.width*i);n.height=Jt(n.height),n.width=Jt(n.width);let r=n.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${n.height}px`,r.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(n.currentDevicePixelRatio=i,r.height=s,r.width=o,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}var xa=(function(){let n=!1;try{let t={get passive(){return n=!0,!1}};ei()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function go(n,t){let e=Xh(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Zt(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function ya(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function _a(n,t,e,i){let s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},r=Zt(n,s,e),a=Zt(s,o,e),l=Zt(o,t,e),c=Zt(r,a,e),u=Zt(a,l,e);return Zt(c,u,e)}var Zh=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Jh=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function pe(n,t,e){return n?Zh(t,e):Jh()}function mo(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function bo(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function wa(n){return n==="angle"?{between:Le,compare:mh,normalize:it}:{between:At,compare:(t,e)=>t-e,normalize:t=>t}}function qr({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function td(n,t,e){let{property:i,start:s,end:o}=e,{between:r,normalize:a}=wa(i),l=t.length,{start:c,end:u,loop:h}=n,d,f;if(h){for(c+=l,u+=l,d=0,f=l;d<f&&r(a(t[c%l][i]),s,o);++d)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:n.style}}function xo(n,t,e){if(!e)return[n];let{property:i,start:s,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=wa(i),{start:u,end:h,loop:d,style:f}=td(n,t,e),p=[],g=!1,m=null,b,x,w,_=()=>l(s,w,b)&&a(s,w)!==0,y=()=>a(o,b)===0||l(o,w,b),v=()=>g||_(),k=()=>!g||y();for(let D=u,P=u;D<=h;++D)x=t[D%r],!x.skip&&(b=c(x[i]),b!==w&&(g=l(b,s,o),m===null&&v()&&(m=a(b,s)===0?D:P),m!==null&&k()&&(p.push(qr({start:m,end:D,loop:d,count:r,style:f})),m=null),P=D,w=b));return m!==null&&p.push(qr({start:m,end:h,loop:d,count:r,style:f})),p}function yo(n,t){let e=[],i=n.segments;for(let s=0;s<i.length;s++){let o=xo(i[s],n.points,t);o.length&&e.push(...o)}return e}function ed(n,t,e,i){let s=0,o=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&n[o%t].skip;)o--;return o%=t,{start:s,end:o}}function nd(n,t,e,i){let s=n.length,o=[],r=t,a=n[t],l;for(l=t+1;l<=e;++l){let c=n[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function va(n,t){let e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];let o=!!n._loop,{start:r,end:a}=ed(e,s,o,i);if(i===!0)return $r(n,[{start:r,end:a,loop:o}],e,t);let l=a<r?a+s:a,c=!!n._fullLoop&&r===0&&a===s-1;return $r(n,nd(e,r,l,c),e,t)}function $r(n,t,e,i){return!i||!i.setContext||!e?t:id(n,t,e,i)}function id(n,t,e,i){let s=n._chart.getContext(),o=Xr(n.options),{_datasetIndex:r,options:{spanGaps:a}}=n,l=e.length,c=[],u=o,h=t[0].start,d=h;function f(p,g,m,b){let x=a?-1:1;if(p!==g){for(p+=l;e[p%l].skip;)p-=x;for(;e[g%l].skip;)g+=x;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:b}),u=b,h=g%l)}}for(let p of t){h=a?h:p.start;let g=e[h%l],m;for(d=h+1;d<=p.end;d++){let b=e[d%l];m=Xr(i.setContext(Yt(s,{type:"segment",p0:g,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:r}))),sd(m,u)&&f(h,d-1,p.loop,u),g=b,u=m}h<d-1&&f(h,d-1,p.loop,u)}return c}function Xr(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function sd(n,t){if(!t)return!1;let e=[],i=function(s,o){return so(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Yn(n,t,e){return n.options.clip?n[e]:t[e]}function od(n,t){let{xScale:e,yScale:i}=n;return e&&i?{left:Yn(e,t,"left"),right:Yn(e,t,"right"),top:Yn(i,t,"top"),bottom:Yn(i,t,"bottom")}:t}function _o(n,t){let e=t._clip;if(e.disabled)return!1;let i=od(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}var Lo=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){let o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=to.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let o=i.items,r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Vt=new Lo,Ma="transparent",rd={boolean(n,t,e){return e>.5?t:n},color(n,t,e){let i=oo(n||Ma),s=i.valid&&oo(t||Ma);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}},Eo=class{constructor(t,e,i,s){let o=e[i];s=Ie([t.to,s,o,t.from]);let r=Ie([t.from,o,s]);this._active=!0,this._fn=t.fn||rd[t.type||typeof r],this._easing=Oe[t.easing]||Oe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ie([t.to,e,s,t.from]),this._from=Ie([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}},di=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!I(t))return;let e=Object.keys(U.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!I(o))return;let r={};for(let a of e)r[a]=o[a];($(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){let i=e.options,s=ld(t,i);if(!s)return[];let o=this._createAnimations(s,i);return i.$shared&&ad(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){let i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}let u=e[c],h=o[c],d=i.get(c);if(h)if(d&&h.active()){h.update(d,u,a);continue}else h.cancel();if(!d||!d.duration){t[c]=u;continue}o[c]=h=new Eo(d,t,c,u),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return Vt.add(this._chart,i),!0}};function ad(n,t){let e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){let o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function ld(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function ka(n,t){let e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function cd(n,t,e){if(e===!1)return!1;let i=ka(n,e),s=ka(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function ud(n){let t,e,i,s;return I(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function vl(n,t){let e=[],i=n._getSortedDatasetMetas(t),s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function Da(n,t,e,i={}){let s=n.keys,o=i.mode==="single",r,a,l,c;if(t===null)return;let u=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(u=!0,i.all)continue;break}c=n.values[l],K(c)&&(o||t===0||vt(t)===vt(c))&&(t+=c)}return!u&&!i.all?0:t}function hd(n,t){let{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(n),a=new Array(r.length),l,c,u;for(l=0,c=r.length;l<c;++l)u=r[l],a[l]={[s]:u,[o]:n[u]};return a}function wo(n,t){let e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function dd(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function fd(n){let{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function pd(n,t,e){let i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Oa(n,t,e,i){for(let s of t.getMatchingVisibleMetas(i).reverse()){let o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Pa(n,t){let{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=dd(o,r,i),h=t.length,d;for(let f=0;f<h;++f){let p=t[f],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});d=b[c]=pd(s,u,g),d[a]=m,d._top=Oa(d,r,!0,i.type),d._bottom=Oa(d,r,!1,i.type);let x=d._visualValues||(d._visualValues={});x[a]=m}}function vo(n,t){let e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function gd(n,t){return Yt(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function md(n,t,e){return Yt(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function fn(n,t){let e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(let s of t){let o=s._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}var Mo=n=>n==="reset"||n==="none",Sa=(n,t)=>t?n:Object.assign({},n),bd=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:vl(e,!0),values:null},Ft=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=wo(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&fn(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(h,d,f,p)=>h==="x"?d:h==="r"?p:f,o=e.xAxisID=C(i.xAxisID,vo(t,"x")),r=e.yAxisID=C(i.yAxisID,vo(t,"y")),a=e.rAxisID=C(i.rAxisID,vo(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),u=e.vAxisID=s(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Zs(this._data,this),t._stacked&&fn(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(I(e)){let s=this._cachedMeta;this._data=hd(e,s)}else if(i!==e){if(i){Zs(i,this);let s=this._cachedMeta;fn(s),s._parsed=[]}e&&Object.isExtensible(e)&&sa(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let o=e._stacked;e._stacked=wo(e.vScale,e),e.stack!==i.stack&&(s=!0,fn(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&(Pa(this,e._parsed),e._stacked=wo(e.vScale,e))}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis,l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{$(s[t])?d=this.parseArrayData(i,s,t,e):I(s[t])?d=this.parseObjectData(i,s,t,e):d=this.parsePrimitiveData(i,s,t,e);let f=()=>h[a]===null||c&&h[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=h=d[u],l&&(f()&&(l=!1),c=h);i._sorted=l}r&&Pa(this,d)}parsePrimitiveData(t,e,i,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,h=new Array(s),d,f,p;for(d=0,f=s;d<f;++d)p=d+i,h[d]={[a]:u||o.parse(c[p],p),[l]:r.parse(e[p],p)};return h}parseArrayData(t,e,i,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=e[u],a[l]={x:o.parse(h[0],u),y:r.parse(h[1],u)};return a}parseObjectData(t,e,i,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),u,h,d,f;for(u=0,h=s;u<h;++u)d=u+i,f=e[d],c[u]={x:o.parse(Ht(f,a),d),y:r.parse(Ht(f,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:vl(s,!0),values:e._stacks[t.axis]._visualValues};return Da(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){let o=i[e.axis],r=o===null?NaN:o,a=s&&i._stacks[e.axis];s&&a&&(s.values=a,r=Da(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){let i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=bd(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=fd(a),d,f;function p(){f=s[d];let g=f[a.axis];return!K(f[t.axis])||u>g||h<g}for(d=0;d<r&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),o));++d);if(o){for(d=r-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let e=this._cachedMeta._parsed,i=[],s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],K(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,i=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let e=this._cachedMeta;this.update(t||"default"),e._clip=ud(C(this.options.clip,cd(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){let h=s[u];h.hidden||(h.active&&c?r.push(h):h.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,e){let i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=md(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=gd(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){let s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&Te(i);if(a)return Sa(a,l);let c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),u),f=Object.keys(U.elements[t]),p=()=>this.getContext(i,s,e),g=c.resolveNamedOptions(d,f,p,h);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(Sa(g,l))),g}_resolveAnimations(t,e,i){let s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,e),d=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(d,this.getContext(t,i,e))}let c=new di(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Mo(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,s){Mo(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Mo(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;let o=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=i.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,i=!0){let s=this._cachedMeta,o=s.data,r=t+e,a,l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,e);i._stacked&&fn(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let 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]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};function xd(n,t){if(!n._cache.$bar){let e=n.getMatchingVisibleMetas(t),i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Js(i.sort((s,o)=>s-o))}return n._cache.$bar}function yd(n){let t=n.iScale,e=xd(t,n.type),i=t._length,s,o,r,a,l=()=>{r===32767||r===-32768||(Te(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(s=0,o=e.length;s<o;++s)r=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return i}function _d(n,t,e,i){let s=e.barThickness,o,r;return F(s)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[n]-o/2}}function wd(n,t,e,i){let s=t.pixels,o=s[n],r=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null,l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);let c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:e.barPercentage,start:c}}function vd(n,t,e,i){let s=e.parse(n[0],i),o=e.parse(n[1],i),r=Math.min(s,o),a=Math.max(s,o),l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function Ml(n,t,e,i){return $(n)?vd(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Ca(n,t,e,i){let s=n.iScale,o=n.vScale,r=s.getLabels(),a=s===o,l=[],c,u,h,d;for(c=e,u=e+i;c<u;++c)d=t[c],h={},h[s.axis]=a||s.parse(r[c],c),l.push(Ml(d,h,o,c));return l}function ko(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Md(n,t,e){return n!==0?vt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function kd(n){let t,e,i,s,o;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:i,reverse:t,top:s,bottom:o}}function Dd(n,t,e,i){let s=t.borderSkipped,o={};if(!s){n.borderSkipped=o;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:r,end:a,reverse:l,top:c,bottom:u}=kd(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(o[Ta(u,r,a,l)]=!0,s=c)),o[Ta(s,r,a,l)]=!0,n.borderSkipped=o}function Ta(n,t,e,i){return i?(n=Od(n,t,e),n=Aa(n,e,t)):n=Aa(n,t,e),n}function Od(n,t,e){return n===t?e:n===e?t:n}function Aa(n,t,e){return n==="start"?t:n==="end"?e:n}function Pd(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}var Fo=class extends Ft{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return Ca(t,e,i,s)}parseArrayData(t,e,i,s){return Ca(t,e,i,s)}parseObjectData(t,e,i,s){let{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,u=r.axis==="x"?a:l,h=[],d,f,p,g;for(d=i,f=i+s;d<f;++d)g=e[d],p={},p[o.axis]=o.parse(Ht(g,c),d),h.push(Ml(Ht(g,u),p,r,d));return h}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);let o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let e=this._cachedMeta,{iScale:i,vScale:s}=e,o=this.getParsed(t),r=o._custom,a=ko(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){let o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s);for(let f=e;f<e+i;f++){let p=this.getParsed(f),g=o||F(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,u),b=(p._stacks||{})[a.axis],x={horizontal:c,base:g.base,enableBorderRadius:!b||ko(p._custom)||r===b._top||r===b._bottom,x:c?g.head:m.center,y:c?m.center:g.head,height:c?m.size:Math.abs(g.size),width:c?Math.abs(g.size):m.size};d&&(x.options=h||this.resolveDataElementOptions(f,t[f].active?"active":s));let w=x.options||t[f].options;Dd(x,w,b,r),Pd(x,w,u.ratio),this.updateElement(t[f],f,x,s)}}_getStacks(t,e){let{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=i.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{let h=u._parsed.find(f=>f[i.axis]===l),d=h&&h[u.vScale.axis];if(F(d)||isNaN(d))return!0};for(let u of s)if(!(e!==void 0&&c(u))&&((o===!1||r.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&r.push(u.stack),u.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){let t={},e=this.getFirstScaleIdForIndexAxis();for(let i of this.chart.data.datasets)t[C(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){let s=this._getStacks(t,i),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){let t=this.options,e=this._cachedMeta,i=e.iScale,s=[],o,r;for(o=0,r=e.data.length;o<r;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));let a=t.barThickness;return{min:a||yd(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,u=ko(c),h=l[e.axis],d=0,f=i?this.applyStack(e,l,i):h,p,g;f!==h&&(d=f-h,f=h),u&&(h=c.barStart,f=c.barEnd-c.barStart,h!==0&&vt(h)!==vt(c.barEnd)&&(d=0),d+=h);let m=!F(o)&&!u?o:d,b=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(d+f):p=b,g=p-b,Math.abs(g)<r){g=Md(g,e,a)*r,h===a&&(b-=g/2);let x=e.getPixelForDecimal(0),w=e.getPixelForDecimal(1),_=Math.min(x,w),y=Math.max(x,w);b=Math.max(Math.min(b,y),_),p=b+g,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(b))}if(b===e.getPixelForValue(a)){let x=vt(g)*e.getLineWidthForValue(a)/2;b+=x,g-=x}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(t,e){let i=e.scale,s=this.options,o=s.skipNull,r=C(s.maxBarThickness,1/0),a,l,c=this._getAxisCount();if(e.grouped){let u=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?wd(t,e,s,u*c):_d(t,e,s,u*c),d=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(C(d,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+f;a=h.start+h.chunk*p+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){let t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length,o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}},Io=class extends Ft{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){let o=super.parsePrimitiveData(t,e,i,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+i).radius;return o}parseArrayData(t,e,i,s){let o=super.parseArrayData(t,e,i,s);for(let r=0;r<o.length;r++){let a=e[i+r];o[r]._custom=C(a[2],this.resolveDataElementOptions(r+i).radius)}return o}parseObjectData(t,e,i,s){let o=super.parseObjectData(t,e,i,s);for(let r=0;r<o.length;r++){let a=e[i+r];o[r]._custom=C(a&&a.r&&+a.r,this.resolveDataElementOptions(r+i).radius)}return o}getMaxOverflow(){let t=this._cachedMeta.data,e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){let o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=r.axis,h=a.axis;for(let d=e;d<e+i;d++){let f=t[d],p=!o&&this.getParsed(d),g={},m=g[u]=o?r.getPixelForDecimal(.5):r.getPixelForValue(p[u]),b=g[h]=o?a.getBasePixel():a.getPixelForValue(p[h]);g.skip=isNaN(m)||isNaN(b),c&&(g.options=l||this.resolveDataElementOptions(d,f.active?"active":s),o&&(g.options.radius=0)),this.updateElement(f,d,g,s)}}resolveDataElementOptions(t,e){let i=this.getParsed(t),s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=C(i&&i._custom,o),s}};function Sd(n,t,e){let i=1,s=1,o=0,r=0;if(t<X){let a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),h=Math.cos(l),d=Math.sin(l),f=(w,_,y)=>Le(w,a,l,!0)?1:Math.max(_,_*e,y,y*e),p=(w,_,y)=>Le(w,a,l,!0)?-1:Math.min(_,_*e,y,y*e),g=f(0,c,h),m=f(Z,u,d),b=p(W,c,h),x=p(W+Z,u,d);i=(g-b)/2,s=(m-x)/2,o=-(g+b)/2,r=-(m+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}var _n=class extends Ft{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data,{labels:{pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{let h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:s,pointStyle:i,borderRadius:r&&(a||h.borderRadius),index:c}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(I(i[t])){let{key:l="value"}=this._parsing;o=c=>+Ht(i[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return bt(this.options.rotation-90)}_getCircumference(){return bt(this.options.circumference)}_getRotationExtents(){let t=X,e=-X;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){let s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){let e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(Gr(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:p,offsetY:g}=Sd(h,u,l),m=(i.width-r)/d,b=(i.height-r)/f,x=Math.max(Math.min(m,b)/2,0),w=$s(this.options.radius,x),_=Math.max(w*l,0),y=(w-_)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=g*w,s.total=this.calculateTotal(),this.outerRadius=w-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){let i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/X)}updateElements(t,e,i,s){let o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,u=(a.left+a.right)/2,h=(a.top+a.bottom)/2,d=o&&c.animateScale,f=d?0:this.innerRadius,p=d?0:this.outerRadius,{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,s),b=this._getRotation(),x;for(x=0;x<e;++x)b+=this._circumference(x,o);for(x=e;x<e+i;++x){let w=this._circumference(x,o),_=t[x],y={x:u+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:p,innerRadius:f};m&&(y.options=g||this.resolveDataElementOptions(x,_.active?"active":s)),b+=w,this.updateElement(_,x,y,s)}}calculateTotal(){let t=this._cachedMeta,e=t.data,i=0,s;for(s=0;s<e.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?X*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Ee(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0,i=this.chart,s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++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 i=0,s=t.length;i<s;++i){let o=this.resolveDataElementOptions(i);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(C(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}},Ro=class extends Ft{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled,{start:a,count:l}=no(e,s,r);this._drawStart=a,this._drawCount=l,io(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),d=r.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,m=fe(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=e+i,w=t.length,_=e>0&&this.getParsed(e-1);for(let y=0;y<w;++y){let v=t[y],k=b?v:{};if(y<e||y>=x){k.skip=!0;continue}let D=this.getParsed(y),P=F(D[f]),S=k[d]=r.getPixelForValue(D[d],y),T=k[f]=o||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,D,l):D[f],y);k.skip=isNaN(S)||isNaN(T)||P,k.stop=y>0&&Math.abs(D[d]-_[d])>m,g&&(k.parsed=D,k.raw=c.data[y]),h&&(k.options=u||this.resolveDataElementOptions(y,v.active?"active":s)),b||this.updateElement(v,y,k,s),_=D}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},fi=class extends Ft{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{let l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Ee(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return fo.bind(this)(t,e,i,s)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{let o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){let o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,d=c.getIndexAngle(0)-.5*W,f=d,p,g=360/this.countVisibleElements();for(p=0;p<e;++p)f+=this._computeAngle(p,s,g);for(p=e;p<e+i;p++){let m=t[p],b=f,x=f+this._computeAngle(p,s,g),w=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;f=x,o&&(l.animateScale&&(w=0),l.animateRotate&&(b=x=d));let _={x:u,y:h,innerRadius:0,outerRadius:w,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,m.active?"active":s)};this.updateElement(m,p,_,s)}}countVisibleElements(){let t=this._cachedMeta,e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?bt(this.resolveDataElementOptions(t,e).angle||i):0}},No=class extends _n{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},zo=class extends Ft{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return fo.bind(this)(t,e,i,s)}update(t){let e=this._cachedMeta,i=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(i.points=s,t!=="resize"){let r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);let a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){let o=this._cachedMeta.rScale,r=s==="reset";for(let a=e;a<e+i;a++){let l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=o.getPointPositionForValue(a,this.getParsed(a).r),h=r?o.xCenter:u.x,d=r?o.yCenter:u.y,f={x:h,y:d,angle:u.angle,skip:isNaN(h)||isNaN(d),options:c};this.updateElement(l,a,f,s)}}},Wo=class extends Ft{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){let e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled,{start:o,count:r}=no(e,i,s);if(this._drawStart=o,this._drawCount=r,io(e)&&(o=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,o,r,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(u),d=this.includeOptions(s,h),f=r.axis,p=a.axis,{spanGaps:g,segment:m}=this.options,b=fe(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none",w=e>0&&this.getParsed(e-1);for(let _=e;_<e+i;++_){let y=t[_],v=this.getParsed(_),k=x?y:{},D=F(v[p]),P=k[f]=r.getPixelForValue(v[f],_),S=k[p]=o||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,v,l):v[p],_);k.skip=isNaN(P)||isNaN(S)||D,k.stop=_>0&&Math.abs(v[f]-w[f])>b,m&&(k.parsed=v,k.raw=c.data[_]),d&&(k.options=h||this.resolveDataElementOptions(_,y.active?"active":s)),x||this.updateElement(y,_,k,s),w=v}this.updateSharedOptions(h,s,u)}getMaxOverflow(){let 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}let i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;let o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,r)/2}},Cd=Object.freeze({__proto__:null,BarController:Fo,BubbleController:Io,DoughnutController:_n,LineController:Ro,PieController:No,PolarAreaController:fi,RadarController:zo,ScatterController:Wo});function ge(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Bo=class n{static override(t){Object.assign(n.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ge()}parse(){return ge()}format(){return ge()}add(){return ge()}diff(){return ge()}startOf(){return ge()}endOf(){return ge()}},rr={_date:Bo};function Td(n,t,e,i){let{controller:s,data:o,_sorted:r}=n,a=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?ea:St;if(i){if(s._sharedOptions){let u=o[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){let d=c(o,t,e-h),f=c(o,t,e+h);return{lo:d.lo,hi:f.hi}}}}else{let u=c(o,t,e);if(l){let{vScale:h}=s._cachedMeta,{_parsed:d}=n,f=d.slice(0,u.lo+1).reverse().findIndex(g=>!F(g[h.axis]));u.lo-=Math.max(0,f);let p=d.slice(u.hi).findIndex(g=>!F(g[h.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:o.length-1}}function Dn(n,t,e,i,s){let o=n.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:u}=o[a],{lo:h,hi:d}=Td(o[a],t,r,s);for(let f=h;f<=d;++f){let p=u[f];p.skip||i(p,c,f)}}}function Ad(n){let t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){let o=t?Math.abs(i.x-s.x):0,r=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Do(n,t,e,i,s){let o=[];return!s&&!n.isPointInArea(t)||Dn(n,e,t,function(a,l,c){!s&&!Ct(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Ld(n,t,e,i){let s=[];function o(r,a,l){let{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:h}=Ks(r,{x:t.x,y:t.y});Le(h,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return Dn(n,e,t,o),s}function Ed(n,t,e,i,s,o){let r=[],a=Ad(e),l=Number.POSITIVE_INFINITY;function c(u,h,d){let f=u.inRange(t.x,t.y,s);if(i&&!f)return;let p=u.getCenterPoint(s);if(!(!!o||n.isPointInArea(p))&&!f)return;let m=a(t,p);m<l?(r=[{element:u,datasetIndex:h,index:d}],l=m):m===l&&r.push({element:u,datasetIndex:h,index:d})}return Dn(n,e,t,c),r}function Oo(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Ld(n,t,e,s):Ed(n,t,e,i,s,o)}function La(n,t,e,i,s){let o=[],r=e==="x"?"inXRange":"inYRange",a=!1;return Dn(n,e,t,(l,c,u)=>{l[r]&&l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var Fd={evaluateInteractionItems:Dn,modes:{index(n,t,e,i){let s=se(t,n),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Do(n,s,o,i,r):Oo(n,s,o,!1,i,r),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{let u=a[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){let s=se(t,n),o=e.axis||"xy",r=e.includeInvisible||!1,a=e.intersect?Do(n,s,o,i,r):Oo(n,s,o,!1,i,r);if(a.length>0){let l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){let s=se(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return Do(n,s,o,i,r)},nearest(n,t,e,i){let s=se(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return Oo(n,s,o,e.intersect,i,r)},x(n,t,e,i){let s=se(t,n);return La(n,s,"x",e.intersect,i)},y(n,t,e,i){let s=se(t,n);return La(n,s,"y",e.intersect,i)}}},kl=["left","top","right","bottom"];function pn(n,t){return n.filter(e=>e.pos===t)}function Ea(n,t){return n.filter(e=>kl.indexOf(e.pos)===-1&&e.box.axis===t)}function gn(n,t){return n.sort((e,i)=>{let s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Id(n){let t=[],e,i,s,o,r,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Rd(n){let t={};for(let e of n){let{stack:i,pos:s,stackWeight:o}=e;if(!i||!kl.includes(s))continue;let r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Nd(n,t){let e=Rd(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=n.length;o<r;++o){a=n[o];let{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function zd(n){let t=Id(n),e=gn(t.filter(c=>c.box.fullSize),!0),i=gn(pn(t,"left"),!0),s=gn(pn(t,"right")),o=gn(pn(t,"top"),!0),r=gn(pn(t,"bottom")),a=Ea(t,"x"),l=Ea(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:pn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Fa(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Dl(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Wd(n,t,e,i){let{pos:s,box:o}=e,r=n.maxPadding;if(!I(s)){e.size&&(n[s]-=e.size);let h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?o.height:o.width),e.size=h.size/h.count,n[s]+=e.size}o.getPadding&&Dl(r,o.getPadding());let a=Math.max(0,t.outerWidth-Fa(r,n,"left","right")),l=Math.max(0,t.outerHeight-Fa(r,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Bd(n){let t=n.maxPadding;function e(i){let s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Hd(n,t){let e=t.maxPadding;function i(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return i(n?["left","right"]:["top","bottom"])}function xn(n,t,e,i){let s=[],o,r,a,l,c,u;for(o=0,r=n.length,c=0;o<r;++o){a=n[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Hd(a.horizontal,t));let{same:h,other:d}=Wd(t,e,a,i);c|=h&&s.length,u=u||d,l.fullSize||s.push(a)}return c&&xn(s,t,e,i)||u}function si(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Ia(n,t,e,i){let s=e.padding,{x:o,y:r}=t;for(let a of n){let l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){let h=t.w*u,d=c.size||l.height;Te(c.start)&&(r=c.start),l.fullSize?si(l,s.left,r,e.outerWidth-s.right-s.left,d):si(l,t.left+c.placed,r,h,d),c.start=r,c.placed+=h,r=l.bottom}else{let h=t.h*u,d=c.size||l.width;Te(c.start)&&(o=c.start),l.fullSize?si(l,o,s.top,d,e.outerHeight-s.bottom-s.top):si(l,o,t.top+c.placed,d,h),c.start=o,c.placed+=h,o=l.right}}t.x=o,t.y=r}var lt={addBox(n,t){n.boxes||(n.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)}}]},n.boxes.push(t)},removeBox(n,t){let e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;let s=ot(n.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=zd(n.boxes),l=a.vertical,c=a.horizontal;H(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});let u=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),d=Object.assign({},s);Dl(d,ot(i));let f=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),p=Nd(l.concat(c),h);xn(a.fullSize,f,h,p),xn(l,f,h,p),xn(c,f,h,p)&&xn(l,f,h,p),Bd(f),Ia(a.leftAndTop,f,h,p),f.x+=f.w,f.y+=f.h,Ia(a.rightAndBottom,f,h,p),n.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},H(a.chartArea,g=>{let m=g.box;Object.assign(m,n.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},pi=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}},Ho=class extends pi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},ui="$chartjs",Yd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ra=n=>n===null||n==="";function Vd(n,t){let e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ui]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ra(s)){let o=go(n,"width");o!==void 0&&(n.width=o)}if(Ra(i))if(n.style.height==="")n.height=n.width/(t||2);else{let o=go(n,"height");o!==void 0&&(n.height=o)}return n}var Ol=xa?{passive:!0}:!1;function jd(n,t,e){n&&n.addEventListener(t,e,Ol)}function qd(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Ol)}function $d(n,t){let e=Yd[n.type]||n.type,{x:i,y:s}=se(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function gi(n,t){for(let e of n)if(e===t||e.contains(t))return!0}function Xd(n,t,e){let i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||gi(a.addedNodes,i),r=r&&!gi(a.removedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ud(n,t,e){let i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||gi(a.removedNodes,i),r=r&&!gi(a.addedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}var wn=new Map,Na=0;function Pl(){let n=window.devicePixelRatio;n!==Na&&(Na=n,wn.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Gd(n,t){wn.size||window.addEventListener("resize",Pl),wn.set(n,t)}function Qd(n){wn.delete(n),wn.size||window.removeEventListener("resize",Pl)}function Kd(n,t,e){let i=n.canvas,s=i&&ni(i);if(!s)return;let o=eo((a,l)=>{let c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),Gd(n,o),r}function Po(n,t,e){e&&e.disconnect(),t==="resize"&&Qd(n)}function Zd(n,t,e){let i=n.canvas,s=eo(o=>{n.ctx!==null&&e($d(o,n))},n);return jd(i,t,s),s}var Yo=class extends pi{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Vd(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[ui])return!1;let i=e[ui].initial;["height","width"].forEach(o=>{let r=i[o];F(r)?e.removeAttribute(o):e.setAttribute(o,r)});let s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[ui],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),r={attach:Xd,detach:Ud,resize:Kd}[e]||Zd;s[e]=r(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Po,detach:Po,resize:Po}[e]||qd)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return ba(t,e,i,s)}isAttached(t){let e=t&&ni(t);return!!(e&&e.isConnected)}};function Jd(n){return!ei()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Ho:Yo}var Mt=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return fe(this.x)&&fe(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}};function tf(n,t){let e=n.options.ticks,i=ef(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?sf(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return of(t,c,o,r/s),c;let u=nf(o,t,s);if(r>0){let h,d,f=r>1?Math.round((l-a)/(r-1)):null;for(oi(t,c,u,F(f)?0:a-f,a),h=0,d=r-1;h<d;h++)oi(t,c,u,o[h],o[h+1]);return oi(t,c,u,l,F(f)?t.length:l+f),c}return oi(t,c,u),c}function ef(n){let t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function nf(n,t,e){let i=rf(n),s=t.length/e;if(!i)return Math.max(s,1);let o=Zr(i);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function sf(n){let t=[],e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function of(n,t,e,i){let s=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<n.length;r++)r===o&&(t.push(n[r]),s++,o=e[s*i])}function oi(n,t,e,i,s){let o=C(i,0),r=Math.min(C(s,n.length),n.length),a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=o;u<0;)a++,u=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(n[c]),a++,u=Math.round(o+a*e))}function rf(n){let t=n.length,e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}var af=n=>n==="left"?"right":n==="right"?"left":n,za=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Wa=(n,t)=>Math.min(t||n,n);function Ba(n,t){let e=[],i=n.length/t,s=n.length,o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function lf(n,t,e){let i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,r=n._endPixel,a=1e-6,l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-o,r-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function cf(n,t){H(n,e=>{let i=e.gc,s=i.length/2,o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function mn(n){return n.drawTicks?n.tickLength:0}function Ha(n,t){if(!n.display)return 0;let e=tt(n.font,t),i=ot(n.padding);return($(n.text)?n.text.length:1)*e.lineHeight+i.height}function uf(n,t){return Yt(n,{scale:t,type:"scale"})}function hf(n,t,e){return Yt(n,{tick:e,index:t,type:"tick"})}function df(n,t,e){let i=Qn(n);return(e&&t!=="right"||!e&&t==="right")&&(i=af(i)),i}function ff(n,t,e,i){let{top:s,left:o,bottom:r,right:a,chart:l}=n,{chartArea:c,scales:u}=l,h=0,d,f,p,g=r-s,m=a-o;if(n.isHorizontal()){if(f=st(i,o,a),I(e)){let b=Object.keys(e)[0],x=e[b];p=u[b].getPixelForValue(x)+g-t}else e==="center"?p=(c.bottom+c.top)/2+g-t:p=za(n,e,t);d=a-o}else{if(I(e)){let b=Object.keys(e)[0],x=e[b];f=u[b].getPixelForValue(x)-m+t}else e==="center"?f=(c.left+c.right)/2-m+t:f=za(n,e,t);p=st(i,r,s),h=e==="left"?-Z:Z}return{titleX:f,titleY:p,maxWidth:d,rotation:h}}var be=class n extends Mt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=ut(t,Number.POSITIVE_INFINITY),e=ut(e,Number.NEGATIVE_INFINITY),i=ut(i,Number.POSITIVE_INFINITY),s=ut(s,Number.NEGATIVE_INFINITY),{min:ut(t,i),max:ut(e,s),minDefined:K(t),maxDefined:K(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:i};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:ut(e,ut(i,e)),max:ut(i,ut(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){j(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ha(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Ba(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=tf(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,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){j(this.options.afterUpdate,[this])}beforeSetDimensions(){j(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(){j(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),j(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){j(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e=this.options.ticks,i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=j(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){j(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){j(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,e=t.ticks,i=Wa(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation,r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let u=this._getLabelSizes(),h=u.widest.width,d=u.highest.height,f=et(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),h+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-mn(t.grid)-e.padding-Ha(t.title,this.chart.options.font),c=Math.sqrt(h*h+d*d),r=Un(Math.min(Math.asin(et((u.highest.height+6)/a,-1,1)),Math.asin(et(l/c,-1,1))-Math.asin(et(d/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){j(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){j(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=Ha(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=mn(o)+l):(t.height=this.maxHeight,t.width=mn(o)+l),i.display&&this.ticks.length){let{first:c,last:u,widest:h,highest:d}=this._getLabelSizes(),f=i.padding*2,p=bt(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){let b=i.mirror?0:m*h.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=i.mirror?0:g*h.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,u,m,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),d=0,f=0;l?c?(d=s*t.width,f=i*e.height):(d=i*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-h+r)*this.width/(this.width-h),0)}else{let u=e.height/2,h=t.height/2;o==="start"?(u=0,h=t.height):o==="end"&&(u=e.height,h=0),this.paddingTop=u+r,this.paddingBottom=h+r}}_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(){j(this.options.afterFit,[this])}isHorizontal(){let{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,i;for(e=0,i=t.length;e<i;e++)F(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=Ba(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Wa(e,i)),c=0,u=0,h,d,f,p,g,m,b,x,w,_,y;for(h=0;h<e;h+=l){if(p=t[h].label,g=this._resolveTickFontOptions(h),s.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},x=g.lineHeight,w=_=0,!F(p)&&!$(p))w=ln(s,b.data,b.gc,w,p),_=x;else if($(p))for(d=0,f=p.length;d<f;++d)y=p[d],!F(y)&&!$(y)&&(w=ln(s,b.data,b.gc,w,y),_+=x);r.push(w),a.push(_),c=Math.max(w,c),u=Math.max(_,u)}cf(o,e);let v=r.indexOf(c),k=a.indexOf(u),D=P=>({width:r[P]||0,height:a[P]||0});return{first:D(0),last:D(e-1),widest:D(v),highest:D(k),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return ta(this._alignToPixels?ee(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let i=e[t];return i.$context||(i.$context=hf(this.getContext(),t,i))}return this.$context||(this.$context=uf(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,e=bt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),d=mn(o),f=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(G){return ee(i,G,g)},x,w,_,y,v,k,D,P,S,T,E,nt;if(r==="top")x=b(this.bottom),k=this.bottom-d,P=x-m,T=b(t.top)+m,nt=t.bottom;else if(r==="bottom")x=b(this.top),T=t.top,nt=b(t.bottom)-m,k=x+m,P=this.top+d;else if(r==="left")x=b(this.right),v=this.right-d,D=x-m,S=b(t.left)+m,E=t.right;else if(r==="right")x=b(this.left),S=t.left,E=b(t.right)-m,v=x+m,D=this.left+d;else if(e==="x"){if(r==="center")x=b((t.top+t.bottom)/2+.5);else if(I(r)){let G=Object.keys(r)[0],J=r[G];x=b(this.chart.scales[G].getPixelForValue(J))}T=t.top,nt=t.bottom,k=x+m,P=k+d}else if(e==="y"){if(r==="center")x=b((t.left+t.right)/2);else if(I(r)){let G=Object.keys(r)[0],J=r[G];x=b(this.chart.scales[G].getPixelForValue(J))}v=x-m,D=v-d,S=t.left,E=t.right}let gt=C(s.ticks.maxTicksLimit,h),V=Math.max(1,Math.ceil(h/gt));for(w=0;w<h;w+=V){let G=this.getContext(w),J=o.setContext(G),_t=a.setContext(G),at=J.lineWidth,we=J.color,An=_t.dash||[],ve=_t.dashOffset,Ke=J.tickWidth,ae=J.tickColor,Ze=J.tickBorderDash||[],le=J.tickBorderDashOffset;_=lf(this,w,l),_!==void 0&&(y=ee(i,_,at),c?v=D=S=E=y:k=P=T=nt=y,f.push({tx1:v,ty1:k,tx2:D,ty2:P,x1:S,y1:T,x2:E,y2:nt,width:at,color:we,borderDash:An,borderDashOffset:ve,tickWidth:Ke,tickColor:ae,tickBorderDash:Ze,tickBorderDashOffset:le}))}return this._ticksLength=h,this._borderValue=x,f}_computeLabelItems(t){let e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=o,d=mn(i.grid),f=d+u,p=h?-u:f,g=-bt(this.labelRotation),m=[],b,x,w,_,y,v,k,D,P,S,T,E,nt="middle";if(s==="top")v=this.bottom-p,k=this._getXAxisLabelAlignment();else if(s==="bottom")v=this.top+p,k=this._getXAxisLabelAlignment();else if(s==="left"){let V=this._getYAxisLabelAlignment(d);k=V.textAlign,y=V.x}else if(s==="right"){let V=this._getYAxisLabelAlignment(d);k=V.textAlign,y=V.x}else if(e==="x"){if(s==="center")v=(t.top+t.bottom)/2+f;else if(I(s)){let V=Object.keys(s)[0],G=s[V];v=this.chart.scales[V].getPixelForValue(G)+f}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")y=(t.left+t.right)/2-f;else if(I(s)){let V=Object.keys(s)[0],G=s[V];y=this.chart.scales[V].getPixelForValue(G)}k=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?nt="top":l==="end"&&(nt="bottom"));let gt=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){w=a[b],_=w.label;let V=o.setContext(this.getContext(b));D=this.getPixelForTick(b)+o.labelOffset,P=this._resolveTickFontOptions(b),S=P.lineHeight,T=$(_)?_.length:1;let G=T/2,J=V.color,_t=V.textStrokeColor,at=V.textStrokeWidth,we=k;r?(y=D,k==="inner"&&(b===x-1?we=this.options.reverse?"left":"right":b===0?we=this.options.reverse?"right":"left":we="center"),s==="top"?c==="near"||g!==0?E=-T*S+S/2:c==="center"?E=-gt.highest.height/2-G*S+S:E=-gt.highest.height+S/2:c==="near"||g!==0?E=S/2:c==="center"?E=gt.highest.height/2-G*S:E=gt.highest.height-T*S,h&&(E*=-1),g!==0&&!V.showLabelBackdrop&&(y+=S/2*Math.sin(g))):(v=D,E=(1-T)*S/2);let An;if(V.showLabelBackdrop){let ve=ot(V.backdropPadding),Ke=gt.heights[b],ae=gt.widths[b],Ze=E-ve.top,le=0-ve.left;switch(nt){case"middle":Ze-=Ke/2;break;case"bottom":Ze-=Ke;break}switch(k){case"center":le-=ae/2;break;case"right":le-=ae;break;case"inner":b===x-1?le-=ae:b>0&&(le-=ae/2);break}An={left:le,top:Ze,width:ae+ve.width,height:Ke+ve.height,color:V.backdropColor}}m.push({label:_,font:P,textOffset:E,options:{rotation:g,color:J,strokeColor:_t,strokeWidth:at,textAlign:we,textBaseline:nt,translation:[y,v],backdrop:An}})}return m}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-bt(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){let{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,u;return e==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let 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(){let{ctx:t,options:{backgroundColor:e},left:i,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){let l=s[o];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(){let{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,u,h,d;this.isHorizontal()?(c=ee(t,this.left,r)-r/2,u=ee(t,this.right,a)+a/2,h=d=l):(h=ee(t,this.top,r)-r/2,d=ee(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,h),e.lineTo(u,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&hn(i,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,u=r.textOffset;ne(i,c,0,u,l,a)}s&&dn(i)}drawTitle(){let{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;let o=tt(i.font),r=ot(i.padding),a=i.align,l=o.lineHeight/2;e==="bottom"||e==="center"||I(e)?(l+=r.bottom,$(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;let{titleX:c,titleY:u,maxWidth:h,rotation:d}=ff(this,l,e,a);ne(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:d,textAlign:df(a,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,e=t.ticks&&t.ticks.z||0,i=C(t.grid&&t.grid.z,-1),s=C(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==n.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],o,r;for(o=0,r=e.length;o<r;++o){let a=e[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let e=this.options.ticks.setContext(this.getContext(t));return tt(e.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Ne=class{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let e=Object.getPrototypeOf(t),i;mf(e)&&(i=this.register(e));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,pf(t,r,i),this.override&&U.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in U[s]&&(delete U[s][i],this.override&&delete te[i])}};function pf(n,t,e){let i=Pe(Object.create(null),[e?U.get(e):{},U.get(t),n.defaults]);U.set(t,i),n.defaultRoutes&&gf(t,n.defaultRoutes),n.descriptors&&U.describe(t,n.descriptors)}function gf(n,t){Object.keys(t).forEach(e=>{let i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");U.route(o,s,l,a)})}function mf(n){return"id"in n&&"defaults"in n}var Vo=class{constructor(){this.controllers=new Ne(Ft,"datasets",!0),this.elements=new Ne(Mt,"elements"),this.plugins=new Ne(Object,"plugins"),this.scales=new Ne(be,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{let o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):H(s,r=>{let a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){let s=Xn(t);j(i["before"+s],[],i),e[t](i),j(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){let s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}},Et=new Vo,jo=class{constructor(){this._init=void 0}notify(t,e,i,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,e,i,s){s=s||{};for(let o of t){let r=o.plugin,a=r[i],l=[e,s,o.options];if(j(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){F(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,s=C(i.options&&i.options.plugins,{}),o=bf(i);return s===!1&&!e?[]:yf(t,o,s,e)}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}};function bf(n){let t={},e=[],i=Object.keys(Et.plugins.items);for(let o=0;o<i.length;o++)e.push(Et.getPlugin(i[o]));let s=n.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function xf(n,t){return!t&&n===!1?null:n===!0?{}:n}function yf(n,{plugins:t,localIds:e},i,s){let o=[],r=n.getContext();for(let a of t){let l=a.id,c=xf(i[l],s);c!==null&&o.push({plugin:a,options:_f(n.config,{plugin:a,local:e[l]},c,r)})}return o}function _f(n,{plugin:t,local:e},i,s){let o=n.pluginScopeKeys(t),r=n.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),n.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function qo(n,t){let e=U.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function wf(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function vf(n,t){return n===t?"_index_":"_value_"}function Ya(n){if(n==="x"||n==="y"||n==="r")return n}function Mf(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function $o(n,...t){if(Ya(n))return n;for(let e of t){let i=e.axis||Mf(e.position)||n.length>1&&Ya(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Va(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function kf(n,t){if(t.data&&t.data.datasets){let e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Va(n,"x",e[0])||Va(n,"y",e[0])}return{}}function Df(n,t){let e=te[n.type]||{scales:{}},i=t.scales||{},s=qo(n.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{let a=i[r];if(!I(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let l=$o(r,a,kf(r,n),U.scales[a.type]),c=vf(l,s),u=e.scales||{};o[r]=Ce(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(r=>{let a=r.type||n.type,l=r.indexAxis||qo(a,t),u=(te[a]||{}).scales||{};Object.keys(u).forEach(h=>{let d=wf(h,l),f=r[d+"AxisID"]||d;o[f]=o[f]||Object.create(null),Ce(o[f],[{axis:d},i[f],u[h]])})}),Object.keys(o).forEach(r=>{let a=o[r];Ce(a,[U.scales[a.type],U.scale])}),o}function Sl(n){let t=n.options||(n.options={});t.plugins=C(t.plugins,{}),t.scales=Df(n,t)}function Cl(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Of(n){return n=n||{},n.data=Cl(n.data),Sl(n),n}var ja=new Map,Tl=new Set;function ri(n,t){let e=ja.get(n);return e||(e=t(),ja.set(n,e),Tl.add(e)),e}var bn=(n,t,e)=>{let i=Ht(t,e);i!==void 0&&n.add(i)},Xo=class{constructor(t){this._config=Of(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=Cl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),Sl(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ri(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ri(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ri(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return ri(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){let{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;let l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(h=>bn(l,t,h))),u.forEach(h=>bn(l,s,h)),u.forEach(h=>bn(l,te[o]||{},h)),u.forEach(h=>bn(l,U,h)),u.forEach(h=>bn(l,Kn,h))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Tl.has(e)&&r.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return[t,te[e]||{},U.datasets[e]||{},{type:e},U,Kn]}resolveNamedOptions(t,e,i,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=qa(this._resolverCache,t,s),l=r;if(Sf(r,e)){o.$shared=!1,i=Wt(i)?i():i;let c=this.createResolver(t,i,a);l=de(r,i,c)}for(let c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],s){let{resolver:o}=qa(this._resolverCache,t,i);return I(e)?de(o,e,void 0,s):o}};function qa(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));let s=e.join(),o=i.get(s);return o||(o={resolver:ti(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}var Pf=n=>I(n)&&Object.getOwnPropertyNames(n).some(t=>Wt(n[t]));function Sf(n,t){let{isScriptable:e,isIndexable:i}=co(n);for(let s of t){let o=e(s),r=i(s),a=(r||o)&&n[s];if(o&&(Wt(a)||Pf(a))||r&&$(a))return!0}return!1}var Cf="4.5.1",Tf=["top","bottom","left","right","chartArea"];function $a(n,t){return n==="top"||n==="bottom"||Tf.indexOf(n)===-1&&t==="x"}function Xa(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Ua(n){let t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),j(e&&e.onComplete,[n],t)}function Af(n){let t=n.chart,e=t.options.animation;j(e&&e.onProgress,[n],t)}function Al(n){return ei()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}var hi={},Ga=n=>{let t=Al(n);return Object.values(hi).filter(e=>e.canvas===t).pop()};function Lf(n,t,e){let i=Object.keys(n);for(let s of i){let o=+s;if(o>=t){let r=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=r)}}}function Ef(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}var ze=class{static defaults=U;static instances=hi;static overrides=te;static registry=Et;static version=Cf;static getChart=Ga;static register(...t){Et.add(...t),Qa()}static unregister(...t){Et.remove(...t),Qa()}constructor(t,e){let i=this.config=new Xo(e),s=Al(t),o=Ga(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Jd(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Ur(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new jo,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=oa(h=>this.update(h),r.resizeDelay||0),this._dataChanges=[],hi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Vt.listen(this,"complete",Ua),Vt.listen(this,"progress",Af),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return F(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Et}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():po(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ro(this.canvas,this.ctx),this}stop(){return Vt.stop(this),this}resize(t,e){Vt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,po(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),j(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};H(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{}),o=[];e&&(o=o.concat(Object.keys(e).map(r=>{let a=e[r],l=$o(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),H(o,r=>{let a=r.options,l=a.id,c=$o(l,a),u=C(a.type,r.dtype);(a.position===void 0||$a(a.position,c)!==$a(r.dposition))&&(a.position=r.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{let d=Et.getScale(u);h=new d({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(a,t)}),H(s,(r,a)=>{r||delete i[a]}),H(i,r=>{lt.configure(this,r,r.options),lt.addBox(this,r)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Xa("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){let o=e[i],r=this.getDatasetMeta(i),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||qo(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{let l=Et.getController(a),{datasetElementType:c,dataElementType:u}=U.datasets[a];Object.assign(l,{dataElementType:Et.getElement(u),datasetElementType:c&&Et.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){H(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){let{controller:h}=this.getDatasetMeta(c),d=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(d),r=Math.max(+h.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||H(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Xa("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){H(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xs(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:o}of e){let r=i==="_removeElements"?-o:o;Lf(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!Xs(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;lt.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],H(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Wt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Vt.has(this)?this.attached&&!Vt.running(this)&&Vt.start(this):(this.draw(),Ua({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let 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){let e=this._sortedMetasets,i=[],s,o;for(s=0,o=e.length;s<o;++s){let r=e[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=_o(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&hn(e,s),t.controller.draw(),s&&dn(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Ct(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){let o=Fd.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,s=i.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Yt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Te(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),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){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Vt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ro(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete hi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,e=this.platform,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};H(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},r,a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){H(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},H(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let s=i?"set":"remove",o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!cn(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){let s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),r=o(e,t),a=i?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;let o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),l=Kr(t),c=Ef(t,this._lastEvent,i,l);i&&(this._lastEvent=null,j(o.onHover,[t,a,this],this),l&&j(o.onClick,[t,a,this],this));let u=!cn(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function Qa(){return H(ze.instances,n=>n._plugins.invalidate())}function Ff(n,t,e){let{startAngle:i,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/r,it(i-e));if(n.beginPath(),n.arc(s,o,r-c/2,i+h/2,e-h/2),a>0){let d=Math.min(c/a,it(i-e));n.arc(s,o,a+c/2,e-d/2,i+d/2,!0)}else{let d=Math.min(c/2,r*it(i-e));if(u==="round")n.arc(s,o,d,e-W/2,i+W/2,!0);else if(u==="bevel"){let f=2*d*d,p=-f*Math.cos(e+W/2)+s,g=-f*Math.sin(e+W/2)+o,m=f*Math.cos(i+W/2)+s,b=f*Math.sin(i+W/2)+o;n.lineTo(p,g),n.lineTo(m,b)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function If(n,t,e){let{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t,c=s/a;n.beginPath(),n.arc(o,r,a,i-c,e+c),l>s?(c=s/l,n.arc(o,r,l,e+c,i-c,!0)):n.arc(o,r,s,e+Z,i-Z),n.closePath(),n.clip()}function Rf(n){return Jn(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Nf(n,t,e,i){let s=Rf(n.options.borderRadius),o=(e-t)/2,r=Math.min(o,i*t/2),a=l=>{let c=(e-Math.min(o,l))*i/2;return et(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:et(s.innerStart,0,r),innerEnd:et(s.innerEnd,0,r)}}function Re(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function mi(n,t,e,i,s,o){let{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+e-c,0),d=u>0?u+i+e+c:0,f=0,p=s-l;if(i){let V=u>0?u-i:0,G=h>0?h-i:0,J=(V+G)/2,_t=J!==0?p*J/(J+i):p;f=(p-_t)/2}let g=Math.max(.001,p*h-e/W)/h,m=(p-g)/2,b=l+m+f,x=s-m-f,{outerStart:w,outerEnd:_,innerStart:y,innerEnd:v}=Nf(t,d,h,x-b),k=h-w,D=h-_,P=b+w/k,S=x-_/D,T=d+y,E=d+v,nt=b+y/T,gt=x-v/E;if(n.beginPath(),o){let V=(P+S)/2;if(n.arc(r,a,h,P,V),n.arc(r,a,h,V,S),_>0){let at=Re(D,S,r,a);n.arc(at.x,at.y,_,S,x+Z)}let G=Re(E,x,r,a);if(n.lineTo(G.x,G.y),v>0){let at=Re(E,gt,r,a);n.arc(at.x,at.y,v,x+Z,gt+Math.PI)}let J=(x-v/d+(b+y/d))/2;if(n.arc(r,a,d,x-v/d,J,!0),n.arc(r,a,d,J,b+y/d,!0),y>0){let at=Re(T,nt,r,a);n.arc(at.x,at.y,y,nt+Math.PI,b-Z)}let _t=Re(k,b,r,a);if(n.lineTo(_t.x,_t.y),w>0){let at=Re(k,P,r,a);n.arc(at.x,at.y,w,b-Z,P)}}else{n.moveTo(r,a);let V=Math.cos(P)*h+r,G=Math.sin(P)*h+a;n.lineTo(V,G);let J=Math.cos(S)*h+r,_t=Math.sin(S)*h+a;n.lineTo(J,_t)}n.closePath()}function zf(n,t,e,i,s){let{fullCircles:o,startAngle:r,circumference:a}=t,l=t.endAngle;if(o){mi(n,t,e,i,l,s);for(let c=0;c<o;++c)n.fill();isNaN(a)||(l=r+(a%X||X))}return mi(n,t,e,i,l,s),n.fill(),l}function Wf(n,t,e,i,s){let{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:d,borderRadius:f}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(h||[]),n.lineDashOffset=d,p?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let g=t.endAngle;if(o){mi(n,t,e,i,g,s);for(let m=0;m<o;++m)n.stroke();isNaN(a)||(g=r+(a%X||X))}p&&If(n,t,g),l.selfJoin&&g-r>=W&&f===0&&u!=="miter"&&Ff(n,t,g),o||(mi(n,t,e,i,g,s),n.stroke())}var Uo=class extends Mt{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){let s=this.getProps(["x","y"],i),{angle:o,distance:r}=Ks(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,f=C(h,l-a),p=Le(o,a,l)&&a!==l,g=f>=X||p,m=At(r,c+d,u+d);return g&&m}getCenterPoint(t){let{x:e,y:i,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(s+o)/2,h=(r+a+c+l)/2;return{x:e+Math.cos(u)*h,y:i+Math.sin(u)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>X?Math.floor(i/X):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);let l=1-Math.sin(Math.min(W,i||0)),c=s*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,zf(t,this,c,o,r),Wf(t,this,c,o,r),t.restore()}};function Ll(n,t,e=t){n.lineCap=C(e.borderCapStyle,t.borderCapStyle),n.setLineDash(C(e.borderDash,t.borderDash)),n.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),n.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=C(e.borderWidth,t.borderWidth),n.strokeStyle=C(e.borderColor,t.borderColor)}function Bf(n,t,e){n.lineTo(e.x,e.y)}function Hf(n){return n.stepped?ca:n.tension||n.cubicInterpolationMode==="monotone"?ua:Bf}function El(n,t,e={}){let i=n.length,{start:s=0,end:o=i-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),u=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Yf(n,t,e,i){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=El(s,e,i),u=Hf(o),{move:h=!0,reverse:d}=i||{},f,p,g;for(f=0;f<=c;++f)p=s[(a+(d?c-f:f))%r],!p.skip&&(h?(n.moveTo(p.x,p.y),h=!1):u(n,g,p,d,o.stepped),g=p);return l&&(p=s[(a+(d?c:0))%r],u(n,g,p,d,o.stepped)),!!l}function Vf(n,t,e,i){let s=t.points,{count:o,start:r,ilen:a}=El(s,e,i),{move:l=!0,reverse:c}=i||{},u=0,h=0,d,f,p,g,m,b,x=_=>(r+(c?a-_:_))%o,w=()=>{g!==m&&(n.lineTo(u,m),n.lineTo(u,g),n.lineTo(u,b))};for(l&&(f=s[x(0)],n.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=s[x(d)],f.skip)continue;let _=f.x,y=f.y,v=_|0;v===p?(y<g?g=y:y>m&&(m=y),u=(h*u+_)/++h):(w(),n.lineTo(_,y),p=v,h=0,g=m=y),b=y}w()}function Go(n){let t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Vf:Yf}function jf(n){return n.stepped?ya:n.tension||n.cubicInterpolationMode==="monotone"?_a:Zt}function qf(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Ll(n,t.options),n.stroke(s)}function $f(n,t,e,i){let{segments:s,options:o}=t,r=Go(t);for(let a of s)Ll(n,o,a.style),n.beginPath(),r(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}var Xf=typeof Path2D=="function";function Uf(n,t,e,i){Xf&&!t.options.segment?qf(n,t,e,i):$f(n,t,e,i)}var We=class extends Mt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;ma(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=va(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,s=t[e],o=this.points,r=yo(this,{property:e,start:s,end:s});if(!r.length)return;let a=[],l=jf(i),c,u;for(c=0,u=r.length;c<u;++c){let{start:h,end:d}=r[c],f=o[h],p=o[d];if(f===p){a.push(f);continue}let g=Math.abs((s-f[e])/(p[e]-f[e])),m=l(f,p,g,i.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Go(this)(t,this,e,i)}path(t,e,i){let s=this.segments,o=Go(this),r=this._loop;e=e||0,i=i||this.points.length-e;for(let a of s)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Uf(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function Ka(n,t,e,i){let s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}var Qo=class extends Mt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){let s=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Ka(this,t,"x",e)}inYRange(t,e){return Ka(this,t,"y",e)}getCenterPoint(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);let i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){let i=this.options;this.skip||i.radius<.1||!Ct(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Zn(t,i,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};function Fl(n,t){let{x:e,y:i,base:s,width:o,height:r}=n.getProps(["x","y","base","width","height"],t),a,l,c,u,h;return n.horizontal?(h=r/2,a=Math.min(e,s),l=Math.max(e,s),c=i-h,u=i+h):(h=o/2,a=e-h,l=e+h,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function oe(n,t,e,i){return n?0:et(t,e,i)}function Gf(n,t,e){let i=n.options.borderWidth,s=n.borderSkipped,o=lo(i);return{t:oe(s.top,o.top,0,e),r:oe(s.right,o.right,0,t),b:oe(s.bottom,o.bottom,0,e),l:oe(s.left,o.left,0,t)}}function Qf(n,t,e){let{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=ie(s),r=Math.min(t,e),a=n.borderSkipped,l=i||I(s);return{topLeft:oe(!l||a.top||a.left,o.topLeft,0,r),topRight:oe(!l||a.top||a.right,o.topRight,0,r),bottomLeft:oe(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:oe(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Kf(n){let t=Fl(n),e=t.right-t.left,i=t.bottom-t.top,s=Gf(n,e/2,i/2),o=Qf(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function So(n,t,e,i){let s=t===null,o=e===null,a=n&&!(s&&o)&&Fl(n,i);return a&&(s||At(t,a.left,a.right))&&(o||At(e,a.top,a.bottom))}function Zf(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Jf(n,t){n.rect(t.x,t.y,t.w,t.h)}function Co(n,t,e={}){let i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-i,r=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+r,radius:n.radius}}var Ko=class extends Mt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){let{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:r}=Kf(this),a=Zf(r.radius)?Fe:Jf;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Co(r,e,o)),t.clip(),a(t,Co(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Co(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return So(this,t,e,i)}inXRange(t,e){return So(this,t,null,e)}inYRange(t,e){return So(this,null,t,e)}getCenterPoint(t){let{x:e,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}},tp=Object.freeze({__proto__:null,ArcElement:Uo,BarElement:Ko,LineElement:We,PointElement:Qo}),Zo=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Za=Zo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Il(n){return Zo[n%Zo.length]}function Rl(n){return Za[n%Za.length]}function ep(n,t){return n.borderColor=Il(t),n.backgroundColor=Rl(t),++t}function np(n,t){return n.backgroundColor=n.data.map(()=>Il(t++)),t}function ip(n,t){return n.backgroundColor=n.data.map(()=>Rl(t++)),t}function sp(n){let t=0;return(e,i)=>{let s=n.getDatasetMeta(i).controller;s instanceof _n?t=np(e,t):s instanceof fi?t=ip(e,t):s&&(t=ep(e,t))}}function Ja(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function op(n){return n&&(n.borderColor||n.backgroundColor)}function rp(){return U.borderColor!=="rgba(0,0,0,0.1)"||U.backgroundColor!=="rgba(0,0,0,0.1)"}var ap={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;let{data:{datasets:i},options:s}=n.config,{elements:o}=s,r=Ja(i)||op(s)||o&&Ja(o)||rp();if(!e.forceOverride&&r)return;let a=sp(n);i.forEach(a)}};function lp(n,t,e,i,s){let o=s.samples||i;if(o>=e)return n.slice(t,t+e);let r=[],a=(e-2)/(o-2),l=0,c=t+e-1,u=t,h,d,f,p,g;for(r[l++]=n[u],h=0;h<o-2;h++){let m=0,b=0,x,w=Math.floor((h+1)*a)+1+t,_=Math.min(Math.floor((h+2)*a)+1,e)+t,y=_-w;for(x=w;x<_;x++)m+=n[x].x,b+=n[x].y;m/=y,b/=y;let v=Math.floor(h*a)+1+t,k=Math.min(Math.floor((h+1)*a)+1,e)+t,{x:D,y:P}=n[u];for(f=p=-1,x=v;x<k;x++)p=.5*Math.abs((D-m)*(n[x].y-P)-(D-n[x].x)*(b-P)),p>f&&(f=p,d=n[x],g=x);r[l++]=d,u=g}return r[l++]=n[c],r}function cp(n,t,e,i){let s=0,o=0,r,a,l,c,u,h,d,f,p,g,m=[],b=t+e-1,x=n[t].x,_=n[b].x-x;for(r=t;r<t+e;++r){a=n[r],l=(a.x-x)/_*i,c=a.y;let y=l|0;if(y===u)c<p?(p=c,h=r):c>g&&(g=c,d=r),s=(o*s+a.x)/++o;else{let v=r-1;if(!F(h)&&!F(d)){let k=Math.min(h,d),D=Math.max(h,d);k!==f&&k!==v&&m.push({...n[k],x:s}),D!==f&&D!==v&&m.push({...n[D],x:s})}r>0&&v!==f&&m.push(n[v]),m.push(a),u=y,o=0,p=g=c,h=d=f=r}}return m}function Nl(n){if(n._decimated){let t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function tl(n){n.data.datasets.forEach(t=>{Nl(t)})}function up(n,t){let e=t.length,i=0,s,{iScale:o}=n,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=et(St(t,o.axis,r).lo,0,e-1)),c?s=et(St(t,o.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var hp={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){tl(n);return}let i=n.width;n.data.datasets.forEach((s,o)=>{let{_data:r,indexAxis:a}=s,l=n.getDatasetMeta(o),c=r||s.data;if(Ie([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:h,count:d}=up(l,c),f=e.threshold||4*i;if(d<=f){Nl(s);return}F(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(e.algorithm){case"lttb":p=lp(c,h,d,i,e);break;case"min-max":p=cp(c,h,d,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){tl(n)}};function dp(n,t,e){let i=n.segments,s=n.points,o=t.points,r=[];for(let a of i){let{start:l,end:c}=a;c=_i(l,c,s);let u=Jo(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:u,start:s[l],end:s[c]});continue}let h=yo(t,u);for(let d of h){let f=Jo(e,o[d.start],o[d.end],d.loop),p=xo(a,s,f);for(let g of p)r.push({source:g,target:d,start:{[e]:el(u,f,"start",Math.max)},end:{[e]:el(u,f,"end",Math.min)}})}}return r}function Jo(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=it(s),o=it(o)),{property:n,start:s,end:o}}function fp(n,t){let{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=_i(r,a,s);let l=s[r],c=s[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function _i(n,t,e){for(;t>n;t--){let i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function el(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function zl(n,t){let e=[],i=!1;return $(n)?(i=!0,e=n):e=fp(n,t),e.length?new We({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function nl(n){return n&&n.fill!==!1}function pp(n,t,e){let s=n[t].fill,o=[t],r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!K(s))return s;if(r=n[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function gp(n,t,e){let i=yp(n);if(I(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return K(s)&&Math.floor(s)===s?mp(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function mp(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function bp(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:I(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function xp(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:I(n)?i=n.value:i=t.getBaseValue(),i}function yp(n){let t=n.options,e=t.fill,i=C(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function _p(n){let{scale:t,index:e,line:i}=n,s=[],o=i.segments,r=i.points,a=wp(t,e);a.push(zl({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){let c=o[l];for(let u=c.start;u<=c.end;u++)vp(s,r[u],a)}return new We({points:s,options:{}})}function wp(n,t){let e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){let o=i[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function vp(n,t,e){let i=[];for(let s=0;s<e.length;s++){let o=e[s],{first:r,last:a,point:l}=Mp(o,t,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function Mp(n,t,e){let i=n.interpolate(t,e);if(!i)return{};let s=i[e],o=n.segments,r=n.points,a=!1,l=!1;for(let c=0;c<o.length;c++){let u=o[c],h=r[u.start][e],d=r[u.end][e];if(At(s,h,d)){a=s===h,l=s===d;break}}return{first:a,last:l,point:i}}var bi=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){let{x:s,y:o,radius:r}=this;return e=e||{start:0,end:X},t.arc(s,o,r,e.end,e.start,!0),!i.bounds}interpolate(t){let{x:e,y:i,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}};function kp(n){let{chart:t,fill:e,line:i}=n;if(K(e))return Dp(t,e);if(e==="stack")return _p(n);if(e==="shape")return!0;let s=Op(n);return s instanceof bi?s:zl(s,i)}function Dp(n,t){let e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Op(n){return(n.scale||{}).getPointPositionForValue?Sp(n):Pp(n)}function Pp(n){let{scale:t={},fill:e}=n,i=bp(e,t);if(K(i)){let s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Sp(n){let{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,r=xp(e,t,o),a=[];if(i.grid.circular){let l=t.getPointPositionForValue(0,o);return new bi({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function To(n,t,e){let i=kp(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,u=c.fill,h=c.backgroundColor,{above:d=h,below:f=h}=u||{},p=s.getDatasetMeta(o),g=_o(s,p);i&&r.points.length&&(hn(n,e),Cp(n,{line:r,target:i,above:d,below:f,area:e,scale:a,axis:l,clip:g}),dn(n))}function Cp(n,t){let{line:e,target:i,above:s,below:o,area:r,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=o;o!==s&&(c==="x"?(il(n,i,r.top),Ao(n,{line:e,target:i,color:s,scale:a,property:c,clip:l}),n.restore(),n.save(),il(n,i,r.bottom)):c==="y"&&(sl(n,i,r.left),Ao(n,{line:e,target:i,color:o,scale:a,property:c,clip:l}),n.restore(),n.save(),sl(n,i,r.right),u=s)),Ao(n,{line:e,target:i,color:u,scale:a,property:c,clip:l}),n.restore()}function il(n,t,e){let{segments:i,points:s}=t,o=!0,r=!1;n.beginPath();for(let a of i){let{start:l,end:c}=a,u=s[l],h=s[_i(l,c,s)];o?(n.moveTo(u.x,u.y),o=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),r=!!t.pathSegment(n,a,{move:r}),r?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function sl(n,t,e){let{segments:i,points:s}=t,o=!0,r=!1;n.beginPath();for(let a of i){let{start:l,end:c}=a,u=s[l],h=s[_i(l,c,s)];o?(n.moveTo(u.x,u.y),o=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),r=!!t.pathSegment(n,a,{move:r}),r?n.closePath():n.lineTo(e,h.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Ao(n,t){let{line:e,target:i,property:s,color:o,scale:r,clip:a}=t,l=dp(e,i,s);for(let{source:c,target:u,start:h,end:d}of l){let{style:{backgroundColor:f=o}={}}=c,p=i!==!0;n.save(),n.fillStyle=f,Tp(n,r,a,p&&Jo(s,h,d)),n.beginPath();let g=!!e.pathSegment(n,c),m;if(p){g?n.closePath():ol(n,i,d,s);let b=!!i.pathSegment(n,u,{move:g,reverse:!0});m=g&&b,m||ol(n,i,h,s)}n.closePath(),n.fill(m?"evenodd":"nonzero"),n.restore()}}function Tp(n,t,e,i){let s=t.chart.chartArea,{property:o,start:r,end:a}=i||{};if(o==="x"||o==="y"){let l,c,u,h;o==="x"?(l=r,c=s.top,u=a,h=s.bottom):(l=s.left,c=r,u=s.right,h=a),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),h=Math.min(h,e.bottom)),n.rect(l,c,u-l,h-c),n.clip()}}function ol(n,t,e,i){let s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Ap={id:"filler",afterDatasetsUpdate(n,t,e){let i=(n.data.datasets||[]).length,s=[],o,r,a,l;for(r=0;r<i;++r)o=n.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof We&&(l={visible:n.isDatasetVisible(r),index:r,fill:gp(a,r,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<i;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=pp(s,r,e.propagate))},beforeDraw(n,t,e){let i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let r=s.length-1;r>=0;--r){let a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&To(n.ctx,a,o))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){let o=i[s].$filler;nl(o)&&To(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){let i=t.meta.$filler;!nl(i)||e.drawTime!=="beforeDatasetDraw"||To(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},rl=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Lp=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index,xi=class extends Mt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=j(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,s=tt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=rl(i,o),c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a,h=t;o.textAlign="left",o.textBaseline="middle";let d=-1,f=-u;return this.legendItems.forEach((p,g)=>{let m=i+e/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>r)&&(h+=u,c[c.length-(g>0?0:1)]=0,f+=u,d++),l[g]={left:0,top:f,row:d,width:m,height:s},c[c.length-1]+=m+a}),h}_fitCols(t,e,i,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t,h=a,d=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:x,itemHeight:w}=Ep(i,e,o,m,s);b>0&&f+w+2*a>u&&(h+=d+a,c.push({width:d,height:f}),p+=d+a,g++,d=f=0),l[b]={left:p,top:f,col:g,width:x,height:w},d=Math.max(d,x),f+=w+a}),h+=d,c.push({width:d,height:f}),h}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=pe(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=st(i,this.left+s,this.right-this.lineWidths[a]);for(let c of e)a!==c.row&&(a=c.row,l=st(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=st(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of e)c.col!==a&&(a=c.col,l=st(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;hn(t,this),this._draw(),dn(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=U.color,l=pe(t.rtl,this.left,this.width),c=tt(r.font),{padding:u}=r,h=c.size,d=h/2,f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:p,boxHeight:g,itemHeight:m}=rl(r,h),b=function(v,k,D){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();let P=C(D.lineWidth,1);if(s.fillStyle=C(D.fillStyle,a),s.lineCap=C(D.lineCap,"butt"),s.lineDashOffset=C(D.lineDashOffset,0),s.lineJoin=C(D.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=C(D.strokeStyle,a),s.setLineDash(C(D.lineDash,[])),r.usePointStyle){let S={radius:g*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:P},T=l.xPlus(v,p/2),E=k+d;ao(s,S,T,E,r.pointStyleWidth&&p)}else{let S=k+Math.max((h-g)/2,0),T=l.leftForLtr(v,p),E=ie(D.borderRadius);s.beginPath(),Object.values(E).some(nt=>nt!==0)?Fe(s,{x:T,y:S,w:p,h:g,radius:E}):s.rect(T,S,p,g),s.fill(),P!==0&&s.stroke()}s.restore()},x=function(v,k,D){ne(s,D.text,v,k+m/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},w=this.isHorizontal(),_=this._computeTitleHeight();w?f={x:st(o,this.left+u,this.right-i[0]),y:this.top+u+_,line:0}:f={x:this.left+u,y:st(o,this.top+_+u,this.bottom-e[0].height),line:0},mo(this.ctx,t.textDirection);let y=m+u;this.legendItems.forEach((v,k)=>{s.strokeStyle=v.fontColor,s.fillStyle=v.fontColor;let D=s.measureText(v.text).width,P=l.textAlign(v.textAlign||(v.textAlign=r.textAlign)),S=p+d+D,T=f.x,E=f.y;l.setWidth(this.width),w?k>0&&T+S+u>this.right&&(E=f.y+=y,f.line++,T=f.x=st(o,this.left+u,this.right-i[f.line])):k>0&&E+y>this.bottom&&(T=f.x=T+e[f.line].width+u,f.line++,E=f.y=st(o,this.top+_+u,this.bottom-e[f.line].height));let nt=l.x(T);if(b(nt,E,v),T=ra(P,T+p+d,w?T+S:this.right,t.rtl),x(l.x(T),E,v),w)f.x+=S+u;else if(typeof v.text!="string"){let gt=c.lineHeight;f.y+=Wl(v,gt)+u}else f.y+=y}),bo(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,i=tt(e.font),s=ot(e.padding);if(!e.display)return;let o=pe(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,c=s.top+l,u,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),u=this.top+c,h=st(t.align,h,this.right-d);else{let p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);u=c+st(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}let f=st(a,h,h+d);r.textAlign=o.textAlign(Qn(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,ne(r,e.text,f,u,i)}_computeTitleHeight(){let t=this.options.title,e=tt(t.font),i=ot(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(At(t,this.left,this.right)&&At(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],At(t,s.left,s.left+s.width)&&At(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){let e=this.options;if(!Rp(t.type,e))return;let i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=Lp(s,i);s&&!o&&j(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&j(e.onHover,[t,i,this],this)}else i&&j(e.onClick,[t,i,this],this)}};function Ep(n,t,e,i,s){let o=Fp(i,n,t,e),r=Ip(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Fp(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+i.measureText(s).width}function Ip(n,t,e){let i=n;return typeof t.text!="string"&&(i=Wl(t,e)),i}function Wl(n,t){let e=n.text?n.text.length:0;return t*e}function Rp(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Np={id:"legend",_element:xi,start(n,t,e){let i=n.legend=new xi({ctx:n.ctx,options:e,chart:n});lt.configure(n,i,e),lt.addBox(n,i)},stop(n){lt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){let i=n.legend;lt.configure(n,i,e),i.options=e},afterUpdate(n){let t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){let i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){let t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(e?0:void 0),u=ot(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}},vn=class extends Mt{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){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let s=$(i.text)?i.text.length:1;this._padding=ot(i.padding);let o=s*tt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:i,bottom:s,right:o,options:r}=this,a=r.align,l=0,c,u,h;return this.isHorizontal()?(u=st(a,i,o),h=e+t,c=o-i):(r.position==="left"?(u=i+t,h=st(a,s,e),l=W*-.5):(u=o-t,h=st(a,e,s),l=W*.5),c=s-e),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=tt(e.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);ne(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Qn(e.align),textBaseline:"middle",translation:[r,a]})}};function zp(n,t){let e=new vn({ctx:n.ctx,options:t,chart:n});lt.configure(n,e,t),lt.addBox(n,e),n.titleBlock=e}var Wp={id:"title",_element:vn,start(n,t,e){zp(n,e)},stop(n){let t=n.titleBlock;lt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){let i=n.titleBlock;lt.configure(n,i,e),i.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}},ai=new WeakMap,Bp={id:"subtitle",start(n,t,e){let i=new vn({ctx:n.ctx,options:e,chart:n});lt.configure(n,i,e),lt.addBox(n,i),ai.set(n,i)},stop(n){lt.removeBox(n,ai.get(n)),ai.delete(n)},beforeUpdate(n,t,e){let i=ai.get(n);lt.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},yn={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,o=0;for(t=0,e=n.length;t<e;++t){let a=n[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=n.length;o<r;++o){let l=n[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),u=qn(t,c);u<s&&(s=u,a=l)}}if(a){let l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Lt(n,t){return t&&($(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function jt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
4
|
+
`)>-1?n.split(`
|
|
5
|
+
`):n}function Hp(n,t){let{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:n,label:r,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function al(n,t){let e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:r,boxHeight:a}=t,l=tt(t.bodyFont),c=tt(t.titleFont),u=tt(t.footerFont),h=o.length,d=s.length,f=i.length,p=ot(t.padding),g=p.height,m=0,b=i.reduce((_,y)=>_+y.before.length+y.lines.length+y.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,h&&(g+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),b){let _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*_+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(g+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);let x=0,w=function(_){m=Math.max(m,e.measureText(_).width+x)};return e.save(),e.font=c.string,H(n.title,w),e.font=l.string,H(n.beforeBody.concat(n.afterBody),w),x=t.displayColors?r+2+t.boxPadding:0,H(i,_=>{H(_.before,w),H(_.lines,w),H(_.after,w)}),x=0,e.font=u.string,H(n.footer,w),e.restore(),m+=p.width,{width:m,height:g}}function Yp(n,t){let{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Vp(n,t,e,i){let{x:s,width:o}=i,r=e.caretSize+e.caretPadding;if(n==="left"&&s+o+r>t.width||n==="right"&&s-o-r<0)return!0}function jp(n,t,e,i){let{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=n,c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Vp(c,n,t,e)&&(c="center"),c}function ll(n,t,e){let i=e.yAlign||t.yAlign||Yp(n,e);return{xAlign:e.xAlign||t.xAlign||jp(n,t,e,i),yAlign:i}}function qp(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function $p(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function cl(n,t,e,i){let{caretSize:s,caretPadding:o,cornerRadius:r}=n,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:f}=ie(r),p=qp(t,a),g=$p(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,d)+s:a==="right"&&(p+=Math.max(h,f)+s),{x:et(p,0,i.width-t.width),y:et(g,0,i.height-t.height)}}function li(n,t,e){let i=ot(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function ul(n){return Lt([],jt(n))}function Xp(n,t,e){return Yt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function hl(n,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}var Bl={beforeTitle:Tt,title(n){if(n.length>0){let t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Tt,beforeBody:Tt,beforeLabel:Tt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");let e=n.formattedValue;return F(e)||(t+=e),t},labelColor(n){let e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.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(n){let e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Tt,afterBody:Tt,beforeFooter:Tt,footer:Tt,afterFooter:Tt};function ht(n,t,e,i){let s=n[t].call(e,i);return typeof s>"u"?Bl[t].call(e,i):s}var yi=class extends Mt{static positioners=yn;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new di(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Xp(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,s=ht(i,"beforeTitle",this,t),o=ht(i,"title",this,t),r=ht(i,"afterTitle",this,t),a=[];return a=Lt(a,jt(s)),a=Lt(a,jt(o)),a=Lt(a,jt(r)),a}getBeforeBody(t,e){return ul(ht(e.callbacks,"beforeBody",this,t))}getBody(t,e){let{callbacks:i}=e,s=[];return H(t,o=>{let r={before:[],lines:[],after:[]},a=hl(i,o);Lt(r.before,jt(ht(a,"beforeLabel",this,o))),Lt(r.lines,ht(a,"label",this,o)),Lt(r.after,jt(ht(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return ul(ht(e.callbacks,"afterBody",this,t))}getFooter(t,e){let{callbacks:i}=e,s=ht(i,"beforeFooter",this,t),o=ht(i,"footer",this,t),r=ht(i,"afterFooter",this,t),a=[];return a=Lt(a,jt(s)),a=Lt(a,jt(o)),a=Lt(a,jt(r)),a}_createItems(t){let e=this._active,i=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Hp(this.chart,e[l]));return t.filter&&(a=a.filter((u,h,d)=>t.filter(u,h,d,i))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,i))),H(a,u=>{let h=hl(t.callbacks,u);s.push(ht(h,"labelColor",this,u)),o.push(ht(h,"labelPointStyle",this,u)),r.push(ht(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){let i=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=yn[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);let l=this._size=al(this,i),c=Object.assign({},a,l),u=ll(this.chart,i,c),h=cl(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){let o=this.getCaretPosition(t,i,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=ie(a),{x:d,y:f}=t,{width:p,height:g}=e,m,b,x,w,_,y;return o==="center"?(_=f+g/2,s==="left"?(m=d,b=m-r,w=_+r,y=_-r):(m=d+p,b=m+r,w=_-r,y=_+r),x=m):(s==="left"?b=d+Math.max(l,u)+r:s==="right"?b=d+p-Math.max(c,h)-r:b=this.caretX,o==="top"?(w=f,_=w-r,m=b-r,x=b+r):(w=f+g,_=w+r,m=b+r,x=b-r),y=w),{x1:m,x2:b,x3:x,y1:w,y2:_,y3:y}}drawTitle(t,e,i){let s=this.title,o=s.length,r,a,l;if(o){let c=pe(i.rtl,this.x,this.width);for(t.x=li(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=tt(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,o){let r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=tt(o.bodyFont),h=li(this,"left",o),d=s.x(h),f=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){let g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(d,c)+c/2,b=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Zn(t,g,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Zn(t,g,m,b)}else{t.lineWidth=I(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let g=s.leftForLtr(d,c),m=s.leftForLtr(s.xPlus(d,1),c-2),b=ie(r.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Fe(t,{x:g,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Fe(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=tt(i.bodyFont),d=h.lineHeight,f=0,p=pe(i.rtl,this.x,this.width),g=function(D){e.fillText(D,p.x(t.x+f),t.y+d/2),t.y+=d+o},m=p.textAlign(r),b,x,w,_,y,v,k;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=li(this,m,i),e.fillStyle=i.bodyColor,H(this.beforeBody,g),f=a&&m!=="right"?r==="center"?c/2+u:c+2+u:0,_=0,v=s.length;_<v;++_){for(b=s[_],x=this.labelTextColors[_],e.fillStyle=x,H(b.before,g),w=b.lines,a&&w.length&&(this._drawColorBox(e,t,_,p,i),d=Math.max(h.lineHeight,l)),y=0,k=w.length;y<k;++y)g(w[y]),d=h.lineHeight;H(b.after,g)}f=0,d=h.lineHeight,H(this.afterBody,g),t.y-=o}drawFooter(t,e,i){let s=this.footer,o=s.length,r,a;if(o){let l=pe(i.rtl,this.x,this.width);for(t.x=li(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=tt(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:p}=ie(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+h,l),r==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),r==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),r==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+f,l+u),e.quadraticCurveTo(a,l+u,a,l+u-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+h),e.quadraticCurveTo(a,l,a+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){let r=yn[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=al(this,t),l=Object.assign({},r,this._size),c=ll(e,t,l),u=cl(t,l,c,e);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let r=ot(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),mo(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),bo(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,s=t.map(({datasetIndex:a,index:l})=>{let 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}}),o=!cn(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!cn(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){let{caretX:i,caretY:s,options:o}=this,r=yn[o.position].call(this,t,e);return r!==!1&&(i!==r.x||s!==r.y)}},Up={id:"tooltip",_element:yi,positioners:yn,afterInit(n,t,e){e&&(n.tooltip=new yi({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){let t=n.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){let e=t.replay;n.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:(n,t)=>t.bodyFont.size,boxWidth:(n,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:Bl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Gp=Object.freeze({__proto__:null,Colors:ap,Decimation:hp,Filler:Ap,Legend:Np,SubTitle:Bp,Title:Wp,Tooltip:Up}),Qp=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Kp(n,t,e,i){let s=n.indexOf(t);if(s===-1)return Qp(n,t,e,i);let o=n.lastIndexOf(t);return s!==o?e:s}var Zp=(n,t)=>n===null?null:et(Math.round(n),0,t);function dl(n){let t=this.getLabels();return n>=0&&n<t.length?t[n]:n}var tr=class extends be{static id="category";static defaults={ticks:{callback:dl}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let i=this.getLabels();for(let{index:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(F(t))return null;let i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Kp(i,t,C(e,t),this._addedLabels),Zp(e,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,s=[],o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){return dl.call(this,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){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};function Jp(n,t){let e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:d}=n,f=o||1,p=u-1,{min:g,max:m}=t,b=!F(r),x=!F(a),w=!F(c),_=(m-g)/(h+1),y=Us((m-g)/p/f)*f,v,k,D,P;if(y<1e-14&&!b&&!x)return[{value:g},{value:m}];P=Math.ceil(m/y)-Math.floor(g/y),P>p&&(y=Us(P*y/p/f)*f),F(l)||(v=Math.pow(10,l),y=Math.ceil(y*v)/v),s==="ticks"?(k=Math.floor(g/y)*y,D=Math.ceil(m/y)*y):(k=g,D=m),b&&x&&o&&Jr((a-r)/o,y/1e3)?(P=Math.round(Math.min((a-r)/y,u)),y=(a-r)/P,k=r,D=a):w?(k=b?r:k,D=x?a:D,P=c-1,y=(D-k)/P):(P=(D-k)/y,Ae(P,Math.round(P),y/1e3)?P=Math.round(P):P=Math.ceil(P));let S=Math.max(Qs(y),Qs(k));v=Math.pow(10,F(l)?S:l),k=Math.round(k*v)/v,D=Math.round(D*v)/v;let T=0;for(b&&(d&&k!==r?(e.push({value:r}),k<r&&T++,Ae(Math.round((k+T*y)*v)/v,r,fl(r,_,n))&&T++):k<r&&T++);T<P;++T){let E=Math.round((k+T*y)*v)/v;if(x&&E>a)break;e.push({value:E})}return x&&d&&D!==a?e.length&&Ae(e[e.length-1].value,a,fl(a,_,n))?e[e.length-1].value=a:e.push({value:a}):(!x||D===a)&&e.push({value:D}),e}function fl(n,t,{horizontal:e,minRotation:i}){let s=bt(i),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+n).length;return Math.min(t/o,r)}var Be=class extends be{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 F(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=e?s:l,a=l=>o=i?o:l;if(t){let l=vt(s),c=vt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} 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(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=Jp(s,o);return t.bounds==="ticks"&&Gs(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Ee(t,this.chart.options.locale,this.options.ticks.format)}},er=class extends Be{static id="linear";static defaults={ticks:{callback:un.formatters.numeric}};determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?t:0,this.max=K(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=bt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.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}},Mn=n=>Math.floor(Bt(n)),me=(n,t)=>Math.pow(10,Mn(n)+t);function pl(n){return n/Math.pow(10,Mn(n))===1}function gl(n,t,e){let i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function tg(n,t){let e=t-n,i=Mn(e);for(;gl(n,t,i)>10;)i++;for(;gl(n,t,i)<10;)i--;return Math.min(i,Mn(n))}function eg(n,{min:t,max:e}){t=ut(n.min,t);let i=[],s=Mn(t),o=tg(t,e),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10,h=Math.floor((c-u)/Math.pow(10,o)),d=ut(n.min,Math.round((l+u+h*Math.pow(10,o))*r)/r);for(;d<e;)i.push({value:d,major:pl(d),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,r=o>=0?1:r),d=Math.round((l+u+h*Math.pow(10,o))*r)/r;let f=ut(n.max,d);return i.push({value:f,major:pl(f),significand:h}),i}var nr=class extends be{static id="logarithmic";static defaults={ticks:{callback:un.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let i=Be.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return K(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?Math.max(0,t):null,this.max=K(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!K(this._userMin)&&(this.min=t===me(this.min,0)?me(this.min,-1):me(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,s=this.max,o=a=>i=t?i:a,r=a=>s=e?s:a;i===s&&(i<=0?(o(1),r(10)):(o(me(i,-1)),r(me(s,1)))),i<=0&&o(me(s,-1)),s<=0&&r(me(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=eg(e,this);return t.bounds==="ticks"&&Gs(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Ee(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=Bt(t),this._valueRange=Bt(this.max)-Bt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Bt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};function ir(n){let t=n.ticks;if(t.display&&n.display){let e=ot(t.backdropPadding);return C(t.font&&t.font.size,U.font.size)+e.height}return 0}function ng(n,t,e){return e=$(e)?e:[e],{w:la(n,t.string,e),h:e.length*t.lineHeight}}function ml(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function ig(n){let t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],o=n._pointLabels.length,r=n.options.pointLabels,a=r.centerPointLabels?W/o:0;for(let l=0;l<o;l++){let c=r.setContext(n.getPointLabelContext(l));s[l]=c.padding;let u=n.getPointPosition(l,n.drawingArea+s[l],a),h=tt(c.font),d=ng(n.ctx,h,n._pointLabels[l]);i[l]=d;let f=it(n.getIndexAngle(l)+a),p=Math.round(Un(f)),g=ml(p,u.x,d.w,0,180),m=ml(p,u.y,d.h,90,270);sg(e,t,f,g,m)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=ag(n,i,s)}function sg(n,t,e,i,s){let o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e)),a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,n.b=Math.max(n.b,t.b+l))}function og(n,t,e){let i=n.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=n.getPointPosition(t,i+s+r,o),c=Math.round(Un(it(l.angle+Z))),u=ug(l.y,a.h,c),h=lg(c),d=cg(l.x,a.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:d,top:u,right:d+a.w,bottom:u+a.h}}function rg(n,t){if(!t)return!0;let{left:e,top:i,right:s,bottom:o}=n;return!(Ct({x:e,y:i},t)||Ct({x:e,y:o},t)||Ct({x:s,y:i},t)||Ct({x:s,y:o},t))}function ag(n,t,e){let i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:ir(o)/2,additionalAngle:r?W/s:0},c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];let h=og(n,u,l);i.push(h),a==="auto"&&(h.visible=rg(h,c),h.visible&&(c=h))}return i}function lg(n){return n===0||n===180?"center":n<180?"left":"right"}function cg(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function ug(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function hg(n,t,e){let{left:i,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!F(a)){let l=ie(t.borderRadius),c=ot(t.backdropPadding);n.fillStyle=a;let u=i-c.left,h=s-c.top,d=o-i+c.width,f=r-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),Fe(n,{x:u,y:h,w:d,h:f,radius:l}),n.fill()):n.fillRect(u,h,d,f)}}function dg(n,t){let{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){let o=n._pointLabelItems[s];if(!o.visible)continue;let r=i.setContext(n.getPointLabelContext(s));hg(e,r,o);let a=tt(r.font),{x:l,y:c,textAlign:u}=o;ne(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function Hl(n,t,e,i){let{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,X);else{let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=n.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function fg(n,t,e,i,s){let o=n.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Hl(n,e,r,i),o.closePath(),o.stroke(),o.restore())}function pg(n,t,e){return Yt(n,{label:e,index:t,type:"pointLabel"})}var sr=class extends Be{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:un.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=ot(ir(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!1);this.min=K(t)&&!isNaN(t)?t:0,this.max=K(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ir(this.options))}generateTickLabels(t){Be.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{let s=j(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?ig(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){let e=X/(this._pointLabels.length||1),i=this.options.startAngle||0;return it(t*e+bt(i))}getDistanceFromCenterForValue(t){if(F(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(F(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let i=e[t];return pg(this.getContext(),t,i)}}getPointPosition(t,e,i=0){let s=this.getIndexAngle(t)-Z+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),Hl(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,r=this._pointLabels.length,a,l,c;if(e.pointLabels.display&&dg(this,r),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);let d=this.getContext(h),f=s.setContext(d),p=o.setContext(d);fg(this,f,l,r,p)}}),i.display){for(t.save(),a=r-1;a>=0;a--){let u=i.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:d}=u;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let s=this.getIndexAngle(0),o,r;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&&this.min>=0&&!e.reverse)return;let c=i.setContext(this.getContext(l)),u=tt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let h=ot(c.backdropPadding);t.fillRect(-r/2-h.left,-o-u.size/2-h.top,r+h.width,u.size+h.height)}ne(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}},wi={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}},dt=Object.keys(wi);function bl(n,t){return n-t}function xl(n,t){if(F(t))return null;let e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts,r=t;return typeof i=="function"&&(r=i(r)),K(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(fe(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function yl(n,t,e,i){let s=dt.length;for(let o=dt.indexOf(n);o<s-1;++o){let r=wi[dt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return dt[o]}return dt[s-1]}function gg(n,t,e,i,s){for(let o=dt.length-1;o>=dt.indexOf(e);o--){let r=dt[o];if(wi[r].common&&n._adapter.diff(s,i,r)>=t-1)return r}return dt[e?dt.indexOf(e):0]}function mg(n){for(let t=dt.indexOf(n)+1,e=dt.length;t<e;++t)if(wi[dt[t]].common)return dt[t]}function _l(n,t,e){if(!e)n[t]=!0;else if(e.length){let{lo:i,hi:s}=Gn(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function bg(n,t,e,i){let s=n._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function wl(n,t,e){let i=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!e?i:bg(n,i,s,e)}var kn=class extends be{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){let i=t.time||(t.time={}),s=this._adapter=new rr._date(t.adapters.date);s.init(e),Ce(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:xl(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=K(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=K(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,s=i.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]);let o=this.min,r=this.max,a=na(s,o,r);return this._unit=e.unit||(i.autoSkip?yl(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):gg(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:mg(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),wl(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;e=et(e,0,r),i=et(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){let t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||yl(o.minUnit,e,i,this._getLabelCapacity(e)),a=C(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=fe(l)||l===!0,u={},h=e,d,f;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);let p=s.ticks.source==="data"&&this.getDataTimestamps();for(d=h,f=0;d<i;d=+t.add(d,a,r),f++)_l(u,d,p);return(d===i||s.bounds==="ticks"||f===1)&&_l(u,d,p),Object.keys(u).sort(bl).map(g=>+g)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,s){let o=this.options,r=o.ticks.callback;if(r)return j(r,[t,e,i],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],h=c&&a[c],d=i[e],f=c&&h&&d&&d.major;return this._adapter.format(t,s||(f?h:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,i=this.ctx.measureText(t).width,s=bt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){let e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,wl(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],e,i;if(t.length)return t;let s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(xl(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Js(t.sort(bl))}};function ci(n,t,e){let i=0,s=n.length-1,o,r,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=St(n,"pos",t)),{pos:o,time:a}=n[i],{pos:r,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=St(n,"time",t)),{time:o,pos:a}=n[i],{time:r,pos:l}=n[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var or=class extends kn{static id="timeseries";static defaults=kn.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ci(e,this.min),this._tableRange=ci(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:i}=this,s=[],o=[],r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,e=this.max,i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ci(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ci(this._table,i*this._tableRange+this._minPos,!0)}},xg=Object.freeze({__proto__:null,CategoryScale:tr,LinearScale:er,LogarithmicScale:nr,RadialLinearScale:sr,TimeScale:kn,TimeSeriesScale:or}),Yl=[Cd,tp,Gp,xg];ze.register(...Yl);var Vl=ze;var yg=Math.pow(10,8)*24*60*60*1e3,Vm=-yg,vi=6048e5,jl=864e5,qt=6e4,$t=36e5,ql=1e3;var _g=3600;var $l=_g*24,jm=$l*7,wg=$l*365.2425,vg=wg/12,qm=vg*3,ar=Symbol.for("constructDateFrom");function L(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&ar in n?n[ar](t):n instanceof Date?new n.constructor(t):new Date(t)}function M(n,t){return L(t||n,n)}function re(n,t,e){let i=M(n,e?.in);return isNaN(t)?L(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function He(n,t,e){let i=M(n,e?.in);if(isNaN(t))return L(e?.in||n,NaN);if(!t)return i;let s=i.getDate(),o=L(e?.in||n,i.getTime());o.setMonth(i.getMonth()+t+1,0);let r=o.getDate();return s>=r?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function Ye(n,t,e){return L(e?.in||n,+M(n)+t)}function Xl(n,t,e){return Ye(n,t*$t,e)}var Mg={};function ft(){return Mg}function rt(n,t){let e=ft(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,s=M(n,t?.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function kt(n,t){return rt(n,{...t,weekStartsOn:1})}function Mi(n,t){let e=M(n,t?.in),i=e.getFullYear(),s=L(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);let o=kt(s),r=L(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);let a=kt(r);return e.getTime()>=o.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function xe(n){let t=M(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function pt(n,...t){let e=L.bind(null,n||t.find(i=>typeof i=="object"));return t.map(e)}function On(n,t){let e=M(n,t?.in);return e.setHours(0,0,0,0),e}function ki(n,t,e){let[i,s]=pt(e?.in,n,t),o=On(i),r=On(s),a=+o-xe(o),l=+r-xe(r);return Math.round((a-l)/jl)}function Ul(n,t){let e=Mi(n,t),i=L(t?.in||n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),kt(i)}function Gl(n,t,e){let i=M(n,e?.in);return i.setTime(i.getTime()+t*qt),i}function Ql(n,t,e){return He(n,t*3,e)}function Kl(n,t,e){return Ye(n,t*1e3,e)}function Zl(n,t,e){return re(n,t*7,e)}function Jl(n,t,e){return He(n,t*12,e)}function ye(n,t){let e=+M(n)-+M(t);return e<0?-1:e>0?1:e}function tc(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Di(n){return!(!tc(n)&&typeof n!="number"||isNaN(+M(n)))}function ec(n,t,e){let[i,s]=pt(e?.in,n,t),o=i.getFullYear()-s.getFullYear(),r=i.getMonth()-s.getMonth();return o*12+r}function nc(n,t,e){let[i,s]=pt(e?.in,n,t);return i.getFullYear()-s.getFullYear()}function Oi(n,t,e){let[i,s]=pt(e?.in,n,t),o=ic(i,s),r=Math.abs(ki(i,s));i.setDate(i.getDate()-o*r);let a=+(ic(i,s)===-o),l=o*(r-a);return l===0?0:l}function ic(n,t){let e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function It(n){return t=>{let i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function sc(n,t,e){let[i,s]=pt(e?.in,n,t),o=(+i-+s)/$t;return It(e?.roundingMethod)(o)}function Ve(n,t){return+M(n)-+M(t)}function oc(n,t,e){let i=Ve(n,t)/qt;return It(e?.roundingMethod)(i)}function Pi(n,t){let e=M(n,t?.in);return e.setHours(23,59,59,999),e}function Si(n,t){let e=M(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function rc(n,t){let e=M(n,t?.in);return+Pi(e,t)==+Si(e,t)}function Ci(n,t,e){let[i,s,o]=pt(e?.in,n,n,t),r=ye(s,o),a=Math.abs(ec(s,o));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-r*a);let l=ye(s,o)===-r;rc(i)&&a===1&&ye(i,o)===1&&(l=!1);let c=r*(a-+l);return c===0?0:c}function ac(n,t,e){let i=Ci(n,t,e)/3;return It(e?.roundingMethod)(i)}function lc(n,t,e){let i=Ve(n,t)/1e3;return It(e?.roundingMethod)(i)}function cc(n,t,e){let i=Oi(n,t,e)/7;return It(e?.roundingMethod)(i)}function uc(n,t,e){let[i,s]=pt(e?.in,n,t),o=ye(i,s),r=Math.abs(nc(i,s));i.setFullYear(1584),s.setFullYear(1584);let a=ye(i,s)===-o,l=o*(r-+a);return l===0?0:l}function hc(n,t){let e=M(n,t?.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function dc(n,t){let e=M(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function fc(n,t){let e=M(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Ti(n,t){let e=M(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function pc(n,t){let e=M(n,t?.in);return e.setMinutes(59,59,999),e}function gc(n,t){let e=ft(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,s=M(n,t?.in),o=s.getDay(),r=(o<i?-7:0)+6-(o-i);return s.setDate(s.getDate()+r),s.setHours(23,59,59,999),s}function mc(n,t){let e=M(n,t?.in);return e.setSeconds(59,999),e}function bc(n,t){let e=M(n,t?.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function xc(n,t){let e=M(n,t?.in);return e.setMilliseconds(999),e}var kg={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},yc=(n,t,e)=>{let i,s=kg[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ai(n){return(t={})=>{let e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}var Dg={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Og={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Pg={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_c={date:Ai({formats:Dg,defaultWidth:"full"}),time:Ai({formats:Og,defaultWidth:"full"}),dateTime:Ai({formats:Pg,defaultWidth:"full"})};var Sg={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wc=(n,t,e,i)=>Sg[n];function je(n){return(t,e)=>{let i=e?.context?String(e.context):"standalone",s;if(i==="formatting"&&n.formattingValues){let r=n.defaultFormattingWidth||n.defaultWidth,a=e?.width?String(e.width):r;s=n.formattingValues[a]||n.formattingValues[r]}else{let r=n.defaultWidth,a=e?.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[r]}let o=n.argumentCallback?n.argumentCallback(t):t;return s[o]}}var Cg={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Tg={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ag={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Lg={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Eg={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Fg={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ig=(n,t)=>{let e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},vc={ordinalNumber:Ig,era:je({values:Cg,defaultWidth:"wide"}),quarter:je({values:Tg,defaultWidth:"wide",argumentCallback:n=>n-1}),month:je({values:Ag,defaultWidth:"wide"}),day:je({values:Lg,defaultWidth:"wide"}),dayPeriod:je({values:Eg,defaultWidth:"wide",formattingValues:Fg,defaultFormattingWidth:"wide"})};function qe(n){return(t,e={})=>{let i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],o=t.match(s);if(!o)return null;let r=o[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?Ng(a,h=>h.test(r)):Rg(a,h=>h.test(r)),c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;let u=t.slice(r.length);return{value:c,rest:u}}}function Rg(n,t){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Ng(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Mc(n){return(t,e={})=>{let i=t.match(n.matchPattern);if(!i)return null;let s=i[0],o=t.match(n.parsePattern);if(!o)return null;let r=n.valueCallback?n.valueCallback(o[0]):o[0];r=e.valueCallback?e.valueCallback(r):r;let a=t.slice(s.length);return{value:r,rest:a}}}var zg=/^(\d+)(th|st|nd|rd)?/i,Wg=/\d+/i,Bg={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Hg={any:[/^b/i,/^(a|c)/i]},Yg={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vg={any:[/1/i,/2/i,/3/i,/4/i]},jg={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qg={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$g={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Xg={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ug={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Gg={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},kc={ordinalNumber:Mc({matchPattern:zg,parsePattern:Wg,valueCallback:n=>parseInt(n,10)}),era:qe({matchPatterns:Bg,defaultMatchWidth:"wide",parsePatterns:Hg,defaultParseWidth:"any"}),quarter:qe({matchPatterns:Yg,defaultMatchWidth:"wide",parsePatterns:Vg,defaultParseWidth:"any",valueCallback:n=>n+1}),month:qe({matchPatterns:jg,defaultMatchWidth:"wide",parsePatterns:qg,defaultParseWidth:"any"}),day:qe({matchPatterns:$g,defaultMatchWidth:"wide",parsePatterns:Xg,defaultParseWidth:"any"}),dayPeriod:qe({matchPatterns:Ug,defaultMatchWidth:"any",parsePatterns:Gg,defaultParseWidth:"any"})};var Pn={code:"en-US",formatDistance:yc,formatLong:_c,formatRelative:wc,localize:vc,match:kc,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Dc(n,t){let e=M(n,t?.in);return ki(e,Ti(e))+1}function Li(n,t){let e=M(n,t?.in),i=+kt(e)-+Ul(e);return Math.round(i/vi)+1}function $e(n,t){let e=M(n,t?.in),i=e.getFullYear(),s=ft(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,r=L(t?.in||n,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);let a=rt(r,t),l=L(t?.in||n,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);let c=rt(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function Oc(n,t){let e=ft(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,s=$e(n,t),o=L(t?.in||n,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),rt(o,t)}function Ei(n,t){let e=M(n,t?.in),i=+rt(e,t)-+Oc(e,t);return Math.round(i/vi)+1}function B(n,t){let e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}var Xt={y(n,t){let e=n.getFullYear(),i=e>0?e:1-e;return B(t==="yy"?i%100:i,t.length)},M(n,t){let e=n.getMonth();return t==="M"?String(e+1):B(e+1,2)},d(n,t){return B(n.getDate(),t.length)},a(n,t){let e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return B(n.getHours()%12||12,t.length)},H(n,t){return B(n.getHours(),t.length)},m(n,t){return B(n.getMinutes(),t.length)},s(n,t){return B(n.getSeconds(),t.length)},S(n,t){let e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return B(s,t.length)}};var Xe={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lr={G:function(n,t,e){let i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){let i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Xt.y(n,t)},Y:function(n,t,e,i){let s=$e(n,i),o=s>0?s:1-s;if(t==="YY"){let r=o%100;return B(r,2)}return t==="Yo"?e.ordinalNumber(o,{unit:"year"}):B(o,t.length)},R:function(n,t){let e=Mi(n);return B(e,t.length)},u:function(n,t){let e=n.getFullYear();return B(e,t.length)},Q:function(n,t,e){let i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return B(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){let i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return B(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){let i=n.getMonth();switch(t){case"M":case"MM":return Xt.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){let i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return B(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){let s=Ei(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):B(s,t.length)},I:function(n,t,e){let i=Li(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):B(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Xt.d(n,t)},D:function(n,t,e){let i=Dc(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):B(i,t.length)},E:function(n,t,e){let i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){let s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return B(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){let s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return B(o,t.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){let i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return B(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){let s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){let i=n.getHours(),s;switch(i===12?s=Xe.noon:i===0?s=Xe.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){let i=n.getHours(),s;switch(i>=17?s=Xe.evening:i>=12?s=Xe.afternoon:i>=4?s=Xe.morning:s=Xe.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Xt.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Xt.H(n,t)},K:function(n,t,e){let i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):B(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):B(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Xt.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Xt.s(n,t)},S:function(n,t){return Xt.S(n,t)},X:function(n,t,e){let i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Sc(i);case"XXXX":case"XX":return _e(i);default:return _e(i,":")}},x:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"x":return Sc(i);case"xxxx":case"xx":return _e(i);default:return _e(i,":")}},O:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Pc(i,":");default:return"GMT"+_e(i,":")}},z:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Pc(i,":");default:return"GMT"+_e(i,":")}},t:function(n,t,e){let i=Math.trunc(+n/1e3);return B(i,t.length)},T:function(n,t,e){return B(+n,t.length)}};function Pc(n,t=""){let e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),o=i%60;return o===0?e+String(s):e+String(s)+t+B(o,2)}function Sc(n,t){return n%60===0?(n>0?"-":"+")+B(Math.abs(n)/60,2):_e(n,t)}function _e(n,t=""){let e=n>0?"-":"+",i=Math.abs(n),s=B(Math.trunc(i/60),2),o=B(i%60,2);return e+s+t+o}var Cc=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Tc=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Qg=(n,t)=>{let e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Cc(n,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Cc(i,t)).replace("{{time}}",Tc(s,t))},Sn={p:Tc,P:Qg};var Kg=/^D+$/,Zg=/^Y+$/,Jg=["D","DD","YY","YYYY"];function Fi(n){return Kg.test(n)}function Ii(n){return Zg.test(n)}function Cn(n,t,e){let i=tm(n,t,e);if(console.warn(i),Jg.includes(n))throw new RangeError(i)}function tm(n,t,e){let i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var em=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nm=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,im=/^'([^]*?)'?$/,sm=/''/g,om=/[a-zA-Z]/;function Ac(n,t,e){let i=ft(),s=e?.locale??i.locale??Pn,o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=M(n,e?.in);if(!Di(a))throw new RangeError("Invalid time value");let l=t.match(nm).map(u=>{let h=u[0];if(h==="p"||h==="P"){let d=Sn[h];return d(u,s.formatLong)}return u}).join("").match(em).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let h=u[0];if(h==="'")return{isToken:!1,value:rm(u)};if(lr[h])return{isToken:!0,value:u};if(h.match(om))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:u}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));let c={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return l.map(u=>{if(!u.isToken)return u.value;let h=u.value;(!e?.useAdditionalWeekYearTokens&&Ii(h)||!e?.useAdditionalDayOfYearTokens&&Fi(h))&&Cn(h,t,String(n));let d=lr[h[0]];return d(a,h,s.localize,c)}).join("")}function rm(n){let t=n.match(im);return t?t[1].replace(sm,"'"):n}function Lc(){return Object.assign({},ft())}function Ec(n,t){let e=M(n,t?.in).getDay();return e===0?7:e}function Fc(n,t){let e=am(t)?new t(0):L(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function am(n){return typeof n=="function"&&n.prototype?.constructor===n}var lm=10,Ri=class{subPriority=0;validate(t,e){return!0}},Ni=class extends Ri{constructor(t,e,i,s,o){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}},zi=class extends Ri{priority=lm;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>L(e,i))}set(t,e){return e.timestampIsSet?t:L(t,Fc(t,this.context))}};var O=class{run(t,e,i,s){let o=this.parse(t,e,i,s);return o?{setter:new Ni(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,i){return!0}};var Wi=class extends O{priority=140;parse(t,e,i){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]};var z={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}/},xt={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 Y(n,t){return n&&{value:t(n.value),rest:n.rest}}function N(n,t){let e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function yt(n,t){let e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};let i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,o=e[3]?parseInt(e[3],10):0,r=e[5]?parseInt(e[5],10):0;return{value:i*(s*$t+o*qt+r*ql),rest:t.slice(e[0].length)}}function Bi(n){return N(z.anyDigitsSigned,n)}function A(n,t){switch(n){case 1:return N(z.singleDigit,t);case 2:return N(z.twoDigits,t);case 3:return N(z.threeDigits,t);case 4:return N(z.fourDigits,t);default:return N(new RegExp("^\\d{1,"+n+"}"),t)}}function Ue(n,t){switch(n){case 1:return N(z.singleDigitSigned,t);case 2:return N(z.twoDigitsSigned,t);case 3:return N(z.threeDigitsSigned,t);case 4:return N(z.fourDigitsSigned,t);default:return N(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Ge(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Hi(n,t){let e=t>0,i=e?t:1-t,s;if(i<=50)s=n||100;else{let o=i+50,r=Math.trunc(o/100)*100,a=n>=o%100;s=n+r-(a?100:0)}return e?s:1-s}function Yi(n){return n%400===0||n%4===0&&n%100!==0}var Vi=class extends O{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){let s=o=>({year:o,isTwoDigitYear:e==="yy"});switch(e){case"y":return Y(A(4,t),s);case"yo":return Y(i.ordinalNumber(t,{unit:"year"}),s);default:return Y(A(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){let s=t.getFullYear();if(i.isTwoDigitYear){let r=Hi(i.year,s);return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}let o=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}};var ji=class extends O{priority=130;parse(t,e,i){let s=o=>({year:o,isTwoDigitYear:e==="YY"});switch(e){case"Y":return Y(A(4,t),s);case"Yo":return Y(i.ordinalNumber(t,{unit:"year"}),s);default:return Y(A(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,s){let o=$e(t,s);if(i.isTwoDigitYear){let a=Hi(i.year,o);return t.setFullYear(a,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,s)}let r=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(r,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]};var qi=class extends O{priority=130;parse(t,e){return e==="R"?Ue(4,t):Ue(e.length,t)}set(t,e,i){let s=L(t,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),kt(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]};var $i=class extends O{priority=130;parse(t,e){return e==="u"?Ue(4,t):Ue(e.length,t)}set(t,e,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]};var Xi=class extends O{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return A(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]};var Ui=class extends O{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return A(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]};var Gi=class extends O{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){let s=o=>o-1;switch(e){case"M":return Y(N(z.month,t),s);case"MM":return Y(A(2,t),s);case"Mo":return Y(i.ordinalNumber(t,{unit:"month"}),s);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}};var Qi=class extends O{priority=110;parse(t,e,i){let s=o=>o-1;switch(e){case"L":return Y(N(z.month,t),s);case"LL":return Y(A(2,t),s);case"Lo":return Y(i.ordinalNumber(t,{unit:"month"}),s);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]};function Ic(n,t,e){let i=M(n,e?.in),s=Ei(i,e)-t;return i.setDate(i.getDate()-s*7),M(i,e?.in)}var Ki=class extends O{priority=100;parse(t,e,i){switch(e){case"w":return N(z.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return A(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,s){return rt(Ic(t,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]};function Rc(n,t,e){let i=M(n,e?.in),s=Li(i,e)-t;return i.setDate(i.getDate()-s*7),i}var Zi=class extends O{priority=100;parse(t,e,i){switch(e){case"I":return N(z.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return A(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return kt(Rc(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]};var cm=[31,28,31,30,31,30,31,31,30,31,30,31],um=[31,29,31,30,31,30,31,31,30,31,30,31],Ji=class extends O{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return N(z.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return A(e.length,t)}}validate(t,e){let i=t.getFullYear(),s=Yi(i),o=t.getMonth();return s?e>=1&&e<=um[o]:e>=1&&e<=cm[o]}set(t,e,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]};var ts=class extends O{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return N(z.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return A(e.length,t)}}validate(t,e){let i=t.getFullYear();return Yi(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]};function Qe(n,t,e){let i=ft(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=M(n,e?.in),r=o.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(r+c)%7:(l+c)%7-(r+c)%7;return re(o,u,e)}var es=class extends O{priority=90;parse(t,e,i){switch(e){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,s){return t=Qe(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]};var ns=class extends O{priority=90;parse(t,e,i,s){let o=r=>{let a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(e){case"e":case"ee":return Y(A(e.length,t),o);case"eo":return Y(i.ordinalNumber(t,{unit:"day"}),o);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,s){return t=Qe(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]};var is=class extends O{priority=90;parse(t,e,i,s){let o=r=>{let a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(e){case"c":case"cc":return Y(A(e.length,t),o);case"co":return Y(i.ordinalNumber(t,{unit:"day"}),o);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,s){return t=Qe(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]};function Nc(n,t,e){let i=M(n,e?.in),s=Ec(i,e),o=t-s;return re(i,o,e)}var ss=class extends O{priority=90;parse(t,e,i){let s=o=>o===0?7:o;switch(e){case"i":case"ii":return A(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return Y(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return Y(i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Y(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);default:return Y(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return t=Nc(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]};var os=class extends O{priority=80;parse(t,e,i){switch(e){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Ge(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]};var rs=class extends O{priority=80;parse(t,e,i){switch(e){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Ge(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]};var as=class extends O{priority=80;parse(t,e,i){switch(e){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Ge(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]};var ls=class extends O{priority=70;parse(t,e,i){switch(e){case"h":return N(z.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return A(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){let s=t.getHours()>=12;return s&&i<12?t.setHours(i+12,0,0,0):!s&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]};var cs=class extends O{priority=70;parse(t,e,i){switch(e){case"H":return N(z.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return A(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]};var us=class extends O{priority=70;parse(t,e,i){switch(e){case"K":return N(z.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return A(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]};var hs=class extends O{priority=70;parse(t,e,i){switch(e){case"k":return N(z.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return A(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){let s=i<=24?i%24:i;return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]};var ds=class extends O{priority=60;parse(t,e,i){switch(e){case"m":return N(z.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return A(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]};var fs=class extends O{priority=50;parse(t,e,i){switch(e){case"s":return N(z.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return A(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]};var ps=class extends O{priority=30;parse(t,e){let i=s=>Math.trunc(s*Math.pow(10,-e.length+3));return Y(A(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]};var gs=class extends O{priority=10;parse(t,e){switch(e){case"X":return yt(xt.basicOptionalMinutes,t);case"XX":return yt(xt.basic,t);case"XXXX":return yt(xt.basicOptionalSeconds,t);case"XXXXX":return yt(xt.extendedOptionalSeconds,t);default:return yt(xt.extended,t)}}set(t,e,i){return e.timestampIsSet?t:L(t,t.getTime()-xe(t)-i)}incompatibleTokens=["t","T","x"]};var ms=class extends O{priority=10;parse(t,e){switch(e){case"x":return yt(xt.basicOptionalMinutes,t);case"xx":return yt(xt.basic,t);case"xxxx":return yt(xt.basicOptionalSeconds,t);case"xxxxx":return yt(xt.extendedOptionalSeconds,t);default:return yt(xt.extended,t)}}set(t,e,i){return e.timestampIsSet?t:L(t,t.getTime()-xe(t)-i)}incompatibleTokens=["t","T","X"]};var bs=class extends O{priority=40;parse(t){return Bi(t)}set(t,e,i){return[L(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"};var xs=class extends O{priority=20;parse(t){return Bi(t)}set(t,e,i){return[L(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"};var zc={G:new Wi,y:new Vi,Y:new ji,R:new qi,u:new $i,Q:new Xi,q:new Ui,M:new Gi,L:new Qi,w:new Ki,I:new Zi,d:new Ji,D:new ts,E:new es,e:new ns,c:new is,i:new ss,a:new os,b:new rs,B:new as,h:new ls,H:new cs,K:new us,k:new hs,m:new ds,s:new fs,S:new ps,X:new gs,x:new ms,t:new bs,T:new xs};var hm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dm=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fm=/^'([^]*?)'?$/,pm=/''/g,gm=/\S/,mm=/[a-zA-Z]/;function Wc(n,t,e,i){let s=()=>L(i?.in||e,NaN),o=Lc(),r=i?.locale??o.locale??Pn,a=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!t)return n?s():M(e,i?.in);let c={firstWeekContainsDate:a,weekStartsOn:l,locale:r},u=[new zi(i?.in,e)],h=t.match(dm).map(m=>{let b=m[0];if(b in Sn){let x=Sn[b];return x(m,r.formatLong)}return m}).join("").match(hm),d=[];for(let m of h){!i?.useAdditionalWeekYearTokens&&Ii(m)&&Cn(m,t,n),!i?.useAdditionalDayOfYearTokens&&Fi(m)&&Cn(m,t,n);let b=m[0],x=zc[b];if(x){let{incompatibleTokens:w}=x;if(Array.isArray(w)){let y=d.find(v=>w.includes(v.token)||v.token===b);if(y)throw new RangeError(`The format string mustn't contain \`${y.fullToken}\` and \`${m}\` at the same time`)}else if(x.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${m}\` and any other token at the same time`);d.push({token:b,fullToken:m});let _=x.run(n,m,r.match,c);if(!_)return s();u.push(_.setter),n=_.rest}else{if(b.match(mm))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(m==="''"?m="'":b==="'"&&(m=bm(m)),n.indexOf(m)===0)n=n.slice(m.length);else return s()}}if(n.length>0&&gm.test(n))return s();let f=u.map(m=>m.priority).sort((m,b)=>b-m).filter((m,b,x)=>x.indexOf(m)===b).map(m=>u.filter(b=>b.priority===m).sort((b,x)=>x.subPriority-b.subPriority)).map(m=>m[0]),p=M(e,i?.in);if(isNaN(+p))return s();let g={};for(let m of f){if(!m.validate(p,c))return s();let b=m.set(p,g,c);Array.isArray(b)?(p=b[0],Object.assign(g,b[1])):p=b}return p}function bm(n){return n.match(fm)[1].replace(pm,"'")}function Bc(n,t){let e=M(n,t?.in);return e.setMinutes(0,0,0),e}function Hc(n,t){let e=M(n,t?.in);return e.setSeconds(0,0),e}function Yc(n,t){let e=M(n,t?.in);return e.setMilliseconds(0),e}function Vc(n,t){let e=()=>L(t?.in,NaN),i=t?.additionalDigits??2,s=wm(n),o;if(s.date){let c=vm(s.date,i);o=Mm(c.restDateString,c.year)}if(!o||isNaN(+o))return e();let r=+o,a=0,l;if(s.time&&(a=km(s.time),isNaN(a)))return e();if(s.timezone){if(l=Dm(s.timezone),isNaN(l))return e()}else{let c=new Date(r+a),u=M(0,t?.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return M(r+a+l,t?.in)}var ys={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},xm=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ym=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,_m=/^([+-])(\d{2})(?::?(\d{2}))?$/;function wm(n){let t={},e=n.split(ys.dateTimeDelimiter),i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],ys.timeZoneDelimiter.test(t.date)&&(t.date=n.split(ys.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){let s=ys.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function vm(n,t){let e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};let s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:n.slice((i[1]||i[2]).length)}}function Mm(n,t){if(t===null)return new Date(NaN);let e=n.match(xm);if(!e)return new Date(NaN);let i=!!e[4],s=Tn(e[1]),o=Tn(e[2])-1,r=Tn(e[3]),a=Tn(e[4]),l=Tn(e[5])-1;if(i)return Tm(t,a,l)?Om(t,a,l):new Date(NaN);{let c=new Date(0);return!Sm(t,o,r)||!Cm(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,r)),c)}}function Tn(n){return n?parseInt(n):1}function km(n){let t=n.match(ym);if(!t)return NaN;let e=cr(t[1]),i=cr(t[2]),s=cr(t[3]);return Am(e,i,s)?e*$t+i*qt+s*1e3:NaN}function cr(n){return n&&parseFloat(n.replace(",","."))||0}function Dm(n){if(n==="Z")return 0;let t=n.match(_m);if(!t)return 0;let e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Lm(i,s)?e*(i*$t+s*qt):NaN}function Om(n,t,e){let i=new Date(0);i.setUTCFullYear(n,0,4);let s=i.getUTCDay()||7,o=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+o),i}var Pm=[31,null,31,30,31,30,31,31,30,31,30,31];function jc(n){return n%400===0||n%4===0&&n%100!==0}function Sm(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Pm[t]||(jc(n)?29:28))}function Cm(n,t){return t>=1&&t<=(jc(n)?366:365)}function Tm(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Am(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Lm(n,t){return t>=0&&t<=59}var Em={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};rr._date.override({_id:"date-fns",formats:function(){return Em},parse:function(n,t){if(n===null||typeof n>"u")return null;let e=typeof n;return e==="number"||n instanceof Date?n=M(n):e==="string"&&(typeof t=="string"?n=Wc(n,t,new Date,this.options):n=Vc(n,this.options)),Di(n)?n.getTime():null},format:function(n,t){return Ac(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Ye(n,t);case"second":return Kl(n,t);case"minute":return Gl(n,t);case"hour":return Xl(n,t);case"day":return re(n,t);case"week":return Zl(n,t);case"month":return He(n,t);case"quarter":return Ql(n,t);case"year":return Jl(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Ve(n,t);case"second":return lc(n,t);case"minute":return oc(n,t);case"hour":return sc(n,t);case"day":return Oi(n,t);case"week":return cc(n,t);case"month":return Ci(n,t);case"quarter":return ac(n,t);case"year":return uc(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Yc(n);case"minute":return Hc(n);case"hour":return Bc(n);case"day":return On(n);case"week":return rt(n);case"isoWeek":return rt(n,{weekStartsOn:+e});case"month":return dc(n);case"quarter":return hc(n);case"year":return Ti(n);default:return n}},endOf:function(n,t){switch(t){case"second":return xc(n);case"minute":return mc(n);case"hour":return pc(n);case"day":return Pi(n);case"week":return gc(n);case"month":return Si(n);case"quarter":return bc(n);case"year":return fc(n);default:return n}}});R.use(Vl);typeof window<"u"&&(window.Chartkick=R);var dM=R;})();
|
|
6
|
+
/*! Bundled license information:
|
|
7
|
+
|
|
8
|
+
chartkick/dist/chartkick.esm.js:
|
|
9
|
+
(*!
|
|
10
|
+
* Chartkick.js v5.0.1
|
|
11
|
+
* Create beautiful charts with one line of JavaScript
|
|
12
|
+
* https://github.com/ankane/chartkick.js
|
|
13
|
+
* MIT License
|
|
14
|
+
*)
|
|
15
|
+
|
|
16
|
+
@kurkle/color/dist/color.esm.js:
|
|
17
|
+
(*!
|
|
18
|
+
* @kurkle/color v0.3.4
|
|
19
|
+
* https://github.com/kurkle/color#readme
|
|
20
|
+
* (c) 2024 Jukka Kurkela
|
|
21
|
+
* Released under the MIT License
|
|
22
|
+
*)
|
|
23
|
+
|
|
24
|
+
chart.js/dist/chunks/helpers.dataset.js:
|
|
25
|
+
chart.js/dist/chart.js:
|
|
26
|
+
(*!
|
|
27
|
+
* Chart.js v4.5.1
|
|
28
|
+
* https://www.chartjs.org
|
|
29
|
+
* (c) 2025 Chart.js Contributors
|
|
30
|
+
* Released under the MIT License
|
|
31
|
+
*)
|
|
32
|
+
|
|
33
|
+
chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.esm.js:
|
|
34
|
+
(*!
|
|
35
|
+
* chartjs-adapter-date-fns v3.0.0
|
|
36
|
+
* https://www.chartjs.org
|
|
37
|
+
* (c) 2022 chartjs-adapter-date-fns Contributors
|
|
38
|
+
* Released under the MIT license
|
|
39
|
+
*)
|
|
40
|
+
*/
|
|
41
|
+
//# sourceMappingURL=plutonium-charts.min.js.map
|