"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6658],{831734:function(t,e,i){i.d(e,{De:function(){return eg},Dx:function(){return ef},FB:function(){return eU},IQ:function(){return X},ST:function(){return L},ZL:function(){return en},ce:function(){return s.d},f$:function(){return eE},jn:function(){return t8},kL:function(){return tQ},od:function(){return t9},qi:function(){return tZ},u:function(){return eS},uw:function(){return eC},vn:function(){return D}});var s=i(744354),a=new /*! * Chart.js v3.9.1 * https://www.chartjs.org * (c) 2022 Chart.js Contributors * Released under the MIT License */class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){let a=e.listeners[s],n=e.duration;a.forEach(s=>s({chart:t,initial:e.initial,numSteps:n,currentStep:Math.min(i-e.start,n)}))}_refresh(){this._request||(this._running=!0,this._request=s.r.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{let a;if(!i.running||!i.items.length)return;let n=i.items,r=n.length-1,o=!1;for(;r>=0;--r)(a=n[r])._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),o=!0):(n[r]=n[n.length-1],n.pop());o&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!!e&&!!e.running&&!!e.items.length}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};let n="transparent",r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let a=(0,s.c)(t||n),r=a.valid&&(0,s.c)(e||n);return r&&r.valid?r.mix(a,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class o{constructor(t,e,i,a){let n=e[i];a=(0,s.a)([t.to,a,n,t.from]);let o=(0,s.a)([t.from,n,a]);this._active=!0,this._fn=t.fn||r[t.type||typeof o],this._easing=s.e[t.easing]||s.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=o,this._to=a,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let a=this._target[this._prop],n=i-this._start,r=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=(0,s.a)([t.to,e,a,t.from]),this._from=(0,s.a)([t.from,a,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e;let i=t-this._start,s=this._duration,a=this._prop,n=this._from,r=this._loop,o=this._to;if(this._active=n!==o&&(r||i1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[a]=this._fn(n,o,e)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),s.d.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),s.d.describe("animations",{_fallback:"animation"}),s.d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class h{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,s.i)(t))return;let e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{let a=t[i];if(!(0,s.i)(a))return;let n={};for(let t of l)n[t]=a[t];((0,s.b)(a.properties)&&a.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,n)})})}_animateOptions(t,e){let i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i){t.options=e;return}return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!s)return[];let a=this._createAnimations(s,i);return i.$shared&&(function(t,e){let i=[],s=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),a}_createAnimations(t,e){let i;let s=this._properties,a=[],n=t.$animations||(t.$animations={}),r=Object.keys(e),l=Date.now();for(i=r.length-1;i>=0;--i){let h=r[i];if("$"===h.charAt(0))continue;if("options"===h){a.push(...this._animateOptions(t,e));continue}let d=e[h],c=n[h],u=s.get(h);if(c){if(u&&c.active()){c.update(u,d,l);continue}c.cancel()}if(!u||!u.duration){t[h]=d;continue}n[h]=c=new o(u,t,h,d),a.push(c)}return a}update(t,e){if(0===this._properties.size){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return a.add(this._chart,i),!0}}function d(t,e){let i=t&&t.options||{},s=i.reverse,a=void 0===i.min?e:0,n=void 0===i.max?e:0;return{start:s?n:a,end:s?a:n}}function c(t,e){let i,s;let a=[],n=t._getSortedDatasetMetas(e);for(i=0,s=n.length;i0||!i&&e<0)return a.index}return null}function f(t,e){let i;let{chart:s,_cachedMeta:a}=t,n=s._stacks||(s._stacks={}),{iScale:r,vScale:o,index:l}=a,h=r.axis,d=o.axis,c=`${r.id}.${o.id}.${a.stack||a.type}`,u=e.length;for(let t=0;ti[t].axis===e).shift()}function b(t,e){let i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s)for(let a of e=e||t._parsed){let t=a._stacks;if(!t||void 0===t[s]||void 0===t[s][i])return;delete t[s][i]}}let x=t=>"reset"===t||"none"===t,_=(t,e)=>e?t:Object.assign({},t),v=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:c(i,!0),values:null};class y{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=g(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&b(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),a=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=(0,s.v)(i.xAxisID,m(t,"x")),r=e.yAxisID=(0,s.v)(i.yAxisID,m(t,"y")),o=e.rAxisID=(0,s.v)(i.rAxisID,m(t,"r")),l=e.indexAxis,h=e.iAxisID=a(l,n,r,o),d=e.vAxisID=a(l,r,n,o);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&(0,s.u)(this._data,this),t._stacked&&b(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,s.i)(e))this._data=function(t){let e,i,s;let a=Object.keys(t),n=Array(a.length);for(e=0,i=a.length;e0&&r._parsed[t-1];if(!1===this._parsing)r._parsed=o,r._sorted=!0,n=o;else{n=(0,s.b)(o[t])?this.parseArrayData(r,o,t,e):(0,s.i)(o[t])?this.parseObjectData(r,o,t,e):this.parsePrimitiveData(r,o,t,e);let l=()=>null===a[d]||u&&a[d]e||g=0;--i)if(!p()){this.updateRangeFromParsed(c,t,a,d);break}}return c}getAllParsedValues(t){let e,i,a;let n=this._cachedMeta._parsed,r=[];for(e=0,i=n.length;e=0&&tthis.getContext(i,a),f=h.resolveNamedOptions(u,g,p,c);return f.$shared&&(f.$shared=l,n[r]=Object.freeze(_(f,l))),f}_resolveAnimations(t,e,i){let s;let a=this.chart,n=this._cachedDataOpts,r=`animation-${e}`,o=n[r];if(o)return o;if(!1!==a.options.animation){let a=this.chart.config,n=a.datasetAnimationScopeKeys(this._type,e),r=a.getOptionScopes(this.getDataset(),n);s=a.createResolver(r,this.getContext(t,i,e))}let l=new h(a,s&&s.animations);return s&&s._cacheable&&(n[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||x(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,a=this.getSharedOptions(i),n=this.includeOptions(e,a)||a!==s;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:n}}updateElement(t,e,i,s){x(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!x(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;let a=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];let s=i.length,a=e.length,n=Math.min(a,s);n&&this.parse(0,n),a>s?this._insertElements(s,a-s,t):a{for(t.length+=e,s=t.length-1;s>=r;s--)t[s]=t[s-e]};for(o(n),s=t;sMath.abs(o)&&(l=o,h=r),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:a,end:n,min:r,max:o}}(t,e,i,a):e[i.axis]=i.parse(t,a),e}function k(t,e,i,s){let a,n,r,o;let l=t.iScale,h=t.vScale,d=l.getLabels(),c=l===h,u=[];for(a=i,n=i+s;at.x,n="left",r="right"):(a=t.baset.controller.options.grouped),n=i.options.stacked,r=[],o=t=>{let i=t.controller.getParsed(e),a=i&&i[t.vScale.axis];if((0,s.k)(a)||isNaN(a))return!0};for(let i of a)if(!(void 0!==e&&o(i))&&((!1===n||-1===r.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&r.push(i.stack),i.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let s=this._getStacks(t,i),a=void 0!==e?s.indexOf(e):-1;return -1===a?s.length-1:a}_getRuler(){let t,e;let i=this.options,a=this._cachedMeta,n=a.iScale,r=[];for(t=0,e=a.data.length;tt-e))}return t._cache.$bar}(r,t.type),l=r._length,h=()=>{32767!==a&&-32768!==a&&((0,s.j)(n)&&(l=Math.min(l,Math.abs(a-n)||l)),n=a)};for(e=0,i=o.length;e=l?1:-1))*o,u===l&&(m-=i/2);let t=a.getPixelForDecimal(0),n=a.getPixelForDecimal(1);e=(m=Math.max(Math.min(m,Math.max(t,n)),Math.min(t,n)))+i}if(m===a.getPixelForValue(l)){let t=(0,s.s)(i)*a.getLineWidthForValue(l)/2;m+=t,i-=t}return{size:i,base:m,head:e,center:e+i/2}}_calculateBarIndexPixels(t,e){let i,a;let n=e.scale,r=this.options,o=r.skipNull,l=(0,s.v)(r.maxBarThickness,1/0);if(e.grouped){let n=o?this._getStackCount(t):e.stackCount,h="flex"===r.barThickness?function(t,e,i,s){let a=e.pixels,n=a[t],r=t>0?a[t-1]:null,o=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,{xScale:i,yScale:s}=e,a=this.getParsed(t),n=i.getLabelForValue(a.x),r=s.getLabelForValue(a.y),o=a._custom;return{label:e.label,value:"("+n+", "+r+(o?", "+o:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){let a="reset"===s,{iScale:n,vScale:r}=this._cachedMeta,{sharedOptions:o,includeOptions:l}=this._getSharedOptions(e,s),h=n.axis,d=r.axis;for(let c=e;c""}}}};class O extends y{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let i=this.getDataset().data,a=this._cachedMeta;if(!1===this._parsing)a._parsed=i;else{let n,r,o=t=>+i[t];if((0,s.i)(i[t])){let{key:t="value"}=this._parsing;o=e=>+(0,s.f)(i[e],t)}for(n=t,r=t+e;n(0,s.p)(e,t,l,!0)?1:Math.max(a,a*i,n,n*i),p=(e,a,n)=>(0,s.p)(e,t,l,!0)?-1:Math.min(a,a*i,n,n*i),f=g(0,h,c),m=g(s.H,d,u),b=p(s.P,h,c),x=p(s.P+s.H,d,u);a=(f-b)/2,n=(m-x)/2,r=-(f+b)/2,o=-(m+x)/2}return{ratioX:a,ratioY:n,offsetX:r,offsetY:o}}(c,d,l),m=(i.width-r)/u,b=(i.height-r)/g,x=(0,s.n)(this.options.radius,Math.max(Math.min(m,b)/2,0)),_=(x-Math.max(x*l,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*x,this.offsetY=f*x,a.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*h,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){let i=this.options,a=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===a._parsed[t]||a.data[t].hidden?0:this.calculateCircumference(a._parsed[t]*n/s.T)}updateElements(t,e,i,s){let a;let n="reset"===s,r=this.chart,o=r.chartArea,l=r.options,h=l.animation,d=(o.left+o.right)/2,c=(o.top+o.bottom)/2,u=n&&h.animateScale,g=u?0:this.innerRadius,p=u?0:this.outerRadius,{sharedOptions:f,includeOptions:m}=this._getSharedOptions(e,s),b=this._getRotation();for(a=0;a0&&!isNaN(t)?s.T*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,a=i.data.labels||[],n=(0,s.o)(e._parsed[t],i.options.locale);return{label:a[t]||"",value:n}}getMaxBorderWidth(t){let e,i,s,a,n,r=0,o=this.chart;if(!t){for(e=0,i=o.data.datasets.length;e"spacing"!==t,_indexable:t=>"spacing"!==t},O.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,s)=>{let a=t.getDatasetMeta(0),n=a.controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label,i=": "+t.formattedValue;return(0,s.b)(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class L extends y{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:a=[],_dataset:n}=e,r=this.chart._animationsDisabled,{start:o,count:l}=(0,s.q)(e,a,r);this._drawStart=o,this._drawCount=l,(0,s.w)(e)&&(o=0,l=a.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=a;let h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:h},t),this.updateElements(a,o,l,t)}updateElements(t,e,i,a){let n="reset"===a,{iScale:r,vScale:o,_stacked:l,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:c}=this._getSharedOptions(e,a),u=r.axis,g=o.axis,{spanGaps:p,segment:f}=this.options,m=(0,s.x)(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||n||"none"===a,x=e>0&&this.getParsed(e-1);for(let p=e;p0&&Math.abs(i[u]-x[u])>m,f&&(_.parsed=i,_.raw=h.data[p]),c&&(_.options=d||this.resolveDataElementOptions(p,e.active?"active":a)),b||this.updateElement(e,p,_,a),x=i}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let a=s[0].size(this.resolveDataElementOptions(0)),n=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,a,n)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}L.id="line",L.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},L.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class E extends y{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,a=i.data.labels||[],n=(0,s.o)(e._parsed[t].r,i.options.locale);return{label:a[t]||"",value:n}}parseObjectData(t,e,i,a){return s.y.bind(this)(t,e,i,a)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{let s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(se.max&&(e.max=s))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(s/2,0),n=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),r=(a-n)/t.getVisibleDatasetCount();this.outerRadius=a-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,a){let n;let r="reset"===a,o=this.chart,l=o.options,h=l.animation,d=this._cachedMeta.rScale,c=d.xCenter,u=d.yCenter,g=d.getIndexAngle(0)-.5*s.P,p=g,f=360/this.countVisibleElements();for(n=0;n{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?(0,s.t)(this.resolveDataElementOptions(t,e).angle||i):0}}E.id="polarArea",E.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},E.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,s)=>{let a=t.getDatasetMeta(0),n=a.controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class A extends O{}A.id="pie",A.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class T extends y{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,a){return s.y.bind(this)(t,e,i,a)}update(t){let e=this._cachedMeta,i=e.dataset,s=e.data||[],a=e.iScale.getLabels();if(i.points=s,"resize"!==t){let e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);let n={_loop:!0,_fullLoop:a.length===s.length,options:e};this.updateElement(i,void 0,n,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){let a=this._cachedMeta.rScale,n="reset"===s;for(let r=e;r{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}z.defaults={},z.defaultRoutes=void 0;let R={values:t=>(0,s.b)(t)?t:""+t,numeric(t,e,i){let a;if(0===t)return"0";let n=this.chart.options.locale,r=t;if(i.length>1){let e;let s=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(s<1e-4||s>1e15)&&(a="scientific"),Math.abs(e=i.length>3?i[2].value-i[1].value:i[1].value-i[0].value)>=1&&t!==Math.floor(t)&&(e=t-Math.floor(t)),r=e}let o=(0,s.z)(Math.abs(r)),l=Math.max(Math.min(-1*Math.floor(o),20),0),h={notation:a,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(h,this.options.ticks.format),(0,s.o)(t,n,h)},logarithmic(t,e,i){if(0===t)return"0";let a=t/Math.pow(10,Math.floor((0,s.z)(t)));return 1===a||2===a||5===a?R.numeric.call(this,t,e,i):""}};var I={formatters:R};function F(t,e,i,a,n){let r,o,l;let h=(0,s.v)(a,0),d=Math.min((0,s.v)(n,t.length),t.length),c=0;for(i=Math.ceil(i),n&&(i=(r=n-a)/Math.floor(r/i)),l=h;l<0;)l=Math.round(h+ ++c*i);for(o=Math.max(h,0);oe.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:I.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.d.route("scale.ticks","color","","color"),s.d.route("scale.grid","color","","borderColor"),s.d.route("scale.grid","borderColor","","borderColor"),s.d.route("scale.title","color","","color"),s.d.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),s.d.describe("scales",{_fallback:"scale"}),s.d.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});let V=t=>"left"===t?"right":"right"===t?"left":t,B=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function N(t,e){let i=[],s=t.length/e,a=t.length,n=0;for(;na?a:i,a=n&&i>a?i:a,{min:(0,s.B)(i,(0,s.B)(a,i)),max:(0,s.B)(a,(0,s.B)(i,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,s.C)(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:a,grace:n,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=(0,s.D)(this,n,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=oa)return function(t,e,i,s){let a,n=0,r=i[0];for(a=0,s=Math.ceil(s);an)return e}return Math.max(n,1)}(n,e,a);if(r>0){let t,i;let a=r>1?Math.round((l-o)/(r-1)):null;for(F(e,h,d,(0,s.k)(a)?0:o-a,o),t=0,i=r-1;t=l||r<=1||!this.isHorizontal()){this.labelRotation=o;return}let d=this._getLabelSizes(),c=d.widest.width,u=d.highest.height,g=(0,s.E)(this.chart.width-c,0,this.maxWidth);c+6>(t=a.offset?this.maxWidth/r:g/(r-1))&&(t=g/(r-(a.offset?.5:1)),e=this.maxHeight-H(a.grid)-n.padding-W(a.title,this.chart.options.font),i=Math.sqrt(c*c+u*u),h=Math.max(o,Math.min(l,h=(0,s.F)(Math.min(Math.asin((0,s.E)((d.highest.height+6)/t,-1,1)),Math.asin((0,s.E)(e/i,-1,1))-Math.asin((0,s.E)(u/i,-1,1))))))),this.labelRotation=h}afterCalculateLabelRotation(){(0,s.C)(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){(0,s.C)(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:a,grid:n}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){let r=W(a,e.options.font);if(o?(t.width=this.maxWidth,t.height=H(n)+r):(t.height=this.maxHeight,t.width=H(n)+r),i.display&&this.ticks.length){let{first:e,last:a,widest:n,highest:r}=this._getLabelSizes(),l=2*i.padding,h=(0,s.t)(this.labelRotation),d=Math.cos(h),c=Math.sin(h);if(o){let e=i.mirror?0:c*n.width+d*r.height;t.height=Math.min(this.maxHeight,t.height+e+l)}else{let e=i.mirror?0:d*n.width+c*r.height;t.width=Math.min(this.maxWidth,t.width+e+l)}this._calculatePadding(e,a,c,d)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){let{ticks:{align:a,padding:n},position:r}=this.options,o=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){let r=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),d=0,c=0;o?l?(d=s*t.width,c=i*e.height):(d=i*t.height,c=s*e.width):"start"===a?c=e.width:"end"===a?d=t.width:"inner"!==a&&(d=t.width/2,c=e.width/2),this.paddingLeft=Math.max((d-r+n)*this.width/(this.width-r),0),this.paddingRight=Math.max((c-h+n)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===a?(i=0,s=t.height):"end"===a&&(i=e.height,s=0),this.paddingTop=i+n,this.paddingBottom=s+n}}_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(){(0,s.C)(this.options.afterFit,[this])}isHorizontal(){let{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{let i;let s=t.gc,a=s.length/2;if(a>e){for(i=0;i({width:m[t]||0,height:b[t]||0});return{first:M(0),last:M(e-1),widest:M(v),highest:M(y),widths:m,heights:b}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return(0,s.I)(this._alignToPixels?(0,s.J)(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){var e,i;let a=this.ticks||[];if(t>=0&&to*a?o/i:l/a:l*a0}_computeGridLineItems(t){let e,i,a,n,r,o,l,h,d,c,u,g;let p=this.axis,f=this.chart,m=this.options,{grid:b,position:x}=m,_=b.offset,v=this.isHorizontal(),y=this.ticks,M=y.length+(_?1:0),k=H(b),w=[],S=b.setContext(this.getContext()),P=S.drawBorder?S.borderWidth:0,D=P/2,C=function(t){return(0,s.J)(f,t,P)};if("top"===x)e=C(this.bottom),o=this.bottom-k,h=e-D,c=C(t.top)+D,g=t.bottom;else if("bottom"===x)e=C(this.top),c=t.top,g=C(t.bottom)-D,o=e+D,h=this.top+k;else if("left"===x)e=C(this.right),r=this.right-k,l=e-D,d=C(t.left)+D,u=t.right;else if("right"===x)e=C(this.left),d=t.left,u=C(t.right)-D,r=e+D,l=this.left+k;else if("x"===p){if("center"===x)e=C((t.top+t.bottom)/2+.5);else if((0,s.i)(x)){let t=Object.keys(x)[0],i=x[t];e=C(this.chart.scales[t].getPixelForValue(i))}c=t.top,g=t.bottom,h=(o=e+D)+k}else if("y"===p){if("center"===x)e=C((t.left+t.right)/2);else if((0,s.i)(x)){let t=Object.keys(x)[0],i=x[t];e=C(this.chart.scales[t].getPixelForValue(i))}l=(r=e-D)-k,d=t.left,u=t.right}let O=(0,s.v)(m.ticks.maxTicksLimit,M),L=Math.max(1,Math.ceil(M/O));for(i=0;io+1e-6)))return l}(this,i,_))&&(n=(0,s.J)(f,a,e),v?r=l=d=u=n:o=h=c=g=n,w.push({tx1:r,ty1:o,tx2:l,ty2:h,x1:d,y1:c,x2:u,y2:g,width:e,color:p,borderDash:m,borderDashOffset:x,tickWidth:y,tickColor:M,tickBorderDash:k,tickBorderDashOffset:S}))}return this._ticksLength=M,this._borderValue=e,w}_computeLabelItems(t){let e,i,a,n,r,o,l,h,d,c,u;let g=this.axis,p=this.options,{position:f,ticks:m}=p,b=this.isHorizontal(),x=this.ticks,{align:_,crossAlign:v,padding:y,mirror:M}=m,k=H(p.grid),w=k+y,S=M?-y:w,P=-(0,s.t)(this.labelRotation),D=[],C="middle";if("top"===f)r=this.bottom-S,o=this._getXAxisLabelAlignment();else if("bottom"===f)r=this.top+S,o=this._getXAxisLabelAlignment();else if("left"===f){let t=this._getYAxisLabelAlignment(k);o=t.textAlign,n=t.x}else if("right"===f){let t=this._getYAxisLabelAlignment(k);o=t.textAlign,n=t.x}else if("x"===g){if("center"===f)r=(t.top+t.bottom)/2+w;else if((0,s.i)(f)){let t=Object.keys(f)[0],e=f[t];r=this.chart.scales[t].getPixelForValue(e)+w}o=this._getXAxisLabelAlignment()}else if("y"===g){if("center"===f)n=(t.left+t.right)/2-w;else if((0,s.i)(f)){let t=Object.keys(f)[0],e=f[t];n=this.chart.scales[t].getPixelForValue(e)}o=this._getYAxisLabelAlignment(k).textAlign}"y"===g&&("start"===_?C="top":"end"===_&&(C="bottom"));let O=this._getLabelSizes();for(e=0,i=x.length;ee.value===t);if(s>=0){let t=e.setContext(this.getContext(s));return t.lineWidth}return 0}drawGrid(t){let e,i;let s=this.options.grid,a=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r=(t,e,i)=>{i.width&&i.color&&(a.save(),a.lineWidth=i.width,a.strokeStyle=i.color,a.setLineDash(i.borderDash||[]),a.lineDashOffset=i.borderDashOffset,a.beginPath(),a.moveTo(t.x,t.y),a.lineTo(e.x,e.y),a.stroke(),a.restore())};if(s.display)for(e=0,i=n.length;e{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){let e,i;let s=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",n=[];for(e=0,i=s.length;e{let a=i.split("."),n=a.pop(),r=[t].concat(a).join("."),o=e[i].split("."),l=o.pop(),h=o.join(".");s.d.route(r,n,h,l)})}(e,t.defaultRoutes),t.descriptors&&s.d.describe(e,t.descriptors)}(t,r,e),this.override&&s.d.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,a=this.scope;i in e&&delete e[i],a&&i in s.d[a]&&(delete s.d[a][i],this.override&&delete s.U[i])}}var U=new class{constructor(){this.controllers=new $(y,"datasets",!0),this.elements=new $(z,"elements"),this.plugins=new $(Object,"plugins"),this.scales=new $(j,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{let a=i||this._getRegistryForType(e);i||a.isForType(e)||a===this.plugins&&e.id?this._exec(t,a,e):(0,s.Q)(e,e=>{let s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){let a=(0,s.W)(t);(0,s.C)(i["before"+a],[],i),e[t](i),(0,s.C)(i["after"+a],[],i)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let d=e;d0&&Math.abs(i[g]-_[g])>b,m&&(f.parsed=i,f.raw=h.data[d]),u&&(f.options=c||this.resolveDataElementOptions(d,e.active?"active":a)),x||this.updateElement(e,d,f,a),_=i}this.updateSharedOptions(c,a,d)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}let i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;let a=e[0].size(this.resolveDataElementOptions(0)),n=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,a,n)/2}}function K(){throw Error("This method is not implemented: Check that a complete date adapter is provided.")}Y.id="scatter",Y.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Y.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Q{constructor(t){this.options=t||{}}init(t){}formats(){return K()}parse(t,e){return K()}format(t,e){return K()}add(t,e,i){return K()}diff(t,e,i){return K()}startOf(t,e,i){return K()}endOf(t,e){return K()}}Q.override=function(t){Object.assign(Q.prototype,t)};var X={_date:Q};function G(t,e,i,a,n){let r=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=r.length;t{t[r](e[i],a)&&(n.push({element:t,datasetIndex:s,index:l}),o=o||t.inRange(e.x,e.y,a))}),s&&!o)?[]:n}var tt={evaluateInteractionItems:G,modes:{index(t,e,i,a){let n=(0,s.X)(e,t),r=i.axis||"x",o=i.includeInvisible||!1,l=i.intersect?q(t,n,r,a,o):J(t,n,r,!1,a,o),h=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=l[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})}),h):[]},dataset(t,e,i,a){let n=(0,s.X)(e,t),r=i.axis||"xy",o=i.includeInvisible||!1,l=i.intersect?q(t,n,r,a,o):J(t,n,r,!1,a,o);if(l.length>0){let e=l[0].datasetIndex,i=t.getDatasetMeta(e).data;l=[];for(let t=0;tt.pos===e)}function ts(t,e){return t.filter(t=>-1===te.indexOf(t.pos)&&t.box.axis===e)}function ta(t,e){return t.sort((t,i)=>{let s=e?i:t,a=e?t:i;return s.weight===a.weight?s.index-a.index:s.weight-a.weight})}function tn(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function tr(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function to(t,e,i,a){let n,r,o,l,h,d;let c=[];for(n=0,r=t.length,h=0;n{s[t]=Math.max(e[t],i[t])}),s}(t?["left","right"]:["top","bottom"])}(o.horizontal,e));let{same:r,other:u}=function(t,e,i,a){let{pos:n,box:r}=i,o=t.maxPadding;if(!(0,s.i)(n)){i.size&&(t[n]-=i.size);let e=a[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[n]+=i.size}r.getPadding&&tr(o,r.getPadding());let l=Math.max(0,e.outerWidth-tn(o,t,"left","right")),h=Math.max(0,e.outerHeight-tn(o,t,"top","bottom")),d=l!==t.w,c=h!==t.h;return t.w=l,t.h=h,i.horizontal?{same:d,other:c}:{same:c,other:d}}(e,i,o,a);h|=r&&c.length,d=d||u,l.fullSize||c.push(o)}return h&&to(c,e,i,a)||d}function tl(t,e,i,s,a){t.top=i,t.left=e,t.right=e+s,t.bottom=i+a,t.width=s,t.height=a}function th(t,e,i,a){let n=i.padding,{x:r,y:o}=e;for(let l of t){let t=l.box,h=a[l.stack]||{count:1,placed:0,weight:1},d=l.stackWeight/h.weight||1;if(l.horizontal){let a=e.w*d,r=h.size||t.height;(0,s.j)(h.start)&&(o=h.start),t.fullSize?tl(t,n.left,o,i.outerWidth-n.right-n.left,r):tl(t,e.left+h.placed,o,a,r),h.start=o,h.placed+=a,o=t.bottom}else{let a=e.h*d,o=h.size||t.width;(0,s.j)(h.start)&&(r=h.start),t.fullSize?tl(t,r,n.top,o,i.outerHeight-n.bottom-n.top):tl(t,r,e.top+h.placed,o,a),h.start=r,h.placed+=a,r=t.right}}e.x=r,e.y=o}s.d.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var td={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,a){if(!t)return;let n=(0,s.K)(t.options.layout.padding),r=Math.max(e-n.width,0),o=Math.max(i-n.height,0),l=function(t){let e=function(t){let e,i,s,a,n,r;let o=[];for(e=0,i=(t||[]).length;et.box.fullSize),!0),s=ta(ti(e,"left"),!0),a=ta(ti(e,"right")),n=ta(ti(e,"top"),!0),r=ta(ti(e,"bottom")),o=ts(e,"x"),l=ts(e,"y");return{fullSize:i,leftAndTop:s.concat(n),rightAndBottom:a.concat(l).concat(r).concat(o),chartArea:ti(e,"chartArea"),vertical:s.concat(a).concat(l),horizontal:n.concat(r).concat(o)}}(t.boxes),h=l.vertical,d=l.horizontal;(0,s.Q)(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let c=h.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/c,hBoxMaxHeight:o/2}),g=Object.assign({},n);tr(g,(0,s.K)(a));let p=Object.assign({maxPadding:g,w:r,h:o,x:n.left,y:n.top},n),f=function(t,e){let i,s,a;let n=function(t){let e={};for(let i of t){let{stack:t,pos:s,stackWeight:a}=i;if(!t||!te.includes(s))continue;let n=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});n.count++,n.weight+=a}return e}(t),{vBoxMaxWidth:r,hBoxMaxHeight:o}=e;for(i=0,s=t.length;i{let i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class tc{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 tu extends tc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}let tg="$chartjs",tp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},tf=t=>null===t||""===t,tm=!!s.a5&&{passive:!0};function tb(t,e,i){t.canvas.removeEventListener(e,i,tm)}function tx(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function t_(t,e,i){let s=t.canvas,a=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||tx(i.addedNodes,s))&&!tx(i.removedNodes,s);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function tv(t,e,i){let s=t.canvas,a=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||tx(i.removedNodes,s))&&!tx(i.addedNodes,s);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}let ty=new Map,tM=0;function tk(){let t=window.devicePixelRatio;t!==tM&&(tM=t,ty.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function tw(t,e,i){let a=t.canvas,n=a&&(0,s.a2)(a);if(!n)return;let r=(0,s.a4)((t,e)=>{let s=n.clientWidth;i(t,e),s{let e=t[0],i=e.contentRect.width,s=e.contentRect.height;(0!==i||0!==s)&&r(i,s)});return o.observe(n),ty.size||window.addEventListener("resize",tk),ty.set(t,r),o}function tS(t,e,i){i&&i.disconnect(),"resize"===e&&(ty.delete(t),ty.size||window.removeEventListener("resize",tk))}function tP(t,e,i){let a=t.canvas,n=(0,s.a4)(e=>{null!==t.ctx&&i(function(t,e){let i=tp[t.type]||t.type,{x:a,y:n}=(0,s.X)(t,e);return{type:i,chart:e,native:t,x:void 0!==a?a:null,y:void 0!==n?n:null}}(e,t))},t,t=>{let e=t[0];return[e,e.offsetX,e.offsetY]});return!function(t,e,i){t.addEventListener(e,i,tm)}(a,e,n),n}class tD extends tc{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(!function(t,e){let i=t.style,a=t.getAttribute("height"),n=t.getAttribute("width");if(t[tg]={initial:{height:a,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",tf(n)){let e=(0,s.a3)(t,"width");void 0!==e&&(t.width=e)}if(tf(a)){if(""===t.style.height)t.height=t.width/(e||2);else{let e=(0,s.a3)(t,"height");void 0!==e&&(t.height=e)}}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[tg])return!1;let i=e[tg].initial;["height","width"].forEach(t=>{let a=i[t];(0,s.k)(a)?e.removeAttribute(t):e.setAttribute(t,a)});let a=i.style||{};return Object.keys(a).forEach(t=>{e.style[t]=a[t]}),e.width=e.width,delete e[tg],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={});s[e]=(({attach:t_,detach:tv,resize:tw})[e]||tP)(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];s&&((({attach:tS,detach:tS,resize:tS})[e]||tb)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,a){return(0,s.a1)(t,e,i,a)}isAttached(t){let e=(0,s.a2)(t);return!!(e&&e.isConnected)}}class tC{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let a=s?this._descriptors(t).filter(s):this._descriptors(t),n=this._notify(a,t,e,i);return"afterDestroy"===e&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),n}_notify(t,e,i,a){for(let n of(a=a||{},t)){let t=n.plugin,r=t[i],o=[e,a,n.options];if(!1===(0,s.C)(r,o,t)&&a.cancelable)return!1}return!0}invalidate(){(0,s.k)(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,a=(0,s.v)(i.options&&i.options.plugins,{}),n=function(t){let e={},i=[],s=Object.keys(U.plugins.items);for(let t=0;tt.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function tO(t,e){let i=s.d.datasets[t]||{},a=(e.datasets||{})[t]||{};return a.indexAxis||e.indexAxis||i.indexAxis||"x"}function tL(t,e){var i;return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase()}function tE(t){let e=t.options||(t.options={});e.plugins=(0,s.v)(e.plugins,{}),e.scales=function(t,e){let i=s.U[t.type]||{scales:{}},a=e.scales||{},n=tO(t.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(a).forEach(t=>{let e=a[t];if(!(0,s.i)(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let l=tL(t,e),h=i.scales||{};r[l]=r[l]||t,o[t]=(0,s.ac)(Object.create(null),[{axis:l},e,h[l],h[l===n?"_index_":"_value_"]])}),t.data.datasets.forEach(i=>{let n=i.type||t.type,l=i.indexAxis||tO(n,e),h=s.U[n]||{},d=h.scales||{};Object.keys(d).forEach(t=>{let e;let n=(e=t,"_index_"===t?e=l:"_value_"===t&&(e="x"===l?"y":"x"),e),h=i[n+"AxisID"]||r[n]||n;o[h]=o[h]||Object.create(null),(0,s.ac)(o[h],[{axis:n},a[h],d[t]])})}),Object.keys(o).forEach(t=>{let e=o[t];(0,s.ac)(e,[s.d.scales[e.type],s.d.scale])}),o}(t,e)}function tA(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}let tT=new Map,tz=new Set;function tR(t,e){let i=tT.get(t);return i||(i=e(),tT.set(t,i),tz.add(i)),i}let tI=(t,e,i)=>{let a=(0,s.f)(e,i);void 0!==a&&t.add(a)};class tF{constructor(t){var e;this._config=((e=(e=t)||{}).data=tA(e.data),tE(e),e),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=tA(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),tE(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return tR(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return tR(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return tR(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return tR(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){let{options:a,type:n}=this,r=this._cachedScopes(t,i),o=r.get(e);if(o)return o;let l=new Set;e.forEach(e=>{t&&(l.add(t),e.forEach(e=>tI(l,t,e))),e.forEach(t=>tI(l,a,t)),e.forEach(t=>tI(l,s.U[n]||{},t)),e.forEach(t=>tI(l,s.d,t)),e.forEach(t=>tI(l,s.a7,t))});let h=Array.from(l);return 0===h.length&&h.push(Object.create(null)),tz.has(e)&&r.set(e,h),h}chartOptionScopes(){let{options:t,type:e}=this;return[t,s.U[e]||{},s.d.datasets[e]||{},{type:e},s.d,s.a7]}resolveNamedOptions(t,e,i,a=[""]){let n={$shared:!0},{resolver:r,subPrefixes:o}=tV(this._resolverCache,t,a),l=r;if(function(t,e){let{isScriptable:i,isIndexable:a}=(0,s.ab)(t);for(let n of e){let e=i(n),r=a(n),o=(r||e)&&t[n];if(e&&((0,s.a8)(o)||tB(o))||r&&(0,s.b)(o))return!0}return!1}(r,e)){n.$shared=!1,i=(0,s.a8)(i)?i():i;let e=this.createResolver(t,i,o);l=(0,s.a9)(r,i,e)}for(let t of e)n[t]=l[t];return n}createResolver(t,e,i=[""],a){let{resolver:n}=tV(this._resolverCache,t,i);return(0,s.i)(e)?(0,s.a9)(n,e,void 0,a):n}}function tV(t,e,i){let a=t.get(e);a||(a=new Map,t.set(e,a));let n=i.join(),r=a.get(n);if(!r){let t=(0,s.aa)(e,i);r={resolver:t,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},a.set(n,r)}return r}let tB=t=>(0,s.i)(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||(0,s.a8)(t[i]),!1),tN=["top","bottom","left","right","chartArea"];function tH(t,e){return"top"===t||"bottom"===t||-1===tN.indexOf(t)&&"x"===e}function tW(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function tj(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),(0,s.C)(i&&i.onComplete,[t],e)}function t$(t){let e=t.chart,i=e.options.animation;(0,s.C)(i&&i.onProgress,[t],e)}function tU(t){return(0,s.a6)()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}let tY={},tK=t=>{let e=tU(t);return Object.values(tY).filter(t=>t.canvas===e).pop()};class tQ{constructor(t,e){let i=this.config=new tF(e),n=tU(t),r=tK(n);if(r)throw Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||(!(0,s.a6)()||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas?tu:tD)),this.platform.updateConfig(i);let l=this.platform.acquireContext(n,o.aspectRatio),h=l&&l.canvas,d=h&&h.height,c=h&&h.width;if(this.id=(0,s.ad)(),this.ctx=l,this.canvas=h,this.width=c,this.height=d,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new tC,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,s.ae)(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],tY[this.id]=this,!l||!h){console.error("Failed to create chart: can't acquire context from the given item");return}a.listen(this,"complete",tj),a.listen(this,"progress",t$),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:a,_aspectRatio:n}=this;return(0,s.k)(t)?e&&n?n:a?i/a:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,s.af)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,s.ag)(this.canvas,this.ctx),this}stop(){return a.stop(this),this}resize(t,e){a.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,a=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(a,t,e,n),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,(0,s.af)(this,o,!0)&&(this.notifyPlugins("resize",{size:r}),(0,s.C)(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let t=this.options,e=t.scales||{};(0,s.Q)(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,a=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{}),n=[];e&&(n=n.concat(Object.keys(e).map(t=>{let i=e[t],s=tL(t,i),a="r"===s,n="x"===s;return{options:i,dposition:a?"chartArea":n?"bottom":"left",dtype:a?"radialLinear":n?"category":"linear"}}))),(0,s.Q)(n,e=>{let n=e.options,r=n.id,o=tL(r,n),l=(0,s.v)(n.type,e.dtype);(void 0===n.position||tH(n.position,o)!==tH(e.dposition))&&(n.position=e.dposition),a[r]=!0;let h=null;if(r in i&&i[r].type===l)h=i[r];else{let t=U.getScale(l);i[(h=new t({id:r,type:l,ctx:this.ctx,chart:this})).id]=h}h.init(n,t)}),(0,s.Q)(a,(t,e)=>{t||delete i[e]}),(0,s.Q)(i,t=>{td.configure(this,t,t.options),td.addBox(this,t)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){let t,e;let i=[],a=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=a.length;t{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;let n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(tW("z","_idx"));let{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){(0,s.Q)(this.scales,t=>{td.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(0,s.ah)(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:a}of e){let e="_removeElements"===i?-a:a;!function(t,e,i){let s=Object.keys(t);for(let a of s){let s=+a;if(s>=e){let n=t[a];delete t[a],(i>0||s>e)&&(t[s+i]=n)}}}(t,s,e)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),a=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;td.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,s.Q)(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,a=!i.disabled,n=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(a&&(0,s.L)(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),a&&(0,s.N)(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return(0,s.$)(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){let a=tt.modes[e];return"function"==typeof a?a(this,t,i,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=(0,s.h)(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let a=i?"show":"hide",n=this.getDatasetMeta(t),r=n.controller._resolveAnimations(void 0,a);(0,s.j)(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(n,{visible:i}),this.update(e=>e.datasetIndex===t?a:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),a.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},a=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};(0,s.Q)(this.options.events,t=>i(t,a))}bindResponsiveEvents(){let t;this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,i=this.platform,s=(t,s)=>{i.addEventListener(this,t,s),e[t]=s},a=(t,s)=>{e[t]&&(i.removeEventListener(this,t,s),delete e[t])},n=(t,e)=>{this.canvas&&this.resize(t,e)},r=()=>{a("attach",r),this.attached=!0,this.resize(),s("resize",n),s("detach",t)};t=()=>{this.attached=!1,a("resize",n),this._stop(),this._resize(0,0),s("attach",r)},i.isAttached(this.canvas)?r():t()}unbindEvents(){(0,s.Q)(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},(0,s.Q)(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let s,a,n;let r=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+r+"DatasetHoverStyle"](),a=0,n=t.length;a{let i=this.getDatasetMeta(t);if(!i)throw Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!(0,s.ai)(i,e);a&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){let s=this.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),n=a(e,t),r=i?t:a(t,e);n.length&&this.updateHoverStyle(n,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;let a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){var a;let{_active:n=[],options:r}=this,o=this._getActiveElements(t,n,i,e),l=(0,s.aj)(t),h=(a=this._lastEvent,i&&"mouseout"!==t.type?l?a:t:null);i&&(this._lastEvent=null,(0,s.C)(r.onHover,[t,o,this],this),l&&(0,s.C)(r.onClick,[t,o,this],this));let d=!(0,s.ai)(o,n);return(d||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=h,d}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;let a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,s)}}let tX=()=>(0,s.Q)(tQ.instances,t=>t._plugins.invalidate());function tG(t,e,i){let{startAngle:a,pixelMargin:n,x:r,y:o,outerRadius:l,innerRadius:h}=e,d=n/l;t.beginPath(),t.arc(r,o,l,a-d,i+d),h>n?(d=n/h,t.arc(r,o,h,i+d,a-d,!0)):t.arc(r,o,n,i+s.H,a-s.H),t.closePath(),t.clip()}function tq(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function tJ(t,e,i,a,n,r){let{x:o,y:l,startAngle:h,pixelMargin:d,innerRadius:c}=e,u=Math.max(e.outerRadius+a+i-d,0),g=c>0?c+a+i+d:0,p=0,f=n-h;if(a){let t=((c>0?c-a:0)+(u>0?u-a:0))/2;p=(f-(0!==t?f*t/(t+a):f))/2}let m=Math.max(.001,f*u-i/s.P)/u,b=(f-m)/2,x=h+b+p,_=n-b-p,{outerStart:v,outerEnd:y,innerStart:M,innerEnd:k}=function(t,e,i,a){var n;let r=(n=t.options.borderRadius,(0,s.al)(n,["outerStart","outerEnd","innerStart","innerEnd"])),o=(i-e)/2,l=Math.min(o,a*e/2),h=t=>(0,s.E)(t,0,Math.min(o,(i-Math.min(o,t))*a/2));return{outerStart:h(r.outerStart),outerEnd:h(r.outerEnd),innerStart:(0,s.E)(r.innerStart,0,l),innerEnd:(0,s.E)(r.innerEnd,0,l)}}(e,g,u,_-x),w=u-v,S=u-y,P=x+v/w,D=_-y/S,C=g+M,O=g+k,L=x+M/C,E=_-k/O;if(t.beginPath(),r){if(t.arc(o,l,u,P,D),y>0){let e=tq(S,D,o,l);t.arc(e.x,e.y,y,D,_+s.H)}let e=tq(O,_,o,l);if(t.lineTo(e.x,e.y),k>0){let e=tq(O,E,o,l);t.arc(e.x,e.y,k,_+s.H,E+Math.PI)}if(t.arc(o,l,g,_-k/g,x+M/g,!0),M>0){let e=tq(C,L,o,l);t.arc(e.x,e.y,M,L+Math.PI,x-s.H)}let i=tq(w,x,o,l);if(t.lineTo(i.x,i.y),v>0){let e=tq(w,P,o,l);t.arc(e.x,e.y,v,x-s.H,P)}}else t.moveTo(o,l),t.lineTo(Math.cos(P)*u+o,Math.sin(P)*u+l),t.lineTo(Math.cos(D)*u+o,Math.sin(D)*u+l);t.closePath()}Object.defineProperties(tQ,{defaults:{enumerable:!0,value:s.d},instances:{enumerable:!0,value:tY},overrides:{enumerable:!0,value:s.U},registry:{enumerable:!0,value:U},version:{enumerable:!0,value:"3.9.1"},getChart:{enumerable:!0,value:tK},register:{enumerable:!0,value:(...t)=>{U.add(...t),tX()}},unregister:{enumerable:!0,value:(...t)=>{U.remove(...t),tX()}}});class tZ extends z{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){let a=this.getProps(["x","y"],i),{angle:n,distance:r}=(0,s.a0)(a,{x:t,y:e}),{startAngle:o,endAngle:l,innerRadius:h,outerRadius:d,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,g=(0,s.v)(c,l-o),p=g>=s.T||(0,s.p)(n,o,l),f=(0,s.ak)(r,h+u,d+u);return p&&f}getCenterPoint(t){let{x:e,y:i,startAngle:s,endAngle:a,innerRadius:n,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:o,spacing:l}=this.options,h=(s+a)/2,d=(n+r+l+o)/2;return{x:e+Math.cos(h)*d,y:i+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,a=(e.offset||0)/2,n=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>s.T?Math.floor(i/s.T):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let o=0;if(a){o=a/2;let e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*o,Math.sin(e)*o),this.circumference>=s.P&&(o=a)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;let l=function(t,e,i,a,n){let{fullCircles:r,startAngle:o,circumference:l}=e,h=e.endAngle;if(r){tJ(t,e,i,a,o+s.T,n);for(let e=0;eo&&n>o)?s+h-l:h-l}}function t3(t,e,i,a){let n,r,o;let{points:l,options:h}=e,{count:d,start:c,loop:u,ilen:g}=t2(l,i,a),p=h.stepped?s.as:h.tension||"monotone"===h.cubicInterpolationMode?s.at:t1,{move:f=!0,reverse:m}=a||{};for(n=0;n<=g;++n)(r=l[(c+(m?g-n:n))%d]).skip||(f?(t.moveTo(r.x,r.y),f=!1):p(t,o,r,m,h.stepped),o=r);return u&&p(t,o,r=l[(c+(m?g:0))%d],m,h.stepped),!!u}function t5(t,e,i,s){let a,n,r,o,l,h;let d=e.points,{count:c,start:u,ilen:g}=t2(d,i,s),{move:p=!0,reverse:f}=s||{},m=0,b=0,x=t=>(u+(f?g-t:t))%c,_=()=>{o!==l&&(t.lineTo(m,l),t.lineTo(m,o),t.lineTo(m,h))};for(p&&(n=d[x(0)],t.moveTo(n.x,n.y)),a=0;a<=g;++a){if((n=d[x(a)]).skip)continue;let e=n.x,i=n.y,s=0|e;s===r?(il&&(l=i),m=(b*m+e)/++b):(_(),t.lineTo(e,i),r=s,b=0,o=l=i),h=i}_()}function t6(t){let e=t.options,i=e.borderDash&&e.borderDash.length,s=!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i;return s?t5:t3}tZ.id="arc",tZ.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},tZ.defaultRoutes={backgroundColor:"backgroundColor"};let t4="function"==typeof Path2D;class t8 extends z{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){let a=i.spanGaps?this._loop:this._fullLoop;(0,s.am)(this._points,i,t,a,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=(0,s.an)(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i,a;let n=this.options,r=t[e],o=this.points,l=(0,s.ao)(this,{property:e,start:r,end:r});if(!l.length)return;let h=[],d=n.stepped?s.ap:n.tension||"monotone"===n.cubicInterpolationMode?s.aq:s.ar;for(i=0,a=l.length;i"borderDash"!==t&&"fill"!==t};class t9 extends z{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){let s=this.options,{x:a,y:n}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-n,2)t;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function el(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}en.id="bar",en.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},en.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function eh(t,e,i,s){let a=e.interpolate(i,s);a&&t.lineTo(a.x,a.y)}let ed=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}},ec=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class eu extends z{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=(0,s.C)(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let t,e;let{options:i,ctx:a}=this;if(!i.display){this.width=this.height=0;return}let n=i.labels,r=(0,s.O)(n.font),o=r.size,l=this._computeTitleHeight(),{boxWidth:h,itemHeight:d}=ed(n,o);a.font=r.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(l,o,h,d)+10):(e=this.maxHeight,t=this._fitCols(l,o,h,d)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){let{ctx:a,maxWidth:n,options:{labels:{padding:r}}}=this,o=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+r,d=t;a.textAlign="left",a.textBaseline="middle";let c=-1,u=-h;return this.legendItems.forEach((t,g)=>{let p=i+e/2+a.measureText(t.text).width;(0===g||l[l.length-1]+p+2*r>n)&&(d+=h,l[l.length-(g>0?0:1)]=0,u+=h,c++),o[g]={left:0,top:u,row:c,width:p,height:s},l[l.length-1]+=p+r}),d}_fitCols(t,e,i,s){let{ctx:a,maxHeight:n,options:{labels:{padding:r}}}=this,o=this.legendHitBoxes=[],l=this.columnSizes=[],h=n-t,d=r,c=0,u=0,g=0,p=0;return this.legendItems.forEach((t,n)=>{let f=i+e/2+a.measureText(t.text).width;n>0&&u+s+2*r>h&&(d+=c+r,l.push({width:c,height:u}),g+=c+r,p++,c=u=0),o[n]={left:g,top:u,col:p,width:f,height:s},c=Math.max(c,f),u+=s+r}),d+=c,l.push({width:c,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:a},rtl:n}}=this,r=(0,s.aA)(n,this.left,this.width);if(this.isHorizontal()){let n=0,o=(0,s.S)(i,this.left+a,this.right-this.lineWidths[n]);for(let l of e)n!==l.row&&(n=l.row,o=(0,s.S)(i,this.left+a,this.right-this.lineWidths[n])),l.top+=this.top+t+a,l.left=r.leftForLtr(r.x(o),l.width),o+=l.width+a}else{let n=0,o=(0,s.S)(i,this.top+t+a,this.bottom-this.columnSizes[n].height);for(let l of e)l.col!==n&&(n=l.col,o=(0,s.S)(i,this.top+t+a,this.bottom-this.columnSizes[n].height)),l.top=o,l.left+=this.left+a,l.left=r.leftForLtr(r.x(l.left),l.width),o+=l.height+a}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let t=this.ctx;(0,s.L)(t,this),this._draw(),(0,s.N)(t)}}_draw(){let t;let{options:e,columnSizes:i,lineWidths:a,ctx:n}=this,{align:r,labels:o}=e,l=s.d.color,h=(0,s.aA)(e.rtl,this.left,this.width),d=(0,s.O)(o.font),{color:c,padding:u}=o,g=d.size,p=g/2;this.drawTitle(),n.textAlign=h.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=d.string;let{boxWidth:f,boxHeight:m,itemHeight:b}=ed(o,g),x=function(t,e,i){if(isNaN(f)||f<=0||isNaN(m)||m<0)return;n.save();let a=(0,s.v)(i.lineWidth,1);if(n.fillStyle=(0,s.v)(i.fillStyle,l),n.lineCap=(0,s.v)(i.lineCap,"butt"),n.lineDashOffset=(0,s.v)(i.lineDashOffset,0),n.lineJoin=(0,s.v)(i.lineJoin,"miter"),n.lineWidth=a,n.strokeStyle=(0,s.v)(i.strokeStyle,l),n.setLineDash((0,s.v)(i.lineDash,[])),o.usePointStyle){let r={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:a},l=h.xPlus(t,f/2);(0,s.aE)(n,r,l,e+p,o.pointStyleWidth&&f)}else{let r=e+Math.max((g-m)/2,0),o=h.leftForLtr(t,f),l=(0,s.ax)(i.borderRadius);n.beginPath(),Object.values(l).some(t=>0!==t)?(0,s.av)(n,{x:o,y:r,w:f,h:m,radius:l}):n.rect(o,r,f,m),n.fill(),0!==a&&n.stroke()}n.restore()},_=function(t,e,i){(0,s.M)(n,i.text,t,e+b/2,d,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();t=v?{x:(0,s.S)(r,this.left+u,this.right-a[0]),y:this.top+u+y,line:0}:{x:this.left+u,y:(0,s.S)(r,this.top+y+u,this.bottom-i[0].height),line:0},(0,s.aB)(this.ctx,e.textDirection);let M=b+u;this.legendItems.forEach((l,d)=>{n.strokeStyle=l.fontColor||c,n.fillStyle=l.fontColor||c;let g=n.measureText(l.text).width,m=h.textAlign(l.textAlign||(l.textAlign=o.textAlign)),b=f+p+g,k=t.x,w=t.y;h.setWidth(this.width),v?d>0&&k+b+u>this.right&&(w=t.y+=M,t.line++,k=t.x=(0,s.S)(r,this.left+u,this.right-a[t.line])):d>0&&w+M>this.bottom&&(k=t.x=k+i[t.line].width+u,t.line++,w=t.y=(0,s.S)(r,this.top+y+u,this.bottom-i[t.line].height));let S=h.x(k);x(S,w,l),k=(0,s.aC)(m,k+f+p,v?k+b:this.right,e.rtl),_(h.x(k),w,l),v?t.x+=b+u:t.y+=M}),(0,s.aD)(this.ctx,e.textDirection)}drawTitle(){let t;let e=this.options,i=e.title,a=(0,s.O)(i.font),n=(0,s.K)(i.padding);if(!i.display)return;let r=(0,s.aA)(e.rtl,this.left,this.width),o=this.ctx,l=i.position,h=a.size/2,d=n.top+h,c=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),t=this.top+d,c=(0,s.S)(e.align,c,this.right-u);else{let i=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);t=d+(0,s.S)(e.align,this.top,this.bottom-i-e.labels.padding-this._computeTitleHeight())}let g=(0,s.S)(l,c,c+u);o.textAlign=r.textAlign((0,s.R)(l)),o.textBaseline="middle",o.strokeStyle=i.color,o.fillStyle=i.color,o.font=a.string,(0,s.M)(o,i.text,g,t,a)}_computeTitleHeight(){let t=this.options.title,e=(0,s.O)(t.font),i=(0,s.K)(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,a,n;if((0,s.ak)(t,this.left,this.right)&&(0,s.ak)(e,this.top,this.bottom)){for(i=0,n=this.legendHitBoxes;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:a,textAlign:n,color:r}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{let o=t.controller.getStyle(i?0:void 0),l=(0,s.K)(o.borderWidth);return{text:e[t.index].label,fillStyle:o.backgroundColor,fontColor:r,hidden:!t.visible,lineCap:o.borderCapStyle,lineDash:o.borderDash,lineDashOffset:o.borderDashOffset,lineJoin:o.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:o.borderColor,pointStyle:a||o.pointStyle,rotation:o.rotation,textAlign:n||o.textAlign,borderRadius:0,datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class ep extends z{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let a=(0,s.b)(i.text)?i.text.length:1;this._padding=(0,s.K)(i.padding);let n=a*(0,s.O)(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){let t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){let e,i,a;let{top:n,left:r,bottom:o,right:l,options:h}=this,d=h.align,c=0;return this.isHorizontal()?(i=(0,s.S)(d,r,l),a=n+t,e=l-r):("left"===h.position?(i=r+t,a=(0,s.S)(d,o,n),c=-.5*s.P):(i=l-t,a=(0,s.S)(d,n,o),c=.5*s.P),e=o-n),{titleX:i,titleY:a,maxWidth:e,rotation:c}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=(0,s.O)(e.font),a=i.lineHeight,n=a/2+this._padding.top,{titleX:r,titleY:o,maxWidth:l,rotation:h}=this._drawArgs(n);(0,s.M)(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:h,textAlign:(0,s.R)(e.align),textBaseline:"middle",translation:[r,o]})}}var ef={id:"title",_element:ep,start(t,e,i){!function(t,e){let i=new ep({ctx:t.ctx,options:e,chart:t});td.configure(t,i,e),td.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){let e=t.titleBlock;td.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){let s=t.titleBlock;td.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;let em={average(t){let e,i;if(!t.length)return!1;let s=0,a=0,n=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function e_(t,e){let i=t.chart.ctx,{body:a,footer:n,title:r}=t,{boxWidth:o,boxHeight:l}=e,h=(0,s.O)(e.bodyFont),d=(0,s.O)(e.titleFont),c=(0,s.O)(e.footerFont),u=r.length,g=n.length,p=a.length,f=(0,s.K)(e.padding),m=f.height,b=0,x=a.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(x+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*d.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),x){let t=e.displayColors?Math.max(l,h.lineHeight):h.lineHeight;m+=p*t+(x-p)*h.lineHeight+(x-1)*e.bodySpacing}g&&(m+=e.footerMarginTop+g*c.lineHeight+(g-1)*e.footerSpacing);let _=0,v=function(t){b=Math.max(b,i.measureText(t).width+_)};return i.save(),i.font=d.string,(0,s.Q)(t.title,v),i.font=h.string,(0,s.Q)(t.beforeBody.concat(t.afterBody),v),_=e.displayColors?o+2+e.boxPadding:0,(0,s.Q)(a,t=>{(0,s.Q)(t.before,v),(0,s.Q)(t.lines,v),(0,s.Q)(t.after,v)}),_=0,i.font=c.string,(0,s.Q)(t.footer,v),i.restore(),{width:b+=f.width,height:m}}function ev(t,e,i){let s=i.yAlign||e.yAlign||function(t,e){let{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||function(t,e,i,s){let{x:a,width:n}=i,{width:r,chartArea:{left:o,right:l}}=t,h="center";return"center"===s?h=a<=(o+l)/2?"left":"right":a<=n/2?h="left":a>=r-n/2&&(h="right"),function(t,e,i,s){let{x:a,width:n}=s,r=i.caretSize+i.caretPadding;if("left"===t&&a+n+r>e.width||"right"===t&&a-n-r<0)return!0}(h,t,e,i)&&(h="center"),h}(t,e,i,s),yAlign:s}}function ey(t,e,i,a){let{caretSize:n,caretPadding:r,cornerRadius:o}=t,{xAlign:l,yAlign:h}=i,d=n+r,{topLeft:c,topRight:u,bottomLeft:g,bottomRight:p}=(0,s.ax)(o),f=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,l),m=function(t,e,i){let{y:s,height:a}=t;return"top"===e?s+=i:"bottom"===e?s-=a+i:s-=a/2,s}(e,h,d);return"center"===h?"left"===l?f+=d:"right"===l&&(f-=d):"left"===l?f-=Math.max(c,g)+n:"right"===l&&(f+=Math.max(u,p)+n),{x:(0,s.E)(f,0,a.width-e.width),y:(0,s.E)(m,0,a.height-e.height)}}function eM(t,e,i){let a=(0,s.K)(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-a.right:t.x+a.left}function ek(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class ew extends z{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,a=new h(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){var t,e;return this.$context||(this.$context=(t=this.chart.getContext(),e=this._tooltipItems,(0,s.h)(t,{tooltip:this,tooltipItems:e,type:"tooltip"})))}getTitle(t,e){let{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),a=i.title.apply(this,[t]),n=i.afterTitle.apply(this,[t]),r=[];return r=eb(r,ex(s)),r=eb(r,ex(a)),r=eb(r,ex(n))}getBeforeBody(t,e){return eb([],ex(e.callbacks.beforeBody.apply(this,[t])))}getBody(t,e){let{callbacks:i}=e,a=[];return(0,s.Q)(t,t=>{let e={before:[],lines:[],after:[]},s=ek(i,t);eb(e.before,ex(s.beforeLabel.call(this,t))),eb(e.lines,s.label.call(this,t)),eb(e.after,ex(s.afterLabel.call(this,t))),a.push(e)}),a}getAfterBody(t,e){return eb([],ex(e.callbacks.afterBody.apply(this,[t])))}getFooter(t,e){let{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),a=i.footer.apply(this,[t]),n=i.afterFooter.apply(this,[t]),r=[];return r=eb(r,ex(s)),r=eb(r,ex(a)),r=eb(r,ex(n))}_createItems(t){let e,i;let a=this._active,n=this.chart.data,r=[],o=[],l=[],h=[];for(e=0,i=a.length;et.filter(e,i,s,n))),t.itemSort&&(h=h.sort((e,i)=>t.itemSort(e,i,n))),(0,s.Q)(h,e=>{let i=ek(t.callbacks,e);r.push(i.labelColor.call(this,e)),o.push(i.labelPointStyle.call(this,e)),l.push(i.labelTextColor.call(this,e))}),this.labelColors=r,this.labelPointStyles=o,this.labelTextColors=l,this.dataPoints=h,h}update(t,e){let i;let s=this.options.setContext(this.getContext()),a=this._active,n=[];if(a.length){let t=em[s.position].call(this,a,this._eventPosition);n=this._createItems(s),this.title=this.getTitle(n,s),this.beforeBody=this.getBeforeBody(n,s),this.body=this.getBody(n,s),this.afterBody=this.getAfterBody(n,s),this.footer=this.getFooter(n,s);let e=this._size=e_(this,s),r=Object.assign({},t,e),o=ev(this.chart,s,r),l=ey(s,r,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=n,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){let a=this.getCaretPosition(t,i,s);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){let a,n,r,o,l,h;let{xAlign:d,yAlign:c}=this,{caretSize:u,cornerRadius:g}=i,{topLeft:p,topRight:f,bottomLeft:m,bottomRight:b}=(0,s.ax)(g),{x:x,y:_}=t,{width:v,height:y}=e;return"center"===c?(l=_+y/2,"left"===d?(n=(a=x)-u,o=l+u,h=l-u):(n=(a=x+v)+u,o=l-u,h=l+u),r=a):(n="left"===d?x+Math.max(p,m)+u:"right"===d?x+v-Math.max(f,b)-u:this.caretX,"top"===c?(l=(o=_)-u,a=n-u,r=n+u):(l=(o=_+y)+u,a=n+u,r=n-u),h=o),{x1:a,x2:n,x3:r,y1:o,y2:l,y3:h}}drawTitle(t,e,i){let a,n,r;let o=this.title,l=o.length;if(l){let h=(0,s.aA)(i.rtl,this.x,this.width);for(r=0,t.x=eM(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",a=(0,s.O)(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string;r0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,(0,s.av)(t,{x:e,y:f,w:h,h:l,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),(0,s.av)(t,{x:i,y:f+1,w:h-2,h:l-2,radius:o}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,h,l),t.strokeRect(e,f,h,l),t.fillStyle=r.backgroundColor,t.fillRect(i,f+1,h-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let a,n,r,o,l,h,d;let{body:c}=this,{bodySpacing:u,bodyAlign:g,displayColors:p,boxHeight:f,boxWidth:m,boxPadding:b}=i,x=(0,s.O)(i.bodyFont),_=x.lineHeight,v=0,y=(0,s.aA)(i.rtl,this.x,this.width),M=function(i){e.fillText(i,y.x(t.x+v),t.y+_/2),t.y+=_+u},k=y.textAlign(g);for(e.textAlign=g,e.textBaseline="middle",e.font=x.string,t.x=eM(this,k,i),e.fillStyle=i.bodyColor,(0,s.Q)(this.beforeBody,M),v=p&&"right"!==k?"center"===g?m/2+b:m+2+b:0,o=0,h=c.length;o0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,s=i&&i.x,a=i&&i.y;if(s||a){let i=em[t.position].call(this,this._active,this._eventPosition);if(!i)return;let n=this._size=e_(this,t),r=Object.assign({},i,this._size),o=ev(e,t,r),l=ey(t,r,o,e);(s._to!==l.x||a._to!==l.y)&&(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=n.width,this.height=n.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let a={width:this.width,height:this.height},n={x:this.x,y:this.y};i=.001>Math.abs(i)?0:i;let r=(0,s.K)(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,a,e),(0,s.aB)(t,e.textDirection),n.y+=r.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),(0,s.aD)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,a=t.map(({datasetIndex:t,index:e})=>{let i=this.chart.getDatasetMeta(t);if(!i)throw Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),n=!(0,s.ai)(i,a),r=this._positionChanged(a,e);(n||r)&&(this._active=a,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let a=this.options,n=this._active||[],r=this._getActiveElements(t,n,e,i),o=this._positionChanged(r,t),l=e||!(0,s.ai)(r,n)||o;return l&&(this._active=r,(a.enabled||a.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){let a=this.options;if("mouseout"===t.type)return[];if(!s)return e;let n=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&n.reverse(),n}_positionChanged(t,e){let{caretX:i,caretY:s,options:a}=this,n=em[a.position].call(this,t,e);return!1!==n&&(i!==n.x||s!==n.y)}}ew.positioners=em;var eS={id:"tooltip",_element:ew,positioners:em,afterInit(t,e,i){i&&(t.tooltip=new ew({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){let e=t.tooltip;if(e&&e._willRender()){let i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",i))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){let i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:s.aF,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};let eP=(t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i),eD=(t,e)=>null===t?null:(0,s.E)(Math.round(t),0,e);class eC extends j{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let t=this.getLabels();for(let{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if((0,s.k)(t))return null;let i=this.getLabels();return eD(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){let a=t.indexOf(e);if(-1===a)return eP(t,e,i,s);let n=t.lastIndexOf(e);return a!==n?i:a}(i,t,(0,s.v)(e,t),this._addedLabels),i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{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(){let t=this.min,e=this.max,i=this.options.offset,s=[],a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){let e=this.getLabels();return t>=0&&te.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 eO(t,e,{horizontal:i,minRotation:a}){let n=(0,s.t)(a),r=.75*e*(""+t).length;return Math.min(e/((i?Math.sin(n):Math.cos(n))||.001),r)}eC.id="category",eC.defaults={ticks:{callback:eC.prototype.getLabelForValue}};class eL extends j{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(0,s.k)(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:a,max:n}=this,r=t=>a=e?a:t,o=t=>n=i?n:t;if(t){let t=(0,s.s)(a),e=(0,s.s)(n);t<0&&e<0?o(0):t>0&&e>0&&r(0)}if(a===n){let e=1;(n>=Number.MAX_SAFE_INTEGER||a<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*n)),o(n+e),t||r(a-e)}this.min=a,this.max=n}getTickLimit(){let t;let e=this.options.ticks,{maxTicksLimit:i,stepSize:s}=e;return s?(t=Math.ceil(this.max/s)-Math.floor(this.min/s)+1)>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let a={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},n=this._range||this,r=function(t,e){let i,a,n,r;let o=[],{bounds:l,step:h,min:d,max:c,precision:u,count:g,maxTicks:p,maxDigits:f,includeBounds:m}=t,b=h||1,x=p-1,{min:_,max:v}=e,y=!(0,s.k)(d),M=!(0,s.k)(c),k=!(0,s.k)(g),w=(v-_)/(f+1),S=(0,s.aI)((v-_)/x/b)*b;if(S<1e-14&&!y&&!M)return[{value:_},{value:v}];(r=Math.ceil(v/S)-Math.floor(_/S))>x&&(S=(0,s.aI)(r*S/x/b)*b),(0,s.k)(u)||(S=Math.ceil(S*(i=Math.pow(10,u)))/i),"ticks"===l?(a=Math.floor(_/S)*S,n=Math.ceil(v/S)*S):(a=_,n=v),y&&M&&h&&(0,s.aJ)((c-d)/h,S/1e3)?(r=Math.round(Math.min((c-d)/S,p)),S=(c-d)/r,a=d,n=c):k?(a=y?d:a,S=((n=M?c:n)-a)/(r=g-1)):(r=(n-a)/S,r=(0,s.aK)(r,Math.round(r),S/1e3)?Math.round(r):Math.ceil(r));let P=Math.max((0,s.aL)(S),(0,s.aL)(a));i=Math.pow(10,(0,s.k)(u)?P:u),a=Math.round(a*i)/i,n=Math.round(n*i)/i;let D=0;for(y&&(m&&a!==d?(o.push({value:d}),a0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=(0,s.g)(t)?Math.max(0,t):null,this.max=(0,s.g)(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,a=this.max,n=e=>i=t?i:e,r=t=>a=e?a:t,o=(t,e)=>Math.pow(10,Math.floor((0,s.z)(t))+e);i===a&&(i<=0?(n(1),r(10)):(n(o(i,-1)),r(o(a,1)))),i<=0&&n(o(a,-1)),a<=0&&r(o(i,1)),this._zero&&this.min!==this._suggestedMin&&i===o(this.min,0)&&n(o(i,-1)),this.min=i,this.max=a}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=function(t,e){let i=Math.floor((0,s.z)(e.max)),a=Math.ceil(e.max/Math.pow(10,i)),n=[],r=(0,s.B)(t.min,Math.pow(10,Math.floor((0,s.z)(e.min)))),o=Math.floor((0,s.z)(r)),l=Math.floor(r/Math.pow(10,o)),h=o<0?Math.pow(10,Math.abs(o)):1;do n.push({value:r,major:eA(r)}),10==++l&&(l=1,h=++o>=0?1:h),r=Math.round(l*Math.pow(10,o)*h)/h;while(oa?{start:e-i,end:e}:{start:e,end:e+i}}function eI(t,e,i,a){let{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,s.T);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let s=1;s{let i=(0,s.C)(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){let t=this.options;t.display&&t.pointLabels.display?function(t){let e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),a=[],n=[],r=t._pointLabels.length,o=t.options.pointLabels,l=o.centerPointLabels?s.P/r:0;for(let c=0;ce.r&&(o=(s.end-e.r)/n,t.r=Math.max(t.r,e.r+o)),a.starte.b&&(l=(a.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}(i,e,f,b,x)}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){let a=[],n=t._pointLabels.length,r=t.options,o=ez(r)/2,l=t.drawingArea,h=r.pointLabels.centerPointLabels?s.P/n:0;for(let r=0;r270||p<90)&&(d-=c),d),b=0===p||180===p?"center":p<180?"left":"right",x=(u=n.x,g=f.w,"right"===b?u-=g:"center"===b&&(u-=g/2),u);a.push({x:n.x,y:m,textAlign:b,left:x,top:m,right:x+f.w,bottom:m+f.h})}return a}(t,a,n)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){let e=s.T/(this._pointLabels.length||1),i=this.options.startAngle||0;return(0,s.az)(t*e+(0,s.t)(i))}getDistanceFromCenterForValue(t){if((0,s.k)(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if((0,s.k)(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t=0;n--){let e=a.setContext(t.getPointLabelContext(n)),r=(0,s.O)(e.font),{x:o,y:l,textAlign:h,left:d,top:c,right:u,bottom:g}=t._pointLabelItems[n],{backdropColor:p}=e;if(!(0,s.k)(p)){let t=(0,s.ax)(e.borderRadius),a=(0,s.K)(e.backdropPadding);i.fillStyle=p;let n=d-a.left,r=c-a.top,o=u-d+a.width,l=g-c+a.height;Object.values(t).some(t=>0!==t)?(i.beginPath(),(0,s.av)(i,{x:n,y:r,w:o,h:l,radius:t}),i.fill()):i.fillRect(n,r,o,l)}(0,s.M)(i,t._pointLabels[n],o,l+r.lineHeight/2,r,{color:e.color,textAlign:h,textBaseline:"middle"})}}(this,l),o.display&&this.ticks.forEach((t,i)=>{if(0!==i){e=this.getDistanceFromCenterForValue(t.value);let s=o.setContext(this.getContext(i-1));!function(t,e,i,s){let a=t.ctx,n=e.circular,{color:r,lineWidth:o}=e;(n||s)&&r&&o&&!(i<0)&&(a.save(),a.strokeStyle=r,a.lineWidth=o,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),eI(t,i,n,s),a.closePath(),a.stroke(),a.restore())}(this,s,e,l)}}),r.display){for(a.save(),t=l-1;t>=0;t--){let s=r.setContext(this.getPointLabelContext(t)),{color:o,lineWidth:l}=s;l&&o&&(a.lineWidth=l,a.strokeStyle=o,a.setLineDash(s.borderDash),a.lineDashOffset=s.borderDashOffset,e=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),i=this.getPointPosition(t,e),a.beginPath(),a.moveTo(this.xCenter,this.yCenter),a.lineTo(i.x,i.y),a.stroke())}a.restore()}}drawBorder(){}drawLabels(){let t,e;let i=this.ctx,a=this.options,n=a.ticks;if(!n.display)return;let r=this.getIndexAngle(0);i.save(),i.translate(this.xCenter,this.yCenter),i.rotate(r),i.textAlign="center",i.textBaseline="middle",this.ticks.forEach((r,o)=>{if(0===o&&!a.reverse)return;let l=n.setContext(this.getContext(o)),h=(0,s.O)(l.font);if(t=this.getDistanceFromCenterForValue(this.ticks[o].value),l.showLabelBackdrop){i.font=h.string,e=i.measureText(r.label).width,i.fillStyle=l.backdropColor;let a=(0,s.K)(l.backdropPadding);i.fillRect(-e/2-a.left,-t-h.size/2-a.top,e+a.width,h.size+a.height)}(0,s.M)(i,r.label,0,-t,h,{color:l.color})}),i.restore()}drawTitle(){}}eF.id="radialLinear",eF.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:I.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},eF.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},eF.descriptors={angleLines:{_fallback:"grid"}};let eV={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}},eB=Object.keys(eV);function eN(t,e){return t-e}function eH(t,e){if((0,s.k)(e))return null;let i=t._adapter,{parser:a,round:n,isoWeekday:r}=t._parseOpts,o=e;return("function"==typeof a&&(o=a(o)),(0,s.g)(o)||(o="string"==typeof a?i.parse(o,a):i.parse(o)),null===o)?null:(n&&(o="week"===n&&((0,s.x)(r)||!0===r)?i.startOf(o,"isoWeek",r):i.startOf(o,n)),+o)}function eW(t,e,i,s){let a=eB.length;for(let n=eB.indexOf(t);n=e?i[a]:i[n];t[r]=!0}}else t[e]=!0}function e$(t,e,i){let s,a;let n=[],r={},o=e.length;for(s=0;s=0&&(e[n].major=!0);return e}(t,n,r,i):n}class eU extends j{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){let i=t.time||(t.time={}),a=this._adapter=new X._date(t.adapters.date);a.init(e),(0,s.ac)(i.displayFormats,a.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:eH(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:a,max:n,minDefined:r,maxDefined:o}=this.getUserBounds();function l(t){r||isNaN(t.min)||(a=Math.min(a,t.min)),o||isNaN(t.max)||(n=Math.max(n,t.max))}r&&o||(l(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&l(this.getMinMax(!1))),a=(0,s.g)(a)&&!isNaN(a)?a:+e.startOf(Date.now(),i),n=(0,s.g)(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(a,n-1),this.max=Math.max(a+1,n)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,a="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);let n=this.min,r=this.max,o=(0,s.aN)(a,n,r);return this._unit=e.unit||(i.autoSkip?eW(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,i,s,a){for(let n=eB.length-1;n>=eB.indexOf(i);n--){let i=eB[n];if(eV[i].common&&t._adapter.diff(a,s,i)>=e-1)return i}return eB[i?eB.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=eB.indexOf(t)+1,i=eB.length;e+t.value))}initOffsets(t){let e,i,a=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),a=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;a=(0,s.E)(a,0,r),n=(0,s.E)(n,0,r),this._offsets={start:a,end:n,factor:1/(a+1+n)}}_generate(){let t,e;let i=this._adapter,a=this.min,n=this.max,r=this.options,o=r.time,l=o.unit||eW(o.minUnit,a,n,this._getLabelCapacity(a)),h=(0,s.v)(o.stepSize,1),d="week"===l&&o.isoWeekday,c=(0,s.x)(d)||!0===d,u={},g=a;if(c&&(g=+i.startOf(g,"isoWeek",d)),g=+i.startOf(g,c?"day":l),i.diff(n,a,l)>1e5*h)throw Error(a+" and "+n+" are too far apart with stepSize of "+h+" "+l);let p="data"===r.ticks.source&&this.getDataTimestamps();for(t=g,e=0;tt-e).map(t=>+t)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,a){let n=this.options,r=n.time.displayFormats,o=this._unit,l=this._majorUnit,h=o&&r[o],d=l&&r[l],c=i[e],u=l&&d&&c&&c.major,g=this._adapter.format(t,a||(u?d:h)),p=n.ticks.callback;return p?(0,s.C)(p,[g,e,i],this):g}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t=t[l].pos&&e<=t[h].pos&&({lo:l,hi:h}=(0,s.Z)(t,"pos",e)),{pos:a,time:r}=t[l],{pos:n,time:o}=t[h]):(e>=t[l].time&&e<=t[h].time&&({lo:l,hi:h}=(0,s.Z)(t,"time",e)),{time:a,pos:r}=t[l],{time:n,pos:o}=t[h]);let d=n-a;return d?r+(o-r)*(e-a)/d:r}eU.id="time",eU.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class eK extends eU{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=eY(e,this.min),this._tableRange=eY(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let e,i,s;let{min:a,max:n}=this,r=[],o=[];for(e=0,i=t.length;e=a&&s<=n&&r.push(s);if(r.length<2)return[{time:a,pos:0},{time:n,pos:1}];for(e=0,i=r.length;e