-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.cf453737aaa024b6.js
1 lines (1 loc) · 160 KB
/
scripts.cf453737aaa024b6.js
1
import{r as un,a as Ot,e as $e,c as Ue,i as z,d as I,b as X,v as C,u as Ye,l as fn,f as kt,g as B,h as Tt,s as ct,j as ft,k as L,_ as Xe,t as tt,m as gn,n as pn,T as U,o as Gt,p as qt,H as Z,P as ot,q as Ke,w as Ge,x as Mt,y as qe,z as gt,A as mn,B as Et,C as xe,D as Je,E as j,F as O,G as bn,I as Ze,J as Qe,K as xn,L as ti,M as ei,N as _n,O as J,Q as E,R as yn,S as Y,U as _e,V as ii,W as vn,X as pt,Y as Jt,Z as mt,$ as Zt,a0 as V,a1 as ye,a2 as $,a3 as St,a4 as kn,a5 as Mn,a6 as si,a7 as Qt,a8 as ni,a9 as Sn,aa as wn,ab as te,ac as Pn,ad as Dn,ae as oi,af as ai,ag as ri,ah as ee,ai as Cn,aj as ht,ak as An,al as Ln,am as On,an as li,ao as Tn,ap as En,aq as Rn,ar as zn,as as Fn,at as ve,au as Rt,av as In,aw as bt,ax as Bn,ay as zt,az as wt,aA as ci,aB as Vn,aC as hi,aD as Nn,aE as Hn,aF as at,aG as di,aH as ui,aI as Wn,aJ as ke,aK as fi,aL as Me,aM as Ft,aN as jn,aO as $n,aP as Un}from"./chunks/helpers.segment.js";export{aL as Ticks,d as defaults}from"./chunks/helpers.segment.js";import"@kurkle/color";class Yn{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const a=e.duration;e.listeners[s].forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=un.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let l,a=o.length-1,r=!1;for(;a>=0;--a)l=o[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(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,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);!e||(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var it=new Yn;const gi="transparent",Xn={boolean:(n,t,e)=>e>.5?t:n,color(n,t,e){const i=Ue(n||gi),s=i.valid&&Ue(t||gi);return s&&s.valid?s.mix(i,e).hexString():t},number:(n,t,e)=>n+(t-n)*e};class pi{constructor(t,e,i,s){const o=e[i];s=Ot([t.to,s,o,t.from]);const a=Ot([t.from,o,s]);this._active=!0,this._fn=t.fn||Xn[t.type||typeof a],this._easing=$e[t.easing]||$e.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=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ot([t.to,e,s,t.from]),this._from=Ot([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<i),!this._active)return this._target[s]=r,void this._notify(!0);e<0?this._target[s]=o:(l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Se{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!z(t))return;const e=Object.keys(I.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!z(o))return;const a={};for(const r of e)a[r]=o[r];(X(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,e){const i=e.options,s=Gn(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&Kn(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if("$"===c.charAt(0))continue;if("options"===c){s.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=i.get(c);if(d){if(u&&d.active()){d.update(u,h,r);continue}d.cancel()}u&&u.duration?(o[c]=d=new pi(u,t,c,h),s.push(d)):t[c]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(it.add(this._chart,i),!0):void 0}}function Kn(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Gn(n,t){if(!t)return;let e=n.options;if(e)return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e;n.options=t}function mi(n,t){const e=n&&n.options||{},i=e.reverse,s=void 0===e.min?t:0,o=void 0===e.max?t:0;return{start:i?o:s,end:i?s:o}}function qn(n,t,e){if(!1===e)return!1;const i=mi(n,e),s=mi(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Jn(n){let t,e,i,s;return z(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:!1===n}}function bi(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function xi(n,t,e,i={}){const s=n.keys,o="single"===i.mode;let a,r,l,c;if(null!==t){for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(i.all)continue;break}c=n.values[l],B(c)&&(o||0===t||ct(t)===ct(c))&&(t+=c)}return t}}function Zn(n){const t=Object.keys(n),e=new Array(t.length);let i,s,o;for(i=0,s=t.length;i<s;++i)o=t[i],e[i]={x:o,y:n[o]};return e}function _i(n,t){const e=n&&n.options.stacked;return e||void 0===e&&void 0!==t.stack}function Qn(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function to(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function eo(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function yi(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function vi(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=i,l=o.axis,c=a.axis,h=Qn(o,a,i),d=t.length;let u;for(let f=0;f<d;++f){const g=t[f],{[l]:p,[c]:b}=g;u=(g._stacks||(g._stacks={}))[c]=eo(s,h,p),u[r]=b,u._top=yi(u,a,!0,i.type),u._bottom=yi(u,a,!1,i.type),(u._visualValues||(u._visualValues={}))[r]=b}}function we(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function io(n,t){return ft(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function so(n,t,e){return ft(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function It(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const o=s._stacks;if(!o||void 0===o[i]||void 0===o[i][e])return;delete o[i][e],void 0!==o[i]._visualValues&&void 0!==o[i]._visualValues[e]&&delete o[i]._visualValues[e]}}}const Pe=n=>"reset"===n||"none"===n,ki=(n,t)=>t?n:Object.assign({},n),no=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:bi(e,!0),values:null};class rt{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=_i(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&&It(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,u,f,g)=>"x"===d?u:"r"===d?g:f,o=e.xAxisID=C(i.xAxisID,we(t,"x")),a=e.yAxisID=C(i.yAxisID,we(t,"y")),r=e.rAxisID=C(i.rAxisID,we(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),h=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ye(this._data,this),t._stacked&&It(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(z(e))this._data=Zn(e);else if(i!==e){if(i){Ye(i,this);const s=this._cachedMeta;It(s),s._parsed=[]}e&&Object.isExtensible(e)&&fn(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=_i(e.vScale,e),e.stack!==i.stack&&(s=!0,It(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&vi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:a}=i,r=o.axis;let h,d,u,l=0===t&&e===s.length||i._sorted,c=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,u=s;else{u=X(s[t])?this.parseArrayData(i,s,t,e):z(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const f=()=>null===d[r]||c&&d[r]<c[r];for(h=0;h<e;++h)i._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);i._sorted=l}a&&vi(this,u)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,d=new Array(s);let u,f,g;for(u=0,f=s;u<f;++u)g=u+i,d[u]={[r]:h||o.parse(c[g],g),[l]:a.parse(e[g],g)};return d}parseArrayData(t,e,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,h,d;for(l=0,c=s;l<c;++l)h=l+i,d=e[h],r[l]={x:o.parse(d[0],h),y:a.parse(d[1],h)};return r}parseObjectData(t,e,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,d,u,f;for(h=0,d=s;h<d;++h)u=h+i,f=e[u],c[h]={x:o.parse(kt(f,r),u),y:a.parse(kt(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const o=this._cachedMeta,a=e[t.axis];return xi({keys:bi(this.chart,!0),values:e._stacks[t.axis]._visualValues},a,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const o=i[e.axis];let a=null===o?NaN:o;const r=s&&i._stacks[e.axis];s&&r&&(s.values=r,a=xi(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,a=s.length,r=this._getOtherScale(t),l=no(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=to(r);let u,f;function g(){f=s[u];const p=f[r.axis];return!B(f[t.axis])||h>p||d<p}for(u=0;u<a&&(g()||(this.updateRangeFromParsed(c,t,f,l),!o));++u);if(o)for(u=a-1;u>=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],B(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const 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){const e=this._cachedMeta;this.update(t||"default"),e._clip=Jn(C(this.options.clip,qn(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,i=this._cachedMeta,s=i.data||[],o=this.chart.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const d=s[h];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=so(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=io(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){const s="active"===e,o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&Tt(i);if(r)return ki(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(I.elements[t]),p=c.resolveNamedOptions(u,f,()=>this.getContext(i,s,e),d);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(ki(p,l))),p}_resolveAnimations(t,e,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(!1!==s.options.animation){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,i,e))}const c=new Se(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Pe(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:a}}updateElement(t,e,i,s){Pe(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Pe(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const 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(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=i.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,i=!0){const s=this._cachedMeta,o=s.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=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){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&It(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function oo(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Xe(i.sort((s,o)=>s-o))}return n._cache.$bar}function ao(n){const t=n.iScale,e=oo(t,n.type);let s,o,a,r,i=t._length;const l=()=>{32767===a||-32768===a||(Tt(r)&&(i=Math.min(i,Math.abs(a-r)||i)),r=a)};for(s=0,o=e.length;s<o;++s)a=t.getPixelForValue(e[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return i}function ro(n,t,e,i){const s=e.barThickness;let o,a;return L(s)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:t.pixels[n]-o/2}}function lo(n,t,e,i){const s=t.pixels,o=s[n];let a=n>0?s[n-1]:null,r=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;null===a&&(a=o-(null===r?t.end-t.start:r-o)),null===r&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/i,ratio:e.barPercentage,start:c}}function co(n,t,e,i){const s=e.parse(n[0],i),o=e.parse(n[1],i),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function Mi(n,t,e,i){return X(n)?co(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Si(n,t,e,i){const s=n.iScale,o=n.vScale,a=s.getLabels(),r=s===o,l=[];let c,h,d,u;for(c=e,h=e+i;c<h;++c)u=t[c],d={},d[s.axis]=r||s.parse(a[c],c),l.push(Mi(u,d,o,c));return l}function De(n){return n&&void 0!==n.barStart&&void 0!==n.barEnd}function ho(n,t,e){return 0!==n?ct(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function uo(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 fo(n,t,e,i){let s=t.borderSkipped;const o={};if(!s)return void(n.borderSkipped=o);if(!0===s)return void(n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:r,reverse:l,top:c,bottom:h}=uo(n);"middle"===s&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=h:(o[wi(h,a,r,l)]=!0,s=c)),o[wi(s,a,r,l)]=!0,n.borderSkipped=o}function wi(n,t,e,i){return n=i?Pi(n=go(n,t,e),e,t):Pi(n,t,e)}function go(n,t,e){return n===t?e:n===e?t:n}function Pi(n,t,e){return"start"===n?t:"end"===n?e:n}function po(n,{inflateAmount:t},e){n.inflateAmount="auto"===t?1===e?.33:0:t}class Di extends rt{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 Si(t,e,i,s)}parseArrayData(t,e,i,s){return Si(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c="x"===o.axis?r:l,h="x"===a.axis?r:l,d=[];let u,f,g,p;for(u=i,f=i+s;u<f;++u)p=e[u],g={},g[o.axis]=o.parse(kt(p,c),u),d.push(Mi(kt(p,h),g,a,u));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const 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){const e=this._cachedMeta,{iScale:i,vScale:s}=e,o=this.getParsed(t),a=o._custom,r=De(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const o="reset"===s,{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,s);for(let f=e;f<e+i;f++){const g=this.getParsed(f),p=o||L(g[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),b=this._calculateBarIndexPixels(f,h),m=(g._stacks||{})[r.axis],x={horizontal:c,base:p.base,enableBorderRadius:!m||De(g._custom)||a===m._top||a===m._bottom,x:c?p.head:b.center,y:c?b.center:p.head,height:c?b.size:Math.abs(p.size),width:c?Math.abs(p.size):b.size};u&&(x.options=d||this.resolveDataElementOptions(f,t[f].active?"active":s));const v=x.options||t[f].options;fo(x,v,m,a),po(x,v,h.ratio),this.updateElement(t[f],f,x,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=i.options.stacked,a=[],r=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(L(h)||isNaN(h))return!0};for(const l of s)if((void 0===e||!r(l))&&((!1===o||-1===a.indexOf(l.stack)||void 0===o&&void 0===l.stack)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),o=void 0!==e?s.indexOf(e):-1;return-1===o?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let o,a;for(o=0,a=e.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const r=t.barThickness;return{min:r||ao(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=De(c);let g,p,d=l[e.axis],u=0,f=i?this.applyStack(e,l,i):d;f!==d&&(u=f-d,f=d),h&&(d=c.barStart,f=c.barEnd-c.barStart,0!==d&&ct(d)!==ct(c.barEnd)&&(u=0),u+=d);const b=L(o)||h?u:o;let m=e.getPixelForValue(b);if(g=this.chart.getDataVisibility(t)?e.getPixelForValue(u+f):m,p=g-m,Math.abs(p)<a){p=ho(p,e,r)*a,d===r&&(m-=p/2);const x=e.getPixelForDecimal(0),v=e.getPixelForDecimal(1),y=Math.min(x,v),_=Math.max(x,v);m=Math.max(Math.min(m,_),y),g=m+p,i&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const x=ct(p)*e.getLineWidthForValue(r)/2;m+=x,p-=x}return{size:p,base:m,head:g,center:g+p/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,a=C(s.maxBarThickness,1/0);let r,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h="flex"===s.barThickness?lo(t,e,s,c):ro(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=h.start+h.chunk*d+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)null!==this.getParsed(o)[e.axis]&&i[o].draw(this._ctx)}}class Ci extends rt{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const o=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(t,e,i,s){const o=super.parseArrayData(t,e,i,s);for(let a=0;a<o.length;a++)o[a]._custom=C(e[i+a][2],this.resolveDataElementOptions(a+i).radius);return o}parseObjectData(t,e,i,s){const o=super.parseObjectData(t,e,i,s);for(let a=0;a<o.length;a++){const r=e[i+a];o[a]._custom=C(r&&r.r&&+r.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const o="reset"===s,{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=a.axis,d=r.axis;for(let u=e;u<e+i;u++){const f=t[u],g=!o&&this.getParsed(u),p={},b=p[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(g[h]),m=p[d]=o?r.getBasePixel():r.getPixelForValue(g[d]);p.skip=isNaN(b)||isNaN(m),c&&(p.options=l||this.resolveDataElementOptions(u,f.active?"active":s),o&&(p.options.radius=0)),this.updateElement(f,u,p,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return"active"!==e&&(s.radius=0),s.radius+=C(i&&i._custom,o),s}}function mo(n,t,e){let i=1,s=1,o=0,a=0;if(t<U){const r=n,l=r+t,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(v,y,_)=>qt(v,r,l,!0)?1:Math.max(y,y*e,_,_*e),g=(v,y,_)=>qt(v,r,l,!0)?-1:Math.min(y,y*e,_,_*e),p=f(0,c,d),b=f(Z,h,u),m=g(ot,c,d),x=g(ot+Z,h,u);i=(p-m)/2,s=(b-x)/2,o=-(p+m)/2,a=-(b+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class ie extends rt{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let a,r,o=l=>+i[l];if(z(i[t])){const{key:l="value"}=this._parsing;o=c=>+kt(i[c],l)}for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return tt(this.options.rotation-90)}_getCircumference(){return tt(this.options.circumference)}_getRotationExtents(){let t=U,e=-U;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(gn(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:g,offsetY:p}=mo(d,h,l),x=Math.max(Math.min((i.width-a)/u,(i.height-a)/f)/2,0),v=pn(this.options.radius,x),_=(v-Math.max(v*l,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=p*v,s.total=this.calculateTotal(),this.outerRadius=v-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/U)}updateElements(t,e,i,s){const o="reset"===s,a=this.chart,r=a.chartArea,h=(r.left+r.right)/2,d=(r.top+r.bottom)/2,u=o&&a.options.animation.animateScale,f=u?0:this.innerRadius,g=u?0:this.outerRadius,{sharedOptions:p,includeOptions:b}=this._getSharedOptions(e,s);let x,m=this._getRotation();for(x=0;x<e;++x)m+=this._circumference(x,o);for(x=e;x<e+i;++x){const v=this._circumference(x,o),y=t[x],_={x:h+this.offsetX,y:d+this.offsetY,startAngle:m,endAngle:m+v,circumference:v,outerRadius:g,innerRadius:f};b&&(_.options=p||this.resolveDataElementOptions(x,y.active?"active":s)),m+=v,this.updateElement(y,x,_,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s,i=0;for(s=0;s<e.length;s++){const o=t._parsed[s];null!==o&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?U*(Math.abs(t)/e):0}getLabelAndValue(t){const i=this.chart,s=i.data.labels||[],o=Gt(this._cachedMeta._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,o,a,r,l;if(!t)for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,r=a.controller;break}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),"inner"!==l.borderAlign&&(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){const 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}}class Ai extends rt{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=Ke(e,s,a);this._drawStart=r,this._drawCount=l,Ge(e)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,r,l,t)}updateElements(t,e,i,s){const o="reset"===s,{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),u=a.axis,f=r.axis,{spanGaps:g,segment:p}=this.options,b=Mt(g)?g:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||o||"none"===s,x=e+i,v=t.length;let y=e>0&&this.getParsed(e-1);for(let _=0;_<v;++_){const k=t[_],M=m?k:{};if(_<e||_>=x){M.skip=!0;continue}const S=this.getParsed(_),w=L(S[f]),P=M[u]=a.getPixelForValue(S[u],_),D=M[f]=o||w?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,S,l):S[f],_);M.skip=isNaN(P)||isNaN(D)||w,M.stop=_>0&&Math.abs(S[u]-y[u])>b,p&&(M.parsed=S,M.raw=c.data[_]),d&&(M.options=h||this.resolveDataElementOptions(_,k.active?"active":s)),m||this.updateElement(k,_,M,s),y=S}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Ce extends rt{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const i=this.chart,s=i.data.labels||[],o=Gt(this._cachedMeta._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return qe.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return this._cachedMeta.data.forEach((i,s)=>{const 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(){const 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=(o-Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,s){const o="reset"===s,a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*ot;let g,f=u;const p=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,s,p);for(g=e;g<e+i;g++){const b=t[g];let m=f,x=f+this._computeAngle(g,s,p),v=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=x,o&&(l.animateScale&&(v=0),l.animateRotate&&(m=x=u));const y={x:h,y:d,innerRadius:0,outerRadius:v,startAngle:m,endAngle:x,options:this.resolveDataElementOptions(g,b.active?"active":s)};this.updateElement(b,g,y,s)}}countVisibleElements(){let e=0;return this._cachedMeta.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?tt(this.resolveDataElementOptions(t,e).angle||i):0}}class Li extends ie{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Oi extends rt{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return qe.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(i.points=s,"resize"!==t){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0),this.updateElement(i,void 0,{_loop:!0,_fullLoop:o.length===s.length,options:a},t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const o=this._cachedMeta.rScale,a="reset"===s;for(let r=e;r<e+i;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),h=o.getPointPositionForValue(r,this.getParsed(r).r),d=a?o.xCenter:h.x,u=a?o.yCenter:h.y,f={x:d,y:u,angle:h.angle,skip:isNaN(d)||isNaN(u),options:c};this.updateElement(l,r,f,s)}}}class Ti extends rt{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:i[t]||"",value:"("+r+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=Ke(e,i,s);if(this._drawStart=o,this._drawCount=a,Ge(e)&&(o=0,a=i.length),this.options.showLine){const{dataset:r,_dataset:l}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t)}this.updateElements(i,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const o="reset"===s,{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(h),u=this.includeOptions(s,d),f=a.axis,g=r.axis,{spanGaps:p,segment:b}=this.options,m=Mt(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===s;let v=e>0&&this.getParsed(e-1);for(let y=e;y<e+i;++y){const _=t[y],k=this.getParsed(y),M=x?_:{},S=L(k[g]),w=M[f]=a.getPixelForValue(k[f],y),P=M[g]=o||S?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,k,l):k[g],y);M.skip=isNaN(w)||isNaN(P)||S,M.stop=y>0&&Math.abs(k[f]-v[f])>m,b&&(M.parsed=k,M.raw=c.data[y]),u&&(M.options=d||this.resolveDataElementOptions(y,_.active?"active":s)),x||this.updateElement(_,y,M,s),v=k}this.updateSharedOptions(d,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let l=e.length-1;l>=0;--l)r=Math.max(r,e[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,a)/2}}var Ei=Object.freeze({__proto__:null,BarController:Di,BubbleController:Ci,DoughnutController:ie,LineController:Ai,PolarAreaController:Ce,PieController:Li,RadarController:Oi,ScatterController:Ti});function xt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class je{static override(t){Object.assign(je.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return xt()}parse(){return xt()}format(){return xt()}add(){return xt()}diff(){return xt()}startOf(){return xt()}endOf(){return xt()}}var Ri={_date:je};function bo(n,t,e,i){const{controller:s,data:o,_sorted:a}=n,r=s._cachedMeta.iScale;if(r&&t===r.axis&&"r"!==t&&a&&o.length){const l=r._reversePixels?mn:Et;if(!i)return l(o,t,e);if(s._sharedOptions){const c=o[0],h="function"==typeof c.getRange&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}return{lo:0,hi:o.length-1}}function Bt(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:h}=o[r],{lo:d,hi:u}=bo(o[r],t,a,s);for(let f=d;f<=u;++f){const g=h[f];g.skip||i(g,c,f)}}}function xo(n){const t=-1!==n.indexOf("x"),e=-1!==n.indexOf("y");return function(i,s){const o=t?Math.abs(i.x-s.x):0,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Ae(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||Bt(n,e,t,function(r,l,c){!s&&!xe(r,n.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function _o(n,t,e,i){let s=[];return Bt(n,e,t,function o(a,r,l){const{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:d}=Je(a,{x:t.x,y:t.y});qt(d,c,h)&&s.push({element:a,datasetIndex:r,index:l})}),s}function yo(n,t,e,i,s,o){let a=[];const r=xo(e);let l=Number.POSITIVE_INFINITY;return Bt(n,e,t,function c(h,d,u){const f=h.inRange(t.x,t.y,s);if(i&&!f)return;const g=h.getCenterPoint(s);if(!o&&!n.isPointInArea(g)&&!f)return;const b=r(t,g);b<l?(a=[{element:h,datasetIndex:d,index:u}],l=b):b===l&&a.push({element:h,datasetIndex:d,index:u})}),a}function Le(n,t,e,i,s,o){return o||n.isPointInArea(t)?"r"!==e||i?yo(n,t,e,i,s,o):_o(n,t,e,s):[]}function zi(n,t,e,i,s){const o=[],a="x"===e?"inXRange":"inYRange";let r=!1;return Bt(n,e,t,(l,c,h)=>{l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,s))}),i&&!r?[]:o}var Fi={evaluateInteractionItems:Bt,modes:{index(n,t,e,i){const s=gt(t,n),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?Ae(n,s,o,i,a):Le(n,s,o,!1,i,a),l=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(n,t,e,i){const s=gt(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?Ae(n,s,o,i,a):Le(n,s,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,c=n.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point:(n,t,e,i)=>Ae(n,gt(t,n),e.axis||"xy",i,e.includeInvisible||!1),nearest:(n,t,e,i)=>Le(n,gt(t,n),e.axis||"xy",e.intersect,i,e.includeInvisible||!1),x:(n,t,e,i)=>zi(n,gt(t,n),"x",e.intersect,i),y:(n,t,e,i)=>zi(n,gt(t,n),"y",e.intersect,i)}};const Ii=["left","top","right","bottom"];function Vt(n,t){return n.filter(e=>e.pos===t)}function Bi(n,t){return n.filter(e=>-1===Ii.indexOf(e.pos)&&e.box.axis===t)}function Nt(n,t){return n.sort((e,i)=>{const s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function vo(n){const t=[];let e,i,s,o,a,r;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],({position:o,options:{stack:a,stackWeight:r=1}}=s),t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function ko(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!Ii.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Mo(n,t){const e=ko(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=n.length;o<a;++o){r=n[o];const{fullSize:l}=r.box,c=e[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*i:l&&t.availableWidth,r.height=s):(r.width=i,r.height=h?h*s:l&&t.availableHeight)}return e}function So(n){const t=vo(n),e=Nt(t.filter(c=>c.box.fullSize),!0),i=Nt(Vt(t,"left"),!0),s=Nt(Vt(t,"right")),o=Nt(Vt(t,"top"),!0),a=Nt(Vt(t,"bottom")),r=Bi(t,"x"),l=Bi(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Vt(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function Vi(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Ni(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 wo(n,t,e,i){const{pos:s,box:o}=e,a=n.maxPadding;if(!z(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,n[s]+=e.size}o.getPadding&&Ni(a,o.getPadding());const r=Math.max(0,t.outerWidth-Vi(a,n,"left","right")),l=Math.max(0,t.outerHeight-Vi(a,n,"top","bottom")),c=r!==n.w,h=l!==n.h;return n.w=r,n.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Po(n){const t=n.maxPadding;function e(i){const 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 Do(n,t){const e=t.maxPadding;return function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}(n?["left","right"]:["top","bottom"])}function Ht(n,t,e,i){const s=[];let o,a,r,l,c,h;for(o=0,a=n.length,c=0;o<a;++o){r=n[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Do(r.horizontal,t));const{same:d,other:u}=wo(t,e,r,i);c|=d&&s.length,h=h||u,l.fullSize||s.push(r)}return c&&Ht(s,t,e,i)||h}function se(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 Hi(n,t,e,i){const s=e.padding;let{x:o,y:a}=t;for(const r of n){const l=r.box,c=i[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){const d=t.w*h,u=c.size||l.height;Tt(c.start)&&(a=c.start),l.fullSize?se(l,s.left,a,e.outerWidth-s.right-s.left,u):se(l,t.left+c.placed,a,d,u),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*h,u=c.size||l.width;Tt(c.start)&&(o=c.start),l.fullSize?se(l,o,s.top,u,e.outerHeight-s.bottom-s.top):se(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var H={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){const e=n.boxes?n.boxes.indexOf(t):-1;-1!==e&&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;const s=j(n.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=So(n.boxes),l=r.vertical,c=r.horizontal;O(n.boxes,p=>{"function"==typeof p.beforeLayout&&p.beforeLayout()});const h=l.reduce((p,b)=>b.box.options&&!1===b.box.options.display?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},s);Ni(u,j(i));const f=Object.assign({maxPadding:u,w:o,h:a,x:s.left,y:s.top},s),g=Mo(l.concat(c),d);Ht(r.fullSize,f,d,g),Ht(l,f,d,g),Ht(c,f,d,g)&&Ht(l,f,d,g),Po(f),Hi(r.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Hi(r.rightAndBottom,f,d,g),n.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},O(r.chartArea,p=>{const b=p.box;Object.assign(b,n.chartArea),b.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Oe{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Wi extends Oe{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ne="$chartjs",Co={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ji=n=>null===n||""===n;function Ao(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ne]={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",ji(s)){const o=Qe(n,"width");void 0!==o&&(n.width=o)}if(ji(i))if(""===n.style.height)n.height=n.width/(t||2);else{const o=Qe(n,"height");void 0!==o&&(n.height=o)}return n}const $i=!!xn&&{passive:!0};function Lo(n,t,e){n.addEventListener(t,e,$i)}function Oo(n,t,e){n.canvas.removeEventListener(t,e,$i)}function To(n,t){const e=Co[n.type]||n.type,{x:i,y:s}=gt(n,t);return{type:e,chart:t,native:n,x:void 0!==i?i:null,y:void 0!==s?s:null}}function oe(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Eo(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||oe(r.addedNodes,i),a=a&&!oe(r.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ro(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||oe(r.removedNodes,i),a=a&&!oe(r.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Wt=new Map;let Ui=0;function Yi(){const n=window.devicePixelRatio;n!==Ui&&(Ui=n,Wt.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function zo(n,t){Wt.size||window.addEventListener("resize",Yi),Wt.set(n,t)}function Fo(n){Wt.delete(n),Wt.size||window.removeEventListener("resize",Yi)}function Io(n,t,e){const i=n.canvas,s=i&&Ze(i);if(!s)return;const o=ti((r,l)=>{const c=s.clientWidth;e(r,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,h=l.contentRect.height;0===c&&0===h||o(c,h)});return a.observe(s),zo(n,o),a}function Te(n,t,e){e&&e.disconnect(),"resize"===t&&Fo(n)}function Bo(n,t,e){const i=n.canvas,s=ti(o=>{null!==n.ctx&&e(To(o,n))},n);return Lo(i,t,s),s}class Xi extends Oe{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Ao(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[ne])return!1;const i=e[ne].initial;["height","width"].forEach(o=>{const a=i[o];L(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[ne],!0}addEventListener(t,e,i){this.removeEventListener(t,e),(t.$proxies||(t.$proxies={}))[e]=({attach:Eo,detach:Ro,resize:Io}[e]||Bo)(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:Te,detach:Te,resize:Te}[e]||Oo)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return bn(t,e,i,s)}isAttached(t){const e=Ze(t);return!(!e||!e.isConnected)}}function Ki(n){return!ei()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Wi:Xi}class st{static defaults={};static defaultRoutes=void 0;active=!1;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Mt(this.x)&&Mt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function Vo(n,t){const e=n.options.ticks,i=No(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Wo(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return jo(t,c,o,a/s),c;const h=Ho(o,t,s);if(a>0){let d,u;const f=a>1?Math.round((l-r)/(a-1)):null;for(ae(t,c,h,L(f)?0:r-f,r),d=0,u=a-1;d<u;d++)ae(t,c,h,o[d],o[d+1]);return ae(t,c,h,l,L(f)?t.length:l+f),c}return ae(t,c,h),c}function No(n){const t=n.options.offset,e=n._tickSize();return Math.floor(Math.min(n._length/e+(t?0:1),n._maxLength/e))}function Ho(n,t,e){const i=$o(n),s=t.length/e;if(!i)return Math.max(s,1);const o=_n(i);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function Wo(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function jo(n,t,e,i){let a,s=0,o=e[0];for(i=Math.ceil(i),a=0;a<n.length;a++)a===o&&(t.push(n[a]),s++,o=e[s*i])}function ae(n,t,e,i,s){const o=C(i,0),a=Math.min(C(s,n.length),n.length);let l,c,h,r=0;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===h&&(t.push(n[c]),r++,h=Math.round(o+r*e))}function $o(n){const t=n.length;let 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}const Uo=n=>"left"===n?"right":"right"===n?"left":n,Gi=(n,t,e)=>"top"===t||"left"===t?n[t]+e:n[t]-e;function qi(n,t){const e=[],i=n.length/t,s=n.length;let o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function Yo(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,a=n._endPixel,r=1e-6;let c,l=n.getPixelForTick(s);if(!(e&&(c=1===i?Math.max(l-o,a-l):0===t?(n.getPixelForTick(1)-l)/2:(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function Xo(n,t){O(n,e=>{const i=e.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function jt(n){return n.drawTicks?n.tickLength:0}function Ji(n,t){if(!n.display)return 0;const e=V(n.font,t),i=j(n.padding);return(X(n.text)?n.text.length:1)*e.lineHeight+i.height}function Ko(n,t){return ft(n,{scale:t,type:"scale"})}function Go(n,t,e){return ft(n,{tick:e,index:t,type:"tick"})}function qo(n,t,e){let i=ye(n);return(e&&"right"!==t||!e&&"right"===t)&&(i=Uo(i)),i}function Jo(n,t,e,i){const{top:s,left:o,bottom:a,right:r,chart:l}=n,{chartArea:c,scales:h}=l;let u,f,g,d=0;const p=a-s,b=r-o;if(n.isHorizontal()){if(f=$(i,o,r),z(e)){const m=Object.keys(e)[0];g=h[m].getPixelForValue(e[m])+p-t}else g="center"===e?(c.bottom+c.top)/2+p-t:Gi(n,e,t);u=r-o}else{if(z(e)){const m=Object.keys(e)[0];f=h[m].getPixelForValue(e[m])-b+t}else f="center"===e?(c.left+c.right)/2-b+t:Gi(n,e,t);g=$(i,a,s),d="left"===e?-Z:Z}return{titleX:f,titleY:g,maxWidth:u,rotation:d}}class ut extends st{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=J(t,Number.POSITIVE_INFINITY),e=J(e,Number.NEGATIVE_INFINITY),i=J(i,Number.POSITIVE_INFINITY),s=J(s,Number.NEGATIVE_INFINITY),{min:J(t,i),max:J(e,s),minDefined:B(t),maxDefined:B(e)}}getMinMax(t){let a,{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds();if(s&&o)return{min:e,max:i};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),o||(i=Math.max(i,a.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:J(e,J(i,e)),max:J(i,J(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(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){E(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.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=yn(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?qi(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=Vo(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,i,t=this.options.reverse;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(){E(this.options.afterUpdate,[this])}beforeSetDimensions(){E(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(){E(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),E(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){E(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=E(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){E(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){E(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,s=e.minRotation||0,o=e.maxRotation;let r,l,c,a=s;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Y(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/i:f/(i-1),d+6>r&&(r=f/(i-(t.offset?.5:1)),l=this.maxHeight-jt(t.grid)-e.padding-Ji(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),a=_e(Math.min(Math.asin(Y((h.highest.height+6)/r,-1,1)),Math.asin(Y(l/c,-1,1))-Math.asin(Y(u/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){E(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){E(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Ji(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=jt(o)+l):(t.height=this.maxHeight,t.width=jt(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=2*i.padding,g=tt(this.labelRotation),p=Math.cos(g),b=Math.sin(g);r?t.height=Math.min(this.maxHeight,t.height+(i.mirror?0:b*d.width+p*u.height)+f):t.width=Math.min(this.maxWidth,t.width+(i.mirror?0:p*d.width+b*u.height)+f),this._calculatePadding(c,h,b,p)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=0!==this.labelRotation,c="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=s*t.width,f=i*e.height):(u=i*t.height,f=s*e.width):"start"===o?f=e.width:"end"===o?u=t.width:"inner"!==o&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+a)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;"start"===o?(h=0,d=t.height):"end"===o&&(h=e.height,d=0),this.paddingTop=h+a,this.paddingBottom=d+a}}_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(){E(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)L(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=qi(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:s}=this,o=[],a=[];let c,h,d,u,f,g,p,b,m,x,v,r=0,l=0;for(c=0;c<e;++c){if(u=t[c].label,f=this._resolveTickFontOptions(c),i.font=g=f.string,p=s[g]=s[g]||{data:{},gc:[]},b=f.lineHeight,m=x=0,L(u)||X(u)){if(X(u))for(h=0,d=u.length;h<d;++h)v=u[h],!L(v)&&!X(v)&&(m=ii(i,p.data,p.gc,m,v),x+=b)}else m=ii(i,p.data,p.gc,m,u),x=b;o.push(m),a.push(x),r=Math.max(m,r),l=Math.max(x,l)}Xo(s,e);const y=o.indexOf(r),_=a.indexOf(l),k=M=>({width:o[M]||0,height:a[M]||0});return{first:k(0),last:k(e-1),widest:k(y),highest:k(_),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return vn(this._alignToPixels?pt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Go(this.getContext(),t,i))}return this.$context||(this.$context=Ko(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=tt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*i>r*s?r/i:l/s:l*s<r*i?l/i:r/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=jt(o),f=[],g=r.setContext(this.getContext()),p=g.display?g.width:0,b=p/2,m=function(R){return pt(i,R,p)};let x,v,y,_,k,M,S,w,P,D,A,N;if("top"===a)x=m(this.bottom),M=this.bottom-u,w=x-b,D=m(t.top)+b,N=t.bottom;else if("bottom"===a)x=m(this.top),D=t.top,N=m(t.bottom)-b,M=x+b,w=this.top+u;else if("left"===a)x=m(this.right),k=this.right-u,S=x-b,P=m(t.left)+b,A=t.right;else if("right"===a)x=m(this.left),P=t.left,A=m(t.right)-b,k=x+b,S=this.left+u;else if("x"===e){if("center"===a)x=m((t.top+t.bottom)/2+.5);else if(z(a)){const R=Object.keys(a)[0];x=m(this.chart.scales[R].getPixelForValue(a[R]))}D=t.top,N=t.bottom,M=x+b,w=M+u}else if("y"===e){if("center"===a)x=m((t.left+t.right)/2);else if(z(a)){const R=Object.keys(a)[0];x=m(this.chart.scales[R].getPixelForValue(a[R]))}k=x-b,S=k-u,P=t.left,A=t.right}const q=C(s.ticks.maxTicksLimit,d),T=Math.max(1,Math.ceil(d/q));for(v=0;v<d;v+=T){const R=this.getContext(v),F=o.setContext(R),Q=r.setContext(R),W=F.lineWidth,yt=F.color,Kt=Q.dash||[],vt=Q.dashOffset,Dt=F.tickWidth,Ct=F.tickColor,At=F.tickBorderDash||[],Lt=F.tickBorderDashOffset;y=Yo(this,v,l),void 0!==y&&(_=pt(i,y,W),c?k=S=P=A=_:M=w=D=N=_,f.push({tx1:k,ty1:M,tx2:S,ty2:w,x1:P,y1:D,x2:A,y2:N,width:W,color:yt,borderDash:Kt,borderDashOffset:vt,tickWidth:Dt,tickColor:Ct,tickBorderDash:At,tickBorderDashOffset:Lt}))}return this._ticksLength=d,this._borderValue=x,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=jt(i.grid),f=u+h,g=d?-h:f,p=-tt(this.labelRotation),b=[];let m,x,v,y,_,k,M,S,w,P,D,A,N="middle";if("top"===s)k=this.bottom-g,M=this._getXAxisLabelAlignment();else if("bottom"===s)k=this.top+g,M=this._getXAxisLabelAlignment();else if("left"===s){const T=this._getYAxisLabelAlignment(u);M=T.textAlign,_=T.x}else if("right"===s){const T=this._getYAxisLabelAlignment(u);M=T.textAlign,_=T.x}else if("x"===e){if("center"===s)k=(t.top+t.bottom)/2+f;else if(z(s)){const T=Object.keys(s)[0];k=this.chart.scales[T].getPixelForValue(s[T])+f}M=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)_=(t.left+t.right)/2-f;else if(z(s)){const T=Object.keys(s)[0];_=this.chart.scales[T].getPixelForValue(s[T])}M=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===l?N="top":"end"===l&&(N="bottom"));const q=this._getLabelSizes();for(m=0,x=r.length;m<x;++m){v=r[m],y=v.label;const T=o.setContext(this.getContext(m));S=this.getPixelForTick(m)+o.labelOffset,w=this._resolveTickFontOptions(m),P=w.lineHeight,D=X(y)?y.length:1;const R=D/2,F=T.color,Q=T.textStrokeColor,W=T.textStrokeWidth;let Kt,yt=M;if(a?(_=S,"inner"===M&&(yt=m===x-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),A="top"===s?"near"===c||0!==p?-D*P+P/2:"center"===c?-q.highest.height/2-R*P+P:P/2-q.highest.height:"near"===c||0!==p?P/2:"center"===c?q.highest.height/2-R*P:q.highest.height-D*P,d&&(A*=-1),0!==p&&!T.showLabelBackdrop&&(_+=P/2*Math.sin(p))):(k=S,A=(1-D)*P/2),T.showLabelBackdrop){const vt=j(T.backdropPadding),Dt=q.heights[m],Ct=q.widths[m];let At=A-vt.top,Lt=0-vt.left;switch(N){case"middle":At-=Dt/2;break;case"bottom":At-=Dt}switch(M){case"center":Lt-=Ct/2;break;case"right":Lt-=Ct}Kt={left:Lt,top:At,width:Ct+vt.width,height:Dt+vt.height,color:T.backdropColor}}b.push({label:y,font:w,textOffset:A,options:{rotation:p,color:F,strokeColor:Q,strokeWidth:W,textAlign:yt,textBaseline:N,translation:[_,k],backdrop:Kt}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-tt(this.labelRotation))return"top"===t?"left":"right";let s="center";return"start"===e.align?s="left":"end"===e.align?s="right":"inner"===e.align&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=t+o,l=this._getLabelSizes().widest.width;let c,h;return"left"===e?s?(h=this.right+o,"near"===i?c="left":"center"===i?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,"near"===i?c="right":"center"===i?(c="center",h-=l/2):(c="left",h=this.left)):"right"===e?s?(h=this.left+o,"near"===i?c="right":"center"===i?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,"near"===i?c="left":"center"===i?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.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,a=s.length;o<a;++o){const l=s[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,u;this.isHorizontal()?(c=pt(t,this.left,a)-a/2,h=pt(t,this.right,r)+r/2,d=u=l):(d=pt(t,this.top,a)-a/2,u=pt(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Jt(i,s);const o=this.getLabelItems(t);for(const a of o)mt(i,a.label,0,a.textOffset,a.font,a.options);s&&Zt(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=V(i.font),a=j(i.padding),r=i.align;let l=o.lineHeight/2;"bottom"===e||"center"===e||z(e)?(l+=a.bottom,X(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=Jo(this,l,e,r);mt(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:qo(r,e,s),textBaseline:"middle",translation:[c,h]})}draw(t){!this._isVisible()||(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=C(t.grid&&t.grid.z,-1),s=C(t.border&&t.border.z,0);return this._isVisible()&&this.draw===ut.prototype.draw?[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]:[{z:e,draw:o=>{this.draw(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[i]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return V(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class re{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){const e=Object.getPrototypeOf(t);let i;ta(e)&&(i=this.register(e));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Zo(t,a,i),this.override&&I.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in I[s]&&(delete I[s][i],this.override&&delete St[i])}}function Zo(n,t,e){const i=kn(Object.create(null),[e?I.get(e):{},I.get(t),n.defaults]);I.set(t,i),n.defaultRoutes&&Qo(t,n.defaultRoutes),n.descriptors&&I.describe(t,n.descriptors)}function Qo(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");I.route(o,s,l,r)})}function ta(n){return"id"in n&&"defaults"in n}class ea{constructor(){this.controllers=new re(rt,"datasets",!0),this.elements=new re(st,"elements"),this.plugins=new re(Object,"plugins"),this.scales=new re(ut,"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=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):O(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,i){const s=Mn(t);E(i["before"+s],[],i),e[t](i),E(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var et=new ea;class ia{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,e,i);return"afterDestroy"===e&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const o of t){const a=o.plugin;if(!1===E(a[i],[e,s,o.options],a)&&s.cancelable)return!1}return!0}invalidate(){L(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=C(i.options&&i.options.plugins,{}),o=sa(i);return!1!==s||e?oa(t,o,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function sa(n){const t={},e=[],i=Object.keys(et.plugins.items);for(let o=0;o<i.length;o++)e.push(et.getPlugin(i[o]));const s=n.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];-1===e.indexOf(a)&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function na(n,t){return t||!1!==n?!0===n?{}:n:null}function oa(n,{plugins:t,localIds:e},i,s){const o=[],a=n.getContext();for(const r of t){const l=r.id,c=na(i[l],s);null!==c&&o.push({plugin:r,options:aa(n.config,{plugin:r,local:e[l]},c,a)})}return o}function aa(n,{plugin:t,local:e},i,s){const o=n.pluginScopeKeys(t),a=n.getOptionScopes(i,o);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ee(n,t){return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||(I.datasets[n]||{}).indexAxis||"x"}function ra(n,t){let e=n;return"_index_"===n?e=t:"_value_"===n&&(e="x"===t?"y":"x"),e}function la(n,t){return n===t?"_index_":"_value_"}function ca(n){return"top"===n||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0}function le(n,t){if("x"===n||"y"===n||"r"===n||(n=t.axis||ca(t.position)||n.length>1&&le(n[0].toLowerCase(),t)))return n;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function ha(n,t){const e=St[n.type]||{scales:{}},i=t.scales||{},s=Ee(n.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!z(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=le(a,r),c=la(l,s),h=e.scales||{};o[a]=te(Object.create(null),[{axis:l},r,h[l],h[c]])}),n.data.datasets.forEach(a=>{const r=a.type||n.type,l=a.indexAxis||Ee(r,t),h=(St[r]||{}).scales||{};Object.keys(h).forEach(d=>{const u=ra(d,l),f=a[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),te(o[f],[{axis:u},i[f],h[d]])})}),Object.keys(o).forEach(a=>{const r=o[a];te(r,[I.scales[r.type],I.scale])}),o}function Zi(n){const t=n.options||(n.options={});t.plugins=C(t.plugins,{}),t.scales=ha(n,t)}function Qi(n){return(n=n||{}).datasets=n.datasets||[],n.labels=n.labels||[],n}function da(n){return(n=n||{}).data=Qi(n.data),Zi(n),n}const ts=new Map,es=new Set;function ce(n,t){let e=ts.get(n);return e||(e=t(),ts.set(n,e),es.add(e)),e}const $t=(n,t,e)=>{const i=kt(t,e);void 0!==i&&n.add(i)};class ua{constructor(t){this._config=da(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=Qi(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Zi(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ce(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ce(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ce(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return ce(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>$t(l,t,d))),h.forEach(d=>$t(l,s,d)),h.forEach(d=>$t(l,St[o]||{},d)),h.forEach(d=>$t(l,I,d)),h.forEach(d=>$t(l,si,d))});const c=Array.from(l);return 0===c.length&&c.push(Object.create(null)),es.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,St[e]||{},I.datasets[e]||{},{type:e},I,si]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=is(this._resolverCache,t,s);let l=a;if(ga(a,e)){o.$shared=!1,i=Qt(i)?i():i;const c=this.createResolver(t,i,r);l=ni(a,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],s){const{resolver:o}=is(this._resolverCache,t,i);return z(e)?ni(o,e,void 0,s):o}}function is(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let o=i.get(s);return o||(o={resolver:Sn(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const fa=n=>z(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||Qt(n[e]),!1);function ga(n,t){const{isScriptable:e,isIndexable:i}=wn(n);for(const s of t){const o=e(s),a=i(s),r=(a||o)&&n[s];if(o&&(Qt(r)||fa(r))||a&&X(r))return!0}return!1}var pa="4.2.0";const ma=["top","bottom","left","right","chartArea"];function ss(n,t){return"top"===n||"bottom"===n||-1===ma.indexOf(n)&&"x"===t}function ns(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function os(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),E(e&&e.onComplete,[n],t)}function ba(n){const t=n.chart,e=t.options.animation;E(e&&e.onProgress,[n],t)}function as(n){return ei()&&"string"==typeof n?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const he={},rs=n=>{const t=as(n);return Object.values(he).filter(e=>e.canvas===t).pop()};function xa(n,t,e){const i=Object.keys(n);for(const s of i){const o=+s;if(o>=t){const a=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=a)}}}function _a(n,t,e,i){return e&&"mouseout"!==n.type?i?t:n:null}function ya(n){const{xScale:t,yScale:e}=n;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}class ls{static defaults=I;static instances=he;static overrides=St;static registry=et;static version=pa;static getChart=rs;static register(...t){et.add(...t),cs()}static unregister(...t){et.remove(...t),cs()}constructor(t,e){const i=this.config=new ua(e),s=as(t),o=rs(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.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Ki(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;this.id=Pn(),this.ctx=r,this.canvas=l,this.width=h,this.height=c,this._options=a,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 ia,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Dn(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],he[this.id]=this,r&&l?(it.listen(this,"complete",os),it.listen(this,"progress",ba),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return L(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():oi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ai(this.canvas,this.ctx),this}stop(){return it.stop(this),this}resize(t,e){it.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,a=this.platform.getMaximumSize(this.canvas,t,e,i.maintainAspectRatio&&this.aspectRatio),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,oi(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),E(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){O(this.options.scales||{},(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=le(a,r),c="r"===l,h="x"===l;return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),O(o,a=>{const r=a.options,l=r.id,c=le(l,r),h=C(r.type,a.dtype);(void 0===r.position||ss(r.position,c)!==ss(a.dposition))&&(r.position=a.dposition),s[l]=!0;let d=null;l in i&&i[l].type===h?d=i[l]:(d=new(et.getScale(h))({id:l,type:h,ctx:this.ctx,chart:this}),i[d.id]=d),d.init(r,t)}),O(s,(a,r)=>{a||delete i[r]}),O(i,a=>{H.configure(this,a,a.options),H.addBox(this,a)})}_updateMetasets(){const 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(ns("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{0===e.filter(o=>o===i._dataset).length&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const o=e[i];let a=this.getDatasetMeta(i);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=r,a.indexAxis=o.indexAxis||Ee(r,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=et.getController(r),{datasetElementType:c,dataElementType:h}=I.datasets[r];Object.assign(l,{dataElementType:et.getElement(h),datasetElementType:c&&et.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){O(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),u=!s&&-1===o.indexOf(d);d.buildOrUpdateElements(u),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||O(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ns("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){O(this.scales,t=>{H.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!ri(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of e)xa(t,s,"_removeElements"===i?-o:o)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!ri(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(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;H.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],O(this.boxes,s=>{i&&"chartArea"===s.position||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){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,Qt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(it.has(this)?this.attached&&!it.running(this)&&it.start(this):(this.draw(),os({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,o;for(s=0,o=e.length;s<o;++s){const a=e[s];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,o=ya(t)||this.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(s&&Jt(e,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?this.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&Zt(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return xe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=Fi.modes[e];return"function"==typeof o?o(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let 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=ft(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);Tt(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),it.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ai(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete he[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};O(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const 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)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){O(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},O(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let o,a,r,l;for("dataset"===e&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!ee(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),a=o(e,t),r=i?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const 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){const{_active:s=[],options:o}=this,r=this._getActiveElements(t,s,i,e),l=Cn(t),c=_a(t,this._lastEvent,i,l);i&&(this._lastEvent=null,E(o.onHover,[t,r,this],this),l&&E(o.onClick,[t,r,this],this));const h=!ee(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function cs(){return O(ls.instances,n=>n._plugins.invalidate())}function va(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;n.beginPath(),n.arc(o,a,r,i-c,e+c),l>s?(c=s/l,n.arc(o,a,l,e+c,i-c,!0)):n.arc(o,a,s,e+Z,i-Z),n.closePath(),n.clip()}function ka(n){return An(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Ma(n,t,e,i){const s=ka(n.options.borderRadius),o=(e-t)/2,a=Math.min(o,i*t/2),r=l=>{const c=(e-Math.min(o,l))*i/2;return Y(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:Y(s.innerStart,0,a),innerEnd:Y(s.innerEnd,0,a)}}function Pt(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function de(n,t,e,i,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+i+e-c,0),u=h>0?h+i+e+c:0;let f=0;const g=s-l;if(i){const F=((h>0?h-i:0)+(d>0?d-i:0))/2;f=(g-(0!==F?g*F/(F+i):g))/2}const b=(g-Math.max(.001,g*d-e/ot)/d)/2,m=l+b+f,x=s-b-f,{outerStart:v,outerEnd:y,innerStart:_,innerEnd:k}=Ma(t,u,d,x-m),M=d-v,S=d-y,w=m+v/M,P=x-y/S,D=u+_,A=u+k,N=m+_/D,q=x-k/A;if(n.beginPath(),o){const T=(w+P)/2;if(n.arc(a,r,d,w,T),n.arc(a,r,d,T,P),y>0){const W=Pt(S,P,a,r);n.arc(W.x,W.y,y,P,x+Z)}const R=Pt(A,x,a,r);if(n.lineTo(R.x,R.y),k>0){const W=Pt(A,q,a,r);n.arc(W.x,W.y,k,x+Z,q+Math.PI)}const F=(x-k/u+(m+_/u))/2;if(n.arc(a,r,u,x-k/u,F,!0),n.arc(a,r,u,F,m+_/u,!0),_>0){const W=Pt(D,N,a,r);n.arc(W.x,W.y,_,N+Math.PI,m-Z)}const Q=Pt(M,m,a,r);if(n.lineTo(Q.x,Q.y),v>0){const W=Pt(M,w,a,r);n.arc(W.x,W.y,v,m-Z,w)}}else{n.moveTo(a,r);const T=Math.cos(w)*d+a,R=Math.sin(w)*d+r;n.lineTo(T,R);const F=Math.cos(P)*d+a,Q=Math.sin(P)*d+r;n.lineTo(F,Q)}n.closePath()}function Sa(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){de(n,t,e,i,l,s);for(let c=0;c<o;++c)n.fill();isNaN(r)||(l=a+(r%U||U))}return de(n,t,e,i,l,s),n.fill(),l}function wa(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d="inner"===l.borderAlign;if(!c)return;d?(n.lineWidth=2*c,n.lineJoin=h||"round"):(n.lineWidth=c,n.lineJoin=h||"bevel");let u=t.endAngle;if(o){de(n,t,e,i,u,s);for(let f=0;f<o;++f)n.stroke();isNaN(r)||(u=a+(r%U||U))}d&&va(n,t,u),o||(de(n,t,e,i,u,s),n.stroke())}class hs extends st{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:o,distance:a}=Je(s,{x:t,y:e}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,g=C(d,l-r)>=U||qt(o,r,l),p=ht(a,c+u,h+u);return g&&p}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(s+o)/2,d=(a+r+c+l)/2;return{x:e+Math.cos(h)*d,y:i+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>U?Math.floor(i/U):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const c=s*(1-Math.sin(Math.min(ot,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,Sa(t,this,c,o,a),wa(t,this,c,o,a),t.restore()}}function ds(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 Pa(n,t,e){n.lineTo(e.x,e.y)}function Da(n){return n.stepped?zn:n.tension||"monotone"===n.cubicInterpolationMode?Fn:Pa}function us(n,t,e={}){const i=n.length,{start:s=0,end:o=i-1}=e,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r);return{count:i,start:l,loop:t.loop,ilen:c<l&&!(s<a&&o<a||s>r&&o>r)?i+c-l:c-l}}function Ca(n,t,e,i){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=us(s,e,i),h=Da(o);let f,g,p,{move:d=!0,reverse:u}=i||{};for(f=0;f<=c;++f)g=s[(r+(u?c-f:f))%a],!g.skip&&(d?(n.moveTo(g.x,g.y),d=!1):h(n,p,g,u,o.stepped),p=g);return l&&(g=s[(r+(u?c:0))%a],h(n,p,g,u,o.stepped)),!!l}function Aa(n,t,e,i){const s=t.points,{count:o,start:a,ilen:r}=us(s,e,i),{move:l=!0,reverse:c}=i||{};let u,f,g,p,b,m,h=0,d=0;const x=y=>(a+(c?r-y:y))%o,v=()=>{p!==b&&(n.lineTo(h,b),n.lineTo(h,p),n.lineTo(h,m))};for(l&&(f=s[x(0)],n.moveTo(f.x,f.y)),u=0;u<=r;++u){if(f=s[x(u)],f.skip)continue;const y=f.x,_=f.y,k=0|y;k===g?(_<p?p=_:_>b&&(b=_),h=(d*h+y)/++d):(v(),n.lineTo(y,_),g=k,d=0,p=b=_),m=_}v()}function Re(n){const t=n.options;return n._decimated||n._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||t.borderDash&&t.borderDash.length?Ca:Aa}function La(n){return n.stepped?Tn:n.tension||"monotone"===n.cubicInterpolationMode?En:Rn}function Oa(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),ds(n,t.options),n.stroke(s)}function Ta(n,t,e,i){const{segments:s,options:o}=t,a=Re(t);for(const r of s)ds(n,o,r.style),n.beginPath(),a(n,t,r,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Ea="function"==typeof Path2D;function Ra(n,t,e,i){Ea&&!t.options.segment?Oa(n,t,e,i):Ta(n,t,e,i)}class Ut extends st{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;!i.tension&&"monotone"!==i.cubicInterpolationMode||i.stepped||this._pointsUpdated||(Ln(this._points,i,t,i.spanGaps?this._loop:this._fullLoop,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=On(this,this.options.segment))}first(){const t=this.segments;return t.length&&this.points[t[0].start]}last(){const t=this.segments,i=t.length;return i&&this.points[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],o=this.points,a=li(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=La(i);let c,h;for(c=0,h=a.length;c<h;++c){const{start:d,end:u}=a[c],f=o[d],g=o[u];if(f===g){r.push(f);continue}const b=l(f,g,Math.abs((s-f[e])/(g[e]-f[e])),i.stepped);b[e]=t[e],r.push(b)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return Re(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=Re(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const r of s)a&=o(t,this,r,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){(this.points||[]).length&&(this.options||{}).borderWidth&&(t.save(),Ra(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function fs(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class gs extends st{static id="point";static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return fs(this,t,"x",e)}inYRange(t,e){return fs(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!xe(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ve(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function ps(n,t){const{x:e,y:i,base:s,width:o,height:a}=n.getProps(["x","y","base","width","height"],t);let r,l,c,h,d;return n.horizontal?(d=a/2,r=Math.min(e,s),l=Math.max(e,s),c=i-d,h=i+d):(d=o/2,r=e-d,l=e+d,c=Math.min(i,s),h=Math.max(i,s)),{left:r,top:c,right:l,bottom:h}}function dt(n,t,e,i){return n?0:Y(t,e,i)}function za(n,t,e){const s=n.borderSkipped,o=In(n.options.borderWidth);return{t:dt(s.top,o.top,0,e),r:dt(s.right,o.right,0,t),b:dt(s.bottom,o.bottom,0,e),l:dt(s.left,o.left,0,t)}}function Fa(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=bt(s),a=Math.min(t,e),r=n.borderSkipped,l=i||z(s);return{topLeft:dt(!l||r.top||r.left,o.topLeft,0,a),topRight:dt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:dt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:dt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Ia(n){const t=ps(n),e=t.right-t.left,i=t.bottom-t.top,s=za(n,e/2,i/2),o=Fa(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 ze(n,t,e,i){const s=null===t,o=null===e,r=n&&!(s&&o)&&ps(n,i);return r&&(s||ht(t,r.left,r.right))&&(o||ht(e,r.top,r.bottom))}function Ba(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Va(n,t){n.rect(t.x,t.y,t.w,t.h)}function Fe(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0;return{x:n.x+i,y:n.y+s,w:n.w+((n.x+n.w!==e.x+e.w?t:0)-i),h:n.h+((n.y+n.h!==e.y+e.h?t:0)-s),radius:n.radius}}class ms extends st{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:a}=Ia(this),r=Ba(a.radius)?Rt:Va;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,Fe(a,e,o)),t.clip(),r(t,Fe(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,Fe(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ze(this,t,e,i)}inXRange(t,e){return ze(this,t,null,e)}inYRange(t,e){return ze(this,null,t,e)}getCenterPoint(t){const{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"x"===t?this.width/2:this.height/2}}var bs=Object.freeze({__proto__:null,ArcElement:hs,LineElement:Ut,PointElement:gs,BarElement:ms});const Ie=["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)"],xs=Ie.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function _s(n){return Ie[n%Ie.length]}function ys(n){return xs[n%xs.length]}function Na(n,t){return n.borderColor=_s(t),n.backgroundColor=ys(t),++t}function Ha(n,t){return n.backgroundColor=n.data.map(()=>_s(t++)),t}function Wa(n,t){return n.backgroundColor=n.data.map(()=>ys(t++)),t}function ja(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof ie?t=Ha(e,t):s instanceof Ce?t=Wa(e,t):s&&(t=Na(e,t))}}function vs(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function $a(n){return n&&(n.borderColor||n.backgroundColor)}var ks={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:o}=s;if(!e.forceOverride&&(vs(i)||$a(s)||o&&vs(o)))return;const a=ja(n);i.forEach(a)}};function Ua(n,t,e,i,s){const o=s.samples||i;if(o>=e)return n.slice(t,t+e);const a=[],r=(e-2)/(o-2);let l=0;const c=t+e-1;let d,u,f,g,p,h=t;for(a[l++]=n[h],d=0;d<o-2;d++){let x,b=0,m=0;const v=Math.floor((d+1)*r)+1+t,y=Math.min(Math.floor((d+2)*r)+1,e)+t,_=y-v;for(x=v;x<y;x++)b+=n[x].x,m+=n[x].y;b/=_,m/=_;const k=Math.floor(d*r)+1+t,M=Math.min(Math.floor((d+1)*r)+1,e)+t,{x:S,y:w}=n[h];for(f=g=-1,x=k;x<M;x++)g=.5*Math.abs((S-b)*(n[x].y-w)-(S-n[x].x)*(m-w)),g>f&&(f=g,u=n[x],p=x);a[l++]=u,h=p}return a[l++]=n[c],a}function Ya(n,t,e,i){let a,r,l,c,h,d,u,f,g,p,s=0,o=0;const b=[],x=n[t].x,y=n[t+e-1].x-x;for(a=t;a<t+e;++a){r=n[a],l=(r.x-x)/y*i,c=r.y;const _=0|l;if(_===h)c<g?(g=c,d=a):c>p&&(p=c,u=a),s=(o*s+r.x)/++o;else{const k=a-1;if(!L(d)&&!L(u)){const M=Math.min(d,u),S=Math.max(d,u);M!==f&&M!==k&&b.push({...n[M],x:s}),S!==f&&S!==k&&b.push({...n[S],x:s})}a>0&&k!==f&&b.push(n[k]),b.push(r),h=_,o=0,g=p=c,d=u=f=a}}return b}function Ms(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{value:t})}}function Ss(n){n.data.datasets.forEach(t=>{Ms(t)})}function Xa(n,t){const e=t.length;let s,i=0;const{iScale:o}=n,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=Y(Et(t,o.axis,a).lo,0,e-1)),s=c?Y(Et(t,o.axis,r).hi+1,i,e)-i:e-i,{start:i,count:s}}var ws={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled)return void Ss(n);const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=n.getDatasetMeta(o),c=a||s.data;if("y"===Ot([r,n.options.indexAxis])||!l.controller.supportsDecimation)return;const h=n.scales[l.xAxisID];if("linear"!==h.type&&"time"!==h.type||n.options.parsing)return;let g,{start:d,count:u}=Xa(l,c);if(u<=(e.threshold||4*i))Ms(s);else{switch(L(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}})),e.algorithm){case"lttb":g=Ua(c,d,u,i,e);break;case"min-max":g=Ya(c,d,u,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g}})},destroy(n){Ss(n)}};function Ka(n,t,e){const i=n.segments,s=n.points,o=t.points,a=[];for(const r of i){let{start:l,end:c}=r;c=Ve(l,c,s);const h=Be(e,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:h,start:s[l],end:s[c]});continue}const d=li(t,h);for(const u of d){const f=Be(e,o[u.start],o[u.end],u.loop),g=Bn(r,s,f);for(const p of g)a.push({source:p,target:u,start:{[e]:Ps(h,f,"start",Math.max)},end:{[e]:Ps(h,f,"end",Math.min)}})}}return a}function Be(n,t,e,i){if(i)return;let s=t[n],o=e[n];return"angle"===n&&(s=zt(s),o=zt(o)),{property:n,start:s,end:o}}function Ga(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Ve(a,r,s);const l=s[a],c=s[r];null!==i?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):null!==e&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Ve(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Ps(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Ds(n,t){let e=[],i=!1;return X(n)?(i=!0,e=n):e=Ga(n,t),e.length?new Ut({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Cs(n){return n&&!1!==n.fill}function qa(n,t,e){let s=n[t].fill;const o=[t];let a;if(!e)return s;for(;!1!==s&&-1===o.indexOf(s);){if(!B(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function Ja(n,t,e){const i=er(n);if(z(i))return!isNaN(i.value)&&i;let s=parseFloat(i);return B(s)&&Math.floor(s)===s?Za(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Za(n,t,e,i){return("-"===n||"+"===n)&&(e=t+e),!(e===t||e<0||e>=i)&&e}function Qa(n,t){let e=null;return"start"===n?e=t.bottom:"end"===n?e=t.top:z(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function tr(n,t,e){let i;return i="start"===n?e:"end"===n?t.options.reverse?t.min:t.max:z(n)?n.value:t.getBaseValue(),i}function er(n){const t=n.options,e=t.fill;let i=C(e&&e.target,e);return void 0===i&&(i=!!t.backgroundColor),!1!==i&&null!==i&&(!0===i?"origin":i)}function ir(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,a=i.points,r=sr(t,e);r.push(Ds({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)nr(s,a[h],r)}return new Ut({points:s,options:{}})}function sr(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function nr(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=or(o,t,"x");if(!(!l||a&&r))if(a)i.unshift(l);else if(n.push(l),!r)break}n.push(...i)}function or(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],o=n.segments,a=n.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],d=a[h.start][e],u=a[h.end][e];if(ht(s,d,u)){r=s===d,l=s===u;break}}return{first:r,last:l,point:i}}class As{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:o,radius:a}=this;return t.arc(s,o,a,(e=e||{start:0,end:U}).end,e.start,!0),!i.bounds}interpolate(t){const{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 ar(n){const{chart:t,fill:e,line:i}=n;if(B(e))return rr(t,e);if("stack"===e)return ir(n);if("shape"===e)return!0;const s=lr(n);return s instanceof As?s:Ds(s,i)}function rr(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function lr(n){return(n.scale||{}).getPointPositionForValue?hr(n):cr(n)}function cr(n){const{scale:t={},fill:e}=n,i=Qa(e,t);if(B(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function hr(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=tr(e,t,o),r=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new As({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function Ne(n,t,e){const i=ar(t),{line:s,scale:o,axis:a}=t,r=s.options,l=r.fill,c=r.backgroundColor,{above:h=c,below:d=c}=l||{};i&&s.points.length&&(Jt(n,e),dr(n,{line:s,target:i,above:h,below:d,area:e,scale:o,axis:a}),Zt(n))}function dr(n,t){const{line:e,target:i,above:s,below:o,area:a,scale:r}=t,l=e._loop?"angle":t.axis;n.save(),"x"===l&&o!==s&&(Ls(n,i,a.top),Os(n,{line:e,target:i,color:s,scale:r,property:l}),n.restore(),n.save(),Ls(n,i,a.bottom)),Os(n,{line:e,target:i,color:o,scale:r,property:l}),n.restore()}function Ls(n,t,e){const{segments:i,points:s}=t;let o=!0,a=!1;n.beginPath();for(const r of i){const{start:l,end:c}=r,h=s[l],d=s[Ve(l,c,s)];o?(n.moveTo(h.x,h.y),o=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,r,{move:a}),a?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Os(n,t){const{line:e,target:i,property:s,color:o,scale:a}=t,r=Ka(e,i,s);for(const{source:l,target:c,start:h,end:d}of r){const{style:{backgroundColor:u=o}={}}=l,f=!0!==i;n.save(),n.fillStyle=u,ur(n,a,f&&Be(s,h,d)),n.beginPath();const g=!!e.pathSegment(n,l);let p;if(f){g?n.closePath():Ts(n,i,d,s);const b=!!i.pathSegment(n,c,{move:g,reverse:!0});p=g&&b,p||Ts(n,i,h,s)}n.closePath(),n.fill(p?"evenodd":"nonzero"),n.restore()}}function ur(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:o,start:a,end:r}=e||{};"x"===o&&(n.beginPath(),n.rect(a,i,r-a,s-i),n.clip())}function Ts(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Es={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<i;++a)o=n.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Ut&&(l={visible:n.isDatasetVisible(a),index:a,fill:Ja(r,a,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],l&&!1!==l.fill&&(l.fill=qa(s,a,e.propagate))},beforeDraw(n,t,e){const i="beforeDraw"===e.drawTime,s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;!r||(r.line.updateControlPoints(o,r.axis),i&&r.fill&&Ne(n.ctx,r,o))}},beforeDatasetsDraw(n,t,e){if("beforeDatasetsDraw"!==e.drawTime)return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Cs(o)&&Ne(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Cs(i)||"beforeDatasetDraw"!==e.drawTime||Ne(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Rs=(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)}},fr=(n,t)=>null!==n&&null!==t&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class zs extends st{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=E(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(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=V(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Rs(i,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+r;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,p)=>{const b=i+e/2+o.measureText(g.text).width;(0===p||c[c.length-1]+b+2*r>a)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:b,height:s},c[c.length-1]+=b+r}),d}_fitCols(t,e,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t;let d=r,u=0,f=0,g=0,p=0;return this.legendItems.forEach((b,m)=>{const{itemWidth:x,itemHeight:v}=gr(i,e,o,b,s);m>0&&f+v+2*r>h&&(d+=u+r,c.push({width:u,height:f}),g+=u+r,p++,u=f=0),l[m]={left:g,top:f,col:p,width:x,height:v},u=Math.max(u,x),f+=v+r}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=wt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=$(i,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=$(i,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=$(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=$(i,this.top+t+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Jt(t,this),this._draw(),Zt(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=I.color,l=wt(t.rtl,this.left,this.width),c=V(a.font),{padding:h}=a,d=c.size,u=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:p,itemHeight:b}=Rs(a,d),v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:$(o,this.left+h,this.right-i[0]),y:this.top+h+y,line:0}:{x:this.left+h,y:$(o,this.top+y+h,this.bottom-e[0].height),line:0},ci(this.ctx,t.textDirection);const _=b+h;this.legendItems.forEach((k,M)=>{s.strokeStyle=k.fontColor,s.fillStyle=k.fontColor;const S=s.measureText(k.text).width,w=l.textAlign(k.textAlign||(k.textAlign=a.textAlign)),P=g+u+S;let D=f.x,A=f.y;l.setWidth(this.width),v?M>0&&D+P+h>this.right&&(A=f.y+=_,f.line++,D=f.x=$(o,this.left+h,this.right-i[f.line])):M>0&&A+_>this.bottom&&(D=f.x=D+e[f.line].width+h,f.line++,A=f.y=$(o,this.top+y+h,this.bottom-e[f.line].height)),function(k,M,S){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const w=C(S.lineWidth,1);if(s.fillStyle=C(S.fillStyle,r),s.lineCap=C(S.lineCap,"butt"),s.lineDashOffset=C(S.lineDashOffset,0),s.lineJoin=C(S.lineJoin,"miter"),s.lineWidth=w,s.strokeStyle=C(S.strokeStyle,r),s.setLineDash(C(S.lineDash,[])),a.usePointStyle){const P={radius:p*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:w},D=l.xPlus(k,g/2);Nn(s,P,D,M+u,a.pointStyleWidth&&g)}else{const P=M+Math.max((d-p)/2,0),D=l.leftForLtr(k,g),A=bt(S.borderRadius);s.beginPath(),Object.values(A).some(N=>0!==N)?Rt(s,{x:D,y:P,w:g,h:p,radius:A}):s.rect(D,P,g,p),s.fill(),0!==w&&s.stroke()}s.restore()}(l.x(D),A,k),D=Vn(w,D+g+u,v?D+P:this.right,t.rtl),function(k,M,S){mt(s,S.text,k,M+b/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})}(l.x(D),A,k),v?f.x+=P+h:f.y+="string"!=typeof k.text?Fs(k,c.lineHeight):_}),hi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=V(e.font),s=j(e.padding);if(!e.display)return;const o=wt(t.rtl,this.left,this.width),a=this.ctx,r=e.position,c=s.top+i.size/2;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=$(t.align,d,this.right-u);else{const g=this.columnSizes.reduce((p,b)=>Math.max(p,b.height),0);h=c+$(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=$(r,d,d+u);a.textAlign=o.textAlign(ye(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,mt(a,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=V(t.font),i=j(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(ht(t,this.left,this.right)&&ht(e,this.top,this.bottom))for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],ht(t,s.left,s.left+s.width)&&ht(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!br(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const s=this._hoveredItem,o=fr(s,i);s&&!o&&E(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&E(e.onHover,[t,i,this],this)}else i&&E(e.onClick,[t,i,this],this)}}function gr(n,t,e,i,s){return{itemWidth:pr(i,n,t,e),itemHeight:mr(s,i,t.lineHeight)}}function pr(n,t,e,i){let s=n.text;return s&&"string"!=typeof s&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+i.measureText(s).width}function mr(n,t,e){let i=n;return"string"!=typeof t.text&&(i=Fs(t,e)),i}function Fs(n,t){return t*(n.text?n.text.length+.5:0)}function br(n,t){return!(("mousemove"!==n&&"mouseout"!==n||!t.onHover&&!t.onLeave)&&(!t.onClick||"click"!==n&&"mouseup"!==n))}var Is={id:"legend",_element:zs,start(n,t,e){const i=n.legend=new zs({ctx:n.ctx,options:e,chart:n});H.configure(n,i,e),H.addBox(n,i)},stop(n){H.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;H.configure(n,i,e),i.options=e},afterUpdate(n){const 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){const 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){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=j(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:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||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)}}};class He extends st{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=X(i.text)?i.text.length:1;this._padding=j(i.padding);const o=s*V(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:a}=this,r=a.align;let c,h,d,l=0;return this.isHorizontal()?(h=$(r,i,o),d=e+t,c=o-i):("left"===a.position?(h=i+t,d=$(r,s,e),l=-.5*ot):(h=o-t,d=$(r,e,s),l=.5*ot),c=s-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=V(e.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);mt(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:ye(e.align),textBaseline:"middle",translation:[a,r]})}}function xr(n,t){const e=new He({ctx:n.ctx,options:t,chart:n});H.configure(n,e,t),H.addBox(n,e),n.titleBlock=e}var Bs={id:"title",_element:He,start(n,t,e){xr(n,e)},stop(n){H.removeBox(n,n.titleBlock),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;H.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}};const ue=new WeakMap;var Vs={id:"subtitle",start(n,t,e){const i=new He({ctx:n.ctx,options:e,chart:n});H.configure(n,i,e),H.addBox(n,i),ue.set(n,i)},stop(n){H.removeBox(n,ue.get(n)),ue.delete(n)},beforeUpdate(n,t,e){const i=ue.get(n);H.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}};const Yt={average(n){if(!n.length)return!1;let t,e,i=0,s=0,o=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const r=a.tooltipPosition();i+=r.x,s+=r.y,++o}}return{x:i/o,y:s/o}},nearest(n,t){if(!n.length)return!1;let o,a,r,e=t.x,i=t.y,s=Number.POSITIVE_INFINITY;for(o=0,a=n.length;o<a;++o){const l=n[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Hn(t,c);h<s&&(s=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function nt(n,t){return t&&(X(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function lt(n){return("string"==typeof n||n instanceof String)&&n.indexOf("\n")>-1?n.split("\n"):n}function _r(n,t){const{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:n,label:a,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Ns(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:r}=t,l=V(t.bodyFont),c=V(t.titleFont),h=V(t.footerFont),d=o.length,u=s.length,f=i.length,g=j(t.padding);let p=g.height,b=0,m=i.reduce((y,_)=>y+_.before.length+_.lines.length+_.after.length,0);m+=n.beforeBody.length+n.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),m&&(p+=f*(t.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(m-f)*l.lineHeight+(m-1)*t.bodySpacing),u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let x=0;const v=function(y){b=Math.max(b,e.measureText(y).width+x)};return e.save(),e.font=c.string,O(n.title,v),e.font=l.string,O(n.beforeBody.concat(n.afterBody),v),x=t.displayColors?a+2+t.boxPadding:0,O(i,y=>{O(y.before,v),O(y.lines,v),O(y.after,v)}),x=0,e.font=h.string,O(n.footer,v),e.restore(),b+=g.width,{width:b,height:p}}function yr(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function vr(n,t,e,i){const{x:s,width:o}=i,a=e.caretSize+e.caretPadding;if("left"===n&&s+o+a>t.width||"right"===n&&s-o-a<0)return!0}function kr(n,t,e,i){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=n;let c="center";return"center"===i?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),vr(c,n,t,e)&&(c="center"),c}function Hs(n,t,e){const i=e.yAlign||t.yAlign||yr(n,e);return{xAlign:e.xAlign||t.xAlign||kr(n,t,e,i),yAlign:i}}function Mr(n,t){let{x:e,width:i}=n;return"right"===t?e-=i:"center"===t&&(e-=i/2),e}function Sr(n,t,e){let{y:i,height:s}=n;return"top"===t?i+=e:i-="bottom"===t?s+e:s/2,i}function Ws(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:r,yAlign:l}=e,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=bt(a);let g=Mr(t,r);const p=Sr(t,l,c);return"center"===l?"left"===r?g+=c:"right"===r&&(g-=c):"left"===r?g-=Math.max(h,u)+s:"right"===r&&(g+=Math.max(d,f)+s),{x:Y(g,0,i.width-t.width),y:Y(p,0,i.height-t.height)}}function fe(n,t,e){const i=j(e.padding);return"center"===t?n.x+n.width/2:"right"===t?n.x+n.width-i.right:n.x+i.left}function js(n){return nt([],lt(n))}function wr(n,t,e){return ft(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function $s(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Us={beforeTitle:at,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:at,beforeBody:at,beforeLabel:at,label(n){if(this&&this.options&&"dataset"===this.options.mode)return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return L(e)||(t+=e),t},labelColor(n){const 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){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:at,afterBody:at,beforeFooter:at,footer:at,afterFooter:at};function K(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Us[t].call(e,i):s}class Ys extends st{static positioners=Yt;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new Se(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=wr(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=K(i,"beforeTitle",this,t),o=K(i,"title",this,t),a=K(i,"afterTitle",this,t);let r=[];return r=nt(r,lt(s)),r=nt(r,lt(o)),r=nt(r,lt(a)),r}getBeforeBody(t,e){return js(K(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return O(t,o=>{const a={before:[],lines:[],after:[]},r=$s(i,o);nt(a.before,lt(K(r,"beforeLabel",this,o))),nt(a.lines,K(r,"label",this,o)),nt(a.after,lt(K(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return js(K(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=K(i,"beforeFooter",this,t),o=K(i,"footer",this,t),a=K(i,"afterFooter",this,t);let r=[];return r=nt(r,lt(s)),r=nt(r,lt(o)),r=nt(r,lt(a)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],a=[];let l,c,r=[];for(l=0,c=e.length;l<c;++l)r.push(_r(this.chart,e[l]));return t.filter&&(r=r.filter((h,d,u)=>t.filter(h,d,u,i))),t.itemSort&&(r=r.sort((h,d)=>t.itemSort(h,d,i))),O(r,h=>{const d=$s(t.callbacks,h);s.push(K(d,"labelColor",this,h)),o.push(K(d,"labelPointStyle",this,h)),a.push(K(d,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(s.length){const r=Yt[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=Ns(this,i),c=Object.assign({},r,l),h=Hs(this.chart,i,c),d=Ws(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=a,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){const 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){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=bt(r),{x:u,y:f}=t,{width:g,height:p}=e;let b,m,x,v,y,_;return"center"===o?(y=f+p/2,"left"===s?(b=u,m=b-a,v=y+a,_=y-a):(b=u+g,m=b+a,v=y-a,_=y+a),x=b):(m="left"===s?u+Math.max(l,h)+a:"right"===s?u+g-Math.max(c,d)-a:this.caretX,"top"===o?(v=f,y=v-a,b=m-a,x=m+a):(v=f+p,y=v+a,b=m+a,x=m-a),_=v),{x1:b,x2:m,x3:x,y1:v,y2:y,y3:_}}drawTitle(t,e,i){const s=this.title,o=s.length;let a,r,l;if(o){const c=wt(i.rtl,this.x,this.width);for(t.x=fe(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=V(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,s,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:c,boxPadding:h}=o,d=V(o.bodyFont),u=fe(this,"left",o),f=s.x(u),p=e.y+(l<d.lineHeight?(d.lineHeight-l)/2:0);if(o.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},m=s.leftForLtr(f,c)+c/2,x=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ve(t,b,m,x),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ve(t,b,m,x)}else{t.lineWidth=z(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const b=s.leftForLtr(f,c-h),m=s.leftForLtr(s.xPlus(f,1),c-h-2),x=bt(a.borderRadius);Object.values(x).some(v=>0!==v)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Rt(t,{x:b,y:p,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Rt(t,{x:m,y:p+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=i,d=V(i.bodyFont);let u=d.lineHeight,f=0;const g=wt(i.rtl,this.x,this.width),p=function(S){e.fillText(S,g.x(t.x+f),t.y+u/2),t.y+=u+o},b=g.textAlign(a);let m,x,v,y,_,k,M;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=fe(this,b,i),e.fillStyle=i.bodyColor,O(this.beforeBody,p),f=r&&"right"!==b?"center"===a?c/2+h:c+2+h:0,y=0,k=s.length;y<k;++y){for(m=s[y],x=this.labelTextColors[y],e.fillStyle=x,O(m.before,p),v=m.lines,r&&v.length&&(this._drawColorBox(e,t,y,g,i),u=Math.max(d.lineHeight,l)),_=0,M=v.length;_<M;++_)p(v[_]),u=d.lineHeight;O(m.after,p)}f=0,u=d.lineHeight,O(this.afterBody,p),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let a,r;if(o){const l=wt(i.rtl,this.x,this.width);for(t.x=fe(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=V(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=bt(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+d,l),"top"===a&&this.drawCaret(t,e,i,s),e.lineTo(r+c-u,l),e.quadraticCurveTo(r+c,l,r+c,l+u),"center"===a&&"right"===o&&this.drawCaret(t,e,i,s),e.lineTo(r+c,l+h-g),e.quadraticCurveTo(r+c,l+h,r+c-g,l+h),"bottom"===a&&this.drawCaret(t,e,i,s),e.lineTo(r+f,l+h),e.quadraticCurveTo(r,l+h,r,l+h-f),"center"===a&&"left"===o&&this.drawCaret(t,e,i,s),e.lineTo(r,l+d),e.quadraticCurveTo(r,l,r+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=Yt[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=Ns(this,t),l=Object.assign({},a,this._size),c=Hs(e,t,l),h=Ws(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=j(e.padding);e.enabled&&(this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length)&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),ci(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),hi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!ee(i,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,i),r=this._positionChanged(a,t),l=e||!ee(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const o=this.options;if("mouseout"===t.type)return[];if(!s)return e;const a=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:o}=this,a=Yt[o.position].call(this,t,e);return!1!==a&&(i!==a.x||s!==a.y)}}var Xs={id:"tooltip",_element:Ys,positioners:Yt,afterInit(n,t,e){e&&(n.tooltip=new Ys({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){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(!1===n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0}))return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){n.tooltip&&n.tooltip.handleEvent(t.event,t.replay,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:Us},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>"filter"!==n&&"itemSort"!==n&&"external"!==n,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ks=Object.freeze({__proto__:null,Colors:ks,Decimation:ws,Filler:Es,Legend:Is,SubTitle:Vs,Title:Bs,Tooltip:Xs});const Pr=(n,t,e,i)=>("string"==typeof t?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Dr(n,t,e,i){const s=n.indexOf(t);return-1===s?Pr(n,t,e,i):s!==n.lastIndexOf(t)?e:s}const Cr=(n,t)=>null===n?null:Y(Math.round(n),0,t);function Gs(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class qs extends ut{static id="category";static defaults={ticks:{callback:Gs}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(L(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Dr(i,t,C(e,t),this._addedLabels),Cr(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=0===t&&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 a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Gs.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Ar(n,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=n,f=o||1,g=h-1,{min:p,max:b}=t,m=!L(a),x=!L(r),v=!L(c),y=(b-p)/(d+1);let k,M,S,w,_=ui((b-p)/g/f)*f;if(_<1e-14&&!m&&!x)return[{value:p},{value:b}];w=Math.ceil(b/_)-Math.floor(p/_),w>g&&(_=ui(w*_/g/f)*f),L(l)||(k=Math.pow(10,l),_=Math.ceil(_*k)/k),"ticks"===s?(M=Math.floor(p/_)*_,S=Math.ceil(b/_)*_):(M=p,S=b),m&&x&&o&&Wn((r-a)/o,_/1e3)?(w=Math.round(Math.min((r-a)/_,h)),_=(r-a)/w,M=a,S=r):v?(M=m?a:M,S=x?r:S,w=c-1,_=(S-M)/w):(w=(S-M)/_,w=ke(w,Math.round(w),_/1e3)?Math.round(w):Math.ceil(w));const P=Math.max(fi(_),fi(M));k=Math.pow(10,L(l)?P:l),M=Math.round(M*k)/k,S=Math.round(S*k)/k;let D=0;for(m&&(u&&M!==a?(e.push({value:a}),M<a&&D++,ke(Math.round((M+D*_)*k)/k,a,Js(a,y,n))&&D++):M<a&&D++);D<w;++D)e.push({value:Math.round((M+D*_)*k)/k});return x&&u&&S!==r?e.length&&ke(e[e.length-1].value,r,Js(r,y,n))?e[e.length-1].value=r:e.push({value:r}):(!x||S===r)&&e.push({value:S}),e}function Js(n,t,{horizontal:e,minRotation:i}){const s=tt(i),o=(e?Math.sin(s):Math.cos(s))||.001;return Math.min(t/o,.75*t*(""+n).length)}class ge extends ut{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 L(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=i?o:l;if(t){const l=ct(s),c=ct(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=0===o?1:Math.abs(.05*o);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let s,{maxTicksLimit:e,stepSize:i}=t;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(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const a=Ar({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&di(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Gt(t,this.chart.options.locale,this.options.ticks.format)}}class Zs extends ge{static id="linear";static defaults={ticks:{callback:Me.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=B(t)?t:0,this.max=B(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=tt(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 null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Xt=n=>Math.floor(Ft(n)),_t=(n,t)=>Math.pow(10,Xt(n)+t);function Qs(n){return n/Math.pow(10,Xt(n))==1}function tn(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Lr(n,t){let i=Xt(t-n);for(;tn(n,t,i)>10;)i++;for(;tn(n,t,i)<10;)i--;return Math.min(i,Xt(n))}function Or(n,{min:t,max:e}){t=J(n.min,t);const i=[],s=Xt(t);let o=Lr(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,h=Math.floor((t-l)/r/10)*r*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=J(n.min,Math.round((l+h+d*Math.pow(10,o))*a)/a);for(;u<e;)i.push({value:u,major:Qs(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),u=Math.round((l+h+d*Math.pow(10,o))*a)/a;const f=J(n.max,u);return i.push({value:f,major:Qs(f),significand:d}),i}class en extends ut{static id="logarithmic";static defaults={ticks:{callback:Me.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=ge.prototype.parse.apply(this,[t,e]);if(0!==i)return B(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=B(t)?Math.max(0,t):null,this.max=B(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!B(this._userMin)&&(this.min=t===_t(this.min,0)?_t(this.min,-1):_t(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=r=>i=t?i:r,a=r=>s=e?s:r;i===s&&(i<=0?(o(1),a(10)):(o(_t(i,-1)),a(_t(s,1)))),i<=0&&o(_t(s,-1)),s<=0&&a(_t(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,i=Or({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&di(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 void 0===t?"0":Gt(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ft(t),this._valueRange=Ft(this.max)-Ft(t)}getPixelForValue(t){return(void 0===t||0===t)&&(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ft(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function We(n){const t=n.ticks;if(t.display&&n.display){const e=j(t.backdropPadding);return C(t.font&&t.font.size,I.font.size)+e.height}return 0}function Tr(n,t,e){return e=X(e)?e:[e],{w:jn(n,t.string,e),h:e.length*t.lineHeight}}function sn(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 Er(n){const 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,a=n.options.pointLabels,r=a.centerPointLabels?ot/o:0;for(let l=0;l<o;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const h=n.getPointPosition(l,n.drawingArea+s[l],r),d=V(c.font),u=Tr(n.ctx,d,n._pointLabels[l]);i[l]=u;const f=zt(n.getIndexAngle(l)+r),g=Math.round(_e(f));Rr(e,t,f,sn(g,h.x,u.w,0,180),sn(g,h.y,u.h,90,270))}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=zr(n,i,s)}function Rr(n,t,e,i,s){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,l=0;i.start<t.l?(r=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-r)):i.end>t.r&&(r=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function zr(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,a=We(o)/2,r=n.drawingArea,l=o.pointLabels.centerPointLabels?ot/s:0;for(let c=0;c<s;c++){const h=n.getPointPosition(c,r+a+e[c],l),d=Math.round(_e(zt(h.angle+Z))),u=t[c],f=Br(h.y,u.h,d),g=Fr(d),p=Ir(h.x,u.w,g);i.push({x:h.x,y:f,textAlign:g,left:p,top:f,right:p+u.w,bottom:f+u.h})}return i}function Fr(n){return 0===n||180===n?"center":n<180?"left":"right"}function Ir(n,t,e){return"right"===e?n-=t:"center"===e&&(n-=t/2),n}function Br(n,t,e){return 90===e||270===e?n-=t/2:(e>270||e<90)&&(n-=t),n}function Vr(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const o=i.setContext(n.getPointLabelContext(s)),a=V(o.font),{x:r,y:l,textAlign:c,left:h,top:d,right:u,bottom:f}=n._pointLabelItems[s],{backdropColor:g}=o;if(!L(g)){const p=bt(o.borderRadius),b=j(o.backdropPadding);e.fillStyle=g;const m=h-b.left,x=d-b.top,v=u-h+b.width,y=f-d+b.height;Object.values(p).some(_=>0!==_)?(e.beginPath(),Rt(e,{x:m,y:x,w:v,h:y,radius:p}),e.fill()):e.fillRect(m,x,v,y)}mt(e,n._pointLabels[s],r,l+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}function nn(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,U);else{let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=n.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function Nr(n,t,e,i,s){const o=n.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!i||!r||!l||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash),o.lineDashOffset=s.dashOffset,o.beginPath(),nn(n,e,a,i),o.closePath(),o.stroke(),o.restore())}function Hr(n,t,e){return ft(n,{label:e,index:t,type:"pointLabel"})}class on extends ge{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:Me.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=j(We(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=B(t)&&!isNaN(t)?t:0,this.max=B(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/We(this.options))}generateTickLabels(t){ge.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=E(this.options.pointLabels.callback,[e,i],this);return s||0===s?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Er(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){return zt(t*(U/(this._pointLabels.length||1))+tt(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(L(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(L(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return Hr(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const 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){const{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),nn(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,a=this._pointLabels.length;let r,l,c;if(e.pointLabels.display&&Vr(this,a),s.display&&this.ticks.forEach((h,d)=>{if(0!==d){l=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(d),f=s.setContext(u),g=o.setContext(u);Nr(this,f,l,a,g)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const h=i.setContext(this.getPointLabelContext(r)),{color:d,lineWidth:u}=h;!u||!d||(t.lineWidth=u,t.strokeStyle=d,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(0===l&&!e.reverse)return;const c=i.setContext(this.getContext(l)),h=V(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const d=j(c.backdropPadding);t.fillRect(-a/2-d.left,-o-h.size/2-d.top,a+d.width,h.size+d.height)}mt(t,r.label,0,-o,h,{color:c.color})}),t.restore()}drawTitle(){}}const pe={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}},G=Object.keys(pe);function Wr(n,t){return n-t}function an(n,t){if(L(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let a=t;return"function"==typeof i&&(a=i(a)),B(a)||(a="string"==typeof i?e.parse(a,i):e.parse(a)),null===a?null:(s&&(a="week"!==s||!Mt(o)&&!0!==o?e.startOf(a,s):e.startOf(a,"isoWeek",o)),+a)}function rn(n,t,e,i){const s=G.length;for(let o=G.indexOf(n);o<s-1;++o){const a=pe[G[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=i)return G[o]}return G[s-1]}function jr(n,t,e,i,s){for(let o=G.length-1;o>=G.indexOf(e);o--){const a=G[o];if(pe[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return G[e?G.indexOf(e):0]}function $r(n){for(let t=G.indexOf(n)+1,e=G.length;t<e;++t)if(pe[G[t]].common)return G[t]}function ln(n,t,e){if(e){if(e.length){const{lo:i,hi:s}=Un(e,t);n[e[i]>=t?e[i]:e[s]]=!0}}else n[t]=!0}function Ur(n,t,e,i){const s=n._adapter,o=+s.startOf(t[0].value,i),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,i))l=e[r],l>=0&&(t[l].major=!0);return t}function cn(n,t,e){const i=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,i.push({value:r,major:!1});return 0!==o&&e?Ur(n,i,s,e):i}class me extends ut{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Ri._date(t.adapters.date);s.init(e),te(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:an(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&l(this.getMinMax(!1))),s=B(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=B(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(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=$n(s,o,this.max);return this._unit=e.unit||(i.autoSkip?rn(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):jr(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?$r(this._unit):void 0,this.initOffsets(s),t.reverse&&r.reverse(),cn(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let s,o,e=0,i=0;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),e=1===t.length?1-s:(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),i=1===t.length?o:(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Y(e,0,a),i=Y(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||rn(o.minUnit,e,i,this._getLabelCapacity(e)),r=C(s.ticks.stepSize,1),l="week"===a&&o.isoWeekday,c=Mt(l)||!0===l,h={};let u,f,d=e;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(i,e,a)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+a);const g="data"===s.ticks.source&&this.getDataTimestamps();for(u=d,f=0;u<i;u=+t.add(u,r,a),f++)ln(h,u,g);return(u===i||"ticks"===s.bounds||1===f)&&ln(h,u,g),Object.keys(h).sort((p,b)=>p-b).map(p=>+p)}getLabelForValue(t){const i=this.options.time;return this._adapter.format(t,i.tooltipFormat?i.tooltipFormat:i.displayFormats.datetime)}format(t,e){return this._adapter.format(t,e||this.options.time.displayFormats[this._unit])}_tickFormatFunction(t,e,i,s){const o=this.options,a=o.ticks.callback;if(a)return E(a,[t,e,i],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=c&&r[c],u=i[e];return this._adapter.format(t,s||(c&&d&&u&&u.major?d:l&&r[l]))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=tt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*o+r*a,h:i*a+r*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,cn(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let e,i,t=this._cache.data||[];if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(an(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Xe(t.sort(Wr))}}function be(n,t,e){let o,a,r,l,i=0,s=n.length-1;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Et(n,"pos",t)),({pos:o,time:r}=n[i]),({pos:a,time:l}=n[s])):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Et(n,"time",t)),({time:o,pos:r}=n[i]),({time:a,pos:l}=n[s]));const c=a-o;return c?r+(l-r)*(t-o)/c:r}class hn extends me{static id="timeseries";static defaults=me.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=be(e,this.min),this._tableRange=be(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let a,r,l,c,h;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,r=s.length;a<r;++a)h=s[a+1],l=s[a-1],c=s[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(be(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return be(this._table,i*this._tableRange+this._minPos,!0)}}var dn=Object.freeze({__proto__:null,CategoryScale:qs,LinearScale:Zs,LogarithmicScale:en,RadialLinearScale:on,TimeScale:me,TimeSeriesScale:hn});const Yr=[Ei,bs,Ks,dn];export{pi as Animation,Se as Animations,hs as ArcElement,Di as BarController,ms as BarElement,Oe as BasePlatform,Wi as BasicPlatform,Ci as BubbleController,qs as CategoryScale,ls as Chart,ks as Colors,rt as DatasetController,ws as Decimation,Xi as DomPlatform,ie as DoughnutController,st as Element,Es as Filler,Fi as Interaction,Is as Legend,Ai as LineController,Ut as LineElement,Zs as LinearScale,en as LogarithmicScale,Li as PieController,gs as PointElement,Ce as PolarAreaController,Oi as RadarController,on as RadialLinearScale,ut as Scale,Ti as ScatterController,Vs as SubTitle,me as TimeScale,hn as TimeSeriesScale,Bs as Title,Xs as Tooltip,Ri as _adapters,Ki as _detectPlatform,it as animator,Ei as controllers,bs as elements,H as layouts,Ks as plugins,Yr as registerables,et as registry,dn as scales};