@xfers/design-system 7.1.0 → 8.0.0-dev.dfd424f601
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +6 -6
- package/cjs/index.js.map +1 -1
- package/dist/components/Carousel/index.js +7 -2
- package/dist/components/Carousel/index.js.map +1 -1
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Steps/DesktopSteps.js +20 -35
- package/dist/components/Steps/DesktopSteps.js.map +1 -1
- package/dist/components/Tabs/index.js +21 -2
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Timeline/index.js +11 -30
- package/dist/components/Timeline/index.js.map +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/types/components/Tabs/index.d.ts +4 -2
- package/es/index.js +6 -6
- package/es/index.js.map +1 -1
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -324,7 +324,7 @@ import*as tt from"react";import et,{createContext as nt,createElement as it,Frag
|
|
|
324
324
|
* https://www.chartjs.org
|
|
325
325
|
* (c) 2021 Chart.js Contributors
|
|
326
326
|
* Released under the MIT License
|
|
327
|
-
*/var $s=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const o=e.listeners[i],r=e.duration;o.forEach(i=>i({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(n-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=mo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const o=n.items;let r,a=o.length-1,s=!1;for(;a>=0;--a)r=o[a],r._active?(r._total>n.duration&&(n.duration=r._total),r.tick(t),s=!0):(o[a]=o[o.length-1],o.pop());s&&(i.draw(),this._notify(i,n,t,"progress")),o.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const Ts="transparent",As={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=Kr(t||Ts),o=i.valid&&Kr(e||Ts);return o&&o.valid?o.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class Ps{constructor(t,e,n,i){const o=e[n];i=Ca([t.to,i,o,t.from]);const r=Ca([t.from,o,i]);this._active=!0,this._fn=t.fn||As[t.type||typeof r],this._easing=br[t.easing]||br.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=r,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const i=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ca([t.to,e,i,t.from]),this._from=Ca([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,i=this._prop,o=this._from,r=this._loop,a=this._to;let s;if(this._active=o!==a&&(r||e<n),!this._active)return this._target[i]=a,void this._notify(!0);e<0?this._target[i]=o:(s=e/n%2,s=r&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[i]=this._fn(o,a,s))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}ia.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Rs=Object.keys(ia.animation);ia.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),ia.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),ia.describe("animations",{_fallback:"animation"}),ia.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 Ls{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ko(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const i=t[n];if(!ko(i))return;const o={};for(const t of Rs)o[t]=i[t];(wo(i.properties)&&i.properties||[n]).forEach(t=>{t!==n&&e.has(t)||e.set(t,o)})})}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(!n)return void(t.options=e);n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(t,n);if(!i)return[];const o=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e<i.length;e++){const o=t[i[e]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,i=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let s;for(s=r.length-1;s>=0;--s){const l=r[s];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(t,e));continue}const c=e[l];let d=o[l];const h=n.get(l);if(d){if(h&&d.active()){d.update(h,c,a);continue}d.cancel()}h&&h.duration?(o[l]=d=new Ps(h,t,l,c),i.push(d)):t[l]=c}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?($s.add(this._chart,n),!0):void 0}}function Ns(t,e){const n=t&&t.options||{},i=n.reverse,o=void 0===n.min?e:0,r=void 0===n.max?e:0;return{start:i?r:o,end:i?o:r}}function Is(t,e){const n=[],i=t._getSortedDatasetMetas(e);let o,r;for(o=0,r=i.length;o<r;++o)n.push(i[o].index);return n}function Fs(t,e,n,i={}){const o=t.keys,r="single"===i.mode;let a,s,l,c;if(null!==e){for(a=0,s=o.length;a<s;++a){if(l=+o[a],l===n){if(i.all)continue;break}c=t.values[l],So(c)&&(r||0===e||Jo(e)===Jo(c))&&(e+=c)}return e}}function zs(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function Bs(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function Ys(t,e,n,i){for(const o of e.getMatchingVisibleMetas(i).reverse()){const e=t[o.index];if(n&&e>0||!n&&e<0)return o.index}return null}function Vs(t,e){const{chart:n,_cachedMeta:i}=t,o=n._stacks||(n._stacks={}),{iScale:r,vScale:a,index:s}=i,l=r.axis,c=a.axis,d=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(r,a,i),h=e.length;let u;for(let t=0;t<h;++t){const n=e[t],{[l]:r,[c]:h}=n;u=(n._stacks||(n._stacks={}))[c]=Bs(o,d,r),u[s]=h,u._top=Ys(u,a,!0,i.type),u._bottom=Ys(u,a,!1,i.type)}}function Hs(t,e){const n=t.scales;return Object.keys(n).filter(t=>n[t].axis===e).shift()}function Ws(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n]}}}const js=t=>"reset"===t||"none"===t,Us=(t,e)=>e?t:Object.assign({},t);class Gs{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.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=zs(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Ws(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),i=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,o=e.xAxisID=Mo(n.xAxisID,Hs(t,"x")),r=e.yAxisID=Mo(n.yAxisID,Hs(t,"y")),a=e.rAxisID=Mo(n.rAxisID,Hs(t,"r")),s=e.indexAxis,l=e.iAxisID=i(s,o,r,a),c=e.vAxisID=i(s,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ra(this._data,this),t._stacked&&Ws(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(ko(e))this._data=function(t){const e=Object.keys(t),n=new Array(e.length);let i,o,r;for(i=0,o=e.length;i<o;++i)r=e[i],n[i]={x:r,y:t[r]};return n}(e);else if(n!==e){if(n){Ra(n,this);const t=this._cachedMeta;Ws(t),t._parsed=[]}e&&Object.isExtensible(e)&&(o=this,(i=e)._chartjs?i._chartjs.listeners.push(o):(Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[o]}}),Pa.forEach(t=>{const e="_onData"+zo(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...t){const o=n.apply(this,t);return i._chartjs.listeners.forEach(n=>{"function"==typeof n[e]&&n[e](...t)}),o}})}))),this._syncList=[],this._data=e}var i,o}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const o=e._stacked;e._stacked=zs(e.vScale,e),e.stack!==n.stack&&(i=!0,Ws(e),e.stack=n.stack),this._resyncElements(t),(i||o!==e._stacked)&&Vs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:i}=this,{iScale:o,_stacked:r}=n,a=o.axis;let s,l,c,d=0===t&&e===i.length||n._sorted,h=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=i,n._sorted=!0,c=i;else{c=wo(i[t])?this.parseArrayData(n,i,t,e):ko(i[t])?this.parseObjectData(n,i,t,e):this.parsePrimitiveData(n,i,t,e);const o=()=>null===l[a]||h&&l[a]<h[a];for(s=0;s<e;++s)n._parsed[s+t]=l=c[s],d&&(o()&&(d=!1),h=l);n._sorted=d}r&&Vs(this,c)}parsePrimitiveData(t,e,n,i){const{iScale:o,vScale:r}=t,a=o.axis,s=r.axis,l=o.getLabels(),c=o===r,d=new Array(i);let h,u,p;for(h=0,u=i;h<u;++h)p=h+n,d[h]={[a]:c||o.parse(l[p],p),[s]:r.parse(e[p],p)};return d}parseArrayData(t,e,n,i){const{xScale:o,yScale:r}=t,a=new Array(i);let s,l,c,d;for(s=0,l=i;s<l;++s)c=s+n,d=e[c],a[s]={x:o.parse(d[0],c),y:r.parse(d[1],c)};return a}parseObjectData(t,e,n,i){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(i);let c,d,h,u;for(c=0,d=i;c<d;++c)h=c+n,u=e[h],l[c]={x:o.parse(Fo(u,a),h),y:r.parse(Fo(u,s),h)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const i=this.chart,o=this._cachedMeta,r=e[t.axis];return Fs({keys:Is(i,!0),values:e._stacks[t.axis]},r,o.index,{mode:n})}updateRangeFromParsed(t,e,n,i){const o=n[e.axis];let r=null===o?NaN:o;const a=i&&n._stacks[e.axis];i&&a&&(i.values=a,r=Fs(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const n=this._cachedMeta,i=n._parsed,o=n._sorted&&t===n.iScale,r=i.length,a=this._getOtherScale(t),s=((t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Is(n,!0),values:null})(e,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=function(t){const{min:e,max:n,minDefined:i,maxDefined:o}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}(a);let h,u;function p(){u=i[h];const e=u[a.axis];return!So(u[t.axis])||c>e||d<e}for(h=0;h<r&&(p()||(this.updateRangeFromParsed(l,t,u,s),!o));++h);if(o)for(h=r-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(l,t,u,s);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,o,r;for(i=0,o=e.length;i<o;++i)r=e[i][t.axis],So(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,i=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,n,i,o;return ko(t)?(e=t.top,n=t.right,i=t.bottom,o=t.left):e=n=i=o=t,{top:e,right:n,bottom:i,left:o,disabled:!1===t}}(Mo(this.options.clip,function(t,e,n){if(!1===n)return!1;const i=Ns(t,n),o=Ns(e,n);return{top:o.end,right:i.end,bottom:o.start,left:i.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,i=n.data||[],o=e.chartArea,r=[],a=this._drawStart||0,s=this._drawCount||i.length-a,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(t,o,a,s),c=a;c<a+s;++c){const e=i[c];e.hidden||(e.active&&l?r.push(e):e.draw(t,o))}for(c=0;c<r.length;++c)r[c].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];o=e.$context||(e.$context=function(t,e,n){return Oa(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=function(t,e){return Oa(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const i="active"===e,o=this._cachedDataOpts,r=t+"-"+e,a=o[r],s=this.enableOptionSharing&&Bo(n);if(a)return Us(a,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],h=l.getOptionScopes(this.getDataset(),c),u=Object.keys(ia.elements[t]),p=l.resolveNamedOptions(h,u,()=>this.getContext(n,i),d);return p.$shared&&(p.$shared=s,o[r]=Object.freeze(Us(p,s))),p}_resolveAnimations(t,e,n){const i=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let s;if(!1!==i.options.animation){const i=this.chart.config,o=i.datasetAnimationScopeKeys(this._type,e),r=i.getOptionScopes(this.getDataset(),o);s=i.createResolver(r,this.getContext(t,n,e))}const l=new Ls(i,s&&s.animations);return s&&s._cacheable&&(o[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||js(t)||this.chart._animationsDisabled}updateElement(t,e,n,i){js(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!js(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const o=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[t,e,n]of this._syncList)this[t](e,n);this._syncList=[];const i=n.length,o=e.length,r=Math.min(o,i);r&&this.parse(0,r),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,e,n=!0){const i=this._cachedMeta,o=i.data,r=t+e;let a;const s=t=>{for(t.length+=e,a=t.length-1;a>=r;a--)t[a]=t[a-e]};for(s(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&s(i._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,i){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,e);n._stacked&&Ws(n,i)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,i]=t;this[e](n,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Xs(t){const e=t.iScale,n=function(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let i=[];for(let e=0,o=n.length;e<o;e++)i=i.concat(n[e].controller.getAllParsedValues(t));t._cache.$bar=La(i.sort((t,e)=>t-e))}return t._cache.$bar}(e,t.type);let i,o,r,a,s=e._length;const l=()=>{32767!==r&&-32768!==r&&(Bo(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(i=0,o=n.length;i<o;++i)r=e.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=e.ticks.length;i<o;++i)r=e.getPixelForTick(i),l();return s}function qs(t,e,n,i){return wo(t)?function(t,e,n,i){const o=n.parse(t[0],i),r=n.parse(t[1],i),a=Math.min(o,r),s=Math.max(o,r);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:o,end:r,min:a,max:s}}(t,e,n,i):e[n.axis]=n.parse(t,i),e}function Zs(t,e,n,i){const o=t.iScale,r=t.vScale,a=o.getLabels(),s=o===r,l=[];let c,d,h,u;for(c=n,d=n+i;c<d;++c)u=e[c],h={},h[o.axis]=s||o.parse(a[c],c),l.push(qs(u,h,r,c));return l}function Ks(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Js(t,e,n,i){let o=e.borderSkipped;const r={};if(!o)return void(t.borderSkipped=r);const{start:a,end:s,reverse:l,top:c,bottom:d}=function(t){let e,n,i,o,r;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(o="end",r="start"):(o="start",r="end"),{start:n,end:i,reverse:e,top:o,bottom:r}}(t);"middle"===o&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?o=c:(n._bottom||0)===i?o=d:(r[Qs(d,a,s,l)]=!0,o=c)),r[Qs(o,a,s,l)]=!0,t.borderSkipped=r}function Qs(t,e,n,i){var o,r,a;return i?(a=n,t=tl(t=(o=t)===(r=e)?a:o===a?r:o,n,e)):t=tl(t,e,n),t}function tl(t,e,n){return"start"===t?e:"end"===t?n:t}function el(t,{inflateAmount:e},n){t.inflateAmount="auto"===e?1===n?.33:0:e}Gs.defaults={},Gs.prototype.datasetElementType=null,Gs.prototype.dataElementType=null;class nl extends Gs{parsePrimitiveData(t,e,n,i){return Zs(t,e,n,i)}parseArrayData(t,e,n,i){return Zs(t,e,n,i)}parseObjectData(t,e,n,i){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===o.axis?a:s,c="x"===r.axis?a:s,d=[];let h,u,p,f;for(h=n,u=n+i;h<u;++h)f=e[h],p={},p[o.axis]=o.parse(Fo(f,l),h),d.push(qs(Fo(f,c),p,r,h));return d}updateRangeFromParsed(t,e,n,i){super.updateRangeFromParsed(t,e,n,i);const o=n._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:i}=e,o=this.getParsed(t),r=o._custom,a=Ks(r)?"["+r.start+", "+r.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,i){const o="reset"===i,{index:r,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),d=this.resolveDataElementOptions(e,i),h=this.getSharedOptions(d),u=this.includeOptions(i,h);this.updateSharedOptions(h,i,d);for(let d=e;d<e+n;d++){const e=this.getParsed(d),n=o||_o(e[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(d),p=this._calculateBarIndexPixels(d,c),f=(e._stacks||{})[a.axis],m={horizontal:l,base:n.base,enableBorderRadius:!f||Ks(e._custom)||r===f._top||r===f._bottom,x:l?n.head:p.center,y:l?p.center:n.head,height:l?p.size:Math.abs(n.size),width:l?Math.abs(n.size):p.size};u&&(m.options=h||this.resolveDataElementOptions(d,t[d].active?"active":i));const g=m.options||t[d].options;Js(m,g,f,r),el(m,g,c.ratio),this.updateElement(t[d],d,m,i)}}_getStacks(t,e){const n=this._cachedMeta.iScale,i=n.getMatchingVisibleMetas(this._type),o=n.options.stacked,r=i.length,a=[];let s,l;for(s=0;s<r;++s)if(l=i[s],l.controller.options.grouped){if(void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(_o(t)||isNaN(t))continue}if((!1===o||-1===a.indexOf(l.stack)||void 0===o&&void 0===l.stack)&&a.push(l.stack),l.index===t)break}return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const i=this._getStacks(t,n),o=void 0!==e?i.indexOf(e):-1;return-1===o?i.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,i=[];let o,r;for(o=0,r=e.data.length;o<r;++o)i.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const a=t.barThickness;return{min:a||Xs(e),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n},options:{base:i,minBarLength:o}}=this,r=i||0,a=this.getParsed(t),s=a._custom,l=Ks(s);let c,d,h=a[e.axis],u=0,p=n?this.applyStack(e,a,n):h;p!==h&&(u=p-h,p=h),l&&(h=s.barStart,p=s.barEnd-s.barStart,0!==h&&Jo(h)!==Jo(s.barEnd)&&(u=0),u+=h);const f=_o(i)||l?u:i;let m=e.getPixelForValue(f);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(u+p):m,d=c-m,Math.abs(d)<o&&(d=function(t,e,n){return 0!==t?Jo(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}(d,e,r)*o,h===r&&(m-=d/2),c=m+d),m===e.getPixelForValue(r)){const t=Jo(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const n=e.scale,i=this.options,o=i.skipNull,r=Mo(i.maxBarThickness,1/0);let a,s;if(e.grouped){const n=o?this._getStackCount(t):e.stackCount,l="flex"===i.barThickness?function(t,e,n,i){const o=e.pixels,r=o[t];let a=t>0?o[t-1]:null,s=t<o.length-1?o[t+1]:null;const l=n.categoryPercentage;null===a&&(a=r-(null===s?e.end-e.start:s-r)),null===s&&(s=r+r-a);const c=r-(r-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/i,ratio:n.barPercentage,start:c}}(t,e,i,n):function(t,e,n,i){const o=n.barThickness;let r,a;return _o(o)?(r=e.min*n.categoryPercentage,a=n.barPercentage):(r=o*i,a=1),{chunk:r/i,ratio:a,start:e.pixels[t]-r/2}}(t,e,i,n),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=l.start+l.chunk*c+l.chunk/2,s=Math.min(r,l.chunk*l.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),s=Math.min(r,e.min*e.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,i=n.length;let o=0;for(;o<i;++o)null!==this.getParsed(o)[e.axis]&&n[o].draw(this._ctx)}}nl.id="bar",nl.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},nl.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class il extends Gs{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,i){const o=super.parsePrimitiveData(t,e,n,i);for(let t=0;t<o.length;t++)o[t]._custom=this.resolveDataElementOptions(t+n).radius;return o}parseArrayData(t,e,n,i){const o=super.parseArrayData(t,e,n,i);for(let t=0;t<o.length;t++){const i=e[n+t];o[t]._custom=Mo(i[2],this.resolveDataElementOptions(t+n).radius)}return o}parseObjectData(t,e,n,i){const o=super.parseObjectData(t,e,n,i);for(let t=0;t<o.length;t++){const i=e[n+t];o[t]._custom=Mo(i&&i.r&&+i.r,this.resolveDataElementOptions(t+n).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:i}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=i.getLabelForValue(o.y),s=o._custom;return{label:e.label,value:"("+r+", "+a+(s?", "+s:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const o="reset"===i,{iScale:r,vScale:a}=this._cachedMeta,s=this.resolveDataElementOptions(e,i),l=this.getSharedOptions(s),c=this.includeOptions(i,l),d=r.axis,h=a.axis;for(let s=e;s<e+n;s++){const e=t[s],n=!o&&this.getParsed(s),l={},u=l[d]=o?r.getPixelForDecimal(.5):r.getPixelForValue(n[d]),p=l[h]=o?a.getBasePixel():a.getPixelForValue(n[h]);l.skip=isNaN(u)||isNaN(p),c&&(l.options=this.resolveDataElementOptions(s,e.active?"active":i),o&&(l.options.radius=0)),this.updateElement(e,s,l,i)}this.updateSharedOptions(l,i,s)}resolveDataElementOptions(t,e){const n=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return"active"!==e&&(i.radius=0),i.radius+=Mo(n&&n._custom,o),i}}il.id="bubble",il.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},il.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class ol extends Gs{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;if(!1===this._parsing)i._parsed=n;else{let o,r,a=t=>+n[t];if(ko(n[t])){const{key:t="value"}=this._parsing;a=e=>+Fo(n[e],t)}for(o=t,r=t+e;o<r;++o)i._parsed[o]=a(o)}}_getRotation(){return ir(this.options.rotation-90)}_getCircumference(){return ir(this.options.circumference)}_getRotationExtents(){let t=Wo,e=-Wo;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){const i=this.chart.getDatasetMeta(n).controller,o=i._getRotation(),r=i._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,i=this._cachedMeta,o=i.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-r)/2,0),s=Math.min((l=this.options.cutout,c=a,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:l/c),1);var l,c;const d=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:p,ratioY:f,offsetX:m,offsetY:g}=function(t,e,n){let i=1,o=1,r=0,a=0;if(e<Wo){const s=t,l=s+e,c=Math.cos(s),d=Math.sin(s),h=Math.cos(l),u=Math.sin(l),p=(t,e,i)=>hr(t,s,l,!0)?1:Math.max(e,e*n,i,i*n),f=(t,e,i)=>hr(t,s,l,!0)?-1:Math.min(e,e*n,i,i*n),m=p(0,c,h),g=p(Xo,d,u),b=f(Ho,c,h),x=f(Ho+Xo,d,u);i=(m-b)/2,o=(g-x)/2,r=-(m+b)/2,a=-(g+x)/2}return{ratioX:i,ratioY:o,offsetX:r,offsetY:a}}(u,h,s),b=(n.width-r)/p,x=(n.height-r)/f,y=Math.max(Math.min(b,x)/2,0),v=Do(this.options.radius,y),_=(v-Math.max(v*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*v,this.offsetY=g*v,i.total=this.calculateTotal(),this.outerRadius=v-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,i=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===i._parsed[t]||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Wo)}updateElements(t,e,n,i){const o="reset"===i,r=this.chart,a=r.chartArea,s=r.options.animation,l=(a.left+a.right)/2,c=(a.top+a.bottom)/2,d=o&&s.animateScale,h=d?0:this.innerRadius,u=d?0:this.outerRadius,p=this.resolveDataElementOptions(e,i),f=this.getSharedOptions(p),m=this.includeOptions(i,f);let g,b=this._getRotation();for(g=0;g<e;++g)b+=this._circumference(g,o);for(g=e;g<e+n;++g){const e=this._circumference(g,o),n=t[g],r={x:l+this.offsetX,y:c+this.offsetY,startAngle:b,endAngle:b+e,circumference:e,outerRadius:u,innerRadius:h};m&&(r.options=f||this.resolveDataElementOptions(g,n.active?"active":i)),b+=e,this.updateElement(n,g,r,i)}this.updateSharedOptions(f,i,p)}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,i=0;for(n=0;n<e.length;n++){const o=t._parsed[n];null===o||isNaN(o)||!this.chart.getDataVisibility(n)||e[n].hidden||(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Wo*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],o=ys(e._parsed[t],n.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let i,o,r,a,s;if(!t)for(i=0,o=n.data.datasets.length;i<o;++i)if(n.isDatasetVisible(i)){r=n.getDatasetMeta(i),t=r.data,a=r.controller;break}if(!t)return 0;for(i=0,o=t.length;i<o;++i)s=a.resolveDataElementOptions(i),"inner"!==s.borderAlign&&(e=Math.max(e,s.borderWidth||0,s.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,i=t.length;n<i;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(Mo(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ol.id="doughnut",ol.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},ol.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},ol.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map((e,i)=>{const o=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const n=": "+t.formattedValue;return wo(e)?(e=e.slice(),e[0]+=n):e+=n,e}}}}};class rl extends Gs{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:i=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:s}=function(t,e,n){const i=e.length;let o=0,r=i;if(t._sorted){const{iScale:a,_parsed:s}=t,l=a.axis,{min:c,max:d,minDefined:h,maxDefined:u}=a.getUserBounds();h&&(o=ur(Math.min(Ta(s,a.axis,c).lo,n?i:Ta(e,l,a.getPixelForValue(c)).lo),0,i-1)),r=u?ur(Math.max(Ta(s,a.axis,d).hi+1,n?0:Ta(e,l,a.getPixelForValue(d)).hi+1),o,i)-o:i-o}return{start:o,count:r}}(e,i,r);this._drawStart=a,this._drawCount=s,function(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,o={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=o,!0;const r=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,o),r}(e)&&(a=0,s=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=i;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:l},t),this.updateElements(i,a,s,t)}updateElements(t,e,n,i){const o="reset"===i,{iScale:r,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,i),d=this.getSharedOptions(c),h=this.includeOptions(i,d),u=r.axis,p=a.axis,{spanGaps:f,segment:m}=this.options,g=tr(f)?f:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||"none"===i;let x=e>0&&this.getParsed(e-1);for(let c=e;c<e+n;++c){const e=t[c],n=this.getParsed(c),f=b?e:{},y=_o(n[p]),v=f[u]=r.getPixelForValue(n[u],c),_=f[p]=o||y?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,n,s):n[p],c);f.skip=isNaN(v)||isNaN(_)||y,f.stop=c>0&&n[u]-x[u]>g,m&&(f.parsed=n,f.raw=l.data[c]),h&&(f.options=d||this.resolveDataElementOptions(c,e.active?"active":i)),b||this.updateElement(e,c,f,i),x=n}this.updateSharedOptions(d,i,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const o=i[0].size(this.resolveDataElementOptions(0)),r=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}rl.id="line",rl.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},rl.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class sl extends Gs{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],o=ys(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:o}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(i/2,0),r=(o-Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,n,i){const o="reset"===i,r=this.chart,a=this.getDataset(),s=r.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,d=l.yCenter,h=l.getIndexAngle(0)-.5*Ho;let u,p=h;const f=360/this.countVisibleElements();for(u=0;u<e;++u)p+=this._computeAngle(u,i,f);for(u=e;u<e+n;u++){const e=t[u];let n=p,m=p+this._computeAngle(u,i,f),g=r.getDataVisibility(u)?l.getDistanceFromCenterForValue(a.data[u]):0;p=m,o&&(s.animateScale&&(g=0),s.animateRotate&&(n=m=h));const b={x:c,y:d,innerRadius:0,outerRadius:g,startAngle:n,endAngle:m,options:this.resolveDataElementOptions(u,e.active?"active":i)};this.updateElement(e,u,b,i)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let n=0;return e.data.forEach((e,i)=>{!isNaN(t.data[i])&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?ir(this.resolveDataElementOptions(t,e).angle||n):0}}sl.id="polarArea",sl.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},sl.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map((e,i)=>{const o=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.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 ll extends ol{}ll.id="pie",ll.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class cl extends Gs{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}update(t){const e=this._cachedMeta,n=e.dataset,i=e.data||[],o=e.iScale.getLabels();if(n.points=i,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===i.length,options:e};this.updateElement(n,void 0,r,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,n,i){const o=this.getDataset(),r=this._cachedMeta.rScale,a="reset"===i;for(let s=e;s<e+n;s++){const e=t[s],n=this.resolveDataElementOptions(s,e.active?"active":i),l=r.getPointPositionForValue(s,o.data[s]),c=a?r.xCenter:l.x,d=a?r.yCenter:l.y,h={x:c,y:d,angle:l.angle,skip:isNaN(c)||isNaN(d),options:n};this.updateElement(e,s,h,i)}}}cl.id="radar",cl.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},cl.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class dl extends rl{}function hl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}dl.id="scatter",dl.defaults={showLine:!1,fill:!1},dl.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class ul{constructor(t){this.options=t||{}}formats(){return hl()}parse(t,e){return hl()}format(t,e){return hl()}add(t,e,n){return hl()}diff(t,e,n){return hl()}startOf(t,e,n){return hl()}endOf(t,e){return hl()}}ul.override=function(t){Object.assign(ul.prototype,t)};var pl={_date:ul};function fl(t,e){return"native"in t?{x:t.x,y:t.y}:cs(t,e)}function ml(t,e,n,i){const{controller:o,data:r,_sorted:a}=t,s=o._cachedMeta.iScale;if(s&&e===s.axis&&"r"!==e&&a&&r.length){const t=s._reversePixels?Aa:Ta;if(!i)return t(r,e,n);if(o._sharedOptions){const i=r[0],o="function"==typeof i.getRange&&i.getRange(e);if(o){const i=t(r,e,n-o),a=t(r,e,n+o);return{lo:i.lo,hi:a.hi}}}}return{lo:0,hi:r.length-1}}function gl(t,e,n,i,o){const r=t.getSortedVisibleDatasetMetas(),a=n[e];for(let t=0,n=r.length;t<n;++t){const{index:n,data:s}=r[t],{lo:l,hi:c}=ml(r[t],e,a,o);for(let t=l;t<=c;++t){const e=s[t];e.skip||i(e,n,t)}}}function bl(t,e,n,i){const o=[];if(!da(e,t.chartArea,t._minPadding))return o;return gl(t,n,e,function(t,n,r){t.inRange(e.x,e.y,i)&&o.push({element:t,datasetIndex:n,index:r})},!0),o}function xl(t,e,n,i,o){let r=[];const a=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){const o=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}(n);let s=Number.POSITIVE_INFINITY;return gl(t,n,e,function(n,l,c){const d=n.inRange(e.x,e.y,o);if(i&&!d)return;const h=n.getCenterPoint(o);if(!da(h,t.chartArea,t._minPadding)&&!d)return;const u=a(e,h);u<s?(r=[{element:n,datasetIndex:l,index:c}],s=u):u===s&&r.push({element:n,datasetIndex:l,index:c})}),r}function yl(t,e,n,i,o){return da(e,t.chartArea,t._minPadding)?"r"!==n||i?xl(t,e,n,i,o):function(t,e,n,i){let o=[];return gl(t,n,e,function(t,n,r){const{startAngle:a,endAngle:s}=t.getProps(["startAngle","endAngle"],i),{angle:l}=sr(t,{x:e.x,y:e.y});hr(l,a,s)&&o.push({element:t,datasetIndex:n,index:r})}),o}(t,e,n,o):[]}function vl(t,e,n,i){const o=fl(e,t),r=[],a=n.axis,s="x"===a?"inXRange":"inYRange";let l=!1;return function(t,e){const n=t.getSortedVisibleDatasetMetas();let i,o,r;for(let t=0,a=n.length;t<a;++t){({index:i,data:o}=n[t]);for(let t=0,n=o.length;t<n;++t)r=o[t],r.skip||e(r,i,t)}}(t,(t,e,n)=>{t[s](o[a],i)&&r.push({element:t,datasetIndex:e,index:n}),t.inRange(o.x,o.y,i)&&(l=!0)}),n.intersect&&!l?[]:r}var _l={modes:{index(t,e,n,i){const o=fl(e,t),r=n.axis||"x",a=n.intersect?bl(t,o,r,i):yl(t,o,r,!1,i),s=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,n=t.data[e];n&&!n.skip&&s.push({element:n,datasetIndex:t.index,index:e})}),s):[]},dataset(t,e,n,i){const o=fl(e,t),r=n.axis||"xy";let a=n.intersect?bl(t,o,r,i):yl(t,o,r,!1,i);if(a.length>0){const e=a[0].datasetIndex,n=t.getDatasetMeta(e).data;a=[];for(let t=0;t<n.length;++t)a.push({element:n[t],datasetIndex:e,index:t})}return a},point:(t,e,n,i)=>bl(t,fl(e,t),n.axis||"xy",i),nearest:(t,e,n,i)=>yl(t,fl(e,t),n.axis||"xy",n.intersect,i),x:(t,e,n,i)=>vl(t,e,{axis:"x",intersect:n.intersect},i),y:(t,e,n,i)=>vl(t,e,{axis:"y",intersect:n.intersect},i)}};const wl=["left","top","right","bottom"];function kl(t,e){return t.filter(t=>t.pos===e)}function Sl(t,e){return t.filter(t=>-1===wl.indexOf(t.pos)&&t.box.axis===e)}function El(t,e){return t.sort((t,n)=>{const i=e?n:t,o=e?t:n;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function Ml(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:i,stackWeight:o}=n;if(!t||!wl.includes(i))continue;const r=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return e}(t),{vBoxMaxWidth:i,hBoxMaxHeight:o}=e;let r,a,s;for(r=0,a=t.length;r<a;++r){s=t[r];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*i:a&&e.availableWidth,s.height=o):(s.width=i,s.height=c?c*o:a&&e.availableHeight)}return n}function Dl(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Cl(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 Ol(t,e,n,i){const{pos:o,box:r}=n,a=t.maxPadding;if(!ko(o)){n.size&&(t[o]-=n.size);const e=i[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?r.height:r.width),n.size=e.size/e.count,t[o]+=n.size}r.getPadding&&Cl(a,r.getPadding());const s=Math.max(0,e.outerWidth-Dl(a,t,"left","right")),l=Math.max(0,e.outerHeight-Dl(a,t,"top","bottom")),c=s!==t.w,d=l!==t.h;return t.w=s,t.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function $l(t,e){const n=e.maxPadding;function i(t){const i={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{i[t]=Math.max(e[t],n[t])}),i}return i(t?["left","right"]:["top","bottom"])}function Tl(t,e,n,i){const o=[];let r,a,s,l,c,d;for(r=0,a=t.length,c=0;r<a;++r){s=t[r],l=s.box,l.update(s.width||e.w,s.height||e.h,$l(s.horizontal,e));const{same:a,other:h}=Ol(e,n,s,i);c|=a&&o.length,d=d||h,l.fullSize||o.push(s)}return c&&Tl(o,e,n,i)||d}function Al(t,e,n,i,o){t.top=n,t.left=e,t.right=e+i,t.bottom=n+o,t.width=i,t.height=o}function Pl(t,e,n,i){const o=n.padding;let{x:r,y:a}=e;for(const s of t){const t=s.box,l=i[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const i=e.w*c,r=l.size||t.height;Bo(l.start)&&(a=l.start),t.fullSize?Al(t,o.left,a,n.outerWidth-o.right-o.left,r):Al(t,e.left+l.placed,a,i,r),l.start=a,l.placed+=i,a=t.bottom}else{const i=e.h*c,a=l.size||t.width;Bo(l.start)&&(r=l.start),t.fullSize?Al(t,r,o.top,a,n.outerHeight-o.bottom-o.top):Al(t,r,e.top+l.placed,a,i),l.start=r,l.placed+=i,r=t.right}}e.x=r,e.y=a}ia.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Rl={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const o=Ma(t.options.layout.padding),r=Math.max(e-o.width,0),a=Math.max(n-o.height,0),s=function(t){const e=function(t){const e=[];let n,i,o,r,a,s;for(n=0,i=(t||[]).length;n<i;++n)o=t[n],({position:r,options:{stack:a,stackWeight:s=1}}=o),e.push({index:n,box:o,pos:r,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&r+a,stackWeight:s});return e}(t),n=El(e.filter(t=>t.box.fullSize),!0),i=El(kl(e,"left"),!0),o=El(kl(e,"right")),r=El(kl(e,"top"),!0),a=El(kl(e,"bottom")),s=Sl(e,"x"),l=Sl(e,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:o.concat(l).concat(a).concat(s),chartArea:kl(e,"chartArea"),vertical:i.concat(o).concat(l),horizontal:r.concat(a).concat(s)}}(t.boxes),l=s.vertical,c=s.horizontal;Oo(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const d=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:o,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/d,hBoxMaxHeight:a/2}),u=Object.assign({},o);Cl(u,Ma(i));const p=Object.assign({maxPadding:u,w:r,h:a,x:o.left,y:o.top},o),f=Ml(l.concat(c),h);Tl(s.fullSize,p,h,f),Tl(l,p,h,f),Tl(c,p,h,f)&&Tl(l,p,h,f),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(p),Pl(s.leftAndTop,p,h,f),p.x+=p.w,p.y+=p.h,Pl(s.rightAndBottom,p,h,f),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Oo(s.chartArea,e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Ll{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}updateConfig(t){}}class Nl extends Ll{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Il="$chartjs",Fl={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},zl=t=>null===t||""===t;const Bl=!!ps&&{passive:!0};function Yl(t,e,n){t.canvas.removeEventListener(e,n,Bl)}function Vl(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Hl(t,e,n){const i=t.canvas,o=new MutationObserver(t=>{let e=!1;for(const n of t)e=e||Vl(n.addedNodes,i),e=e&&!Vl(n.removedNodes,i);e&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function Wl(t,e,n){const i=t.canvas,o=new MutationObserver(t=>{let e=!1;for(const n of t)e=e||Vl(n.removedNodes,i),e=e&&!Vl(n.addedNodes,i);e&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const jl=new Map;let Ul=0;function Gl(){const t=window.devicePixelRatio;t!==Ul&&(Ul=t,jl.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Xl(t,e,n){const i=t.canvas,o=i&&is(i);if(!o)return;const r=go((t,e)=>{const i=o.clientWidth;n(t,e),i<o.clientWidth&&n()},window),a=new ResizeObserver(t=>{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||r(n,i)});return a.observe(o),function(t,e){jl.size||window.addEventListener("resize",Gl),jl.set(t,e)}(t,r),a}function ql(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){jl.delete(t),jl.size||window.removeEventListener("resize",Gl)}(t)}function Zl(t,e,n){const i=t.canvas,o=go(e=>{null!==t.ctx&&n(function(t,e){const n=Fl[t.type]||t.type,{x:i,y:o}=cs(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==o?o:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,n){t.addEventListener(e,n,Bl)}(i,e,o),o}class Kl extends Ll{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),o=t.getAttribute("width");if(t[Il]={initial:{height:i,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",zl(o)){const e=fs(t,"width");void 0!==e&&(t.width=e)}if(zl(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=fs(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Il])return!1;const n=e[Il].initial;["height","width"].forEach(t=>{const i=n[t];_o(i)?e.removeAttribute(t):e.setAttribute(t,i)});const i=n.style||{};return Object.keys(i).forEach(t=>{e.style[t]=i[t]}),e.width=e.width,delete e[Il],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),o={attach:Hl,detach:Wl,resize:Xl}[e]||Zl;i[e]=o(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];if(!i)return;({attach:ql,detach:ql,resize:ql}[e]||Yl)(t,e,i),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return hs(t,e,n,i)}isAttached(t){const e=is(t);return!(!e||!e.isConnected)}}class Jl{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return tr(this.x)&&tr(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const i={};return t.forEach(t=>{i[t]=n[t]&&n[t].active()?n[t]._to:this[t]}),i}}Jl.defaults={},Jl.defaultRoutes=void 0;const Ql={values:t=>wo(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let o,r=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),r=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t));return n}(t,n)}const a=Ko(Math.abs(r)),s=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:o,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),ys(t,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=t/Math.pow(10,Math.floor(Ko(t)));return 1===i||2===i||5===i?Ql.numeric.call(this,t,e,n):""}};var tc={formatters:Ql};function ec(t,e){const n=t.options.ticks,i=n.maxTicksLimit||function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),o=t._maxLength/n;return Math.floor(Math.min(i,o))}(t),o=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}(e):[],r=o.length,a=o[0],s=o[r-1],l=[];if(r>i)return function(t,e,n,i){let o,r=0,a=n[0];for(i=Math.ceil(i),o=0;o<t.length;o++)o===a&&(e.push(t[o]),r++,a=n[r*i])}(e,l,o,r/i),l;const c=function(t,e,n){const i=function(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}(t),o=e.length/n;if(!i)return Math.max(o,1);const r=function(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i===0&&(e.push(i),e.push(t/i));return n===(0|n)&&e.push(n),e.sort((t,e)=>t-e).pop(),e}(i);for(let t=0,e=r.length-1;t<e;t++){const e=r[t];if(e>o)return e}return Math.max(o,1)}(o,e,i);if(r>0){let t,n;const i=r>1?Math.round((s-a)/(r-1)):null;for(nc(e,l,c,_o(i)?0:a-i,a),t=0,n=r-1;t<n;t++)nc(e,l,c,o[t],o[t+1]);return nc(e,l,c,s,_o(i)?e.length:s+i),l}return nc(e,l,c),l}function nc(t,e,n,i,o){const r=Mo(i,0),a=Math.min(Mo(o,t.length),t.length);let s,l,c,d=0;for(n=Math.ceil(n),o&&(s=o-i,n=s/Math.floor(s/n)),c=r;c<0;)d++,c=Math.round(r+d*n);for(l=Math.max(r,0);l<a;l++)l===c&&(e.push(t[l]),d++,c=Math.round(r+d*n))}ia.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.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:tc.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ia.route("scale.ticks","color","","color"),ia.route("scale.grid","color","","borderColor"),ia.route("scale.grid","borderColor","","borderColor"),ia.route("scale.title","color","","color"),ia.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),ia.describe("scales",{_fallback:"scale"}),ia.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const ic=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n;function oc(t,e){const n=[],i=t.length/e,o=t.length;let r=0;for(;r<o;r+=i)n.push(t[Math.floor(r)]);return n}function rc(t,e,n){const i=t.ticks.length,o=Math.min(e,i-1),r=t._startPixel,a=t._endPixel,s=1e-6;let l,c=t.getPixelForTick(o);if(!(n&&(l=1===i?Math.max(c-r,a-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(o-1))/2,c+=o<e?l:-l,c<r-s||c>a+s)))return c}function sc(t){return t.drawTicks?t.tickLength:0}function lc(t,e){if(!t.display)return 0;const n=Da(t.font,e),i=Ma(t.padding);return(wo(t.text)?t.text.length:1)*n.lineHeight+i.height}function cc(t,e,n){let i=bo(t);return(n&&"right"!==e||!n&&"right"===e)&&(i=(t=>"left"===t?"right":"right"===t?"left":t)(i)),i}class dc extends Jl{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=Eo(t,Number.POSITIVE_INFINITY),e=Eo(e,Number.NEGATIVE_INFINITY),n=Eo(n,Number.POSITIVE_INFINITY),i=Eo(i,Number.NEGATIVE_INFINITY),{min:Eo(t,n),max:Eo(e,i),minDefined:So(t),maxDefined:So(e)}}getMinMax(t){let e,{min:n,max:i,minDefined:o,maxDefined:r}=this.getUserBounds();if(o&&r)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)e=a[s].controller.getMinMax(this,t),o||(n=Math.min(n,e.min)),r||(i=Math.max(i,e.max));return n=r&&n>i?i:n,i=o&&n>i?n:i,{min:Eo(n,Eo(i,n)),max:Eo(i,Eo(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Co(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:i,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,n){const{min:i,max:o}=t,r=Do(e,(o-i)/2),a=(t,e)=>n&&0===t?0:t+e;return{min:a(i,-Math.abs(r)),max:a(o,r)}}(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?oc(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=ec(this,this.ticks),this._labelSizes=null),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,n=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,n=!n),this._startPixel=t,this._endPixel=e,this._reversePixels=n,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Co(this.options.afterUpdate,[this])}beforeSetDimensions(){Co(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Co(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Co(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Co(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,i,o;for(n=0,i=t.length;n<i;n++)o=t[n],o.label=Co(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){Co(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Co(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=this.ticks.length,i=e.minRotation||0,o=e.maxRotation;let r,a,s,l=i;if(!this._isVisible()||!e.display||i>=o||n<=1||!this.isHorizontal())return void(this.labelRotation=i);const c=this._getLabelSizes(),d=c.widest.width,h=c.highest.height,u=ur(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/n:u/(n-1),d+6>r&&(r=u/(n-(t.offset?.5:1)),a=this.maxHeight-sc(t.grid)-e.padding-lc(t.title,this.chart.options.font),s=Math.sqrt(d*d+h*h),l=or(Math.min(Math.asin(ur((c.highest.height+6)/r,-1,1)),Math.asin(ur(a/s,-1,1))-Math.asin(ur(h/s,-1,1)))),l=Math.max(i,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){Co(this.options.afterCalculateLabelRotation,[this])}beforeFit(){Co(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:i,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const r=lc(i,e.options.font);if(a?(t.width=this.maxWidth,t.height=sc(o)+r):(t.height=this.maxHeight,t.width=sc(o)+r),n.display&&this.ticks.length){const{first:e,last:i,widest:o,highest:r}=this._getLabelSizes(),s=2*n.padding,l=ir(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(a){const e=n.mirror?0:d*o.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{const e=n.mirror?0:c*o.width+d*r.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,i,d,c)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,i){const{ticks:{align:o,padding:r},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;s?l?(d=i*t.width,h=n*e.height):(d=n*t.height,h=i*e.width):"start"===o?h=e.width:"end"===o?d=t.width:(d=t.width/2,h=e.width/2),this.paddingLeft=Math.max((d-a+r)*this.width/(this.width-a),0),this.paddingRight=Math.max((h-c+r)*this.width/(this.width-c),0)}else{let n=e.height/2,i=t.height/2;"start"===o?(n=0,i=t.height):"end"===o&&(n=e.height,i=0),this.paddingTop=n+r,this.paddingBottom=i+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Co(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,n=t.length;e<n;e++)_o(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=oc(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length)}return t}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:i}=this,o=[],r=[];let a,s,l,c,d,h,u,p,f,m,g,b=0,x=0;for(a=0;a<e;++a){if(c=t[a].label,d=this._resolveTickFontOptions(a),n.font=h=d.string,u=i[h]=i[h]||{data:{},gc:[]},p=d.lineHeight,f=m=0,_o(c)||wo(c)){if(wo(c))for(s=0,l=c.length;s<l;++s)g=c[s],_o(g)||wo(g)||(f=oa(n,u.data,u.gc,f,g),m+=p)}else f=oa(n,u.data,u.gc,f,c),m=p;o.push(f),r.push(m),b=Math.max(f,b),x=Math.max(m,x)}!function(t,e){Oo(t,t=>{const n=t.gc,i=n.length/2;let o;if(i>e){for(o=0;o<i;++o)delete t.data[n[o]];n.splice(0,i)}})}(i,e);const y=o.indexOf(b),v=r.indexOf(x),_=t=>({width:o[t]||0,height:r[t]||0});return{first:_(0),last:_(e-1),widest:_(y),highest:_(v),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ur(this._alignToPixels?sa(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=function(t,e,n){return Oa(t,{tick:n,index:e,type:"tick"})}(this.getContext(),t,n))}return this.$context||(this.$context=Oa(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=ir(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,s=o?o.highest.height+r:0;return this.isHorizontal()?s*n>a*i?a/n:s/i:s*i<a*n?s/n:a/i}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,i=this.options,{grid:o,position:r}=i,a=o.offset,s=this.isHorizontal(),l=this.ticks.length+(a?1:0),c=sc(o),d=[],h=o.setContext(this.getContext()),u=h.drawBorder?h.borderWidth:0,p=u/2,f=function(t){return sa(n,t,u)};let m,g,b,x,y,v,_,w,k,S,E,M;if("top"===r)m=f(this.bottom),v=this.bottom-c,w=m-p,S=f(t.top)+p,M=t.bottom;else if("bottom"===r)m=f(this.top),S=t.top,M=f(t.bottom)-p,v=m+p,w=this.top+c;else if("left"===r)m=f(this.right),y=this.right-c,_=m-p,k=f(t.left)+p,E=t.right;else if("right"===r)m=f(this.left),k=t.left,E=f(t.right)-p,y=m+p,_=this.left+c;else if("x"===e){if("center"===r)m=f((t.top+t.bottom)/2+.5);else if(ko(r)){const t=Object.keys(r)[0],e=r[t];m=f(this.chart.scales[t].getPixelForValue(e))}S=t.top,M=t.bottom,v=m+p,w=v+c}else if("y"===e){if("center"===r)m=f((t.left+t.right)/2);else if(ko(r)){const t=Object.keys(r)[0],e=r[t];m=f(this.chart.scales[t].getPixelForValue(e))}y=m-p,_=y-c,k=t.left,E=t.right}const D=Mo(i.ticks.maxTicksLimit,l),C=Math.max(1,Math.ceil(l/D));for(g=0;g<l;g+=C){const t=o.setContext(this.getContext(g)),e=t.lineWidth,i=t.color,r=o.borderDash||[],l=t.borderDashOffset,c=t.tickWidth,h=t.tickColor,u=t.tickBorderDash||[],p=t.tickBorderDashOffset;b=rc(this,g,a),void 0!==b&&(x=sa(n,b,e),s?y=_=k=E=x:v=w=S=M=x,d.push({tx1:y,ty1:v,tx2:_,ty2:w,x1:k,y1:S,x2:E,y2:M,width:e,color:i,borderDash:r,borderDashOffset:l,tickWidth:c,tickColor:h,tickBorderDash:u,tickBorderDashOffset:p}))}return this._ticksLength=l,this._borderValue=m,d}_computeLabelItems(t){const e=this.axis,n=this.options,{position:i,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:c,mirror:d}=o,h=sc(n.grid),u=h+c,p=d?-c:u,f=-ir(this.labelRotation),m=[];let g,b,x,y,v,_,w,k,S,E,M,D,C="middle";if("top"===i)_=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===i)_=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===i){const t=this._getYAxisLabelAlignment(h);w=t.textAlign,v=t.x}else if("right"===i){const t=this._getYAxisLabelAlignment(h);w=t.textAlign,v=t.x}else if("x"===e){if("center"===i)_=(t.top+t.bottom)/2+u;else if(ko(i)){const t=Object.keys(i)[0],e=i[t];_=this.chart.scales[t].getPixelForValue(e)+u}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===i)v=(t.left+t.right)/2-u;else if(ko(i)){const t=Object.keys(i)[0],e=i[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(h).textAlign}"y"===e&&("start"===s?C="top":"end"===s&&(C="bottom"));const O=this._getLabelSizes();for(g=0,b=a.length;g<b;++g){x=a[g],y=x.label;const t=o.setContext(this.getContext(g));k=this.getPixelForTick(g)+o.labelOffset,S=this._resolveTickFontOptions(g),E=S.lineHeight,M=wo(y)?y.length:1;const e=M/2,n=t.color,s=t.textStrokeColor,c=t.textStrokeWidth;let h;if(r?(v=k,D="top"===i?"near"===l||0!==f?-M*E+E/2:"center"===l?-O.highest.height/2-e*E+E:-O.highest.height+E/2:"near"===l||0!==f?E/2:"center"===l?O.highest.height/2-e*E:O.highest.height-M*E,d&&(D*=-1)):(_=k,D=(1-M)*E/2),t.showLabelBackdrop){const e=Ma(t.backdropPadding),n=O.heights[g],i=O.widths[g];let o=_+D-e.top,r=v-e.left;switch(C){case"middle":o-=n/2;break;case"bottom":o-=n}switch(w){case"center":r-=i/2;break;case"right":r-=i}h={left:r,top:o,width:i+e.width,height:n+e.height,color:t.backdropColor}}m.push({rotation:f,label:y,font:S,color:n,strokeColor:s,strokeWidth:c,textOffset:D,textAlign:w,textBaseline:C,translation:[v,_],backdrop:h})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ir(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align&&(n="right"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:i,padding:o}}=this.options,r=t+o,a=this._getLabelSizes().widest.width;let s,l;return"left"===e?i?(l=this.right+o,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-r,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l=this.left)):"right"===e?i?(l=this.left+o,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+r,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:i,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,i,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(e=>e.value===t);if(n>=0){return e.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(e.display)for(o=0,r=i.length;o<r;++o){const t=i[o];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:n}}=this,i=n.setContext(this.getContext()),o=n.drawBorder?i.borderWidth:0;if(!o)return;const r=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let s,l,c,d;this.isHorizontal()?(s=sa(t,this.left,o)-o/2,l=sa(t,this.right,r)+r/2,c=d=a):(c=sa(t,this.top,o)-o/2,d=sa(t,this.bottom,r)+r/2,s=l=a),e.save(),e.lineWidth=i.borderWidth,e.strokeStyle=i.borderColor,e.beginPath(),e.moveTo(s,c),e.lineTo(l,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,n=this._computeLabelArea();n&&ha(e,n);const i=this._labelItems||(this._labelItems=this._computeLabelItems(t));let o,r;for(o=0,r=i.length;o<r;++o){const t=i[o],n=t.font,r=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),ma(e,r,0,t.textOffset,n,t)}n&&ua(e)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:i}}=this;if(!n.display)return;const o=Da(n.font),r=Ma(n.padding),a=n.align;let s=o.lineHeight/2;"bottom"===e||"center"===e||ko(e)?(s+=r.bottom,wo(n.text)&&(s+=o.lineHeight*(n.text.length-1))):s+=r.top;const{titleX:l,titleY:c,maxWidth:d,rotation:h}=function(t,e,n,i){const{top:o,left:r,bottom:a,right:s,chart:l}=t,{chartArea:c,scales:d}=l;let h,u,p,f=0;const m=a-o,g=s-r;if(t.isHorizontal()){if(u=xo(i,r,s),ko(n)){const t=Object.keys(n)[0],i=n[t];p=d[t].getPixelForValue(i)+m-e}else p="center"===n?(c.bottom+c.top)/2+m-e:ic(t,n,e);h=s-r}else{if(ko(n)){const t=Object.keys(n)[0],i=n[t];u=d[t].getPixelForValue(i)-g+e}else u="center"===n?(c.left+c.right)/2-g+e:ic(t,n,e);p=xo(i,a,o),f="left"===n?-Xo:Xo}return{titleX:u,titleY:p,maxWidth:h,rotation:f}}(this,s,e,a);ma(t,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:h,textAlign:cc(a,e,i),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=Mo(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===dc.prototype.draw?[{z:n,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let o,r;for(o=0,r=e.length;o<r;++o){const r=e[o];r[n]!==this.id||t&&r.type!==t||i.push(r)}return i}_resolveTickFontOptions(t){return Da(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class hc{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;(function(t){return"id"in t&&"defaults"in t})(e)&&(n=this.register(e));const i=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,function(t,e,n){const i=Ro(Object.create(null),[n?ia.get(n):{},ia.get(e),t.defaults]);ia.set(e,i),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(n=>{const i=n.split("."),o=i.pop(),r=[t].concat(i).join("."),a=e[n].split("."),s=a.pop(),l=a.join(".");ia.route(r,o,l,s)})}(e,t.defaultRoutes);t.descriptors&&ia.describe(e,t.descriptors)}(t,r,n),this.override&&ia.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in ia[i]&&(delete ia[i][n],this.override&&delete Qr[n])}}var uc=new class{constructor(){this.controllers=new hc(Gs,"datasets",!0),this.elements=new hc(Jl,"elements"),this.plugins=new hc(Object,"plugins"),this.scales=new hc(dc,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(e=>{const i=n||this._getRegistryForType(e);n||i.isForType(e)||i===this.plugins&&e.id?this._exec(t,i,e):Oo(e,e=>{const i=n||this._getRegistryForType(e);this._exec(t,i,e)})})}_exec(t,e,n){const i=zo(t);Co(n["before"+i],[],n),e[t](n),Co(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const i=e.get(t);if(void 0===i)throw new Error('"'+t+'" is not a registered '+n+".");return i}};class pc{constructor(){this._init=[]}notify(t,e,n,i){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),r=this._notify(o,t,e,n);return"afterDestroy"===e&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,n,i){i=i||{};for(const o of t){const t=o.plugin;if(!1===Co(t[n],[e,i,o.options],t)&&i.cancelable)return!1}return!0}invalidate(){_o(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=Mo(n.options&&n.options.plugins,{}),o=function(t){const e=[],n=Object.keys(uc.plugins.items);for(let t=0;t<n.length;t++)e.push(uc.getPlugin(n[t]));const i=t.plugins||[];for(let t=0;t<i.length;t++){const n=i[t];-1===e.indexOf(n)&&e.push(n)}return e}(n);return!1!==i||e?function(t,e,n,i){const o=[],r=t.getContext();for(let a=0;a<e.length;a++){const s=e[a],l=fc(n[s.id],i);null!==l&&o.push({plugin:s,options:mc(t.config,s,l,r)})}return o}(t,o,i,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,i=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function fc(t,e){return e||!1!==t?!0===t?{}:t:null}function mc(t,e,n,i){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return t.createResolver(r,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function gc(t,e){const n=ia.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function xc(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(n=e.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||t.charAt(0).toLowerCase();var n}function yc(t){const e=t.options||(t.options={});e.plugins=Mo(e.plugins,{}),e.scales=function(t,e){const n=Qr[t.type]||{scales:{}},i=e.scales||{},o=gc(t.type,e),r=Object.create(null),a=Object.create(null);return Object.keys(i).forEach(t=>{const e=i[t];if(!ko(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const s=xc(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(s,o),c=n.scales||{};r[s]=r[s]||t,a[t]=Lo(Object.create(null),[{axis:s},e,c[s],c[l]])}),t.data.datasets.forEach(n=>{const o=n.type||t.type,s=n.indexAxis||gc(o,e),l=(Qr[o]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,s),o=n[e+"AxisID"]||r[e]||e;a[o]=a[o]||Object.create(null),Lo(a[o],[{axis:e},i[o],l[t]])})}),Object.keys(a).forEach(t=>{const e=a[t];Lo(e,[ia.scales[e.type],ia.scale])}),a}(t,e)}function vc(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const _c=new Map,wc=new Set;function kc(t,e){let n=_c.get(t);return n||(n=e(),_c.set(t,n),wc.add(n)),n}const Sc=(t,e,n)=>{const i=Fo(e,n);void 0!==i&&t.add(i)};class Ec{constructor(t){this._config=function(t){return(t=t||{}).data=vc(t.data),yc(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=vc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),yc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return kc(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return kc(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return kc(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return kc(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:o}=this,r=this._cachedScopes(t,n),a=r.get(e);if(a)return a;const s=new Set;e.forEach(e=>{t&&(s.add(t),e.forEach(e=>Sc(s,t,e))),e.forEach(t=>Sc(s,i,t)),e.forEach(t=>Sc(s,Qr[o]||{},t)),e.forEach(t=>Sc(s,ia,t)),e.forEach(t=>Sc(s,ta,t))});const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),wc.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Qr[e]||{},ia.datasets[e]||{},{type:e},ia,ta]}resolveNamedOptions(t,e,n,i=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Mc(this._resolverCache,t,i);let s=r;if(function(t,e){const{isScriptable:n,isIndexable:i}=Fa(t);for(const o of e){const e=n(o),r=i(o),a=(r||e)&&t[o];if(e&&(Yo(a)||Dc(a))||r&&wo(a))return!0}return!1}(r,e)){o.$shared=!1;s=Ia(r,n=Yo(n)?n():n,this.createResolver(t,n,a))}for(const t of e)o[t]=s[t];return o}createResolver(t,e,n=[""],i){const{resolver:o}=Mc(this._resolverCache,t,n);return ko(e)?Ia(o,e,void 0,i):o}}function Mc(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const o=n.join();let r=i.get(o);if(!r){r={resolver:Na(e,n),subPrefixes:n.filter(t=>!t.toLowerCase().includes("hover"))},i.set(o,r)}return r}const Dc=t=>ko(t)&&Object.getOwnPropertyNames(t).reduce((e,n)=>e||Yo(t[n]),!1);const Cc=["top","bottom","left","right","chartArea"];function Oc(t,e){return"top"===t||"bottom"===t||-1===Cc.indexOf(t)&&"x"===e}function $c(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function Tc(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Co(n&&n.onComplete,[t],e)}function Ac(t){const e=t.chart,n=e.options.animation;Co(n&&n.onProgress,[t],e)}function Pc(t){return ns()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Rc={},Lc=t=>{const e=Pc(t);return Object.values(Rc).filter(t=>t.canvas===e).pop()};function Nc(t,e,n){const i=Object.keys(t);for(const o of i){const i=+o;if(i>=e){const r=t[o];delete t[o],(n>0||i>e)&&(t[i+n]=r)}}}class Ic{constructor(t,e){const n=this.config=new Ec(e),i=Pc(t),o=Lc(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(t){return!ns()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Nl:Kl}(i)),this.platform.updateConfig(n);const a=this.platform.acquireContext(i,r.aspectRatio),s=a&&a.canvas,l=s&&s.height,c=s&&s.width;this.id=vo(),this.ctx=a,this.canvas=s,this.width=c,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new pc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],Rc[this.id]=this,a&&s?($s.listen(this,"complete",Tc),$s.listen(this,"progress",Ac),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:o}=this;return _o(t)?e&&o?o:i?n/i: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():us(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return la(this.canvas,this.ctx),this}stop(){return $s.stop(this),this}resize(t,e){$s.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,i=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(i,t,e,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,us(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),Co(n.onResize,[this,r],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){Oo(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,i=Object.keys(n).reduce((t,e)=>(t[e]=!1,t),{});let o=[];e&&(o=o.concat(Object.keys(e).map(t=>{const n=e[t],i=xc(t,n),o="r"===i,r="x"===i;return{options:n,dposition:o?"chartArea":r?"bottom":"left",dtype:o?"radialLinear":r?"category":"linear"}}))),Oo(o,e=>{const o=e.options,r=o.id,a=xc(r,o),s=Mo(o.type,e.dtype);void 0!==o.position&&Oc(o.position,a)===Oc(e.dposition)||(o.position=e.dposition),i[r]=!0;let l=null;if(r in n&&n[r].type===s)l=n[r];else{l=new(uc.getScale(s))({id:r,type:s,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(o,t)}),Oo(i,(t,e)=>{t||delete n[e]}),Oo(n,t=>{Rl.configure(this,t,t.options),Rl.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((t,e)=>t.index-e.index),n>e){for(let t=e;t<n;++t)this._destroyDatasetMeta(t);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort($c("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,n)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=e.length;n<i;n++){const i=e[n];let o=this.getDatasetMeta(n);const r=i.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=r,o.indexAxis=i.indexAxis||gc(r,this.options),o.order=i.order||0,o.index=n,o.label=""+i.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const e=uc.getController(r),{datasetElementType:i,dataElementType:a}=ia.datasets[r];Object.assign(e.prototype,{dataElementType:uc.getElement(a),datasetElementType:i&&uc.getElement(i)}),o.controller=new e(this,n),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Oo(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),n=!i&&-1===o.indexOf(e);e.buildOrUpdateElements(n),r=Math.max(+e.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),i||Oo(o,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort($c("z","_idx"));const{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Oo(this.scales,t=>{Rl.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);Vo(e,n)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:o}of e){Nc(t,i,"_removeElements"===n?-o:o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),i=n(0);for(let t=1;t<e;t++)if(!Vo(i,n(t)))return;return Array.from(i).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Rl.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],Oo(this.boxes,t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Yo(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),i={meta:n,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",i)&&(n.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&($s.has(this)?this.attached&&!$s.running(this)&&$s.start(this):(this.draw(),Tc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let i,o;for(i=0,o=e.length;i<o;++i){const o=e[i];t&&!o.visible||n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,i=!n.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(i&&ha(e,{left:!1===n.left?0:o.left-n.left,right:!1===n.right?this.width:o.right+n.right,top:!1===n.top?0:o.top-n.top,bottom:!1===n.bottom?this.height:o.bottom+n.bottom}),t.controller.draw(),i&&ua(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,n,i){const o=_l.modes[e];return"function"==typeof o?o(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter(t=>t&&t._dataset===e).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=Oa(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const i=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,i);Bo(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(e=>e.datasetIndex===t?i:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),$s.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),la(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Rc[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(t,e,n)=>{t.offsetX=e,t.offsetY=n,this._eventHandler(t)};Oo(this.options.events,t=>n(t,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(n,i)=>{t[n]&&(e.removeEventListener(this,n,i),delete t[n])},o=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const a=()=>{i("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){Oo(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Oo(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let o,r,a,s;for("dataset"===e&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,s=t.length;a<s;++a){r=t[a];const e=r&&this.getDatasetMeta(r.datasetIndex).controller;e&&e[i+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:t,index:e})=>{const n=this.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[e],index:e}});!$o(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const i=this.options.hover,o=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),r=o(e,t),a=n?t:o(t,e);r.length&&this.updateHoverStyle(r,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:da(t,this.chartArea,this._minPadding)},i=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",n,i))return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:i=[],options:o}=this,r=e,a=this._getActiveElements(t,i,n,r),s=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,n,i){return n&&"mouseout"!==t.type?i?e:t:null}(t,this._lastEvent,n,s);n&&(this._lastEvent=null,Co(o.onHover,[t,a,this],this),s&&Co(o.onClick,[t,a,this],this));const c=!$o(a,i);return(c||e)&&(this._active=a,this._updateHoverStyles(a,i,e)),this._lastEvent=l,c}_getActiveElements(t,e,n,i){if("mouseout"===t.type)return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}const Fc=()=>Oo(Ic.instances,t=>t._plugins.invalidate()),zc=!0;function Bc(t,e,n){const{startAngle:i,pixelMargin:o,x:r,y:a,outerRadius:s,innerRadius:l}=e;let c=o/s;t.beginPath(),t.arc(r,a,s,i-c,n+c),l>o?(c=o/l,t.arc(r,a,l,n+c,i-c,!0)):t.arc(r,a,o,n+Xo,i-Xo),t.closePath(),t.clip()}function Yc(t,e,n,i){const o=ka(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const r=(n-e)/2,a=Math.min(r,i*e/2),s=t=>{const e=(n-Math.min(r,t))*i/2;return ur(t,0,Math.min(r,e))};return{outerStart:s(o.outerStart),outerEnd:s(o.outerEnd),innerStart:ur(o.innerStart,0,a),innerEnd:ur(o.innerEnd,0,a)}}function Vc(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function Hc(t,e,n,i,o){const{x:r,y:a,startAngle:s,pixelMargin:l,innerRadius:c}=e,d=Math.max(e.outerRadius+i+n-l,0),h=c>0?c+i+n+l:0;let u=0;const p=o-s;if(i){const t=((c>0?c-i:0)+(d>0?d-i:0))/2;u=(p-(0!==t?p*t/(t+i):p))/2}const f=(p-Math.max(.001,p*d-n/Ho)/d)/2,m=s+f+u,g=o-f-u,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=Yc(e,h,d,g-m),_=d-b,w=d-x,k=m+b/_,S=g-x/w,E=h+y,M=h+v,D=m+y/E,C=g-v/M;if(t.beginPath(),t.arc(r,a,d,k,S),x>0){const e=Vc(w,S,r,a);t.arc(e.x,e.y,x,S,g+Xo)}const O=Vc(M,g,r,a);if(t.lineTo(O.x,O.y),v>0){const e=Vc(M,C,r,a);t.arc(e.x,e.y,v,g+Xo,C+Math.PI)}if(t.arc(r,a,h,g-v/h,m+y/h,!0),y>0){const e=Vc(E,D,r,a);t.arc(e.x,e.y,y,D+Math.PI,m-Xo)}const $=Vc(_,m,r,a);if(t.lineTo($.x,$.y),b>0){const e=Vc(_,k,r,a);t.arc(e.x,e.y,b,m-Xo,k)}t.closePath()}function Wc(t,e,n,i,o){const{options:r}=e,{borderWidth:a,borderJoinStyle:s}=r,l="inner"===r.borderAlign;a&&(l?(t.lineWidth=2*a,t.lineJoin=s||"round"):(t.lineWidth=a,t.lineJoin=s||"bevel"),e.fullCircles&&function(t,e,n){const{x:i,y:o,startAngle:r,pixelMargin:a,fullCircles:s}=e,l=Math.max(e.outerRadius-a,0),c=e.innerRadius+a;let d;for(n&&Bc(t,e,r+Wo),t.beginPath(),t.arc(i,o,c,r+Wo,r,!0),d=0;d<s;++d)t.stroke();for(t.beginPath(),t.arc(i,o,l,r,r+Wo),d=0;d<s;++d)t.stroke()}(t,e,l),l&&Bc(t,e,o),Hc(t,e,n,i,o),t.stroke())}Object.defineProperties(Ic,{defaults:{enumerable:zc,value:ia},instances:{enumerable:zc,value:Rc},overrides:{enumerable:zc,value:Qr},registry:{enumerable:zc,value:uc},version:{enumerable:zc,value:"3.7.0"},getChart:{enumerable:zc,value:Lc},register:{enumerable:zc,value:(...t)=>{uc.add(...t),Fc()}},unregister:{enumerable:zc,value:(...t)=>{uc.remove(...t),Fc()}}});class jc extends Jl{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.getProps(["x","y"],n),{angle:o,distance:r}=sr(i,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),h=this.options.spacing/2,u=Mo(d,s-a)>=Wo||hr(o,a,s),p=pr(r,l+h,c+h);return u&&p}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:s,spacing:l}=this.options,c=(i+o)/2,d=(r+a+l+s)/2;return{x:e+Math.cos(c)*d,y:n+Math.sin(c)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,i=(e.offset||0)/2,o=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=n>Wo?Math.floor(n/Wo):0,0===n||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(i){r=i/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*r,Math.sin(e)*r),this.circumference>=Ho&&(r=i)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=function(t,e,n,i){const{fullCircles:o,startAngle:r,circumference:a}=e;let s=e.endAngle;if(o){Hc(t,e,n,i,r+Wo);for(let e=0;e<o;++e)t.fill();isNaN(a)||(s=r+a%Wo,a%Wo===0&&(s+=Wo))}return Hc(t,e,n,i,s),t.fill(),s}(t,this,r,o);Wc(t,this,r,o,a),t.restore()}}function Uc(t,e,n=e){t.lineCap=Mo(n.borderCapStyle,e.borderCapStyle),t.setLineDash(Mo(n.borderDash,e.borderDash)),t.lineDashOffset=Mo(n.borderDashOffset,e.borderDashOffset),t.lineJoin=Mo(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Mo(n.borderWidth,e.borderWidth),t.strokeStyle=Mo(n.borderColor,e.borderColor)}function Gc(t,e,n){t.lineTo(n.x,n.y)}function Xc(t,e,n={}){const i=t.length,{start:o=0,end:r=i-1}=n,{start:a,end:s}=e,l=Math.max(o,a),c=Math.min(r,s),d=o<a&&r<a||o>s&&r>s;return{count:i,start:l,loop:e.loop,ilen:c<l&&!d?i+c-l:c-l}}function qc(t,e,n,i){const{points:o,options:r}=e,{count:a,start:s,loop:l,ilen:c}=Xc(o,n,i),d=function(t){return t.stepped?pa:t.tension||"monotone"===t.cubicInterpolationMode?fa:Gc}(r);let h,u,p,{move:f=!0,reverse:m}=i||{};for(h=0;h<=c;++h)u=o[(s+(m?c-h:h))%a],u.skip||(f?(t.moveTo(u.x,u.y),f=!1):d(t,p,u,m,r.stepped),p=u);return l&&(u=o[(s+(m?c:0))%a],d(t,p,u,m,r.stepped)),!!l}function Zc(t,e,n,i){const o=e.points,{count:r,start:a,ilen:s}=Xc(o,n,i),{move:l=!0,reverse:c}=i||{};let d,h,u,p,f,m,g=0,b=0;const x=t=>(a+(c?s-t:t))%r,y=()=>{p!==f&&(t.lineTo(g,f),t.lineTo(g,p),t.lineTo(g,m))};for(l&&(h=o[x(0)],t.moveTo(h.x,h.y)),d=0;d<=s;++d){if(h=o[x(d)],h.skip)continue;const e=h.x,n=h.y,i=0|e;i===u?(n<p?p=n:n>f&&(f=n),g=(b*g+e)/++b):(y(),t.lineTo(e,n),u=i,b=0,p=f=n),m=n}y()}function Kc(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n)?Zc:qc}jc.id="arc",jc.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},jc.defaultRoutes={backgroundColor:"backgroundColor"};const Jc="function"==typeof Path2D;function Qc(t,e,n,i){Jc&&!e.options.segment?function(t,e,n,i){let o=e._path;o||(o=e._path=new Path2D,e.path(o,n,i)&&o.closePath()),Uc(t,e.options),t.stroke(o)}(t,e,n,i):function(t,e,n,i){const{segments:o,options:r}=e,a=Kc(e);for(const s of o)Uc(t,r,s.style),t.beginPath(),a(t,e,s,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}class td extends Jl{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;es(this._points,n,t,i,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=function(t,e){const n=t.points,i=t.options.spanGaps,o=n.length;if(!o)return[];const r=!!t._loop,{start:a,end:s}=function(t,e,n,i){let o=0,r=e-1;if(n&&!i)for(;o<e&&!t[o].skip;)o++;for(;o<e&&t[o].skip;)o++;for(o%=e,n&&(r+=o);r>o&&t[r%e].skip;)r--;return r%=e,{start:o,end:r}}(n,o,r,i);return Ds(t,!0===i?[{start:a,end:s,loop:r}]:function(t,e,n,i){const o=t.length,r=[];let a,s=e,l=t[e];for(a=e+1;a<=n;++a){const n=t[a%o];n.skip||n.stop?l.skip||(i=!1,r.push({start:e%o,end:(a-1)%o,loop:i}),e=s=n.stop?a:null):(s=a,l.skip&&(e=a)),l=n}return null!==s&&r.push({start:e%o,end:s%o,loop:i}),r}(n,a,s<a?s+o:s,!!t._fullLoop&&0===a&&s===o-1),n,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,i=t[e],o=this.points,r=Ms(this,{property:e,start:i,end:i});if(!r.length)return;const a=[],s=function(t){return t.stepped?gs:t.tension||"monotone"===t.cubicInterpolationMode?bs:ms}(n);let l,c;for(l=0,c=r.length;l<c;++l){const{start:c,end:d}=r[l],h=o[c],u=o[d];if(h===u){a.push(h);continue}const p=s(h,u,Math.abs((i-h[e])/(u[e]-h[e])),n.stepped);p[e]=t[e],a.push(p)}return 1===a.length?a[0]:a}pathSegment(t,e,n){return Kc(this)(t,this,e,n)}path(t,e,n){const i=this.segments,o=Kc(this);let r=this._loop;e=e||0,n=n||this.points.length-e;for(const a of i)r&=o(t,this,a,{start:e,end:e+n-1});return!!r}draw(t,e,n,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Qc(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ed(t,e,n,i){const o=t.options,{[n]:r}=t.getProps([n],i);return Math.abs(e-r)<o.radius+o.hitRadius}td.id="line",td.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},td.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},td.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class nd extends Jl{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.options,{x:o,y:r}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,e){return ed(this,t,"x",e)}inYRange(t,e){return ed(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const n=this.options;this.skip||n.radius<.1||!da(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,ca(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function id(t,e){const{x:n,y:i,base:o,width:r,height:a}=t.getProps(["x","y","base","width","height"],e);let s,l,c,d,h;return t.horizontal?(h=a/2,s=Math.min(n,o),l=Math.max(n,o),c=i-h,d=i+h):(h=r/2,s=n-h,l=n+h,c=Math.min(i,o),d=Math.max(i,o)),{left:s,top:c,right:l,bottom:d}}function od(t,e,n,i){return t?0:ur(e,n,i)}function rd(t){const e=id(t),n=e.right-e.left,i=e.bottom-e.top,o=function(t,e,n){const i=t.options.borderWidth,o=t.borderSkipped,r=Sa(i);return{t:od(o.top,r.top,0,n),r:od(o.right,r.right,0,e),b:od(o.bottom,r.bottom,0,n),l:od(o.left,r.left,0,e)}}(t,n/2,i/2),r=function(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,r=Ea(o),a=Math.min(e,n),s=t.borderSkipped,l=i||ko(o);return{topLeft:od(!l||s.top||s.left,r.topLeft,0,a),topRight:od(!l||s.top||s.right,r.topRight,0,a),bottomLeft:od(!l||s.bottom||s.left,r.bottomLeft,0,a),bottomRight:od(!l||s.bottom||s.right,r.bottomRight,0,a)}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:r},inner:{x:e.left+o.l,y:e.top+o.t,w:n-o.l-o.r,h:i-o.t-o.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,r.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(o.b,o.r))}}}}function sd(t,e,n,i){const o=null===e,r=null===n,a=t&&!(o&&r)&&id(t,i);return a&&(o||pr(e,a.left,a.right))&&(r||pr(n,a.top,a.bottom))}function ld(t,e){t.rect(e.x,e.y,e.w,e.h)}function cd(t,e,n={}){const i=t.x!==n.x?-e:0,o=t.y!==n.y?-e:0,r=(t.x+t.w!==n.x+n.w?e:0)-i,a=(t.y+t.h!==n.y+n.h?e:0)-o;return{x:t.x+i,y:t.y+o,w:t.w+r,h:t.h+a,radius:t.radius}}nd.id="point",nd.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},nd.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class dd extends Jl{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:n,backgroundColor:i}}=this,{inner:o,outer:r}=rd(this),a=(s=r.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?xa:ld;var s;t.save(),r.w===o.w&&r.h===o.h||(t.beginPath(),a(t,cd(r,e,o)),t.clip(),a(t,cd(o,-e,r)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,cd(o,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,n){return sd(this,t,e,n)}inXRange(t,e){return sd(this,t,null,e)}inYRange(t,e){return sd(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+i)/2:e,y:o?n:(n+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}function hd(t,e,n){const i=function(t){const e=t.options,n=e.fill;let i=Mo(n&&n.target,n);return void 0===i&&(i=!!e.backgroundColor),!1!==i&&null!==i&&(!0===i?"origin":i)}(t);if(ko(i))return!isNaN(i.value)&&i;let o=parseFloat(i);return So(o)&&Math.floor(o)===o?("-"!==i[0]&&"+"!==i[0]||(o=e+o),!(o===e||o<0||o>=n)&&o):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}dd.id="bar",dd.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},dd.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class ud{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:i,y:o,radius:r}=this;return e=e||{start:0,end:Wo},t.arc(i,o,r,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:i}=this,o=t.angle;return{x:e+Math.cos(o)*i,y:n+Math.sin(o)*i,angle:o}}}function pd(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:n}=t,i=e.options,o=e.getLabels().length,r=[],a=i.reverse?e.max:e.min,s=i.reverse?e.min:e.max;let l,c,d;if(d="start"===n?a:"end"===n?s:ko(n)?n.value:e.getBaseValue(),i.grid.circular)return c=e.getPointPositionForValue(0,a),new ud({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(d)});for(l=0;l<o;++l)r.push(e.getPointPositionForValue(l,d));return r}(t):function(t){const{scale:e={},fill:n}=t;let i,o=null;return"start"===n?o=e.bottom:"end"===n?o=e.top:ko(n)?o=e.getPixelForValue(n.value):e.getBasePixel&&(o=e.getBasePixel()),So(o)?(i=e.isHorizontal(),{x:i?o:null,y:i?null:o}):null}(t)}function fd(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function md(t,e,n){const i=[];for(let o=0;o<n.length;o++){const r=n[o],{first:a,last:s,point:l}=gd(r,e,"x");if(!(!l||a&&s))if(a)i.unshift(l);else if(t.push(l),!s)break}t.push(...i)}function gd(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const o=i[n],r=t.segments,a=t.points;let s=!1,l=!1;for(let t=0;t<r.length;t++){const e=r[t],i=a[e.start][n],c=a[e.end][n];if(pr(o,i,c)){s=o===i,l=o===c;break}}return{first:s,last:l,point:i}}function xd(t){const{chart:e,fill:n,line:i}=t;if(So(n))return function(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}(e,n);if("stack"===n)return function(t){const{scale:e,index:n,line:i}=t,o=[],r=i.segments,a=i.points,s=function(t,e){const n=[],i=t.getMatchingVisibleMetas("line");for(let t=0;t<i.length;t++){const o=i[t];if(o.index===e)break;o.hidden||n.unshift(o.dataset)}return n}(e,n);s.push(yd({x:null,y:e.bottom},i));for(let t=0;t<r.length;t++){const e=r[t];for(let t=e.start;t<=e.end;t++)md(o,a[t],s)}return new td({points:o,options:{}})}(t);if("shape"===n)return!0;const o=pd(t);return o instanceof ud?o:yd(o,i)}function yd(t,e){let n=[],i=!1;return wo(t)?(i=!0,n=t):n=function(t,e){const{x:n=null,y:i=null}=t||{},o=e.points,r=[];return e.segments.forEach(({start:t,end:e})=>{e=fd(t,e,o);const a=o[t],s=o[e];null!==i?(r.push({x:a.x,y:i}),r.push({x:s.x,y:i})):null!==n&&(r.push({x:n,y:a.y}),r.push({x:n,y:s.y}))}),r}(t,e),n.length?new td({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function vd(t,e,n){let i=t[e].fill;const o=[e];let r;if(!n)return i;for(;!1!==i&&-1===o.indexOf(i);){if(!So(i))return i;if(r=t[i],!r)return!1;if(r.visible)return i;o.push(i),i=r.fill}return!1}function _d(t,e,n){t.beginPath(),e.path(t),t.lineTo(e.last().x,n),t.lineTo(e.first().x,n),t.closePath(),t.clip()}function wd(t,e,n,i){if(i)return;let o=e[t],r=n[t];return"angle"===t&&(o=dr(o),r=dr(r)),{property:t,start:o,end:r}}function kd(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function Sd(t,e,n){const{top:i,bottom:o}=e.chart.chartArea,{property:r,start:a,end:s}=n||{};"x"===r&&(t.beginPath(),t.rect(a,i,s-a,o-i),t.clip())}function Ed(t,e,n,i){const o=e.interpolate(n,i);o&&t.lineTo(o.x,o.y)}function Md(t,e){const{line:n,target:i,property:o,color:r,scale:a}=e,s=function(t,e,n){const i=t.segments,o=t.points,r=e.points,a=[];for(const t of i){let{start:i,end:s}=t;s=fd(i,s,o);const l=wd(n,o[i],o[s],t.loop);if(!e.segments){a.push({source:t,target:l,start:o[i],end:o[s]});continue}const c=Ms(e,l);for(const e of c){const i=wd(n,r[e.start],r[e.end],e.loop),s=Es(t,o,i);for(const t of s)a.push({source:t,target:e,start:{[n]:kd(l,i,"start",Math.max)},end:{[n]:kd(l,i,"end",Math.min)}})}}return a}(n,i,o);for(const{source:e,target:l,start:c,end:d}of s){const{style:{backgroundColor:s=r}={}}=e,h=!0!==i;t.save(),t.fillStyle=s,Sd(t,a,h&&wd(o,c,d)),t.beginPath();const u=!!n.pathSegment(t,e);let p;if(h){u?t.closePath():Ed(t,i,d,o);const e=!!i.pathSegment(t,l,{move:u,reverse:!0});p=u&&e,p||Ed(t,i,c,o)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function Dd(t,e,n){const i=xd(e),{line:o,scale:r,axis:a}=e,s=o.options,l=s.fill,c=s.backgroundColor,{above:d=c,below:h=c}=l||{};i&&o.points.length&&(ha(t,n),function(t,e){const{line:n,target:i,above:o,below:r,area:a,scale:s}=e,l=n._loop?"angle":e.axis;t.save(),"x"===l&&r!==o&&(_d(t,i,a.top),Md(t,{line:n,target:i,color:o,scale:s,property:l}),t.restore(),t.save(),_d(t,i,a.bottom)),Md(t,{line:n,target:i,color:r,scale:s,property:l}),t.restore()}(t,{line:o,target:i,above:d,below:h,area:n,scale:r,axis:a}),ua(t))}var Cd={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,o=[];let r,a,s,l;for(a=0;a<i;++a)r=t.getDatasetMeta(a),s=r.dataset,l=null,s&&s.options&&s instanceof td&&(l={visible:t.isDatasetVisible(a),index:a,fill:hd(s,a,i),chart:t,axis:r.controller.options.indexAxis,scale:r.vScale,line:s}),r.$filler=l,o.push(l);for(a=0;a<i;++a)l=o[a],l&&!1!==l.fill&&(l.fill=vd(o,a,n.propagate))},beforeDraw(t,e,n){const i="beforeDraw"===n.drawTime,o=t.getSortedVisibleDatasetMetas(),r=t.chartArea;for(let e=o.length-1;e>=0;--e){const n=o[e].$filler;n&&(n.line.updateControlPoints(r,n.axis),i&&Dd(t.ctx,n,r))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=t.getSortedVisibleDatasetMetas();for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;n&&Dd(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;i&&!1!==i.fill&&"beforeDatasetDraw"===n.drawTime&&Dd(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Od=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}};class $d extends Jl{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Co(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,n)=>t.sort(e,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const n=t.labels,i=Da(n.font),o=i.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=Od(n,o);let l,c;e.font=i.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(r,o,a,s)+10):(c=this.maxHeight,l=this._fitCols(r,o,a,s)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,i){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=i+a;let d=t;o.textAlign="left",o.textBaseline="middle";let h=-1,u=-c;return this.legendItems.forEach((t,p)=>{const f=n+e/2+o.measureText(t.text).width;(0===p||l[l.length-1]+f+2*a>r)&&(d+=c,l[l.length-(p>0?0:1)]=0,u+=c,h++),s[p]={left:0,top:u,row:h,width:f,height:i},l[l.length-1]+=f+a}),d}_fitCols(t,e,n,i){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=r-t;let d=a,h=0,u=0,p=0,f=0;return this.legendItems.forEach((t,r)=>{const m=n+e/2+o.measureText(t.text).width;r>0&&u+i+2*a>c&&(d+=h+a,l.push({width:h,height:u}),p+=h+a,f++,h=u=0),s[r]={left:p,top:u,col:f,width:m,height:i},h=Math.max(h,m),u+=i+a}),d+=h,l.push({width:h,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:i},rtl:o}}=this,r=vs(o,this.left,this.width);if(this.isHorizontal()){let o=0,a=xo(n,this.left+i,this.right-this.lineWidths[o]);for(const s of e)o!==s.row&&(o=s.row,a=xo(n,this.left+i,this.right-this.lineWidths[o])),s.top+=this.top+t+i,s.left=r.leftForLtr(r.x(a),s.width),a+=s.width+i}else{let o=0,a=xo(n,this.top+t+i,this.bottom-this.columnSizes[o].height);for(const s of e)s.col!==o&&(o=s.col,a=xo(n,this.top+t+i,this.bottom-this.columnSizes[o].height)),s.top=a,s.left+=this.left+i,s.left=r.leftForLtr(r.x(s.left),s.width),a+=s.height+i}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;ha(t,this),this._draw(),ua(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:i}=this,{align:o,labels:r}=t,a=ia.color,s=vs(t.rtl,this.left,this.width),l=Da(r.font),{color:c,padding:d}=r,h=l.size,u=h/2;let p;this.drawTitle(),i.textAlign=s.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=l.string;const{boxWidth:f,boxHeight:m,itemHeight:g}=Od(r,h),b=this.isHorizontal(),x=this._computeTitleHeight();p=b?{x:xo(o,this.left+d,this.right-n[0]),y:this.top+d+x,line:0}:{x:this.left+d,y:xo(o,this.top+x+d,this.bottom-e[0].height),line:0},_s(this.ctx,t.textDirection);const y=g+d;this.legendItems.forEach((v,_)=>{i.strokeStyle=v.fontColor||c,i.fillStyle=v.fontColor||c;const w=i.measureText(v.text).width,k=s.textAlign(v.textAlign||(v.textAlign=r.textAlign)),S=f+u+w;let E=p.x,M=p.y;s.setWidth(this.width),b?_>0&&E+S+d>this.right&&(M=p.y+=y,p.line++,E=p.x=xo(o,this.left+d,this.right-n[p.line])):_>0&&M+y>this.bottom&&(E=p.x=E+e[p.line].width+d,p.line++,M=p.y=xo(o,this.top+x+d,this.bottom-e[p.line].height));!function(t,e,n){if(isNaN(f)||f<=0||isNaN(m)||m<0)return;i.save();const o=Mo(n.lineWidth,1);if(i.fillStyle=Mo(n.fillStyle,a),i.lineCap=Mo(n.lineCap,"butt"),i.lineDashOffset=Mo(n.lineDashOffset,0),i.lineJoin=Mo(n.lineJoin,"miter"),i.lineWidth=o,i.strokeStyle=Mo(n.strokeStyle,a),i.setLineDash(Mo(n.lineDash,[])),r.usePointStyle){const r={radius:f*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},a=s.xPlus(t,f/2);ca(i,r,a,e+u)}else{const r=e+Math.max((h-m)/2,0),a=s.leftForLtr(t,f),l=Ea(n.borderRadius);i.beginPath(),Object.values(l).some(t=>0!==t)?xa(i,{x:a,y:r,w:f,h:m,radius:l}):i.rect(a,r,f,m),i.fill(),0!==o&&i.stroke()}i.restore()}(s.x(E),M,v),E=((t,e,n,i)=>t===(i?"left":"right")?n:"center"===t?(e+n)/2:e)(k,E+f+u,b?E+S:this.right,t.rtl),function(t,e,n){ma(i,n.text,t,e+g/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(E),M,v),b?p.x+=S+d:p.y+=y}),ws(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=Da(e.font),i=Ma(e.padding);if(!e.display)return;const o=vs(t.rtl,this.left,this.width),r=this.ctx,a=e.position,s=n.size/2,l=i.top+s;let c,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+l,d=xo(t.align,d,this.right-h);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+xo(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=xo(a,d,d+h);r.textAlign=o.textAlign(bo(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,ma(r,e.text,u,c,n)}_computeTitleHeight(){const t=this.options.title,e=Da(t.font),n=Ma(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,i,o;if(pr(t,this.left,this.right)&&pr(e,this.top,this.bottom))for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(i=o[n],pr(t,i.left,i.left+i.width)&&pr(e,i.top,i.top+i.height))return this.legendItems[n];return null}handleEvent(t){const e=this.options;if(!function(t,e){if("mousemove"===t&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const i=this._hoveredItem,o=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(i,n);i&&!o&&Co(e.onLeave,[t,i,this],this),this._hoveredItem=n,n&&!o&&Co(e.onHover,[t,n,this],this)}else n&&Co(e.onClick,[t,n,this],this)}}var Td={id:"legend",_element:$d,start(t,e,n){const i=t.legend=new $d({ctx:t.ctx,options:n,chart:t});Rl.configure(t,i,n),Rl.addBox(t,i)},stop(t){Rl.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;Rl.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,o=n.chart;o.isDatasetVisible(i)?(o.hide(i),e.hidden=!0):(o.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:o,color:r}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const a=t.controller.getStyle(n?0:void 0),s=Ma(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:o||a.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)}}};const Ad={average(t){if(!t.length)return!1;let e,n,i=0,o=0,r=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();i+=t.x,o+=t.y,++r}}return{x:i/r,y:o/r}},nearest(t,e){if(!t.length)return!1;let n,i,o,r=e.x,a=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){const i=t[n].element;if(i&&i.hasValue()){const t=lr(e,i.getCenterPoint());t<s&&(s=t,o=i)}}if(o){const t=o.tooltipPosition();r=t.x,a=t.y}return{x:r,y:a}}};function Pd(t,e){return e&&(wo(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Rd(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Ld(t,e){const{element:n,datasetIndex:i,index:o}=e,r=t.getDatasetMeta(i).controller,{label:a,value:s}=r.getLabelAndValue(o);return{chart:t,label:a,parsed:r.getParsed(o),raw:t.data.datasets[i].data[o],formattedValue:s,dataset:r.getDataset(),dataIndex:o,datasetIndex:i,element:n}}function Nd(t,e){const n=t.chart.ctx,{body:i,footer:o,title:r}=t,{boxWidth:a,boxHeight:s}=e,l=Da(e.bodyFont),c=Da(e.titleFont),d=Da(e.footerFont),h=r.length,u=o.length,p=i.length,f=Ma(e.padding);let m=f.height,g=0,b=i.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,h&&(m+=h*c.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),b){m+=p*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(b-p)*l.lineHeight+(b-1)*e.bodySpacing}u&&(m+=e.footerMarginTop+u*d.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){g=Math.max(g,n.measureText(t).width+x)};return n.save(),n.font=c.string,Oo(t.title,y),n.font=l.string,Oo(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?a+2+e.boxPadding:0,Oo(i,t=>{Oo(t.before,y),Oo(t.lines,y),Oo(t.after,y)}),x=0,n.font=d.string,Oo(t.footer,y),n.restore(),g+=f.width,{width:g,height:m}}function Id(t,e,n,i){const{x:o,width:r}=n,{width:a,chartArea:{left:s,right:l}}=t;let c="center";return"center"===i?c=o<=(s+l)/2?"left":"right":o<=r/2?c="left":o>=a-r/2&&(c="right"),function(t,e,n,i){const{x:o,width:r}=i,a=n.caretSize+n.caretPadding;return"left"===t&&o+r+a>e.width||"right"===t&&o-r-a<0||void 0}(c,t,e,n)&&(c="center"),c}function Fd(t,e,n){const i=n.yAlign||e.yAlign||function(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}(t,n);return{xAlign:n.xAlign||e.xAlign||Id(t,e,n,i),yAlign:i}}function zd(t,e,n,i){const{caretSize:o,caretPadding:r,cornerRadius:a}=t,{xAlign:s,yAlign:l}=n,c=o+r,{topLeft:d,topRight:h,bottomLeft:u,bottomRight:p}=Ea(a);let f=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,s);const m=function(t,e,n){let{y:i,height:o}=t;return"top"===e?i+=n:i-="bottom"===e?o+n:o/2,i}(e,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=Math.max(d,u)+o:"right"===s&&(f+=Math.max(h,p)+o),{x:ur(f,0,i.width-e.width),y:ur(m,0,i.height-e.height)}}function Bd(t,e,n){const i=Ma(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function Yd(t){return Pd([],Rd(t))}function Vd(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}class Hd extends Jl{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&e.options.animation&&n.animations,o=new Ls(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,n=this._tooltipItems,Oa(t,{tooltip:e,tooltipItems:n,type:"tooltip"})));var t,e,n}getTitle(t,e){const{callbacks:n}=e,i=n.beforeTitle.apply(this,[t]),o=n.title.apply(this,[t]),r=n.afterTitle.apply(this,[t]);let a=[];return a=Pd(a,Rd(i)),a=Pd(a,Rd(o)),a=Pd(a,Rd(r)),a}getBeforeBody(t,e){return Yd(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:n}=e,i=[];return Oo(t,t=>{const e={before:[],lines:[],after:[]},o=Vd(n,t);Pd(e.before,Rd(o.beforeLabel.call(this,t))),Pd(e.lines,o.label.call(this,t)),Pd(e.after,Rd(o.afterLabel.call(this,t))),i.push(e)}),i}getAfterBody(t,e){return Yd(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:n}=e,i=n.beforeFooter.apply(this,[t]),o=n.footer.apply(this,[t]),r=n.afterFooter.apply(this,[t]);let a=[];return a=Pd(a,Rd(i)),a=Pd(a,Rd(o)),a=Pd(a,Rd(r)),a}_createItems(t){const e=this._active,n=this.chart.data,i=[],o=[],r=[];let a,s,l=[];for(a=0,s=e.length;a<s;++a)l.push(Ld(this.chart,e[a]));return t.filter&&(l=l.filter((e,i,o)=>t.filter(e,i,o,n))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,n))),Oo(l,e=>{const n=Vd(t.callbacks,e);i.push(n.labelColor.call(this,e)),o.push(n.labelPointStyle.call(this,e)),r.push(n.labelTextColor.call(this,e))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),i=this._active;let o,r=[];if(i.length){const t=Ad[n.position].call(this,i,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);const e=this._size=Nd(this,n),a=Object.assign({},t,e),s=Fd(this.chart,n,a),l=zd(n,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,o={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,i){const o=this.getCaretPosition(t,n,i);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:d}=Ea(a),{x:h,y:u}=t,{width:p,height:f}=e;let m,g,b,x,y,v;return"center"===o?(y=u+f/2,"left"===i?(m=h,g=m-r,x=y+r,v=y-r):(m=h+p,g=m+r,x=y-r,v=y+r),b=m):(g="left"===i?h+Math.max(s,c)+r:"right"===i?h+p-Math.max(l,d)-r:this.caretX,"top"===o?(x=u,y=x-r,m=g-r,b=g+r):(x=u+f,y=x+r,m=g+r,b=g-r),v=x),{x1:m,x2:g,x3:b,y1:x,y2:y,y3:v}}drawTitle(t,e,n){const i=this.title,o=i.length;let r,a,s;if(o){const l=vs(n.rtl,this.x,this.width);for(t.x=Bd(this,n.titleAlign,n),e.textAlign=l.textAlign(n.titleAlign),e.textBaseline="middle",r=Da(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=r.string,s=0;s<o;++s)e.fillText(i[s],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,s+1===o&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,i,o){const r=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:s,boxWidth:l,boxPadding:c}=o,d=Da(o.bodyFont),h=Bd(this,"left",o),u=i.x(h),p=s<d.lineHeight?(d.lineHeight-s)/2:0,f=e.y+p;if(o.usePointStyle){const e={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=i.leftForLtr(u,l)+l/2,c=f+s/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ca(t,e,n,c),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ca(t,e,n,c)}else{t.lineWidth=r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const e=i.leftForLtr(u,l-c),n=i.leftForLtr(i.xPlus(u,1),l-c-2),a=Ea(r.borderRadius);Object.values(a).some(t=>0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,xa(t,{x:e,y:f,w:l,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),xa(t,{x:n,y:f+1,w:l-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,f,l,s),t.strokeRect(e,f,l,s),t.fillStyle=r.backgroundColor,t.fillRect(n,f+1,l-2,s-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:i}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:c}=n,d=Da(n.bodyFont);let h=d.lineHeight,u=0;const p=vs(n.rtl,this.x,this.width),f=function(n){e.fillText(n,p.x(t.x+u),t.y+h/2),t.y+=h+o},m=p.textAlign(r);let g,b,x,y,v,_,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Bd(this,m,n),e.fillStyle=n.bodyColor,Oo(this.beforeBody,f),u=a&&"right"!==m?"center"===r?l/2+c:l+2+c:0,y=0,_=i.length;y<_;++y){for(g=i[y],b=this.labelTextColors[y],e.fillStyle=b,Oo(g.before,f),x=g.lines,a&&x.length&&(this._drawColorBox(e,t,y,p,n),h=Math.max(d.lineHeight,s)),v=0,w=x.length;v<w;++v)f(x[v]),h=d.lineHeight;Oo(g.after,f)}u=0,h=d.lineHeight,Oo(this.afterBody,f),t.y-=o}drawFooter(t,e,n){const i=this.footer,o=i.length;let r,a;if(o){const s=vs(n.rtl,this.x,this.width);for(t.x=Bd(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=s.textAlign(n.footerAlign),e.textBaseline="middle",r=Da(n.footerFont),e.fillStyle=n.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(i[a],s.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,e,n,i){const{xAlign:o,yAlign:r}=this,{x:a,y:s}=t,{width:l,height:c}=n,{topLeft:d,topRight:h,bottomLeft:u,bottomRight:p}=Ea(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(a+d,s),"top"===r&&this.drawCaret(t,e,n,i),e.lineTo(a+l-h,s),e.quadraticCurveTo(a+l,s,a+l,s+h),"center"===r&&"right"===o&&this.drawCaret(t,e,n,i),e.lineTo(a+l,s+c-p),e.quadraticCurveTo(a+l,s+c,a+l-p,s+c),"bottom"===r&&this.drawCaret(t,e,n,i),e.lineTo(a+u,s+c),e.quadraticCurveTo(a,s+c,a,s+c-u),"center"===r&&"left"===o&&this.drawCaret(t,e,n,i),e.lineTo(a,s+d),e.quadraticCurveTo(a,s,a+d,s),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,i=n&&n.x,o=n&&n.y;if(i||o){const n=Ad[t.position].call(this,this._active,this._eventPosition);if(!n)return;const r=this._size=Nd(this,t),a=Object.assign({},n,this._size),s=Fd(e,t,a),l=zd(t,a,s,e);i._to===l.x&&o._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=r.width,this.height=r.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const r=Ma(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,i,e),_s(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),ws(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,i=t.map(({datasetIndex:t,index:e})=>{const n=this.chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}),o=!$o(n,i),r=this._positionChanged(i,e);(o||r)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,n),a=this._positionChanged(r,t),s=e||!$o(r,o)||a;return s&&(this._active=r,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}_getActiveElements(t,e,n,i){const o=this.options;if("mouseout"===t.type)return[];if(!i)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:n,caretY:i,options:o}=this,r=Ad[o.position].call(this,t,e);return!1!==r&&(n!==r.x||i!==r.y)}}Hd.positioners=Ad;var Wd={id:"tooltip",_element:Hd,positioners:Ad,afterInit(t,e,n){n&&(t.tooltip=new Hd({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip,n={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",n)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n))},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,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:yo,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:yo,beforeBody:yo,beforeLabel:yo,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return _o(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:yo,afterBody:yo,beforeFooter:yo,footer:yo,afterFooter:yo}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function jd(t,e,n,i){const o=t.indexOf(e);if(-1===o)return((t,e,n,i)=>("string"==typeof e?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n))(t,e,n,i);return o!==t.lastIndexOf(e)?n:o}class Ud extends dc{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:n,label:i}of e)t[n]===i&&t.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(_o(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:ur(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:jd(n,t,Mo(e,t),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(n=0),e||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,i=[];let o=this.getLabels();o=0===t&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=t;n<=e;n++)i.push({value:n});return i}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Gd(t,e){const n=[],{bounds:i,step:o,min:r,max:a,precision:s,count:l,maxTicks:c,maxDigits:d,includeBounds:h}=t,u=o||1,p=c-1,{min:f,max:m}=e,g=!_o(r),b=!_o(a),x=!_o(l),y=(m-f)/(d+1);let v,_,w,k,S=Qo((m-f)/p/u)*u;if(S<1e-14&&!g&&!b)return[{value:f},{value:m}];k=Math.ceil(m/S)-Math.floor(f/S),k>p&&(S=Qo(k*S/p/u)*u),_o(s)||(v=Math.pow(10,s),S=Math.ceil(S*v)/v),"ticks"===i?(_=Math.floor(f/S)*S,w=Math.ceil(m/S)*S):(_=f,w=m),g&&b&&o&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((a-r)/o,S/1e3)?(k=Math.round(Math.min((a-r)/S,c)),S=(a-r)/k,_=r,w=a):x?(_=g?r:_,w=b?a:w,k=l-1,S=(w-_)/k):(k=(w-_)/S,k=er(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const E=Math.max(rr(S),rr(_));v=Math.pow(10,_o(s)?E:s),_=Math.round(_*v)/v,w=Math.round(w*v)/v;let M=0;for(g&&(h&&_!==r?(n.push({value:r}),_<r&&M++,er(Math.round((_+M*S)*v)/v,r,Xd(r,y,t))&&M++):_<r&&M++);M<k;++M)n.push({value:Math.round((_+M*S)*v)/v});return b&&h&&w!==a?n.length&&er(n[n.length-1].value,a,Xd(a,y,t))?n[n.length-1].value=a:n.push({value:a}):b&&w!==a||n.push({value:w}),n}function Xd(t,e,{horizontal:n,minRotation:i}){const o=ir(i),r=(n?Math.sin(o):Math.cos(o))||.001,a=.75*e*(""+t).length;return Math.min(e/r,a)}Ud.id="category",Ud.defaults={ticks:{callback:Ud.prototype.getLabelForValue}};class qd extends dc{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 _o(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:o}=this;const r=t=>i=e?i:t,a=t=>o=n?o:t;if(t){const t=Jo(i),e=Jo(o);t<0&&e<0?a(0):t>0&&e>0&&r(0)}if(i===o){let e=1;(o>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*o)),a(o+e),t||r(i-e)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:n,stepSize:i}=t;return i?(e=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i=Gd({maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&nr(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-e)/Math.max(t.length-1,1)/2;e-=i,n+=i}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return ys(t,this.chart.options.locale,this.options.ticks.format)}}class Zd extends qd{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=So(t)?t:0,this.max=So(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=ir(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Kd(t){return 1===t/Math.pow(10,Math.floor(Ko(t)))}Zd.id="linear",Zd.defaults={ticks:{callback:tc.formatters.numeric}};class Jd extends dc{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=qd.prototype.parse.apply(this,[t,e]);if(0!==n)return So(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=So(t)?Math.max(0,t):null,this.max=So(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,i=this.max;const o=e=>n=t?n:e,r=t=>i=e?i:t,a=(t,e)=>Math.pow(10,Math.floor(Ko(t))+e);n===i&&(n<=0?(o(1),r(10)):(o(a(n,-1)),r(a(i,1)))),n<=0&&o(a(i,-1)),i<=0&&r(a(n,1)),this._zero&&this.min!==this._suggestedMin&&n===a(this.min,0)&&o(a(n,-1)),this.min=n,this.max=i}buildTicks(){const t=this.options,e=function(t,e){const n=Math.floor(Ko(e.max)),i=Math.ceil(e.max/Math.pow(10,n)),o=[];let r=Eo(t.min,Math.pow(10,Math.floor(Ko(e.min)))),a=Math.floor(Ko(r)),s=Math.floor(r/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{o.push({value:r,major:Kd(r)}),++s,10===s&&(s=1,++a,l=a>=0?1:l),r=Math.round(s*Math.pow(10,a)*l)/l}while(a<n||a===n&&s<i);const c=Eo(t.max,r);return o.push({value:c,major:Kd(r)}),o}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&nr(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ys(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ko(t),this._valueRange=Ko(this.max)-Ko(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ko(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Qd(t){const e=t.ticks;if(e.display&&t.display){const t=Ma(e.backdropPadding);return Mo(e.font&&e.font.size,ia.font.size)+t.height}return 0}function th(t,e,n){return n=wo(n)?n:[n],{w:ra(t,e.string,n),h:n.length*e.lineHeight}}function eh(t,e,n,i,o){return t===i||t===o?{start:e-n/2,end:e+n/2}:t<i||t>o?{start:e-n,end:e}:{start:e,end:e+n}}function nh(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],o=[],r=t._pointLabels.length,a=t.options.pointLabels,s=a.centerPointLabels?Ho/r:0;for(let l=0;l<r;l++){const r=a.setContext(t.getPointLabelContext(l));o[l]=r.padding;const c=t.getPointPosition(l,t.drawingArea+o[l],s),d=Da(r.font),h=th(t.ctx,d,t._pointLabels[l]);i[l]=h;const u=dr(t.getIndexAngle(l)+s),p=Math.round(or(u));ih(n,e,u,eh(p,c.x,h.w,0,180),eh(p,c.y,h.h,90,270))}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=function(t,e,n){const i=[],o=t._pointLabels.length,r=t.options,a=Qd(r)/2,s=t.drawingArea,l=r.pointLabels.centerPointLabels?Ho/o:0;for(let r=0;r<o;r++){const o=t.getPointPosition(r,s+a+n[r],l),c=Math.round(or(dr(o.angle+Xo))),d=e[r],h=sh(o.y,d.h,c),u=oh(c),p=rh(o.x,d.w,u);i.push({x:o.x,y:h,textAlign:u,left:p,top:h,right:p+d.w,bottom:h+d.h})}return i}(t,i,o)}function ih(t,e,n,i,o){const r=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let s=0,l=0;i.start<e.l?(s=(e.l-i.start)/r,t.l=Math.min(t.l,e.l-s)):i.end>e.r&&(s=(i.end-e.r)/r,t.r=Math.max(t.r,e.r+s)),o.start<e.t?(l=(e.t-o.start)/a,t.t=Math.min(t.t,e.t-l)):o.end>e.b&&(l=(o.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function oh(t){return 0===t||180===t?"center":t<180?"left":"right"}function rh(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function sh(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}function lh(t,e,n,i){const{ctx:o}=t;if(n)o.arc(t.xCenter,t.yCenter,e,0,Wo);else{let n=t.getPointPosition(0,e);o.moveTo(n.x,n.y);for(let r=1;r<i;r++)n=t.getPointPosition(r,e),o.lineTo(n.x,n.y)}}Jd.id="logarithmic",Jd.defaults={ticks:{callback:tc.formatters.logarithmic,major:{enabled:!0}}};class ch extends qd{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ma(Qd(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=So(t)&&!isNaN(t)?t:0,this.max=So(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Qd(this.options))}generateTickLabels(t){qd.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const n=Co(this.options.pointLabels.callback,[t,e],this);return n||0===n?n:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?nh(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,i))}getIndexAngle(t){return dr(t*(Wo/(this._pointLabels.length||1))+ir(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(_o(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(_o(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return function(t,e,n){return Oa(t,{label:n,index:e,type:"pointLabel"})}(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const i=this.getIndexAngle(t)-Xo+n;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:i,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),lh(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:i}=e,o=this._pointLabels.length;let r,a,s;if(e.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let o=e-1;o>=0;o--){const e=i.setContext(t.getPointLabelContext(o)),r=Da(e.font),{x:a,y:s,textAlign:l,left:c,top:d,right:h,bottom:u}=t._pointLabelItems[o],{backdropColor:p}=e;if(!_o(p)){const t=Ma(e.backdropPadding);n.fillStyle=p,n.fillRect(c-t.left,d-t.top,h-c+t.width,u-d+t.height)}ma(n,t._pointLabels[o],a,s+r.lineHeight/2,r,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,o),i.display&&this.ticks.forEach((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);!function(t,e,n,i){const o=t.ctx,r=e.circular,{color:a,lineWidth:s}=e;!r&&!i||!a||!s||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=s,o.setLineDash(e.borderDash),o.lineDashOffset=e.borderDashOffset,o.beginPath(),lh(t,n,r,i),o.closePath(),o.stroke(),o.restore())}(this,i.setContext(this.getContext(e-1)),a,o)}}),n.display){for(t.save(),r=o-1;r>=0;r--){const i=n.setContext(this.getPointLabelContext(r)),{color:o,lineWidth:l}=i;l&&o&&(t.lineWidth=l,t.strokeStyle=o,t.setLineDash(i.borderDash),t.lineDashOffset=i.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),s=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(s.x,s.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((i,a)=>{if(0===a&&!e.reverse)return;const s=n.setContext(this.getContext(a)),l=Da(s.font);if(o=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){t.font=l.string,r=t.measureText(i.label).width,t.fillStyle=s.backdropColor;const e=Ma(s.backdropPadding);t.fillRect(-r/2-e.left,-o-l.size/2-e.top,r+e.width,l.size+e.height)}ma(t,i.label,0,-o,l,{color:s.color})}),t.restore()}drawTitle(){}}ch.id="radialLinear",ch.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:tc.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},ch.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},ch.descriptors={angleLines:{_fallback:"grid"}};const dh={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}},hh=Object.keys(dh);function uh(t,e){return t-e}function ph(t,e){if(_o(e))return null;const n=t._adapter,{parser:i,round:o,isoWeekday:r}=t._parseOpts;let a=e;return"function"==typeof i&&(a=i(a)),So(a)||(a="string"==typeof i?n.parse(a,i):n.parse(a)),null===a?null:(o&&(a="week"!==o||!tr(r)&&!0!==r?n.startOf(a,o):n.startOf(a,"isoWeek",r)),+a)}function fh(t,e,n,i){const o=hh.length;for(let r=hh.indexOf(t);r<o-1;++r){const t=dh[hh[r]],o=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((n-e)/(o*t.size))<=i)return hh[r]}return hh[o-1]}function mh(t,e,n){if(n){if(n.length){const{lo:i,hi:o}=$a(n,e);t[n[i]>=e?n[i]:n[o]]=!0}}else t[e]=!0}function gh(t,e,n){const i=[],o={},r=e.length;let a,s;for(a=0;a<r;++a)s=e[a],o[s]=a,i.push({value:s,major:!1});return 0!==r&&n?function(t,e,n,i){const o=t._adapter,r=+o.startOf(e[0].value,i),a=e[e.length-1].value;let s,l;for(s=r;s<=a;s=+o.add(s,1,i))l=n[s],l>=0&&(e[l].major=!0);return e}(t,i,o,n):i}class xh extends dc{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const n=t.time||(t.time={}),i=this._adapter=new pl._date(t.adapters.date);Lo(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ph(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:i,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function s(t){r||isNaN(t.min)||(i=Math.min(i,t.min)),a||isNaN(t.max)||(o=Math.max(o,t.max))}r&&a||(s(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||s(this.getMinMax(!1))),i=So(i)&&!isNaN(i)?i:+e.startOf(Date.now(),n),o=So(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,i="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,r=function(t,e,n){let i=0,o=t.length;for(;i<o&&t[i]<e;)i++;for(;o>i&&t[o-1]>n;)o--;return i>0||o<t.length?t.slice(i,o):t}(i,o,this.max);return this._unit=e.unit||(n.autoSkip?fh(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(t,e,n,i,o){for(let r=hh.length-1;r>=hh.indexOf(n);r--){const n=hh[r];if(dh[n].common&&t._adapter.diff(o,i,n)>=e-1)return n}return hh[n?hh.indexOf(n):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(t){for(let e=hh.indexOf(t)+1,n=hh.length;e<n;++e)if(dh[hh[e]].common)return hh[e]}(this._unit):void 0,this.initOffsets(i),t.reverse&&r.reverse(),gh(this,r,this._majorUnit)}initOffsets(t){let e,n,i=0,o=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),i=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,n=this.getDecimalForValue(t[t.length-1]),o=1===t.length?n:(n-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;i=ur(i,0,r),o=ur(o,0,r),this._offsets={start:i,end:o,factor:1/(i+1+o)}}_generate(){const t=this._adapter,e=this.min,n=this.max,i=this.options,o=i.time,r=o.unit||fh(o.minUnit,e,n,this._getLabelCapacity(e)),a=Mo(o.stepSize,1),s="week"===r&&o.isoWeekday,l=tr(s)||!0===s,c={};let d,h,u=e;if(l&&(u=+t.startOf(u,"isoWeek",s)),u=+t.startOf(u,l?"day":r),t.diff(n,e,r)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+r);const p="data"===i.ticks.source&&this.getDataTimestamps();for(d=u,h=0;d<n;d=+t.add(d,a,r),h++)mh(c,d,p);return d!==n&&"ticks"!==i.bounds&&1!==h||mh(c,d,p),Object.keys(c).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,i){const o=this.options,r=o.time.displayFormats,a=this._unit,s=this._majorUnit,l=a&&r[a],c=s&&r[s],d=n[e],h=s&&c&&d&&d.major,u=this._adapter.format(t,i||(h?c:l)),p=o.ticks.callback;return p?Co(p,[u,e,n],this):u}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e<n;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,i=ir(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(i),r=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*r,h:n*r+a*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,i=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,gh(this,[t],this._majorUnit),i),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,n=this._cache.data||[];if(n.length)return n;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(t=0,e=i.length;t<e;++t)n=n.concat(i[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const i=this.getLabels();for(e=0,n=i.length;e<n;++e)t.push(ph(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return La(t.sort(uh))}}function yh(t,e,n){let i,o,r,a,s=0,l=t.length-1;n?(e>=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=Ta(t,"pos",e)),({pos:i,time:r}=t[s]),({pos:o,time:a}=t[l])):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=Ta(t,"time",e)),({time:i,pos:r}=t[s]),({time:o,pos:a}=t[l]));const c=o-i;return c?r+(a-r)*(e-i)/c:r}xh.id="time",xh.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class vh extends xh{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=yh(e,this.min),this._tableRange=yh(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,i=[],o=[];let r,a,s,l,c;for(r=0,a=t.length;r<a;++r)l=t[r],l>=e&&l<=n&&i.push(l);if(i.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(r=0,a=i.length;r<a;++r)c=i[r+1],s=i[r-1],l=i[r],Math.round((c+s)/2)!==l&&o.push({time:l,pos:r/(a-1)});return o}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return t=e.length&&n.length?this.normalize(e.concat(n)):e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(yh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return yh(this._table,n*this._tableRange+this._minPos,!0)}}vh.id="timeseries",vh.defaults=xh.defaults;const _h="label";function wh(t,e){"function"==typeof t?t(e):t&&(t.current=e)}function kh(t,e){t.labels=e}function Sh(t,e,n=_h){const i=[];t.datasets=e.map(e=>{const o=t.datasets.find(t=>t[n]===e[n]);return o&&e.data&&!i.includes(o)?(i.push(o),Object.assign(o,e),o):{...e}})}function Eh(t,e=_h){const n={labels:[],datasets:[]};return kh(n,t.labels),Sh(n,t.datasets,e),n}function Mh({height:t=150,width:e=300,redraw:n=!1,datasetIdKey:i,type:o,data:r,options:a,plugins:s=[],fallbackContent:l,...c},d){const h=ct(null),u=ct(),p=()=>{h.current&&(u.current=new Ic(h.current,{type:o,data:Eh(r,i),options:a,plugins:s}),wh(d,u.current))},f=()=>{wh(d,null),u.current&&(u.current.destroy(),u.current=null)};return dt(()=>{var t,e;!n&&u.current&&a&&(t=u.current,e=a,t.options={...e})},[n,a]),dt(()=>{!n&&u.current&&kh(u.current.config.data,r.labels)},[n,r.labels]),dt(()=>{!n&&u.current&&r.datasets&&Sh(u.current.config.data,r.datasets,i)},[n,r.datasets]),dt(()=>{u.current&&(n?(f(),setTimeout(p)):u.current.update())},[n,a,r.labels,r.datasets]),dt(()=>(p(),()=>f()),[]),et.createElement("canvas",Object.assign({ref:h,role:"img",height:t,width:e},c),l)}const Dh=rt(Mh);Ic.register(Ud,Zd,nd,td,rl,Wd,Td,Cd);const Ch=({xValues:t,yValues:e,dataPrefix:n,dataPostfix:i,straitsXStyle:o,height:r=40})=>{const a=ct(null),[s,l]=lt({datasets:[]}),c={labels:t,datasets:[{data:e}]},d=n||"",h=i||"";dt(()=>{const t=a.current;if(!t)return;const e=t.ctx,n=e.createLinearGradient(0,0,0,280);n.addColorStop(.3,"rgba(47, 141, 238, 0.08)"),n.addColorStop(.6,"rgba(47, 141, 238, 0.0002)"),n.addColorStop(1,"rgba(47, 141, 238, 0");const i=e.createLinearGradient(0,0,0,280);i.addColorStop(0,"rgba(0, 211, 126, 0.2)"),i.addColorStop(.1,"rgba(0, 211, 126, 0.1)"),i.addColorStop(1,"rgba(0, 211, 126, 0)");const r=Object.assign(Object.assign({},c),{datasets:c.datasets.map(t=>Object.assign(Object.assign({},t),{backgroundColor:o?i:n,fill:!0,borderColor:o?"#00D37E":"#2E8DEE",pointRadius:0}))});l(r)},[o,t,e]);const u={maintainAspectRatio:!1,plugins:{legend:{display:!1,labels:{font:{family:"'Inter', 'Arial', sans-serif"}}},tooltip:{intersect:!1,padding:15,displayColors:!1,borderColor:"rgba(0, 211, 126, 1)",borderWidth:o?1:0,backgroundColor:o?"#ffffff":"#000000",titleColor:o?"#1B2736":"#fff",bodyColor:o?"#1B2736":"#fff",titleAlign:"center",bodyAlign:"center",titleFont:{size:14},bodyFont:{size:14},callbacks:{title:t=>o?`${d}${t[0].parsed.y}${h}`:t[0].label,label:t=>o?t.label:`${d}${t.parsed.y}${h}`}}},scales:{x:{ticks:{color:o?"#1B2736":"rgba(0, 0, 0, 0.4)",font:{weight:"500",size:13}},grid:{display:!1}},y:{ticks:{beginAtZero:!0,padding:18,maxTicksLimit:3,color:o?"#1B2736":"rgba(0, 0, 0, 0.4)",callback:t=>`${d}${t}${h}`},grid:{display:!1,drawBorder:!1}}}};return et.createElement("div",{style:{position:"relative",height:`${r}vh`,width:"99%"}},et.createElement(Dh,{id:"chart",ref:a,type:"line",data:s,options:u}))};function Oh(t){var{children:e,activeKey:n,width:i=250}=t,o=jt(t,["children","activeKey","width"]);const{brand:r}=$i(),a=e.map((t,e)=>et.createElement(bt.TabPane,{key:e,forceRender:!0},t)),s=e.map((t,e)=>et.createElement(Ph,{key:e,isActive:e===n,activeColor:r.primary.default}));return et.createElement($h,null,et.createElement(Th,Object.assign({renderTabBar:()=>et.createElement("div",null),width:i,activeKey:n.toString(),animated:!0},o),a),et.createElement(Ah,null,s))}const $h=Vn.div`
|
|
327
|
+
*/var $s=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const o=e.listeners[i],r=e.duration;o.forEach(i=>i({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(n-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=mo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const o=n.items;let r,a=o.length-1,s=!1;for(;a>=0;--a)r=o[a],r._active?(r._total>n.duration&&(n.duration=r._total),r.tick(t),s=!0):(o[a]=o[o.length-1],o.pop());s&&(i.draw(),this._notify(i,n,t,"progress")),o.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const Ts="transparent",As={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=Kr(t||Ts),o=i.valid&&Kr(e||Ts);return o&&o.valid?o.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class Ps{constructor(t,e,n,i){const o=e[n];i=Ca([t.to,i,o,t.from]);const r=Ca([t.from,o,i]);this._active=!0,this._fn=t.fn||As[t.type||typeof r],this._easing=br[t.easing]||br.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=r,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const i=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ca([t.to,e,i,t.from]),this._from=Ca([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,i=this._prop,o=this._from,r=this._loop,a=this._to;let s;if(this._active=o!==a&&(r||e<n),!this._active)return this._target[i]=a,void this._notify(!0);e<0?this._target[i]=o:(s=e/n%2,s=r&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[i]=this._fn(o,a,s))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}ia.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Rs=Object.keys(ia.animation);ia.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),ia.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),ia.describe("animations",{_fallback:"animation"}),ia.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 Ls{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ko(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const i=t[n];if(!ko(i))return;const o={};for(const t of Rs)o[t]=i[t];(wo(i.properties)&&i.properties||[n]).forEach(t=>{t!==n&&e.has(t)||e.set(t,o)})})}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(!n)return void(t.options=e);n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(t,n);if(!i)return[];const o=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e<i.length;e++){const o=t[i[e]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,i=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let s;for(s=r.length-1;s>=0;--s){const l=r[s];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(t,e));continue}const c=e[l];let d=o[l];const h=n.get(l);if(d){if(h&&d.active()){d.update(h,c,a);continue}d.cancel()}h&&h.duration?(o[l]=d=new Ps(h,t,l,c),i.push(d)):t[l]=c}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?($s.add(this._chart,n),!0):void 0}}function Ns(t,e){const n=t&&t.options||{},i=n.reverse,o=void 0===n.min?e:0,r=void 0===n.max?e:0;return{start:i?r:o,end:i?o:r}}function Is(t,e){const n=[],i=t._getSortedDatasetMetas(e);let o,r;for(o=0,r=i.length;o<r;++o)n.push(i[o].index);return n}function Fs(t,e,n,i={}){const o=t.keys,r="single"===i.mode;let a,s,l,c;if(null!==e){for(a=0,s=o.length;a<s;++a){if(l=+o[a],l===n){if(i.all)continue;break}c=t.values[l],So(c)&&(r||0===e||Jo(e)===Jo(c))&&(e+=c)}return e}}function zs(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function Bs(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function Ys(t,e,n,i){for(const o of e.getMatchingVisibleMetas(i).reverse()){const e=t[o.index];if(n&&e>0||!n&&e<0)return o.index}return null}function Vs(t,e){const{chart:n,_cachedMeta:i}=t,o=n._stacks||(n._stacks={}),{iScale:r,vScale:a,index:s}=i,l=r.axis,c=a.axis,d=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(r,a,i),h=e.length;let u;for(let t=0;t<h;++t){const n=e[t],{[l]:r,[c]:h}=n;u=(n._stacks||(n._stacks={}))[c]=Bs(o,d,r),u[s]=h,u._top=Ys(u,a,!0,i.type),u._bottom=Ys(u,a,!1,i.type)}}function Hs(t,e){const n=t.scales;return Object.keys(n).filter(t=>n[t].axis===e).shift()}function Ws(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n]}}}const js=t=>"reset"===t||"none"===t,Us=(t,e)=>e?t:Object.assign({},t);class Gs{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.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=zs(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Ws(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),i=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,o=e.xAxisID=Mo(n.xAxisID,Hs(t,"x")),r=e.yAxisID=Mo(n.yAxisID,Hs(t,"y")),a=e.rAxisID=Mo(n.rAxisID,Hs(t,"r")),s=e.indexAxis,l=e.iAxisID=i(s,o,r,a),c=e.vAxisID=i(s,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ra(this._data,this),t._stacked&&Ws(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(ko(e))this._data=function(t){const e=Object.keys(t),n=new Array(e.length);let i,o,r;for(i=0,o=e.length;i<o;++i)r=e[i],n[i]={x:r,y:t[r]};return n}(e);else if(n!==e){if(n){Ra(n,this);const t=this._cachedMeta;Ws(t),t._parsed=[]}e&&Object.isExtensible(e)&&(o=this,(i=e)._chartjs?i._chartjs.listeners.push(o):(Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[o]}}),Pa.forEach(t=>{const e="_onData"+zo(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...t){const o=n.apply(this,t);return i._chartjs.listeners.forEach(n=>{"function"==typeof n[e]&&n[e](...t)}),o}})}))),this._syncList=[],this._data=e}var i,o}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const o=e._stacked;e._stacked=zs(e.vScale,e),e.stack!==n.stack&&(i=!0,Ws(e),e.stack=n.stack),this._resyncElements(t),(i||o!==e._stacked)&&Vs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:i}=this,{iScale:o,_stacked:r}=n,a=o.axis;let s,l,c,d=0===t&&e===i.length||n._sorted,h=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=i,n._sorted=!0,c=i;else{c=wo(i[t])?this.parseArrayData(n,i,t,e):ko(i[t])?this.parseObjectData(n,i,t,e):this.parsePrimitiveData(n,i,t,e);const o=()=>null===l[a]||h&&l[a]<h[a];for(s=0;s<e;++s)n._parsed[s+t]=l=c[s],d&&(o()&&(d=!1),h=l);n._sorted=d}r&&Vs(this,c)}parsePrimitiveData(t,e,n,i){const{iScale:o,vScale:r}=t,a=o.axis,s=r.axis,l=o.getLabels(),c=o===r,d=new Array(i);let h,u,p;for(h=0,u=i;h<u;++h)p=h+n,d[h]={[a]:c||o.parse(l[p],p),[s]:r.parse(e[p],p)};return d}parseArrayData(t,e,n,i){const{xScale:o,yScale:r}=t,a=new Array(i);let s,l,c,d;for(s=0,l=i;s<l;++s)c=s+n,d=e[c],a[s]={x:o.parse(d[0],c),y:r.parse(d[1],c)};return a}parseObjectData(t,e,n,i){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(i);let c,d,h,u;for(c=0,d=i;c<d;++c)h=c+n,u=e[h],l[c]={x:o.parse(Fo(u,a),h),y:r.parse(Fo(u,s),h)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const i=this.chart,o=this._cachedMeta,r=e[t.axis];return Fs({keys:Is(i,!0),values:e._stacks[t.axis]},r,o.index,{mode:n})}updateRangeFromParsed(t,e,n,i){const o=n[e.axis];let r=null===o?NaN:o;const a=i&&n._stacks[e.axis];i&&a&&(i.values=a,r=Fs(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const n=this._cachedMeta,i=n._parsed,o=n._sorted&&t===n.iScale,r=i.length,a=this._getOtherScale(t),s=((t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Is(n,!0),values:null})(e,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=function(t){const{min:e,max:n,minDefined:i,maxDefined:o}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}(a);let h,u;function p(){u=i[h];const e=u[a.axis];return!So(u[t.axis])||c>e||d<e}for(h=0;h<r&&(p()||(this.updateRangeFromParsed(l,t,u,s),!o));++h);if(o)for(h=r-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(l,t,u,s);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,o,r;for(i=0,o=e.length;i<o;++i)r=e[i][t.axis],So(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,i=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,n,i,o;return ko(t)?(e=t.top,n=t.right,i=t.bottom,o=t.left):e=n=i=o=t,{top:e,right:n,bottom:i,left:o,disabled:!1===t}}(Mo(this.options.clip,function(t,e,n){if(!1===n)return!1;const i=Ns(t,n),o=Ns(e,n);return{top:o.end,right:i.end,bottom:o.start,left:i.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,i=n.data||[],o=e.chartArea,r=[],a=this._drawStart||0,s=this._drawCount||i.length-a,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(t,o,a,s),c=a;c<a+s;++c){const e=i[c];e.hidden||(e.active&&l?r.push(e):e.draw(t,o))}for(c=0;c<r.length;++c)r[c].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];o=e.$context||(e.$context=function(t,e,n){return Oa(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=function(t,e){return Oa(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const i="active"===e,o=this._cachedDataOpts,r=t+"-"+e,a=o[r],s=this.enableOptionSharing&&Bo(n);if(a)return Us(a,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],h=l.getOptionScopes(this.getDataset(),c),u=Object.keys(ia.elements[t]),p=l.resolveNamedOptions(h,u,()=>this.getContext(n,i),d);return p.$shared&&(p.$shared=s,o[r]=Object.freeze(Us(p,s))),p}_resolveAnimations(t,e,n){const i=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let s;if(!1!==i.options.animation){const i=this.chart.config,o=i.datasetAnimationScopeKeys(this._type,e),r=i.getOptionScopes(this.getDataset(),o);s=i.createResolver(r,this.getContext(t,n,e))}const l=new Ls(i,s&&s.animations);return s&&s._cacheable&&(o[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||js(t)||this.chart._animationsDisabled}updateElement(t,e,n,i){js(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!js(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const o=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[t,e,n]of this._syncList)this[t](e,n);this._syncList=[];const i=n.length,o=e.length,r=Math.min(o,i);r&&this.parse(0,r),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,e,n=!0){const i=this._cachedMeta,o=i.data,r=t+e;let a;const s=t=>{for(t.length+=e,a=t.length-1;a>=r;a--)t[a]=t[a-e]};for(s(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&s(i._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,i){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,e);n._stacked&&Ws(n,i)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,i]=t;this[e](n,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Xs(t){const e=t.iScale,n=function(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let i=[];for(let e=0,o=n.length;e<o;e++)i=i.concat(n[e].controller.getAllParsedValues(t));t._cache.$bar=La(i.sort((t,e)=>t-e))}return t._cache.$bar}(e,t.type);let i,o,r,a,s=e._length;const l=()=>{32767!==r&&-32768!==r&&(Bo(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(i=0,o=n.length;i<o;++i)r=e.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=e.ticks.length;i<o;++i)r=e.getPixelForTick(i),l();return s}function qs(t,e,n,i){return wo(t)?function(t,e,n,i){const o=n.parse(t[0],i),r=n.parse(t[1],i),a=Math.min(o,r),s=Math.max(o,r);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:o,end:r,min:a,max:s}}(t,e,n,i):e[n.axis]=n.parse(t,i),e}function Zs(t,e,n,i){const o=t.iScale,r=t.vScale,a=o.getLabels(),s=o===r,l=[];let c,d,h,u;for(c=n,d=n+i;c<d;++c)u=e[c],h={},h[o.axis]=s||o.parse(a[c],c),l.push(qs(u,h,r,c));return l}function Ks(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Js(t,e,n,i){let o=e.borderSkipped;const r={};if(!o)return void(t.borderSkipped=r);const{start:a,end:s,reverse:l,top:c,bottom:d}=function(t){let e,n,i,o,r;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(o="end",r="start"):(o="start",r="end"),{start:n,end:i,reverse:e,top:o,bottom:r}}(t);"middle"===o&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?o=c:(n._bottom||0)===i?o=d:(r[Qs(d,a,s,l)]=!0,o=c)),r[Qs(o,a,s,l)]=!0,t.borderSkipped=r}function Qs(t,e,n,i){var o,r,a;return i?(a=n,t=tl(t=(o=t)===(r=e)?a:o===a?r:o,n,e)):t=tl(t,e,n),t}function tl(t,e,n){return"start"===t?e:"end"===t?n:t}function el(t,{inflateAmount:e},n){t.inflateAmount="auto"===e?1===n?.33:0:e}Gs.defaults={},Gs.prototype.datasetElementType=null,Gs.prototype.dataElementType=null;class nl extends Gs{parsePrimitiveData(t,e,n,i){return Zs(t,e,n,i)}parseArrayData(t,e,n,i){return Zs(t,e,n,i)}parseObjectData(t,e,n,i){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===o.axis?a:s,c="x"===r.axis?a:s,d=[];let h,u,p,f;for(h=n,u=n+i;h<u;++h)f=e[h],p={},p[o.axis]=o.parse(Fo(f,l),h),d.push(qs(Fo(f,c),p,r,h));return d}updateRangeFromParsed(t,e,n,i){super.updateRangeFromParsed(t,e,n,i);const o=n._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:i}=e,o=this.getParsed(t),r=o._custom,a=Ks(r)?"["+r.start+", "+r.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,i){const o="reset"===i,{index:r,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),d=this.resolveDataElementOptions(e,i),h=this.getSharedOptions(d),u=this.includeOptions(i,h);this.updateSharedOptions(h,i,d);for(let d=e;d<e+n;d++){const e=this.getParsed(d),n=o||_o(e[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(d),p=this._calculateBarIndexPixels(d,c),f=(e._stacks||{})[a.axis],m={horizontal:l,base:n.base,enableBorderRadius:!f||Ks(e._custom)||r===f._top||r===f._bottom,x:l?n.head:p.center,y:l?p.center:n.head,height:l?p.size:Math.abs(n.size),width:l?Math.abs(n.size):p.size};u&&(m.options=h||this.resolveDataElementOptions(d,t[d].active?"active":i));const g=m.options||t[d].options;Js(m,g,f,r),el(m,g,c.ratio),this.updateElement(t[d],d,m,i)}}_getStacks(t,e){const n=this._cachedMeta.iScale,i=n.getMatchingVisibleMetas(this._type),o=n.options.stacked,r=i.length,a=[];let s,l;for(s=0;s<r;++s)if(l=i[s],l.controller.options.grouped){if(void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(_o(t)||isNaN(t))continue}if((!1===o||-1===a.indexOf(l.stack)||void 0===o&&void 0===l.stack)&&a.push(l.stack),l.index===t)break}return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const i=this._getStacks(t,n),o=void 0!==e?i.indexOf(e):-1;return-1===o?i.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,i=[];let o,r;for(o=0,r=e.data.length;o<r;++o)i.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const a=t.barThickness;return{min:a||Xs(e),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n},options:{base:i,minBarLength:o}}=this,r=i||0,a=this.getParsed(t),s=a._custom,l=Ks(s);let c,d,h=a[e.axis],u=0,p=n?this.applyStack(e,a,n):h;p!==h&&(u=p-h,p=h),l&&(h=s.barStart,p=s.barEnd-s.barStart,0!==h&&Jo(h)!==Jo(s.barEnd)&&(u=0),u+=h);const f=_o(i)||l?u:i;let m=e.getPixelForValue(f);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(u+p):m,d=c-m,Math.abs(d)<o&&(d=function(t,e,n){return 0!==t?Jo(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}(d,e,r)*o,h===r&&(m-=d/2),c=m+d),m===e.getPixelForValue(r)){const t=Jo(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const n=e.scale,i=this.options,o=i.skipNull,r=Mo(i.maxBarThickness,1/0);let a,s;if(e.grouped){const n=o?this._getStackCount(t):e.stackCount,l="flex"===i.barThickness?function(t,e,n,i){const o=e.pixels,r=o[t];let a=t>0?o[t-1]:null,s=t<o.length-1?o[t+1]:null;const l=n.categoryPercentage;null===a&&(a=r-(null===s?e.end-e.start:s-r)),null===s&&(s=r+r-a);const c=r-(r-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/i,ratio:n.barPercentage,start:c}}(t,e,i,n):function(t,e,n,i){const o=n.barThickness;let r,a;return _o(o)?(r=e.min*n.categoryPercentage,a=n.barPercentage):(r=o*i,a=1),{chunk:r/i,ratio:a,start:e.pixels[t]-r/2}}(t,e,i,n),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=l.start+l.chunk*c+l.chunk/2,s=Math.min(r,l.chunk*l.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),s=Math.min(r,e.min*e.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,i=n.length;let o=0;for(;o<i;++o)null!==this.getParsed(o)[e.axis]&&n[o].draw(this._ctx)}}nl.id="bar",nl.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},nl.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class il extends Gs{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,i){const o=super.parsePrimitiveData(t,e,n,i);for(let t=0;t<o.length;t++)o[t]._custom=this.resolveDataElementOptions(t+n).radius;return o}parseArrayData(t,e,n,i){const o=super.parseArrayData(t,e,n,i);for(let t=0;t<o.length;t++){const i=e[n+t];o[t]._custom=Mo(i[2],this.resolveDataElementOptions(t+n).radius)}return o}parseObjectData(t,e,n,i){const o=super.parseObjectData(t,e,n,i);for(let t=0;t<o.length;t++){const i=e[n+t];o[t]._custom=Mo(i&&i.r&&+i.r,this.resolveDataElementOptions(t+n).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:i}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=i.getLabelForValue(o.y),s=o._custom;return{label:e.label,value:"("+r+", "+a+(s?", "+s:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const o="reset"===i,{iScale:r,vScale:a}=this._cachedMeta,s=this.resolveDataElementOptions(e,i),l=this.getSharedOptions(s),c=this.includeOptions(i,l),d=r.axis,h=a.axis;for(let s=e;s<e+n;s++){const e=t[s],n=!o&&this.getParsed(s),l={},u=l[d]=o?r.getPixelForDecimal(.5):r.getPixelForValue(n[d]),p=l[h]=o?a.getBasePixel():a.getPixelForValue(n[h]);l.skip=isNaN(u)||isNaN(p),c&&(l.options=this.resolveDataElementOptions(s,e.active?"active":i),o&&(l.options.radius=0)),this.updateElement(e,s,l,i)}this.updateSharedOptions(l,i,s)}resolveDataElementOptions(t,e){const n=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return"active"!==e&&(i.radius=0),i.radius+=Mo(n&&n._custom,o),i}}il.id="bubble",il.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},il.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class ol extends Gs{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;if(!1===this._parsing)i._parsed=n;else{let o,r,a=t=>+n[t];if(ko(n[t])){const{key:t="value"}=this._parsing;a=e=>+Fo(n[e],t)}for(o=t,r=t+e;o<r;++o)i._parsed[o]=a(o)}}_getRotation(){return ir(this.options.rotation-90)}_getCircumference(){return ir(this.options.circumference)}_getRotationExtents(){let t=Wo,e=-Wo;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){const i=this.chart.getDatasetMeta(n).controller,o=i._getRotation(),r=i._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,i=this._cachedMeta,o=i.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-r)/2,0),s=Math.min((l=this.options.cutout,c=a,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:l/c),1);var l,c;const d=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:p,ratioY:f,offsetX:m,offsetY:g}=function(t,e,n){let i=1,o=1,r=0,a=0;if(e<Wo){const s=t,l=s+e,c=Math.cos(s),d=Math.sin(s),h=Math.cos(l),u=Math.sin(l),p=(t,e,i)=>hr(t,s,l,!0)?1:Math.max(e,e*n,i,i*n),f=(t,e,i)=>hr(t,s,l,!0)?-1:Math.min(e,e*n,i,i*n),m=p(0,c,h),g=p(Xo,d,u),b=f(Ho,c,h),x=f(Ho+Xo,d,u);i=(m-b)/2,o=(g-x)/2,r=-(m+b)/2,a=-(g+x)/2}return{ratioX:i,ratioY:o,offsetX:r,offsetY:a}}(u,h,s),b=(n.width-r)/p,x=(n.height-r)/f,y=Math.max(Math.min(b,x)/2,0),v=Do(this.options.radius,y),_=(v-Math.max(v*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*v,this.offsetY=g*v,i.total=this.calculateTotal(),this.outerRadius=v-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,i=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===i._parsed[t]||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Wo)}updateElements(t,e,n,i){const o="reset"===i,r=this.chart,a=r.chartArea,s=r.options.animation,l=(a.left+a.right)/2,c=(a.top+a.bottom)/2,d=o&&s.animateScale,h=d?0:this.innerRadius,u=d?0:this.outerRadius,p=this.resolveDataElementOptions(e,i),f=this.getSharedOptions(p),m=this.includeOptions(i,f);let g,b=this._getRotation();for(g=0;g<e;++g)b+=this._circumference(g,o);for(g=e;g<e+n;++g){const e=this._circumference(g,o),n=t[g],r={x:l+this.offsetX,y:c+this.offsetY,startAngle:b,endAngle:b+e,circumference:e,outerRadius:u,innerRadius:h};m&&(r.options=f||this.resolveDataElementOptions(g,n.active?"active":i)),b+=e,this.updateElement(n,g,r,i)}this.updateSharedOptions(f,i,p)}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,i=0;for(n=0;n<e.length;n++){const o=t._parsed[n];null===o||isNaN(o)||!this.chart.getDataVisibility(n)||e[n].hidden||(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Wo*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],o=ys(e._parsed[t],n.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let i,o,r,a,s;if(!t)for(i=0,o=n.data.datasets.length;i<o;++i)if(n.isDatasetVisible(i)){r=n.getDatasetMeta(i),t=r.data,a=r.controller;break}if(!t)return 0;for(i=0,o=t.length;i<o;++i)s=a.resolveDataElementOptions(i),"inner"!==s.borderAlign&&(e=Math.max(e,s.borderWidth||0,s.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,i=t.length;n<i;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(Mo(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ol.id="doughnut",ol.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},ol.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},ol.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map((e,i)=>{const o=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const n=": "+t.formattedValue;return wo(e)?(e=e.slice(),e[0]+=n):e+=n,e}}}}};class rl extends Gs{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:i=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:s}=function(t,e,n){const i=e.length;let o=0,r=i;if(t._sorted){const{iScale:a,_parsed:s}=t,l=a.axis,{min:c,max:d,minDefined:h,maxDefined:u}=a.getUserBounds();h&&(o=ur(Math.min(Ta(s,a.axis,c).lo,n?i:Ta(e,l,a.getPixelForValue(c)).lo),0,i-1)),r=u?ur(Math.max(Ta(s,a.axis,d).hi+1,n?0:Ta(e,l,a.getPixelForValue(d)).hi+1),o,i)-o:i-o}return{start:o,count:r}}(e,i,r);this._drawStart=a,this._drawCount=s,function(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,o={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=o,!0;const r=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,o),r}(e)&&(a=0,s=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=i;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:l},t),this.updateElements(i,a,s,t)}updateElements(t,e,n,i){const o="reset"===i,{iScale:r,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,i),d=this.getSharedOptions(c),h=this.includeOptions(i,d),u=r.axis,p=a.axis,{spanGaps:f,segment:m}=this.options,g=tr(f)?f:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||"none"===i;let x=e>0&&this.getParsed(e-1);for(let c=e;c<e+n;++c){const e=t[c],n=this.getParsed(c),f=b?e:{},y=_o(n[p]),v=f[u]=r.getPixelForValue(n[u],c),_=f[p]=o||y?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,n,s):n[p],c);f.skip=isNaN(v)||isNaN(_)||y,f.stop=c>0&&n[u]-x[u]>g,m&&(f.parsed=n,f.raw=l.data[c]),h&&(f.options=d||this.resolveDataElementOptions(c,e.active?"active":i)),b||this.updateElement(e,c,f,i),x=n}this.updateSharedOptions(d,i,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const o=i[0].size(this.resolveDataElementOptions(0)),r=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}rl.id="line",rl.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},rl.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class sl extends Gs{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],o=ys(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:o}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(i/2,0),r=(o-Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,n,i){const o="reset"===i,r=this.chart,a=this.getDataset(),s=r.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,d=l.yCenter,h=l.getIndexAngle(0)-.5*Ho;let u,p=h;const f=360/this.countVisibleElements();for(u=0;u<e;++u)p+=this._computeAngle(u,i,f);for(u=e;u<e+n;u++){const e=t[u];let n=p,m=p+this._computeAngle(u,i,f),g=r.getDataVisibility(u)?l.getDistanceFromCenterForValue(a.data[u]):0;p=m,o&&(s.animateScale&&(g=0),s.animateRotate&&(n=m=h));const b={x:c,y:d,innerRadius:0,outerRadius:g,startAngle:n,endAngle:m,options:this.resolveDataElementOptions(u,e.active?"active":i)};this.updateElement(e,u,b,i)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let n=0;return e.data.forEach((e,i)=>{!isNaN(t.data[i])&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?ir(this.resolveDataElementOptions(t,e).angle||n):0}}sl.id="polarArea",sl.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},sl.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map((e,i)=>{const o=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.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 ll extends ol{}ll.id="pie",ll.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class cl extends Gs{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}update(t){const e=this._cachedMeta,n=e.dataset,i=e.data||[],o=e.iScale.getLabels();if(n.points=i,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===i.length,options:e};this.updateElement(n,void 0,r,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,n,i){const o=this.getDataset(),r=this._cachedMeta.rScale,a="reset"===i;for(let s=e;s<e+n;s++){const e=t[s],n=this.resolveDataElementOptions(s,e.active?"active":i),l=r.getPointPositionForValue(s,o.data[s]),c=a?r.xCenter:l.x,d=a?r.yCenter:l.y,h={x:c,y:d,angle:l.angle,skip:isNaN(c)||isNaN(d),options:n};this.updateElement(e,s,h,i)}}}cl.id="radar",cl.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},cl.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class dl extends rl{}function hl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}dl.id="scatter",dl.defaults={showLine:!1,fill:!1},dl.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class ul{constructor(t){this.options=t||{}}formats(){return hl()}parse(t,e){return hl()}format(t,e){return hl()}add(t,e,n){return hl()}diff(t,e,n){return hl()}startOf(t,e,n){return hl()}endOf(t,e){return hl()}}ul.override=function(t){Object.assign(ul.prototype,t)};var pl={_date:ul};function fl(t,e){return"native"in t?{x:t.x,y:t.y}:cs(t,e)}function ml(t,e,n,i){const{controller:o,data:r,_sorted:a}=t,s=o._cachedMeta.iScale;if(s&&e===s.axis&&"r"!==e&&a&&r.length){const t=s._reversePixels?Aa:Ta;if(!i)return t(r,e,n);if(o._sharedOptions){const i=r[0],o="function"==typeof i.getRange&&i.getRange(e);if(o){const i=t(r,e,n-o),a=t(r,e,n+o);return{lo:i.lo,hi:a.hi}}}}return{lo:0,hi:r.length-1}}function gl(t,e,n,i,o){const r=t.getSortedVisibleDatasetMetas(),a=n[e];for(let t=0,n=r.length;t<n;++t){const{index:n,data:s}=r[t],{lo:l,hi:c}=ml(r[t],e,a,o);for(let t=l;t<=c;++t){const e=s[t];e.skip||i(e,n,t)}}}function bl(t,e,n,i){const o=[];if(!da(e,t.chartArea,t._minPadding))return o;return gl(t,n,e,function(t,n,r){t.inRange(e.x,e.y,i)&&o.push({element:t,datasetIndex:n,index:r})},!0),o}function xl(t,e,n,i,o){let r=[];const a=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){const o=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}(n);let s=Number.POSITIVE_INFINITY;return gl(t,n,e,function(n,l,c){const d=n.inRange(e.x,e.y,o);if(i&&!d)return;const h=n.getCenterPoint(o);if(!da(h,t.chartArea,t._minPadding)&&!d)return;const u=a(e,h);u<s?(r=[{element:n,datasetIndex:l,index:c}],s=u):u===s&&r.push({element:n,datasetIndex:l,index:c})}),r}function yl(t,e,n,i,o){return da(e,t.chartArea,t._minPadding)?"r"!==n||i?xl(t,e,n,i,o):function(t,e,n,i){let o=[];return gl(t,n,e,function(t,n,r){const{startAngle:a,endAngle:s}=t.getProps(["startAngle","endAngle"],i),{angle:l}=sr(t,{x:e.x,y:e.y});hr(l,a,s)&&o.push({element:t,datasetIndex:n,index:r})}),o}(t,e,n,o):[]}function vl(t,e,n,i){const o=fl(e,t),r=[],a=n.axis,s="x"===a?"inXRange":"inYRange";let l=!1;return function(t,e){const n=t.getSortedVisibleDatasetMetas();let i,o,r;for(let t=0,a=n.length;t<a;++t){({index:i,data:o}=n[t]);for(let t=0,n=o.length;t<n;++t)r=o[t],r.skip||e(r,i,t)}}(t,(t,e,n)=>{t[s](o[a],i)&&r.push({element:t,datasetIndex:e,index:n}),t.inRange(o.x,o.y,i)&&(l=!0)}),n.intersect&&!l?[]:r}var _l={modes:{index(t,e,n,i){const o=fl(e,t),r=n.axis||"x",a=n.intersect?bl(t,o,r,i):yl(t,o,r,!1,i),s=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,n=t.data[e];n&&!n.skip&&s.push({element:n,datasetIndex:t.index,index:e})}),s):[]},dataset(t,e,n,i){const o=fl(e,t),r=n.axis||"xy";let a=n.intersect?bl(t,o,r,i):yl(t,o,r,!1,i);if(a.length>0){const e=a[0].datasetIndex,n=t.getDatasetMeta(e).data;a=[];for(let t=0;t<n.length;++t)a.push({element:n[t],datasetIndex:e,index:t})}return a},point:(t,e,n,i)=>bl(t,fl(e,t),n.axis||"xy",i),nearest:(t,e,n,i)=>yl(t,fl(e,t),n.axis||"xy",n.intersect,i),x:(t,e,n,i)=>vl(t,e,{axis:"x",intersect:n.intersect},i),y:(t,e,n,i)=>vl(t,e,{axis:"y",intersect:n.intersect},i)}};const wl=["left","top","right","bottom"];function kl(t,e){return t.filter(t=>t.pos===e)}function Sl(t,e){return t.filter(t=>-1===wl.indexOf(t.pos)&&t.box.axis===e)}function El(t,e){return t.sort((t,n)=>{const i=e?n:t,o=e?t:n;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function Ml(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:i,stackWeight:o}=n;if(!t||!wl.includes(i))continue;const r=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return e}(t),{vBoxMaxWidth:i,hBoxMaxHeight:o}=e;let r,a,s;for(r=0,a=t.length;r<a;++r){s=t[r];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*i:a&&e.availableWidth,s.height=o):(s.width=i,s.height=c?c*o:a&&e.availableHeight)}return n}function Dl(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Cl(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 Ol(t,e,n,i){const{pos:o,box:r}=n,a=t.maxPadding;if(!ko(o)){n.size&&(t[o]-=n.size);const e=i[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?r.height:r.width),n.size=e.size/e.count,t[o]+=n.size}r.getPadding&&Cl(a,r.getPadding());const s=Math.max(0,e.outerWidth-Dl(a,t,"left","right")),l=Math.max(0,e.outerHeight-Dl(a,t,"top","bottom")),c=s!==t.w,d=l!==t.h;return t.w=s,t.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function $l(t,e){const n=e.maxPadding;function i(t){const i={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{i[t]=Math.max(e[t],n[t])}),i}return i(t?["left","right"]:["top","bottom"])}function Tl(t,e,n,i){const o=[];let r,a,s,l,c,d;for(r=0,a=t.length,c=0;r<a;++r){s=t[r],l=s.box,l.update(s.width||e.w,s.height||e.h,$l(s.horizontal,e));const{same:a,other:h}=Ol(e,n,s,i);c|=a&&o.length,d=d||h,l.fullSize||o.push(s)}return c&&Tl(o,e,n,i)||d}function Al(t,e,n,i,o){t.top=n,t.left=e,t.right=e+i,t.bottom=n+o,t.width=i,t.height=o}function Pl(t,e,n,i){const o=n.padding;let{x:r,y:a}=e;for(const s of t){const t=s.box,l=i[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const i=e.w*c,r=l.size||t.height;Bo(l.start)&&(a=l.start),t.fullSize?Al(t,o.left,a,n.outerWidth-o.right-o.left,r):Al(t,e.left+l.placed,a,i,r),l.start=a,l.placed+=i,a=t.bottom}else{const i=e.h*c,a=l.size||t.width;Bo(l.start)&&(r=l.start),t.fullSize?Al(t,r,o.top,a,n.outerHeight-o.bottom-o.top):Al(t,r,e.top+l.placed,a,i),l.start=r,l.placed+=i,r=t.right}}e.x=r,e.y=a}ia.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Rl={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const o=Ma(t.options.layout.padding),r=Math.max(e-o.width,0),a=Math.max(n-o.height,0),s=function(t){const e=function(t){const e=[];let n,i,o,r,a,s;for(n=0,i=(t||[]).length;n<i;++n)o=t[n],({position:r,options:{stack:a,stackWeight:s=1}}=o),e.push({index:n,box:o,pos:r,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&r+a,stackWeight:s});return e}(t),n=El(e.filter(t=>t.box.fullSize),!0),i=El(kl(e,"left"),!0),o=El(kl(e,"right")),r=El(kl(e,"top"),!0),a=El(kl(e,"bottom")),s=Sl(e,"x"),l=Sl(e,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:o.concat(l).concat(a).concat(s),chartArea:kl(e,"chartArea"),vertical:i.concat(o).concat(l),horizontal:r.concat(a).concat(s)}}(t.boxes),l=s.vertical,c=s.horizontal;Oo(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const d=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:o,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/d,hBoxMaxHeight:a/2}),u=Object.assign({},o);Cl(u,Ma(i));const p=Object.assign({maxPadding:u,w:r,h:a,x:o.left,y:o.top},o),f=Ml(l.concat(c),h);Tl(s.fullSize,p,h,f),Tl(l,p,h,f),Tl(c,p,h,f)&&Tl(l,p,h,f),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(p),Pl(s.leftAndTop,p,h,f),p.x+=p.w,p.y+=p.h,Pl(s.rightAndBottom,p,h,f),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Oo(s.chartArea,e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Ll{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}updateConfig(t){}}class Nl extends Ll{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Il="$chartjs",Fl={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},zl=t=>null===t||""===t;const Bl=!!ps&&{passive:!0};function Yl(t,e,n){t.canvas.removeEventListener(e,n,Bl)}function Vl(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Hl(t,e,n){const i=t.canvas,o=new MutationObserver(t=>{let e=!1;for(const n of t)e=e||Vl(n.addedNodes,i),e=e&&!Vl(n.removedNodes,i);e&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function Wl(t,e,n){const i=t.canvas,o=new MutationObserver(t=>{let e=!1;for(const n of t)e=e||Vl(n.removedNodes,i),e=e&&!Vl(n.addedNodes,i);e&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const jl=new Map;let Ul=0;function Gl(){const t=window.devicePixelRatio;t!==Ul&&(Ul=t,jl.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Xl(t,e,n){const i=t.canvas,o=i&&is(i);if(!o)return;const r=go((t,e)=>{const i=o.clientWidth;n(t,e),i<o.clientWidth&&n()},window),a=new ResizeObserver(t=>{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||r(n,i)});return a.observe(o),function(t,e){jl.size||window.addEventListener("resize",Gl),jl.set(t,e)}(t,r),a}function ql(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){jl.delete(t),jl.size||window.removeEventListener("resize",Gl)}(t)}function Zl(t,e,n){const i=t.canvas,o=go(e=>{null!==t.ctx&&n(function(t,e){const n=Fl[t.type]||t.type,{x:i,y:o}=cs(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==o?o:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,n){t.addEventListener(e,n,Bl)}(i,e,o),o}class Kl extends Ll{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),o=t.getAttribute("width");if(t[Il]={initial:{height:i,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",zl(o)){const e=fs(t,"width");void 0!==e&&(t.width=e)}if(zl(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=fs(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Il])return!1;const n=e[Il].initial;["height","width"].forEach(t=>{const i=n[t];_o(i)?e.removeAttribute(t):e.setAttribute(t,i)});const i=n.style||{};return Object.keys(i).forEach(t=>{e.style[t]=i[t]}),e.width=e.width,delete e[Il],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),o={attach:Hl,detach:Wl,resize:Xl}[e]||Zl;i[e]=o(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];if(!i)return;({attach:ql,detach:ql,resize:ql}[e]||Yl)(t,e,i),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return hs(t,e,n,i)}isAttached(t){const e=is(t);return!(!e||!e.isConnected)}}class Jl{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return tr(this.x)&&tr(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const i={};return t.forEach(t=>{i[t]=n[t]&&n[t].active()?n[t]._to:this[t]}),i}}Jl.defaults={},Jl.defaultRoutes=void 0;const Ql={values:t=>wo(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let o,r=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),r=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t));return n}(t,n)}const a=Ko(Math.abs(r)),s=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:o,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),ys(t,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=t/Math.pow(10,Math.floor(Ko(t)));return 1===i||2===i||5===i?Ql.numeric.call(this,t,e,n):""}};var tc={formatters:Ql};function ec(t,e){const n=t.options.ticks,i=n.maxTicksLimit||function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),o=t._maxLength/n;return Math.floor(Math.min(i,o))}(t),o=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}(e):[],r=o.length,a=o[0],s=o[r-1],l=[];if(r>i)return function(t,e,n,i){let o,r=0,a=n[0];for(i=Math.ceil(i),o=0;o<t.length;o++)o===a&&(e.push(t[o]),r++,a=n[r*i])}(e,l,o,r/i),l;const c=function(t,e,n){const i=function(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}(t),o=e.length/n;if(!i)return Math.max(o,1);const r=function(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i===0&&(e.push(i),e.push(t/i));return n===(0|n)&&e.push(n),e.sort((t,e)=>t-e).pop(),e}(i);for(let t=0,e=r.length-1;t<e;t++){const e=r[t];if(e>o)return e}return Math.max(o,1)}(o,e,i);if(r>0){let t,n;const i=r>1?Math.round((s-a)/(r-1)):null;for(nc(e,l,c,_o(i)?0:a-i,a),t=0,n=r-1;t<n;t++)nc(e,l,c,o[t],o[t+1]);return nc(e,l,c,s,_o(i)?e.length:s+i),l}return nc(e,l,c),l}function nc(t,e,n,i,o){const r=Mo(i,0),a=Math.min(Mo(o,t.length),t.length);let s,l,c,d=0;for(n=Math.ceil(n),o&&(s=o-i,n=s/Math.floor(s/n)),c=r;c<0;)d++,c=Math.round(r+d*n);for(l=Math.max(r,0);l<a;l++)l===c&&(e.push(t[l]),d++,c=Math.round(r+d*n))}ia.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.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:tc.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ia.route("scale.ticks","color","","color"),ia.route("scale.grid","color","","borderColor"),ia.route("scale.grid","borderColor","","borderColor"),ia.route("scale.title","color","","color"),ia.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),ia.describe("scales",{_fallback:"scale"}),ia.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const ic=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n;function oc(t,e){const n=[],i=t.length/e,o=t.length;let r=0;for(;r<o;r+=i)n.push(t[Math.floor(r)]);return n}function rc(t,e,n){const i=t.ticks.length,o=Math.min(e,i-1),r=t._startPixel,a=t._endPixel,s=1e-6;let l,c=t.getPixelForTick(o);if(!(n&&(l=1===i?Math.max(c-r,a-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(o-1))/2,c+=o<e?l:-l,c<r-s||c>a+s)))return c}function sc(t){return t.drawTicks?t.tickLength:0}function lc(t,e){if(!t.display)return 0;const n=Da(t.font,e),i=Ma(t.padding);return(wo(t.text)?t.text.length:1)*n.lineHeight+i.height}function cc(t,e,n){let i=bo(t);return(n&&"right"!==e||!n&&"right"===e)&&(i=(t=>"left"===t?"right":"right"===t?"left":t)(i)),i}class dc extends Jl{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=Eo(t,Number.POSITIVE_INFINITY),e=Eo(e,Number.NEGATIVE_INFINITY),n=Eo(n,Number.POSITIVE_INFINITY),i=Eo(i,Number.NEGATIVE_INFINITY),{min:Eo(t,n),max:Eo(e,i),minDefined:So(t),maxDefined:So(e)}}getMinMax(t){let e,{min:n,max:i,minDefined:o,maxDefined:r}=this.getUserBounds();if(o&&r)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)e=a[s].controller.getMinMax(this,t),o||(n=Math.min(n,e.min)),r||(i=Math.max(i,e.max));return n=r&&n>i?i:n,i=o&&n>i?n:i,{min:Eo(n,Eo(i,n)),max:Eo(i,Eo(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Co(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:i,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,n){const{min:i,max:o}=t,r=Do(e,(o-i)/2),a=(t,e)=>n&&0===t?0:t+e;return{min:a(i,-Math.abs(r)),max:a(o,r)}}(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?oc(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=ec(this,this.ticks),this._labelSizes=null),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,n=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,n=!n),this._startPixel=t,this._endPixel=e,this._reversePixels=n,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Co(this.options.afterUpdate,[this])}beforeSetDimensions(){Co(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Co(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Co(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Co(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,i,o;for(n=0,i=t.length;n<i;n++)o=t[n],o.label=Co(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){Co(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Co(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=this.ticks.length,i=e.minRotation||0,o=e.maxRotation;let r,a,s,l=i;if(!this._isVisible()||!e.display||i>=o||n<=1||!this.isHorizontal())return void(this.labelRotation=i);const c=this._getLabelSizes(),d=c.widest.width,h=c.highest.height,u=ur(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/n:u/(n-1),d+6>r&&(r=u/(n-(t.offset?.5:1)),a=this.maxHeight-sc(t.grid)-e.padding-lc(t.title,this.chart.options.font),s=Math.sqrt(d*d+h*h),l=or(Math.min(Math.asin(ur((c.highest.height+6)/r,-1,1)),Math.asin(ur(a/s,-1,1))-Math.asin(ur(h/s,-1,1)))),l=Math.max(i,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){Co(this.options.afterCalculateLabelRotation,[this])}beforeFit(){Co(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:i,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const r=lc(i,e.options.font);if(a?(t.width=this.maxWidth,t.height=sc(o)+r):(t.height=this.maxHeight,t.width=sc(o)+r),n.display&&this.ticks.length){const{first:e,last:i,widest:o,highest:r}=this._getLabelSizes(),s=2*n.padding,l=ir(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(a){const e=n.mirror?0:d*o.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{const e=n.mirror?0:c*o.width+d*r.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,i,d,c)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,i){const{ticks:{align:o,padding:r},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;s?l?(d=i*t.width,h=n*e.height):(d=n*t.height,h=i*e.width):"start"===o?h=e.width:"end"===o?d=t.width:(d=t.width/2,h=e.width/2),this.paddingLeft=Math.max((d-a+r)*this.width/(this.width-a),0),this.paddingRight=Math.max((h-c+r)*this.width/(this.width-c),0)}else{let n=e.height/2,i=t.height/2;"start"===o?(n=0,i=t.height):"end"===o&&(n=e.height,i=0),this.paddingTop=n+r,this.paddingBottom=i+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Co(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,n=t.length;e<n;e++)_o(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=oc(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length)}return t}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:i}=this,o=[],r=[];let a,s,l,c,d,h,u,p,f,m,g,b=0,x=0;for(a=0;a<e;++a){if(c=t[a].label,d=this._resolveTickFontOptions(a),n.font=h=d.string,u=i[h]=i[h]||{data:{},gc:[]},p=d.lineHeight,f=m=0,_o(c)||wo(c)){if(wo(c))for(s=0,l=c.length;s<l;++s)g=c[s],_o(g)||wo(g)||(f=oa(n,u.data,u.gc,f,g),m+=p)}else f=oa(n,u.data,u.gc,f,c),m=p;o.push(f),r.push(m),b=Math.max(f,b),x=Math.max(m,x)}!function(t,e){Oo(t,t=>{const n=t.gc,i=n.length/2;let o;if(i>e){for(o=0;o<i;++o)delete t.data[n[o]];n.splice(0,i)}})}(i,e);const y=o.indexOf(b),v=r.indexOf(x),_=t=>({width:o[t]||0,height:r[t]||0});return{first:_(0),last:_(e-1),widest:_(y),highest:_(v),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ur(this._alignToPixels?sa(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=function(t,e,n){return Oa(t,{tick:n,index:e,type:"tick"})}(this.getContext(),t,n))}return this.$context||(this.$context=Oa(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=ir(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,s=o?o.highest.height+r:0;return this.isHorizontal()?s*n>a*i?a/n:s/i:s*i<a*n?s/n:a/i}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,i=this.options,{grid:o,position:r}=i,a=o.offset,s=this.isHorizontal(),l=this.ticks.length+(a?1:0),c=sc(o),d=[],h=o.setContext(this.getContext()),u=h.drawBorder?h.borderWidth:0,p=u/2,f=function(t){return sa(n,t,u)};let m,g,b,x,y,v,_,w,k,S,E,M;if("top"===r)m=f(this.bottom),v=this.bottom-c,w=m-p,S=f(t.top)+p,M=t.bottom;else if("bottom"===r)m=f(this.top),S=t.top,M=f(t.bottom)-p,v=m+p,w=this.top+c;else if("left"===r)m=f(this.right),y=this.right-c,_=m-p,k=f(t.left)+p,E=t.right;else if("right"===r)m=f(this.left),k=t.left,E=f(t.right)-p,y=m+p,_=this.left+c;else if("x"===e){if("center"===r)m=f((t.top+t.bottom)/2+.5);else if(ko(r)){const t=Object.keys(r)[0],e=r[t];m=f(this.chart.scales[t].getPixelForValue(e))}S=t.top,M=t.bottom,v=m+p,w=v+c}else if("y"===e){if("center"===r)m=f((t.left+t.right)/2);else if(ko(r)){const t=Object.keys(r)[0],e=r[t];m=f(this.chart.scales[t].getPixelForValue(e))}y=m-p,_=y-c,k=t.left,E=t.right}const D=Mo(i.ticks.maxTicksLimit,l),C=Math.max(1,Math.ceil(l/D));for(g=0;g<l;g+=C){const t=o.setContext(this.getContext(g)),e=t.lineWidth,i=t.color,r=o.borderDash||[],l=t.borderDashOffset,c=t.tickWidth,h=t.tickColor,u=t.tickBorderDash||[],p=t.tickBorderDashOffset;b=rc(this,g,a),void 0!==b&&(x=sa(n,b,e),s?y=_=k=E=x:v=w=S=M=x,d.push({tx1:y,ty1:v,tx2:_,ty2:w,x1:k,y1:S,x2:E,y2:M,width:e,color:i,borderDash:r,borderDashOffset:l,tickWidth:c,tickColor:h,tickBorderDash:u,tickBorderDashOffset:p}))}return this._ticksLength=l,this._borderValue=m,d}_computeLabelItems(t){const e=this.axis,n=this.options,{position:i,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:c,mirror:d}=o,h=sc(n.grid),u=h+c,p=d?-c:u,f=-ir(this.labelRotation),m=[];let g,b,x,y,v,_,w,k,S,E,M,D,C="middle";if("top"===i)_=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===i)_=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===i){const t=this._getYAxisLabelAlignment(h);w=t.textAlign,v=t.x}else if("right"===i){const t=this._getYAxisLabelAlignment(h);w=t.textAlign,v=t.x}else if("x"===e){if("center"===i)_=(t.top+t.bottom)/2+u;else if(ko(i)){const t=Object.keys(i)[0],e=i[t];_=this.chart.scales[t].getPixelForValue(e)+u}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===i)v=(t.left+t.right)/2-u;else if(ko(i)){const t=Object.keys(i)[0],e=i[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(h).textAlign}"y"===e&&("start"===s?C="top":"end"===s&&(C="bottom"));const O=this._getLabelSizes();for(g=0,b=a.length;g<b;++g){x=a[g],y=x.label;const t=o.setContext(this.getContext(g));k=this.getPixelForTick(g)+o.labelOffset,S=this._resolveTickFontOptions(g),E=S.lineHeight,M=wo(y)?y.length:1;const e=M/2,n=t.color,s=t.textStrokeColor,c=t.textStrokeWidth;let h;if(r?(v=k,D="top"===i?"near"===l||0!==f?-M*E+E/2:"center"===l?-O.highest.height/2-e*E+E:-O.highest.height+E/2:"near"===l||0!==f?E/2:"center"===l?O.highest.height/2-e*E:O.highest.height-M*E,d&&(D*=-1)):(_=k,D=(1-M)*E/2),t.showLabelBackdrop){const e=Ma(t.backdropPadding),n=O.heights[g],i=O.widths[g];let o=_+D-e.top,r=v-e.left;switch(C){case"middle":o-=n/2;break;case"bottom":o-=n}switch(w){case"center":r-=i/2;break;case"right":r-=i}h={left:r,top:o,width:i+e.width,height:n+e.height,color:t.backdropColor}}m.push({rotation:f,label:y,font:S,color:n,strokeColor:s,strokeWidth:c,textOffset:D,textAlign:w,textBaseline:C,translation:[v,_],backdrop:h})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ir(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align&&(n="right"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:i,padding:o}}=this.options,r=t+o,a=this._getLabelSizes().widest.width;let s,l;return"left"===e?i?(l=this.right+o,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-r,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l=this.left)):"right"===e?i?(l=this.left+o,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+r,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:i,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,i,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(e=>e.value===t);if(n>=0){return e.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(e.display)for(o=0,r=i.length;o<r;++o){const t=i[o];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:n}}=this,i=n.setContext(this.getContext()),o=n.drawBorder?i.borderWidth:0;if(!o)return;const r=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let s,l,c,d;this.isHorizontal()?(s=sa(t,this.left,o)-o/2,l=sa(t,this.right,r)+r/2,c=d=a):(c=sa(t,this.top,o)-o/2,d=sa(t,this.bottom,r)+r/2,s=l=a),e.save(),e.lineWidth=i.borderWidth,e.strokeStyle=i.borderColor,e.beginPath(),e.moveTo(s,c),e.lineTo(l,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,n=this._computeLabelArea();n&&ha(e,n);const i=this._labelItems||(this._labelItems=this._computeLabelItems(t));let o,r;for(o=0,r=i.length;o<r;++o){const t=i[o],n=t.font,r=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),ma(e,r,0,t.textOffset,n,t)}n&&ua(e)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:i}}=this;if(!n.display)return;const o=Da(n.font),r=Ma(n.padding),a=n.align;let s=o.lineHeight/2;"bottom"===e||"center"===e||ko(e)?(s+=r.bottom,wo(n.text)&&(s+=o.lineHeight*(n.text.length-1))):s+=r.top;const{titleX:l,titleY:c,maxWidth:d,rotation:h}=function(t,e,n,i){const{top:o,left:r,bottom:a,right:s,chart:l}=t,{chartArea:c,scales:d}=l;let h,u,p,f=0;const m=a-o,g=s-r;if(t.isHorizontal()){if(u=xo(i,r,s),ko(n)){const t=Object.keys(n)[0],i=n[t];p=d[t].getPixelForValue(i)+m-e}else p="center"===n?(c.bottom+c.top)/2+m-e:ic(t,n,e);h=s-r}else{if(ko(n)){const t=Object.keys(n)[0],i=n[t];u=d[t].getPixelForValue(i)-g+e}else u="center"===n?(c.left+c.right)/2-g+e:ic(t,n,e);p=xo(i,a,o),f="left"===n?-Xo:Xo}return{titleX:u,titleY:p,maxWidth:h,rotation:f}}(this,s,e,a);ma(t,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:h,textAlign:cc(a,e,i),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=Mo(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===dc.prototype.draw?[{z:n,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let o,r;for(o=0,r=e.length;o<r;++o){const r=e[o];r[n]!==this.id||t&&r.type!==t||i.push(r)}return i}_resolveTickFontOptions(t){return Da(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class hc{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;(function(t){return"id"in t&&"defaults"in t})(e)&&(n=this.register(e));const i=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,function(t,e,n){const i=Ro(Object.create(null),[n?ia.get(n):{},ia.get(e),t.defaults]);ia.set(e,i),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(n=>{const i=n.split("."),o=i.pop(),r=[t].concat(i).join("."),a=e[n].split("."),s=a.pop(),l=a.join(".");ia.route(r,o,l,s)})}(e,t.defaultRoutes);t.descriptors&&ia.describe(e,t.descriptors)}(t,r,n),this.override&&ia.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in ia[i]&&(delete ia[i][n],this.override&&delete Qr[n])}}var uc=new class{constructor(){this.controllers=new hc(Gs,"datasets",!0),this.elements=new hc(Jl,"elements"),this.plugins=new hc(Object,"plugins"),this.scales=new hc(dc,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(e=>{const i=n||this._getRegistryForType(e);n||i.isForType(e)||i===this.plugins&&e.id?this._exec(t,i,e):Oo(e,e=>{const i=n||this._getRegistryForType(e);this._exec(t,i,e)})})}_exec(t,e,n){const i=zo(t);Co(n["before"+i],[],n),e[t](n),Co(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const i=e.get(t);if(void 0===i)throw new Error('"'+t+'" is not a registered '+n+".");return i}};class pc{constructor(){this._init=[]}notify(t,e,n,i){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),r=this._notify(o,t,e,n);return"afterDestroy"===e&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,n,i){i=i||{};for(const o of t){const t=o.plugin;if(!1===Co(t[n],[e,i,o.options],t)&&i.cancelable)return!1}return!0}invalidate(){_o(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=Mo(n.options&&n.options.plugins,{}),o=function(t){const e=[],n=Object.keys(uc.plugins.items);for(let t=0;t<n.length;t++)e.push(uc.getPlugin(n[t]));const i=t.plugins||[];for(let t=0;t<i.length;t++){const n=i[t];-1===e.indexOf(n)&&e.push(n)}return e}(n);return!1!==i||e?function(t,e,n,i){const o=[],r=t.getContext();for(let a=0;a<e.length;a++){const s=e[a],l=fc(n[s.id],i);null!==l&&o.push({plugin:s,options:mc(t.config,s,l,r)})}return o}(t,o,i,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,i=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function fc(t,e){return e||!1!==t?!0===t?{}:t:null}function mc(t,e,n,i){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return t.createResolver(r,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function gc(t,e){const n=ia.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function xc(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(n=e.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||t.charAt(0).toLowerCase();var n}function yc(t){const e=t.options||(t.options={});e.plugins=Mo(e.plugins,{}),e.scales=function(t,e){const n=Qr[t.type]||{scales:{}},i=e.scales||{},o=gc(t.type,e),r=Object.create(null),a=Object.create(null);return Object.keys(i).forEach(t=>{const e=i[t];if(!ko(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const s=xc(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(s,o),c=n.scales||{};r[s]=r[s]||t,a[t]=Lo(Object.create(null),[{axis:s},e,c[s],c[l]])}),t.data.datasets.forEach(n=>{const o=n.type||t.type,s=n.indexAxis||gc(o,e),l=(Qr[o]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,s),o=n[e+"AxisID"]||r[e]||e;a[o]=a[o]||Object.create(null),Lo(a[o],[{axis:e},i[o],l[t]])})}),Object.keys(a).forEach(t=>{const e=a[t];Lo(e,[ia.scales[e.type],ia.scale])}),a}(t,e)}function vc(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const _c=new Map,wc=new Set;function kc(t,e){let n=_c.get(t);return n||(n=e(),_c.set(t,n),wc.add(n)),n}const Sc=(t,e,n)=>{const i=Fo(e,n);void 0!==i&&t.add(i)};class Ec{constructor(t){this._config=function(t){return(t=t||{}).data=vc(t.data),yc(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=vc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),yc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return kc(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return kc(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return kc(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return kc(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:o}=this,r=this._cachedScopes(t,n),a=r.get(e);if(a)return a;const s=new Set;e.forEach(e=>{t&&(s.add(t),e.forEach(e=>Sc(s,t,e))),e.forEach(t=>Sc(s,i,t)),e.forEach(t=>Sc(s,Qr[o]||{},t)),e.forEach(t=>Sc(s,ia,t)),e.forEach(t=>Sc(s,ta,t))});const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),wc.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Qr[e]||{},ia.datasets[e]||{},{type:e},ia,ta]}resolveNamedOptions(t,e,n,i=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Mc(this._resolverCache,t,i);let s=r;if(function(t,e){const{isScriptable:n,isIndexable:i}=Fa(t);for(const o of e){const e=n(o),r=i(o),a=(r||e)&&t[o];if(e&&(Yo(a)||Dc(a))||r&&wo(a))return!0}return!1}(r,e)){o.$shared=!1;s=Ia(r,n=Yo(n)?n():n,this.createResolver(t,n,a))}for(const t of e)o[t]=s[t];return o}createResolver(t,e,n=[""],i){const{resolver:o}=Mc(this._resolverCache,t,n);return ko(e)?Ia(o,e,void 0,i):o}}function Mc(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const o=n.join();let r=i.get(o);if(!r){r={resolver:Na(e,n),subPrefixes:n.filter(t=>!t.toLowerCase().includes("hover"))},i.set(o,r)}return r}const Dc=t=>ko(t)&&Object.getOwnPropertyNames(t).reduce((e,n)=>e||Yo(t[n]),!1);const Cc=["top","bottom","left","right","chartArea"];function Oc(t,e){return"top"===t||"bottom"===t||-1===Cc.indexOf(t)&&"x"===e}function $c(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function Tc(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Co(n&&n.onComplete,[t],e)}function Ac(t){const e=t.chart,n=e.options.animation;Co(n&&n.onProgress,[t],e)}function Pc(t){return ns()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Rc={},Lc=t=>{const e=Pc(t);return Object.values(Rc).filter(t=>t.canvas===e).pop()};function Nc(t,e,n){const i=Object.keys(t);for(const o of i){const i=+o;if(i>=e){const r=t[o];delete t[o],(n>0||i>e)&&(t[i+n]=r)}}}class Ic{constructor(t,e){const n=this.config=new Ec(e),i=Pc(t),o=Lc(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(t){return!ns()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Nl:Kl}(i)),this.platform.updateConfig(n);const a=this.platform.acquireContext(i,r.aspectRatio),s=a&&a.canvas,l=s&&s.height,c=s&&s.width;this.id=vo(),this.ctx=a,this.canvas=s,this.width=c,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new pc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],Rc[this.id]=this,a&&s?($s.listen(this,"complete",Tc),$s.listen(this,"progress",Ac),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:o}=this;return _o(t)?e&&o?o:i?n/i: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():us(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return la(this.canvas,this.ctx),this}stop(){return $s.stop(this),this}resize(t,e){$s.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,i=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(i,t,e,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,us(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),Co(n.onResize,[this,r],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){Oo(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,i=Object.keys(n).reduce((t,e)=>(t[e]=!1,t),{});let o=[];e&&(o=o.concat(Object.keys(e).map(t=>{const n=e[t],i=xc(t,n),o="r"===i,r="x"===i;return{options:n,dposition:o?"chartArea":r?"bottom":"left",dtype:o?"radialLinear":r?"category":"linear"}}))),Oo(o,e=>{const o=e.options,r=o.id,a=xc(r,o),s=Mo(o.type,e.dtype);void 0!==o.position&&Oc(o.position,a)===Oc(e.dposition)||(o.position=e.dposition),i[r]=!0;let l=null;if(r in n&&n[r].type===s)l=n[r];else{l=new(uc.getScale(s))({id:r,type:s,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(o,t)}),Oo(i,(t,e)=>{t||delete n[e]}),Oo(n,t=>{Rl.configure(this,t,t.options),Rl.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((t,e)=>t.index-e.index),n>e){for(let t=e;t<n;++t)this._destroyDatasetMeta(t);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort($c("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,n)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=e.length;n<i;n++){const i=e[n];let o=this.getDatasetMeta(n);const r=i.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=r,o.indexAxis=i.indexAxis||gc(r,this.options),o.order=i.order||0,o.index=n,o.label=""+i.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const e=uc.getController(r),{datasetElementType:i,dataElementType:a}=ia.datasets[r];Object.assign(e.prototype,{dataElementType:uc.getElement(a),datasetElementType:i&&uc.getElement(i)}),o.controller=new e(this,n),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Oo(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),n=!i&&-1===o.indexOf(e);e.buildOrUpdateElements(n),r=Math.max(+e.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),i||Oo(o,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort($c("z","_idx"));const{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Oo(this.scales,t=>{Rl.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);Vo(e,n)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:o}of e){Nc(t,i,"_removeElements"===n?-o:o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),i=n(0);for(let t=1;t<e;t++)if(!Vo(i,n(t)))return;return Array.from(i).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Rl.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],Oo(this.boxes,t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Yo(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),i={meta:n,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",i)&&(n.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&($s.has(this)?this.attached&&!$s.running(this)&&$s.start(this):(this.draw(),Tc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let i,o;for(i=0,o=e.length;i<o;++i){const o=e[i];t&&!o.visible||n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,i=!n.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(i&&ha(e,{left:!1===n.left?0:o.left-n.left,right:!1===n.right?this.width:o.right+n.right,top:!1===n.top?0:o.top-n.top,bottom:!1===n.bottom?this.height:o.bottom+n.bottom}),t.controller.draw(),i&&ua(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,n,i){const o=_l.modes[e];return"function"==typeof o?o(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter(t=>t&&t._dataset===e).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=Oa(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const i=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,i);Bo(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(e=>e.datasetIndex===t?i:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),$s.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),la(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Rc[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(t,e,n)=>{t.offsetX=e,t.offsetY=n,this._eventHandler(t)};Oo(this.options.events,t=>n(t,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(n,i)=>{t[n]&&(e.removeEventListener(this,n,i),delete t[n])},o=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const a=()=>{i("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){Oo(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Oo(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let o,r,a,s;for("dataset"===e&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,s=t.length;a<s;++a){r=t[a];const e=r&&this.getDatasetMeta(r.datasetIndex).controller;e&&e[i+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:t,index:e})=>{const n=this.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[e],index:e}});!$o(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const i=this.options.hover,o=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),r=o(e,t),a=n?t:o(t,e);r.length&&this.updateHoverStyle(r,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:da(t,this.chartArea,this._minPadding)},i=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",n,i))return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:i=[],options:o}=this,r=e,a=this._getActiveElements(t,i,n,r),s=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,n,i){return n&&"mouseout"!==t.type?i?e:t:null}(t,this._lastEvent,n,s);n&&(this._lastEvent=null,Co(o.onHover,[t,a,this],this),s&&Co(o.onClick,[t,a,this],this));const c=!$o(a,i);return(c||e)&&(this._active=a,this._updateHoverStyles(a,i,e)),this._lastEvent=l,c}_getActiveElements(t,e,n,i){if("mouseout"===t.type)return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}const Fc=()=>Oo(Ic.instances,t=>t._plugins.invalidate()),zc=!0;function Bc(t,e,n){const{startAngle:i,pixelMargin:o,x:r,y:a,outerRadius:s,innerRadius:l}=e;let c=o/s;t.beginPath(),t.arc(r,a,s,i-c,n+c),l>o?(c=o/l,t.arc(r,a,l,n+c,i-c,!0)):t.arc(r,a,o,n+Xo,i-Xo),t.closePath(),t.clip()}function Yc(t,e,n,i){const o=ka(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const r=(n-e)/2,a=Math.min(r,i*e/2),s=t=>{const e=(n-Math.min(r,t))*i/2;return ur(t,0,Math.min(r,e))};return{outerStart:s(o.outerStart),outerEnd:s(o.outerEnd),innerStart:ur(o.innerStart,0,a),innerEnd:ur(o.innerEnd,0,a)}}function Vc(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function Hc(t,e,n,i,o){const{x:r,y:a,startAngle:s,pixelMargin:l,innerRadius:c}=e,d=Math.max(e.outerRadius+i+n-l,0),h=c>0?c+i+n+l:0;let u=0;const p=o-s;if(i){const t=((c>0?c-i:0)+(d>0?d-i:0))/2;u=(p-(0!==t?p*t/(t+i):p))/2}const f=(p-Math.max(.001,p*d-n/Ho)/d)/2,m=s+f+u,g=o-f-u,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=Yc(e,h,d,g-m),_=d-b,w=d-x,k=m+b/_,S=g-x/w,E=h+y,M=h+v,D=m+y/E,C=g-v/M;if(t.beginPath(),t.arc(r,a,d,k,S),x>0){const e=Vc(w,S,r,a);t.arc(e.x,e.y,x,S,g+Xo)}const O=Vc(M,g,r,a);if(t.lineTo(O.x,O.y),v>0){const e=Vc(M,C,r,a);t.arc(e.x,e.y,v,g+Xo,C+Math.PI)}if(t.arc(r,a,h,g-v/h,m+y/h,!0),y>0){const e=Vc(E,D,r,a);t.arc(e.x,e.y,y,D+Math.PI,m-Xo)}const $=Vc(_,m,r,a);if(t.lineTo($.x,$.y),b>0){const e=Vc(_,k,r,a);t.arc(e.x,e.y,b,m-Xo,k)}t.closePath()}function Wc(t,e,n,i,o){const{options:r}=e,{borderWidth:a,borderJoinStyle:s}=r,l="inner"===r.borderAlign;a&&(l?(t.lineWidth=2*a,t.lineJoin=s||"round"):(t.lineWidth=a,t.lineJoin=s||"bevel"),e.fullCircles&&function(t,e,n){const{x:i,y:o,startAngle:r,pixelMargin:a,fullCircles:s}=e,l=Math.max(e.outerRadius-a,0),c=e.innerRadius+a;let d;for(n&&Bc(t,e,r+Wo),t.beginPath(),t.arc(i,o,c,r+Wo,r,!0),d=0;d<s;++d)t.stroke();for(t.beginPath(),t.arc(i,o,l,r,r+Wo),d=0;d<s;++d)t.stroke()}(t,e,l),l&&Bc(t,e,o),Hc(t,e,n,i,o),t.stroke())}Object.defineProperties(Ic,{defaults:{enumerable:zc,value:ia},instances:{enumerable:zc,value:Rc},overrides:{enumerable:zc,value:Qr},registry:{enumerable:zc,value:uc},version:{enumerable:zc,value:"3.7.0"},getChart:{enumerable:zc,value:Lc},register:{enumerable:zc,value:(...t)=>{uc.add(...t),Fc()}},unregister:{enumerable:zc,value:(...t)=>{uc.remove(...t),Fc()}}});class jc extends Jl{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.getProps(["x","y"],n),{angle:o,distance:r}=sr(i,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),h=this.options.spacing/2,u=Mo(d,s-a)>=Wo||hr(o,a,s),p=pr(r,l+h,c+h);return u&&p}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:s,spacing:l}=this.options,c=(i+o)/2,d=(r+a+l+s)/2;return{x:e+Math.cos(c)*d,y:n+Math.sin(c)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,i=(e.offset||0)/2,o=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=n>Wo?Math.floor(n/Wo):0,0===n||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(i){r=i/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*r,Math.sin(e)*r),this.circumference>=Ho&&(r=i)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=function(t,e,n,i){const{fullCircles:o,startAngle:r,circumference:a}=e;let s=e.endAngle;if(o){Hc(t,e,n,i,r+Wo);for(let e=0;e<o;++e)t.fill();isNaN(a)||(s=r+a%Wo,a%Wo===0&&(s+=Wo))}return Hc(t,e,n,i,s),t.fill(),s}(t,this,r,o);Wc(t,this,r,o,a),t.restore()}}function Uc(t,e,n=e){t.lineCap=Mo(n.borderCapStyle,e.borderCapStyle),t.setLineDash(Mo(n.borderDash,e.borderDash)),t.lineDashOffset=Mo(n.borderDashOffset,e.borderDashOffset),t.lineJoin=Mo(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Mo(n.borderWidth,e.borderWidth),t.strokeStyle=Mo(n.borderColor,e.borderColor)}function Gc(t,e,n){t.lineTo(n.x,n.y)}function Xc(t,e,n={}){const i=t.length,{start:o=0,end:r=i-1}=n,{start:a,end:s}=e,l=Math.max(o,a),c=Math.min(r,s),d=o<a&&r<a||o>s&&r>s;return{count:i,start:l,loop:e.loop,ilen:c<l&&!d?i+c-l:c-l}}function qc(t,e,n,i){const{points:o,options:r}=e,{count:a,start:s,loop:l,ilen:c}=Xc(o,n,i),d=function(t){return t.stepped?pa:t.tension||"monotone"===t.cubicInterpolationMode?fa:Gc}(r);let h,u,p,{move:f=!0,reverse:m}=i||{};for(h=0;h<=c;++h)u=o[(s+(m?c-h:h))%a],u.skip||(f?(t.moveTo(u.x,u.y),f=!1):d(t,p,u,m,r.stepped),p=u);return l&&(u=o[(s+(m?c:0))%a],d(t,p,u,m,r.stepped)),!!l}function Zc(t,e,n,i){const o=e.points,{count:r,start:a,ilen:s}=Xc(o,n,i),{move:l=!0,reverse:c}=i||{};let d,h,u,p,f,m,g=0,b=0;const x=t=>(a+(c?s-t:t))%r,y=()=>{p!==f&&(t.lineTo(g,f),t.lineTo(g,p),t.lineTo(g,m))};for(l&&(h=o[x(0)],t.moveTo(h.x,h.y)),d=0;d<=s;++d){if(h=o[x(d)],h.skip)continue;const e=h.x,n=h.y,i=0|e;i===u?(n<p?p=n:n>f&&(f=n),g=(b*g+e)/++b):(y(),t.lineTo(e,n),u=i,b=0,p=f=n),m=n}y()}function Kc(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n)?Zc:qc}jc.id="arc",jc.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},jc.defaultRoutes={backgroundColor:"backgroundColor"};const Jc="function"==typeof Path2D;function Qc(t,e,n,i){Jc&&!e.options.segment?function(t,e,n,i){let o=e._path;o||(o=e._path=new Path2D,e.path(o,n,i)&&o.closePath()),Uc(t,e.options),t.stroke(o)}(t,e,n,i):function(t,e,n,i){const{segments:o,options:r}=e,a=Kc(e);for(const s of o)Uc(t,r,s.style),t.beginPath(),a(t,e,s,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}class td extends Jl{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;es(this._points,n,t,i,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=function(t,e){const n=t.points,i=t.options.spanGaps,o=n.length;if(!o)return[];const r=!!t._loop,{start:a,end:s}=function(t,e,n,i){let o=0,r=e-1;if(n&&!i)for(;o<e&&!t[o].skip;)o++;for(;o<e&&t[o].skip;)o++;for(o%=e,n&&(r+=o);r>o&&t[r%e].skip;)r--;return r%=e,{start:o,end:r}}(n,o,r,i);return Ds(t,!0===i?[{start:a,end:s,loop:r}]:function(t,e,n,i){const o=t.length,r=[];let a,s=e,l=t[e];for(a=e+1;a<=n;++a){const n=t[a%o];n.skip||n.stop?l.skip||(i=!1,r.push({start:e%o,end:(a-1)%o,loop:i}),e=s=n.stop?a:null):(s=a,l.skip&&(e=a)),l=n}return null!==s&&r.push({start:e%o,end:s%o,loop:i}),r}(n,a,s<a?s+o:s,!!t._fullLoop&&0===a&&s===o-1),n,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,i=t[e],o=this.points,r=Ms(this,{property:e,start:i,end:i});if(!r.length)return;const a=[],s=function(t){return t.stepped?gs:t.tension||"monotone"===t.cubicInterpolationMode?bs:ms}(n);let l,c;for(l=0,c=r.length;l<c;++l){const{start:c,end:d}=r[l],h=o[c],u=o[d];if(h===u){a.push(h);continue}const p=s(h,u,Math.abs((i-h[e])/(u[e]-h[e])),n.stepped);p[e]=t[e],a.push(p)}return 1===a.length?a[0]:a}pathSegment(t,e,n){return Kc(this)(t,this,e,n)}path(t,e,n){const i=this.segments,o=Kc(this);let r=this._loop;e=e||0,n=n||this.points.length-e;for(const a of i)r&=o(t,this,a,{start:e,end:e+n-1});return!!r}draw(t,e,n,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Qc(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ed(t,e,n,i){const o=t.options,{[n]:r}=t.getProps([n],i);return Math.abs(e-r)<o.radius+o.hitRadius}td.id="line",td.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},td.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},td.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class nd extends Jl{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.options,{x:o,y:r}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,e){return ed(this,t,"x",e)}inYRange(t,e){return ed(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const n=this.options;this.skip||n.radius<.1||!da(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,ca(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function id(t,e){const{x:n,y:i,base:o,width:r,height:a}=t.getProps(["x","y","base","width","height"],e);let s,l,c,d,h;return t.horizontal?(h=a/2,s=Math.min(n,o),l=Math.max(n,o),c=i-h,d=i+h):(h=r/2,s=n-h,l=n+h,c=Math.min(i,o),d=Math.max(i,o)),{left:s,top:c,right:l,bottom:d}}function od(t,e,n,i){return t?0:ur(e,n,i)}function rd(t){const e=id(t),n=e.right-e.left,i=e.bottom-e.top,o=function(t,e,n){const i=t.options.borderWidth,o=t.borderSkipped,r=Sa(i);return{t:od(o.top,r.top,0,n),r:od(o.right,r.right,0,e),b:od(o.bottom,r.bottom,0,n),l:od(o.left,r.left,0,e)}}(t,n/2,i/2),r=function(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,r=Ea(o),a=Math.min(e,n),s=t.borderSkipped,l=i||ko(o);return{topLeft:od(!l||s.top||s.left,r.topLeft,0,a),topRight:od(!l||s.top||s.right,r.topRight,0,a),bottomLeft:od(!l||s.bottom||s.left,r.bottomLeft,0,a),bottomRight:od(!l||s.bottom||s.right,r.bottomRight,0,a)}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:r},inner:{x:e.left+o.l,y:e.top+o.t,w:n-o.l-o.r,h:i-o.t-o.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,r.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(o.b,o.r))}}}}function sd(t,e,n,i){const o=null===e,r=null===n,a=t&&!(o&&r)&&id(t,i);return a&&(o||pr(e,a.left,a.right))&&(r||pr(n,a.top,a.bottom))}function ld(t,e){t.rect(e.x,e.y,e.w,e.h)}function cd(t,e,n={}){const i=t.x!==n.x?-e:0,o=t.y!==n.y?-e:0,r=(t.x+t.w!==n.x+n.w?e:0)-i,a=(t.y+t.h!==n.y+n.h?e:0)-o;return{x:t.x+i,y:t.y+o,w:t.w+r,h:t.h+a,radius:t.radius}}nd.id="point",nd.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},nd.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class dd extends Jl{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:n,backgroundColor:i}}=this,{inner:o,outer:r}=rd(this),a=(s=r.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?xa:ld;var s;t.save(),r.w===o.w&&r.h===o.h||(t.beginPath(),a(t,cd(r,e,o)),t.clip(),a(t,cd(o,-e,r)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,cd(o,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,n){return sd(this,t,e,n)}inXRange(t,e){return sd(this,t,null,e)}inYRange(t,e){return sd(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+i)/2:e,y:o?n:(n+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}function hd(t,e,n){const i=function(t){const e=t.options,n=e.fill;let i=Mo(n&&n.target,n);return void 0===i&&(i=!!e.backgroundColor),!1!==i&&null!==i&&(!0===i?"origin":i)}(t);if(ko(i))return!isNaN(i.value)&&i;let o=parseFloat(i);return So(o)&&Math.floor(o)===o?("-"!==i[0]&&"+"!==i[0]||(o=e+o),!(o===e||o<0||o>=n)&&o):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}dd.id="bar",dd.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},dd.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class ud{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:i,y:o,radius:r}=this;return e=e||{start:0,end:Wo},t.arc(i,o,r,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:i}=this,o=t.angle;return{x:e+Math.cos(o)*i,y:n+Math.sin(o)*i,angle:o}}}function pd(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:n}=t,i=e.options,o=e.getLabels().length,r=[],a=i.reverse?e.max:e.min,s=i.reverse?e.min:e.max;let l,c,d;if(d="start"===n?a:"end"===n?s:ko(n)?n.value:e.getBaseValue(),i.grid.circular)return c=e.getPointPositionForValue(0,a),new ud({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(d)});for(l=0;l<o;++l)r.push(e.getPointPositionForValue(l,d));return r}(t):function(t){const{scale:e={},fill:n}=t;let i,o=null;return"start"===n?o=e.bottom:"end"===n?o=e.top:ko(n)?o=e.getPixelForValue(n.value):e.getBasePixel&&(o=e.getBasePixel()),So(o)?(i=e.isHorizontal(),{x:i?o:null,y:i?null:o}):null}(t)}function fd(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function md(t,e,n){const i=[];for(let o=0;o<n.length;o++){const r=n[o],{first:a,last:s,point:l}=gd(r,e,"x");if(!(!l||a&&s))if(a)i.unshift(l);else if(t.push(l),!s)break}t.push(...i)}function gd(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const o=i[n],r=t.segments,a=t.points;let s=!1,l=!1;for(let t=0;t<r.length;t++){const e=r[t],i=a[e.start][n],c=a[e.end][n];if(pr(o,i,c)){s=o===i,l=o===c;break}}return{first:s,last:l,point:i}}function xd(t){const{chart:e,fill:n,line:i}=t;if(So(n))return function(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}(e,n);if("stack"===n)return function(t){const{scale:e,index:n,line:i}=t,o=[],r=i.segments,a=i.points,s=function(t,e){const n=[],i=t.getMatchingVisibleMetas("line");for(let t=0;t<i.length;t++){const o=i[t];if(o.index===e)break;o.hidden||n.unshift(o.dataset)}return n}(e,n);s.push(yd({x:null,y:e.bottom},i));for(let t=0;t<r.length;t++){const e=r[t];for(let t=e.start;t<=e.end;t++)md(o,a[t],s)}return new td({points:o,options:{}})}(t);if("shape"===n)return!0;const o=pd(t);return o instanceof ud?o:yd(o,i)}function yd(t,e){let n=[],i=!1;return wo(t)?(i=!0,n=t):n=function(t,e){const{x:n=null,y:i=null}=t||{},o=e.points,r=[];return e.segments.forEach(({start:t,end:e})=>{e=fd(t,e,o);const a=o[t],s=o[e];null!==i?(r.push({x:a.x,y:i}),r.push({x:s.x,y:i})):null!==n&&(r.push({x:n,y:a.y}),r.push({x:n,y:s.y}))}),r}(t,e),n.length?new td({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function vd(t,e,n){let i=t[e].fill;const o=[e];let r;if(!n)return i;for(;!1!==i&&-1===o.indexOf(i);){if(!So(i))return i;if(r=t[i],!r)return!1;if(r.visible)return i;o.push(i),i=r.fill}return!1}function _d(t,e,n){t.beginPath(),e.path(t),t.lineTo(e.last().x,n),t.lineTo(e.first().x,n),t.closePath(),t.clip()}function wd(t,e,n,i){if(i)return;let o=e[t],r=n[t];return"angle"===t&&(o=dr(o),r=dr(r)),{property:t,start:o,end:r}}function kd(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function Sd(t,e,n){const{top:i,bottom:o}=e.chart.chartArea,{property:r,start:a,end:s}=n||{};"x"===r&&(t.beginPath(),t.rect(a,i,s-a,o-i),t.clip())}function Ed(t,e,n,i){const o=e.interpolate(n,i);o&&t.lineTo(o.x,o.y)}function Md(t,e){const{line:n,target:i,property:o,color:r,scale:a}=e,s=function(t,e,n){const i=t.segments,o=t.points,r=e.points,a=[];for(const t of i){let{start:i,end:s}=t;s=fd(i,s,o);const l=wd(n,o[i],o[s],t.loop);if(!e.segments){a.push({source:t,target:l,start:o[i],end:o[s]});continue}const c=Ms(e,l);for(const e of c){const i=wd(n,r[e.start],r[e.end],e.loop),s=Es(t,o,i);for(const t of s)a.push({source:t,target:e,start:{[n]:kd(l,i,"start",Math.max)},end:{[n]:kd(l,i,"end",Math.min)}})}}return a}(n,i,o);for(const{source:e,target:l,start:c,end:d}of s){const{style:{backgroundColor:s=r}={}}=e,h=!0!==i;t.save(),t.fillStyle=s,Sd(t,a,h&&wd(o,c,d)),t.beginPath();const u=!!n.pathSegment(t,e);let p;if(h){u?t.closePath():Ed(t,i,d,o);const e=!!i.pathSegment(t,l,{move:u,reverse:!0});p=u&&e,p||Ed(t,i,c,o)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function Dd(t,e,n){const i=xd(e),{line:o,scale:r,axis:a}=e,s=o.options,l=s.fill,c=s.backgroundColor,{above:d=c,below:h=c}=l||{};i&&o.points.length&&(ha(t,n),function(t,e){const{line:n,target:i,above:o,below:r,area:a,scale:s}=e,l=n._loop?"angle":e.axis;t.save(),"x"===l&&r!==o&&(_d(t,i,a.top),Md(t,{line:n,target:i,color:o,scale:s,property:l}),t.restore(),t.save(),_d(t,i,a.bottom)),Md(t,{line:n,target:i,color:r,scale:s,property:l}),t.restore()}(t,{line:o,target:i,above:d,below:h,area:n,scale:r,axis:a}),ua(t))}var Cd={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,o=[];let r,a,s,l;for(a=0;a<i;++a)r=t.getDatasetMeta(a),s=r.dataset,l=null,s&&s.options&&s instanceof td&&(l={visible:t.isDatasetVisible(a),index:a,fill:hd(s,a,i),chart:t,axis:r.controller.options.indexAxis,scale:r.vScale,line:s}),r.$filler=l,o.push(l);for(a=0;a<i;++a)l=o[a],l&&!1!==l.fill&&(l.fill=vd(o,a,n.propagate))},beforeDraw(t,e,n){const i="beforeDraw"===n.drawTime,o=t.getSortedVisibleDatasetMetas(),r=t.chartArea;for(let e=o.length-1;e>=0;--e){const n=o[e].$filler;n&&(n.line.updateControlPoints(r,n.axis),i&&Dd(t.ctx,n,r))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=t.getSortedVisibleDatasetMetas();for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;n&&Dd(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;i&&!1!==i.fill&&"beforeDatasetDraw"===n.drawTime&&Dd(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Od=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}};class $d extends Jl{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Co(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,n)=>t.sort(e,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const n=t.labels,i=Da(n.font),o=i.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=Od(n,o);let l,c;e.font=i.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(r,o,a,s)+10):(c=this.maxHeight,l=this._fitCols(r,o,a,s)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,i){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=i+a;let d=t;o.textAlign="left",o.textBaseline="middle";let h=-1,u=-c;return this.legendItems.forEach((t,p)=>{const f=n+e/2+o.measureText(t.text).width;(0===p||l[l.length-1]+f+2*a>r)&&(d+=c,l[l.length-(p>0?0:1)]=0,u+=c,h++),s[p]={left:0,top:u,row:h,width:f,height:i},l[l.length-1]+=f+a}),d}_fitCols(t,e,n,i){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=r-t;let d=a,h=0,u=0,p=0,f=0;return this.legendItems.forEach((t,r)=>{const m=n+e/2+o.measureText(t.text).width;r>0&&u+i+2*a>c&&(d+=h+a,l.push({width:h,height:u}),p+=h+a,f++,h=u=0),s[r]={left:p,top:u,col:f,width:m,height:i},h=Math.max(h,m),u+=i+a}),d+=h,l.push({width:h,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:i},rtl:o}}=this,r=vs(o,this.left,this.width);if(this.isHorizontal()){let o=0,a=xo(n,this.left+i,this.right-this.lineWidths[o]);for(const s of e)o!==s.row&&(o=s.row,a=xo(n,this.left+i,this.right-this.lineWidths[o])),s.top+=this.top+t+i,s.left=r.leftForLtr(r.x(a),s.width),a+=s.width+i}else{let o=0,a=xo(n,this.top+t+i,this.bottom-this.columnSizes[o].height);for(const s of e)s.col!==o&&(o=s.col,a=xo(n,this.top+t+i,this.bottom-this.columnSizes[o].height)),s.top=a,s.left+=this.left+i,s.left=r.leftForLtr(r.x(s.left),s.width),a+=s.height+i}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;ha(t,this),this._draw(),ua(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:i}=this,{align:o,labels:r}=t,a=ia.color,s=vs(t.rtl,this.left,this.width),l=Da(r.font),{color:c,padding:d}=r,h=l.size,u=h/2;let p;this.drawTitle(),i.textAlign=s.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=l.string;const{boxWidth:f,boxHeight:m,itemHeight:g}=Od(r,h),b=this.isHorizontal(),x=this._computeTitleHeight();p=b?{x:xo(o,this.left+d,this.right-n[0]),y:this.top+d+x,line:0}:{x:this.left+d,y:xo(o,this.top+x+d,this.bottom-e[0].height),line:0},_s(this.ctx,t.textDirection);const y=g+d;this.legendItems.forEach((v,_)=>{i.strokeStyle=v.fontColor||c,i.fillStyle=v.fontColor||c;const w=i.measureText(v.text).width,k=s.textAlign(v.textAlign||(v.textAlign=r.textAlign)),S=f+u+w;let E=p.x,M=p.y;s.setWidth(this.width),b?_>0&&E+S+d>this.right&&(M=p.y+=y,p.line++,E=p.x=xo(o,this.left+d,this.right-n[p.line])):_>0&&M+y>this.bottom&&(E=p.x=E+e[p.line].width+d,p.line++,M=p.y=xo(o,this.top+x+d,this.bottom-e[p.line].height));!function(t,e,n){if(isNaN(f)||f<=0||isNaN(m)||m<0)return;i.save();const o=Mo(n.lineWidth,1);if(i.fillStyle=Mo(n.fillStyle,a),i.lineCap=Mo(n.lineCap,"butt"),i.lineDashOffset=Mo(n.lineDashOffset,0),i.lineJoin=Mo(n.lineJoin,"miter"),i.lineWidth=o,i.strokeStyle=Mo(n.strokeStyle,a),i.setLineDash(Mo(n.lineDash,[])),r.usePointStyle){const r={radius:f*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},a=s.xPlus(t,f/2);ca(i,r,a,e+u)}else{const r=e+Math.max((h-m)/2,0),a=s.leftForLtr(t,f),l=Ea(n.borderRadius);i.beginPath(),Object.values(l).some(t=>0!==t)?xa(i,{x:a,y:r,w:f,h:m,radius:l}):i.rect(a,r,f,m),i.fill(),0!==o&&i.stroke()}i.restore()}(s.x(E),M,v),E=((t,e,n,i)=>t===(i?"left":"right")?n:"center"===t?(e+n)/2:e)(k,E+f+u,b?E+S:this.right,t.rtl),function(t,e,n){ma(i,n.text,t,e+g/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(E),M,v),b?p.x+=S+d:p.y+=y}),ws(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=Da(e.font),i=Ma(e.padding);if(!e.display)return;const o=vs(t.rtl,this.left,this.width),r=this.ctx,a=e.position,s=n.size/2,l=i.top+s;let c,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+l,d=xo(t.align,d,this.right-h);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+xo(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=xo(a,d,d+h);r.textAlign=o.textAlign(bo(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,ma(r,e.text,u,c,n)}_computeTitleHeight(){const t=this.options.title,e=Da(t.font),n=Ma(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,i,o;if(pr(t,this.left,this.right)&&pr(e,this.top,this.bottom))for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(i=o[n],pr(t,i.left,i.left+i.width)&&pr(e,i.top,i.top+i.height))return this.legendItems[n];return null}handleEvent(t){const e=this.options;if(!function(t,e){if("mousemove"===t&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const i=this._hoveredItem,o=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(i,n);i&&!o&&Co(e.onLeave,[t,i,this],this),this._hoveredItem=n,n&&!o&&Co(e.onHover,[t,n,this],this)}else n&&Co(e.onClick,[t,n,this],this)}}var Td={id:"legend",_element:$d,start(t,e,n){const i=t.legend=new $d({ctx:t.ctx,options:n,chart:t});Rl.configure(t,i,n),Rl.addBox(t,i)},stop(t){Rl.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;Rl.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,o=n.chart;o.isDatasetVisible(i)?(o.hide(i),e.hidden=!0):(o.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:o,color:r}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const a=t.controller.getStyle(n?0:void 0),s=Ma(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:o||a.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)}}};const Ad={average(t){if(!t.length)return!1;let e,n,i=0,o=0,r=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();i+=t.x,o+=t.y,++r}}return{x:i/r,y:o/r}},nearest(t,e){if(!t.length)return!1;let n,i,o,r=e.x,a=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){const i=t[n].element;if(i&&i.hasValue()){const t=lr(e,i.getCenterPoint());t<s&&(s=t,o=i)}}if(o){const t=o.tooltipPosition();r=t.x,a=t.y}return{x:r,y:a}}};function Pd(t,e){return e&&(wo(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Rd(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Ld(t,e){const{element:n,datasetIndex:i,index:o}=e,r=t.getDatasetMeta(i).controller,{label:a,value:s}=r.getLabelAndValue(o);return{chart:t,label:a,parsed:r.getParsed(o),raw:t.data.datasets[i].data[o],formattedValue:s,dataset:r.getDataset(),dataIndex:o,datasetIndex:i,element:n}}function Nd(t,e){const n=t.chart.ctx,{body:i,footer:o,title:r}=t,{boxWidth:a,boxHeight:s}=e,l=Da(e.bodyFont),c=Da(e.titleFont),d=Da(e.footerFont),h=r.length,u=o.length,p=i.length,f=Ma(e.padding);let m=f.height,g=0,b=i.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,h&&(m+=h*c.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),b){m+=p*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(b-p)*l.lineHeight+(b-1)*e.bodySpacing}u&&(m+=e.footerMarginTop+u*d.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){g=Math.max(g,n.measureText(t).width+x)};return n.save(),n.font=c.string,Oo(t.title,y),n.font=l.string,Oo(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?a+2+e.boxPadding:0,Oo(i,t=>{Oo(t.before,y),Oo(t.lines,y),Oo(t.after,y)}),x=0,n.font=d.string,Oo(t.footer,y),n.restore(),g+=f.width,{width:g,height:m}}function Id(t,e,n,i){const{x:o,width:r}=n,{width:a,chartArea:{left:s,right:l}}=t;let c="center";return"center"===i?c=o<=(s+l)/2?"left":"right":o<=r/2?c="left":o>=a-r/2&&(c="right"),function(t,e,n,i){const{x:o,width:r}=i,a=n.caretSize+n.caretPadding;return"left"===t&&o+r+a>e.width||"right"===t&&o-r-a<0||void 0}(c,t,e,n)&&(c="center"),c}function Fd(t,e,n){const i=n.yAlign||e.yAlign||function(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}(t,n);return{xAlign:n.xAlign||e.xAlign||Id(t,e,n,i),yAlign:i}}function zd(t,e,n,i){const{caretSize:o,caretPadding:r,cornerRadius:a}=t,{xAlign:s,yAlign:l}=n,c=o+r,{topLeft:d,topRight:h,bottomLeft:u,bottomRight:p}=Ea(a);let f=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,s);const m=function(t,e,n){let{y:i,height:o}=t;return"top"===e?i+=n:i-="bottom"===e?o+n:o/2,i}(e,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=Math.max(d,u)+o:"right"===s&&(f+=Math.max(h,p)+o),{x:ur(f,0,i.width-e.width),y:ur(m,0,i.height-e.height)}}function Bd(t,e,n){const i=Ma(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function Yd(t){return Pd([],Rd(t))}function Vd(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}class Hd extends Jl{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&e.options.animation&&n.animations,o=new Ls(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,n=this._tooltipItems,Oa(t,{tooltip:e,tooltipItems:n,type:"tooltip"})));var t,e,n}getTitle(t,e){const{callbacks:n}=e,i=n.beforeTitle.apply(this,[t]),o=n.title.apply(this,[t]),r=n.afterTitle.apply(this,[t]);let a=[];return a=Pd(a,Rd(i)),a=Pd(a,Rd(o)),a=Pd(a,Rd(r)),a}getBeforeBody(t,e){return Yd(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:n}=e,i=[];return Oo(t,t=>{const e={before:[],lines:[],after:[]},o=Vd(n,t);Pd(e.before,Rd(o.beforeLabel.call(this,t))),Pd(e.lines,o.label.call(this,t)),Pd(e.after,Rd(o.afterLabel.call(this,t))),i.push(e)}),i}getAfterBody(t,e){return Yd(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:n}=e,i=n.beforeFooter.apply(this,[t]),o=n.footer.apply(this,[t]),r=n.afterFooter.apply(this,[t]);let a=[];return a=Pd(a,Rd(i)),a=Pd(a,Rd(o)),a=Pd(a,Rd(r)),a}_createItems(t){const e=this._active,n=this.chart.data,i=[],o=[],r=[];let a,s,l=[];for(a=0,s=e.length;a<s;++a)l.push(Ld(this.chart,e[a]));return t.filter&&(l=l.filter((e,i,o)=>t.filter(e,i,o,n))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,n))),Oo(l,e=>{const n=Vd(t.callbacks,e);i.push(n.labelColor.call(this,e)),o.push(n.labelPointStyle.call(this,e)),r.push(n.labelTextColor.call(this,e))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),i=this._active;let o,r=[];if(i.length){const t=Ad[n.position].call(this,i,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);const e=this._size=Nd(this,n),a=Object.assign({},t,e),s=Fd(this.chart,n,a),l=zd(n,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,o={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,i){const o=this.getCaretPosition(t,n,i);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:d}=Ea(a),{x:h,y:u}=t,{width:p,height:f}=e;let m,g,b,x,y,v;return"center"===o?(y=u+f/2,"left"===i?(m=h,g=m-r,x=y+r,v=y-r):(m=h+p,g=m+r,x=y-r,v=y+r),b=m):(g="left"===i?h+Math.max(s,c)+r:"right"===i?h+p-Math.max(l,d)-r:this.caretX,"top"===o?(x=u,y=x-r,m=g-r,b=g+r):(x=u+f,y=x+r,m=g+r,b=g-r),v=x),{x1:m,x2:g,x3:b,y1:x,y2:y,y3:v}}drawTitle(t,e,n){const i=this.title,o=i.length;let r,a,s;if(o){const l=vs(n.rtl,this.x,this.width);for(t.x=Bd(this,n.titleAlign,n),e.textAlign=l.textAlign(n.titleAlign),e.textBaseline="middle",r=Da(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=r.string,s=0;s<o;++s)e.fillText(i[s],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,s+1===o&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,i,o){const r=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:s,boxWidth:l,boxPadding:c}=o,d=Da(o.bodyFont),h=Bd(this,"left",o),u=i.x(h),p=s<d.lineHeight?(d.lineHeight-s)/2:0,f=e.y+p;if(o.usePointStyle){const e={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=i.leftForLtr(u,l)+l/2,c=f+s/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ca(t,e,n,c),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ca(t,e,n,c)}else{t.lineWidth=r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const e=i.leftForLtr(u,l-c),n=i.leftForLtr(i.xPlus(u,1),l-c-2),a=Ea(r.borderRadius);Object.values(a).some(t=>0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,xa(t,{x:e,y:f,w:l,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),xa(t,{x:n,y:f+1,w:l-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,f,l,s),t.strokeRect(e,f,l,s),t.fillStyle=r.backgroundColor,t.fillRect(n,f+1,l-2,s-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:i}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:c}=n,d=Da(n.bodyFont);let h=d.lineHeight,u=0;const p=vs(n.rtl,this.x,this.width),f=function(n){e.fillText(n,p.x(t.x+u),t.y+h/2),t.y+=h+o},m=p.textAlign(r);let g,b,x,y,v,_,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Bd(this,m,n),e.fillStyle=n.bodyColor,Oo(this.beforeBody,f),u=a&&"right"!==m?"center"===r?l/2+c:l+2+c:0,y=0,_=i.length;y<_;++y){for(g=i[y],b=this.labelTextColors[y],e.fillStyle=b,Oo(g.before,f),x=g.lines,a&&x.length&&(this._drawColorBox(e,t,y,p,n),h=Math.max(d.lineHeight,s)),v=0,w=x.length;v<w;++v)f(x[v]),h=d.lineHeight;Oo(g.after,f)}u=0,h=d.lineHeight,Oo(this.afterBody,f),t.y-=o}drawFooter(t,e,n){const i=this.footer,o=i.length;let r,a;if(o){const s=vs(n.rtl,this.x,this.width);for(t.x=Bd(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=s.textAlign(n.footerAlign),e.textBaseline="middle",r=Da(n.footerFont),e.fillStyle=n.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(i[a],s.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,e,n,i){const{xAlign:o,yAlign:r}=this,{x:a,y:s}=t,{width:l,height:c}=n,{topLeft:d,topRight:h,bottomLeft:u,bottomRight:p}=Ea(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(a+d,s),"top"===r&&this.drawCaret(t,e,n,i),e.lineTo(a+l-h,s),e.quadraticCurveTo(a+l,s,a+l,s+h),"center"===r&&"right"===o&&this.drawCaret(t,e,n,i),e.lineTo(a+l,s+c-p),e.quadraticCurveTo(a+l,s+c,a+l-p,s+c),"bottom"===r&&this.drawCaret(t,e,n,i),e.lineTo(a+u,s+c),e.quadraticCurveTo(a,s+c,a,s+c-u),"center"===r&&"left"===o&&this.drawCaret(t,e,n,i),e.lineTo(a,s+d),e.quadraticCurveTo(a,s,a+d,s),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,i=n&&n.x,o=n&&n.y;if(i||o){const n=Ad[t.position].call(this,this._active,this._eventPosition);if(!n)return;const r=this._size=Nd(this,t),a=Object.assign({},n,this._size),s=Fd(e,t,a),l=zd(t,a,s,e);i._to===l.x&&o._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=r.width,this.height=r.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const r=Ma(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,i,e),_s(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),ws(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,i=t.map(({datasetIndex:t,index:e})=>{const n=this.chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}),o=!$o(n,i),r=this._positionChanged(i,e);(o||r)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,n),a=this._positionChanged(r,t),s=e||!$o(r,o)||a;return s&&(this._active=r,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}_getActiveElements(t,e,n,i){const o=this.options;if("mouseout"===t.type)return[];if(!i)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:n,caretY:i,options:o}=this,r=Ad[o.position].call(this,t,e);return!1!==r&&(n!==r.x||i!==r.y)}}Hd.positioners=Ad;var Wd={id:"tooltip",_element:Hd,positioners:Ad,afterInit(t,e,n){n&&(t.tooltip=new Hd({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip,n={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",n)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n))},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,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:yo,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:yo,beforeBody:yo,beforeLabel:yo,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return _o(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:yo,afterBody:yo,beforeFooter:yo,footer:yo,afterFooter:yo}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function jd(t,e,n,i){const o=t.indexOf(e);if(-1===o)return((t,e,n,i)=>("string"==typeof e?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n))(t,e,n,i);return o!==t.lastIndexOf(e)?n:o}class Ud extends dc{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:n,label:i}of e)t[n]===i&&t.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(_o(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:ur(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:jd(n,t,Mo(e,t),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(n=0),e||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,i=[];let o=this.getLabels();o=0===t&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=t;n<=e;n++)i.push({value:n});return i}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Gd(t,e){const n=[],{bounds:i,step:o,min:r,max:a,precision:s,count:l,maxTicks:c,maxDigits:d,includeBounds:h}=t,u=o||1,p=c-1,{min:f,max:m}=e,g=!_o(r),b=!_o(a),x=!_o(l),y=(m-f)/(d+1);let v,_,w,k,S=Qo((m-f)/p/u)*u;if(S<1e-14&&!g&&!b)return[{value:f},{value:m}];k=Math.ceil(m/S)-Math.floor(f/S),k>p&&(S=Qo(k*S/p/u)*u),_o(s)||(v=Math.pow(10,s),S=Math.ceil(S*v)/v),"ticks"===i?(_=Math.floor(f/S)*S,w=Math.ceil(m/S)*S):(_=f,w=m),g&&b&&o&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((a-r)/o,S/1e3)?(k=Math.round(Math.min((a-r)/S,c)),S=(a-r)/k,_=r,w=a):x?(_=g?r:_,w=b?a:w,k=l-1,S=(w-_)/k):(k=(w-_)/S,k=er(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const E=Math.max(rr(S),rr(_));v=Math.pow(10,_o(s)?E:s),_=Math.round(_*v)/v,w=Math.round(w*v)/v;let M=0;for(g&&(h&&_!==r?(n.push({value:r}),_<r&&M++,er(Math.round((_+M*S)*v)/v,r,Xd(r,y,t))&&M++):_<r&&M++);M<k;++M)n.push({value:Math.round((_+M*S)*v)/v});return b&&h&&w!==a?n.length&&er(n[n.length-1].value,a,Xd(a,y,t))?n[n.length-1].value=a:n.push({value:a}):b&&w!==a||n.push({value:w}),n}function Xd(t,e,{horizontal:n,minRotation:i}){const o=ir(i),r=(n?Math.sin(o):Math.cos(o))||.001,a=.75*e*(""+t).length;return Math.min(e/r,a)}Ud.id="category",Ud.defaults={ticks:{callback:Ud.prototype.getLabelForValue}};class qd extends dc{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 _o(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:o}=this;const r=t=>i=e?i:t,a=t=>o=n?o:t;if(t){const t=Jo(i),e=Jo(o);t<0&&e<0?a(0):t>0&&e>0&&r(0)}if(i===o){let e=1;(o>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*o)),a(o+e),t||r(i-e)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:n,stepSize:i}=t;return i?(e=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i=Gd({maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&nr(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-e)/Math.max(t.length-1,1)/2;e-=i,n+=i}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return ys(t,this.chart.options.locale,this.options.ticks.format)}}class Zd extends qd{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=So(t)?t:0,this.max=So(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=ir(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Kd(t){return 1===t/Math.pow(10,Math.floor(Ko(t)))}Zd.id="linear",Zd.defaults={ticks:{callback:tc.formatters.numeric}};class Jd extends dc{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=qd.prototype.parse.apply(this,[t,e]);if(0!==n)return So(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=So(t)?Math.max(0,t):null,this.max=So(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,i=this.max;const o=e=>n=t?n:e,r=t=>i=e?i:t,a=(t,e)=>Math.pow(10,Math.floor(Ko(t))+e);n===i&&(n<=0?(o(1),r(10)):(o(a(n,-1)),r(a(i,1)))),n<=0&&o(a(i,-1)),i<=0&&r(a(n,1)),this._zero&&this.min!==this._suggestedMin&&n===a(this.min,0)&&o(a(n,-1)),this.min=n,this.max=i}buildTicks(){const t=this.options,e=function(t,e){const n=Math.floor(Ko(e.max)),i=Math.ceil(e.max/Math.pow(10,n)),o=[];let r=Eo(t.min,Math.pow(10,Math.floor(Ko(e.min)))),a=Math.floor(Ko(r)),s=Math.floor(r/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{o.push({value:r,major:Kd(r)}),++s,10===s&&(s=1,++a,l=a>=0?1:l),r=Math.round(s*Math.pow(10,a)*l)/l}while(a<n||a===n&&s<i);const c=Eo(t.max,r);return o.push({value:c,major:Kd(r)}),o}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&nr(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ys(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ko(t),this._valueRange=Ko(this.max)-Ko(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ko(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Qd(t){const e=t.ticks;if(e.display&&t.display){const t=Ma(e.backdropPadding);return Mo(e.font&&e.font.size,ia.font.size)+t.height}return 0}function th(t,e,n){return n=wo(n)?n:[n],{w:ra(t,e.string,n),h:n.length*e.lineHeight}}function eh(t,e,n,i,o){return t===i||t===o?{start:e-n/2,end:e+n/2}:t<i||t>o?{start:e-n,end:e}:{start:e,end:e+n}}function nh(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],o=[],r=t._pointLabels.length,a=t.options.pointLabels,s=a.centerPointLabels?Ho/r:0;for(let l=0;l<r;l++){const r=a.setContext(t.getPointLabelContext(l));o[l]=r.padding;const c=t.getPointPosition(l,t.drawingArea+o[l],s),d=Da(r.font),h=th(t.ctx,d,t._pointLabels[l]);i[l]=h;const u=dr(t.getIndexAngle(l)+s),p=Math.round(or(u));ih(n,e,u,eh(p,c.x,h.w,0,180),eh(p,c.y,h.h,90,270))}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=function(t,e,n){const i=[],o=t._pointLabels.length,r=t.options,a=Qd(r)/2,s=t.drawingArea,l=r.pointLabels.centerPointLabels?Ho/o:0;for(let r=0;r<o;r++){const o=t.getPointPosition(r,s+a+n[r],l),c=Math.round(or(dr(o.angle+Xo))),d=e[r],h=sh(o.y,d.h,c),u=oh(c),p=rh(o.x,d.w,u);i.push({x:o.x,y:h,textAlign:u,left:p,top:h,right:p+d.w,bottom:h+d.h})}return i}(t,i,o)}function ih(t,e,n,i,o){const r=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let s=0,l=0;i.start<e.l?(s=(e.l-i.start)/r,t.l=Math.min(t.l,e.l-s)):i.end>e.r&&(s=(i.end-e.r)/r,t.r=Math.max(t.r,e.r+s)),o.start<e.t?(l=(e.t-o.start)/a,t.t=Math.min(t.t,e.t-l)):o.end>e.b&&(l=(o.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function oh(t){return 0===t||180===t?"center":t<180?"left":"right"}function rh(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function sh(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}function lh(t,e,n,i){const{ctx:o}=t;if(n)o.arc(t.xCenter,t.yCenter,e,0,Wo);else{let n=t.getPointPosition(0,e);o.moveTo(n.x,n.y);for(let r=1;r<i;r++)n=t.getPointPosition(r,e),o.lineTo(n.x,n.y)}}Jd.id="logarithmic",Jd.defaults={ticks:{callback:tc.formatters.logarithmic,major:{enabled:!0}}};class ch extends qd{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ma(Qd(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=So(t)&&!isNaN(t)?t:0,this.max=So(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Qd(this.options))}generateTickLabels(t){qd.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const n=Co(this.options.pointLabels.callback,[t,e],this);return n||0===n?n:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?nh(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,i))}getIndexAngle(t){return dr(t*(Wo/(this._pointLabels.length||1))+ir(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(_o(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(_o(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return function(t,e,n){return Oa(t,{label:n,index:e,type:"pointLabel"})}(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const i=this.getIndexAngle(t)-Xo+n;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:i,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),lh(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:i}=e,o=this._pointLabels.length;let r,a,s;if(e.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let o=e-1;o>=0;o--){const e=i.setContext(t.getPointLabelContext(o)),r=Da(e.font),{x:a,y:s,textAlign:l,left:c,top:d,right:h,bottom:u}=t._pointLabelItems[o],{backdropColor:p}=e;if(!_o(p)){const t=Ma(e.backdropPadding);n.fillStyle=p,n.fillRect(c-t.left,d-t.top,h-c+t.width,u-d+t.height)}ma(n,t._pointLabels[o],a,s+r.lineHeight/2,r,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,o),i.display&&this.ticks.forEach((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);!function(t,e,n,i){const o=t.ctx,r=e.circular,{color:a,lineWidth:s}=e;!r&&!i||!a||!s||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=s,o.setLineDash(e.borderDash),o.lineDashOffset=e.borderDashOffset,o.beginPath(),lh(t,n,r,i),o.closePath(),o.stroke(),o.restore())}(this,i.setContext(this.getContext(e-1)),a,o)}}),n.display){for(t.save(),r=o-1;r>=0;r--){const i=n.setContext(this.getPointLabelContext(r)),{color:o,lineWidth:l}=i;l&&o&&(t.lineWidth=l,t.strokeStyle=o,t.setLineDash(i.borderDash),t.lineDashOffset=i.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),s=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(s.x,s.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((i,a)=>{if(0===a&&!e.reverse)return;const s=n.setContext(this.getContext(a)),l=Da(s.font);if(o=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){t.font=l.string,r=t.measureText(i.label).width,t.fillStyle=s.backdropColor;const e=Ma(s.backdropPadding);t.fillRect(-r/2-e.left,-o-l.size/2-e.top,r+e.width,l.size+e.height)}ma(t,i.label,0,-o,l,{color:s.color})}),t.restore()}drawTitle(){}}ch.id="radialLinear",ch.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:tc.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},ch.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},ch.descriptors={angleLines:{_fallback:"grid"}};const dh={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}},hh=Object.keys(dh);function uh(t,e){return t-e}function ph(t,e){if(_o(e))return null;const n=t._adapter,{parser:i,round:o,isoWeekday:r}=t._parseOpts;let a=e;return"function"==typeof i&&(a=i(a)),So(a)||(a="string"==typeof i?n.parse(a,i):n.parse(a)),null===a?null:(o&&(a="week"!==o||!tr(r)&&!0!==r?n.startOf(a,o):n.startOf(a,"isoWeek",r)),+a)}function fh(t,e,n,i){const o=hh.length;for(let r=hh.indexOf(t);r<o-1;++r){const t=dh[hh[r]],o=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((n-e)/(o*t.size))<=i)return hh[r]}return hh[o-1]}function mh(t,e,n){if(n){if(n.length){const{lo:i,hi:o}=$a(n,e);t[n[i]>=e?n[i]:n[o]]=!0}}else t[e]=!0}function gh(t,e,n){const i=[],o={},r=e.length;let a,s;for(a=0;a<r;++a)s=e[a],o[s]=a,i.push({value:s,major:!1});return 0!==r&&n?function(t,e,n,i){const o=t._adapter,r=+o.startOf(e[0].value,i),a=e[e.length-1].value;let s,l;for(s=r;s<=a;s=+o.add(s,1,i))l=n[s],l>=0&&(e[l].major=!0);return e}(t,i,o,n):i}class xh extends dc{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const n=t.time||(t.time={}),i=this._adapter=new pl._date(t.adapters.date);Lo(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ph(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:i,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function s(t){r||isNaN(t.min)||(i=Math.min(i,t.min)),a||isNaN(t.max)||(o=Math.max(o,t.max))}r&&a||(s(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||s(this.getMinMax(!1))),i=So(i)&&!isNaN(i)?i:+e.startOf(Date.now(),n),o=So(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,i="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,r=function(t,e,n){let i=0,o=t.length;for(;i<o&&t[i]<e;)i++;for(;o>i&&t[o-1]>n;)o--;return i>0||o<t.length?t.slice(i,o):t}(i,o,this.max);return this._unit=e.unit||(n.autoSkip?fh(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(t,e,n,i,o){for(let r=hh.length-1;r>=hh.indexOf(n);r--){const n=hh[r];if(dh[n].common&&t._adapter.diff(o,i,n)>=e-1)return n}return hh[n?hh.indexOf(n):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(t){for(let e=hh.indexOf(t)+1,n=hh.length;e<n;++e)if(dh[hh[e]].common)return hh[e]}(this._unit):void 0,this.initOffsets(i),t.reverse&&r.reverse(),gh(this,r,this._majorUnit)}initOffsets(t){let e,n,i=0,o=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),i=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,n=this.getDecimalForValue(t[t.length-1]),o=1===t.length?n:(n-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;i=ur(i,0,r),o=ur(o,0,r),this._offsets={start:i,end:o,factor:1/(i+1+o)}}_generate(){const t=this._adapter,e=this.min,n=this.max,i=this.options,o=i.time,r=o.unit||fh(o.minUnit,e,n,this._getLabelCapacity(e)),a=Mo(o.stepSize,1),s="week"===r&&o.isoWeekday,l=tr(s)||!0===s,c={};let d,h,u=e;if(l&&(u=+t.startOf(u,"isoWeek",s)),u=+t.startOf(u,l?"day":r),t.diff(n,e,r)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+r);const p="data"===i.ticks.source&&this.getDataTimestamps();for(d=u,h=0;d<n;d=+t.add(d,a,r),h++)mh(c,d,p);return d!==n&&"ticks"!==i.bounds&&1!==h||mh(c,d,p),Object.keys(c).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,i){const o=this.options,r=o.time.displayFormats,a=this._unit,s=this._majorUnit,l=a&&r[a],c=s&&r[s],d=n[e],h=s&&c&&d&&d.major,u=this._adapter.format(t,i||(h?c:l)),p=o.ticks.callback;return p?Co(p,[u,e,n],this):u}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e<n;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,i=ir(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(i),r=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*r,h:n*r+a*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,i=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,gh(this,[t],this._majorUnit),i),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,n=this._cache.data||[];if(n.length)return n;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(t=0,e=i.length;t<e;++t)n=n.concat(i[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const i=this.getLabels();for(e=0,n=i.length;e<n;++e)t.push(ph(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return La(t.sort(uh))}}function yh(t,e,n){let i,o,r,a,s=0,l=t.length-1;n?(e>=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=Ta(t,"pos",e)),({pos:i,time:r}=t[s]),({pos:o,time:a}=t[l])):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=Ta(t,"time",e)),({time:i,pos:r}=t[s]),({time:o,pos:a}=t[l]));const c=o-i;return c?r+(a-r)*(e-i)/c:r}xh.id="time",xh.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class vh extends xh{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=yh(e,this.min),this._tableRange=yh(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,i=[],o=[];let r,a,s,l,c;for(r=0,a=t.length;r<a;++r)l=t[r],l>=e&&l<=n&&i.push(l);if(i.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(r=0,a=i.length;r<a;++r)c=i[r+1],s=i[r-1],l=i[r],Math.round((c+s)/2)!==l&&o.push({time:l,pos:r/(a-1)});return o}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return t=e.length&&n.length?this.normalize(e.concat(n)):e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(yh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return yh(this._table,n*this._tableRange+this._minPos,!0)}}vh.id="timeseries",vh.defaults=xh.defaults;const _h="label";function wh(t,e){"function"==typeof t?t(e):t&&(t.current=e)}function kh(t,e){t.labels=e}function Sh(t,e,n=_h){const i=[];t.datasets=e.map(e=>{const o=t.datasets.find(t=>t[n]===e[n]);return o&&e.data&&!i.includes(o)?(i.push(o),Object.assign(o,e),o):{...e}})}function Eh(t,e=_h){const n={labels:[],datasets:[]};return kh(n,t.labels),Sh(n,t.datasets,e),n}function Mh({height:t=150,width:e=300,redraw:n=!1,datasetIdKey:i,type:o,data:r,options:a,plugins:s=[],fallbackContent:l,...c},d){const h=ct(null),u=ct(),p=()=>{h.current&&(u.current=new Ic(h.current,{type:o,data:Eh(r,i),options:a,plugins:s}),wh(d,u.current))},f=()=>{wh(d,null),u.current&&(u.current.destroy(),u.current=null)};return dt(()=>{var t,e;!n&&u.current&&a&&(t=u.current,e=a,t.options={...e})},[n,a]),dt(()=>{!n&&u.current&&kh(u.current.config.data,r.labels)},[n,r.labels]),dt(()=>{!n&&u.current&&r.datasets&&Sh(u.current.config.data,r.datasets,i)},[n,r.datasets]),dt(()=>{u.current&&(n?(f(),setTimeout(p)):u.current.update())},[n,a,r.labels,r.datasets]),dt(()=>(p(),()=>f()),[]),et.createElement("canvas",Object.assign({ref:h,role:"img",height:t,width:e},c),l)}const Dh=rt(Mh);Ic.register(Ud,Zd,nd,td,rl,Wd,Td,Cd);const Ch=({xValues:t,yValues:e,dataPrefix:n,dataPostfix:i,straitsXStyle:o,height:r=40})=>{const a=ct(null),[s,l]=lt({datasets:[]}),c={labels:t,datasets:[{data:e}]},d=n||"",h=i||"";dt(()=>{const t=a.current;if(!t)return;const e=t.ctx,n=e.createLinearGradient(0,0,0,280);n.addColorStop(.3,"rgba(47, 141, 238, 0.08)"),n.addColorStop(.6,"rgba(47, 141, 238, 0.0002)"),n.addColorStop(1,"rgba(47, 141, 238, 0");const i=e.createLinearGradient(0,0,0,280);i.addColorStop(0,"rgba(0, 211, 126, 0.2)"),i.addColorStop(.1,"rgba(0, 211, 126, 0.1)"),i.addColorStop(1,"rgba(0, 211, 126, 0)");const r=Object.assign(Object.assign({},c),{datasets:c.datasets.map(t=>Object.assign(Object.assign({},t),{backgroundColor:o?i:n,fill:!0,borderColor:o?"#00D37E":"#2E8DEE",pointRadius:0}))});l(r)},[o,t,e]);const u={maintainAspectRatio:!1,plugins:{legend:{display:!1,labels:{font:{family:"'Inter', 'Arial', sans-serif"}}},tooltip:{intersect:!1,padding:15,displayColors:!1,borderColor:"rgba(0, 211, 126, 1)",borderWidth:o?1:0,backgroundColor:o?"#ffffff":"#000000",titleColor:o?"#1B2736":"#fff",bodyColor:o?"#1B2736":"#fff",titleAlign:"center",bodyAlign:"center",titleFont:{size:14},bodyFont:{size:14},callbacks:{title:t=>o?`${d}${t[0].parsed.y}${h}`:t[0].label,label:t=>o?t.label:`${d}${t.parsed.y}${h}`}}},scales:{x:{ticks:{color:o?"#1B2736":"rgba(0, 0, 0, 0.4)",font:{weight:"500",size:13}},grid:{display:!1}},y:{ticks:{beginAtZero:!0,padding:18,maxTicksLimit:3,color:o?"#1B2736":"rgba(0, 0, 0, 0.4)",callback:t=>`${d}${t}${h}`},grid:{display:!1,drawBorder:!1}}}};return et.createElement("div",{style:{position:"relative",height:`${r}vh`,width:"99%"}},et.createElement(Dh,{id:"chart",ref:a,type:"line",data:s,options:u}))};function Oh(t){var{children:e,activeKey:n,width:i=250}=t,o=jt(t,["children","activeKey","width"]);const{brand:r}=$i(),a=e.map((t,e)=>({key:String(e),label:null,children:t,forceRender:!0})),s=e.map((t,e)=>et.createElement(Ph,{key:e,isActive:e===n,activeColor:r.primary.default}));return et.createElement($h,null,et.createElement(Th,Object.assign({renderTabBar:()=>et.createElement("div",null),width:i,activeKey:n.toString(),animated:!0,items:a},o)),et.createElement(Ah,null,s))}const $h=Vn.div`
|
|
328
328
|
display: flex;
|
|
329
329
|
flex-direction: column;
|
|
330
330
|
justify-content: center;
|
|
@@ -384,7 +384,7 @@ import*as tt from"react";import et,{createContext as nt,createElement as it,Frag
|
|
|
384
384
|
color: ${Ei.text.white};
|
|
385
385
|
box-shadow: none;
|
|
386
386
|
|
|
387
|
-
.ant-tooltip-
|
|
387
|
+
.ant-tooltip-container {
|
|
388
388
|
padding: 12px;
|
|
389
389
|
border-radius: 8px;
|
|
390
390
|
box-shadow: none;
|
|
@@ -500,7 +500,7 @@ import*as tt from"react";import et,{createContext as nt,createElement as it,Frag
|
|
|
500
500
|
${cu}
|
|
501
501
|
${du}
|
|
502
502
|
padding-bottom: 8px;
|
|
503
|
-
`,uu={padding:0,paddingBottom:"4px",borderRadius:"12px"},pu={sm:"md",lg:"lg"},fu={sm:"md",lg:"lg"},mu=t=>et.createElement(et.Fragment,null,t&&et.createElement(tn.Body,{color:Ei.color.base.onNeutralSecondary,size:"sm"},t),et.createElement(Hh,{icon:"keyboard_arrow_down"})),gu=(t,e)=>e?et.createElement(tn.Body,{size:pu[t]},e):null,bu=(t,e,n)=>"multiple"===t?({label:t,onClose:i})=>et.createElement(Zh,{type:e?"disabled":"positive",variant:"removable",size:n,onClick:e?void 0:i},t):void 0,xu=function(t){var{children:e,disabled:n=!1,size:i="sm",mode:o,label:r,labelTooltip:a,selectRef:s,placeholder:l,error:c=!1,secondaryText:d,helperText:h,options:u}=t,p=jt(t,["children","disabled","size","mode","label","labelTooltip","selectRef","placeholder","error","secondaryText","helperText","options"]);const f=ct(null),m=s||f;return et.createElement(eu,null,r&&((t,e)=>t?et.createElement(Qh,null,et.createElement(tn.Body,{size:"md"},t),e?et.createElement(Lh,{placement:"top",title:"I'm Tooltip Component",content:e},et.createElement("span",null,et.createElement(Hh,{icon:"info",size:"xs"}))):null):null)(r,a),et.createElement(ru,Object.assign({disabled:n,mode:o,ref:m,$size:i,$mode:o,getPopupContainer:()=>document.body},p,{error:c,
|
|
503
|
+
`,uu={padding:0,paddingBottom:"4px",borderRadius:"12px"},pu={sm:"md",lg:"lg"},fu={sm:"md",lg:"lg"},mu=t=>et.createElement(et.Fragment,null,t&&et.createElement(tn.Body,{color:Ei.color.base.onNeutralSecondary,size:"sm"},t),et.createElement(Hh,{icon:"keyboard_arrow_down"})),gu=(t,e)=>e?et.createElement(tn.Body,{size:pu[t]},e):null,bu=(t,e,n)=>"multiple"===t?({label:t,onClose:i})=>et.createElement(Zh,{type:e?"disabled":"positive",variant:"removable",size:n,onClick:e?void 0:i},t):void 0,xu=function(t){var{children:e,disabled:n=!1,size:i="sm",mode:o,label:r,labelTooltip:a,selectRef:s,placeholder:l,error:c=!1,secondaryText:d,helperText:h,options:u}=t,p=jt(t,["children","disabled","size","mode","label","labelTooltip","selectRef","placeholder","error","secondaryText","helperText","options"]);const f=ct(null),m=s||f;return et.createElement(eu,null,r&&((t,e)=>t?et.createElement(Qh,null,et.createElement(tn.Body,{size:"md"},t),e?et.createElement(Lh,{placement:"top",title:"I'm Tooltip Component",content:e},et.createElement("span",null,et.createElement(Hh,{icon:"info",size:"xs"}))):null):null)(r,a),et.createElement(ru,Object.assign({disabled:n,mode:o,ref:m,$size:i,$mode:o,getPopupContainer:()=>document.body},p,{error:c,popupRender:t=>et.createElement(hu,{$size:i},et.createElement(tn.Body,{size:"sm"===i?"md":"lg"},t)),popupStyle:uu,suffixIcon:mu(d),placeholder:gu(i,l),tagRender:bu(o,n,i),maxTagCount:999}),u?((t,e)=>t.map(({value:t,label:n,icon:i,disabled:o})=>et.createElement(vt.Option,{key:t,value:t,disabled:o},et.createElement(tu,null,i&&et.createElement(i,{style:{width:"16px",height:"16px"}}),et.createElement(tn.Body,{size:fu[e]},n)))))(u,i):e),(t=>t?et.createElement(tn.Body,{color:Ei.color.base.onNeutralSecondary,size:"sm"},t):null)(h))};xu.Option=vt.Option;const yu=(t,{iconSrc:e=null,extraText:n="",extraAction:i=()=>{},isAddItemBarVisible:o=!0,topContent:r,bottomContent:a,actionContent:s})=>et.createElement(_u,null,r,t,s||(({iconSrc:t=null,extraText:e="",extraAction:n=()=>{},isAddItemBarVisible:i=!0})=>i?et.createElement(ku,{onMouseDown:()=>{n()}},t?et.createElement(wu,{src:t}):et.createElement(Lt,null),e):null)({iconSrc:e,extraText:n,extraAction:i,isAddItemBarVisible:o}),a),vu=t=>{var{className:e="",children:n,disabled:i=!1,mode:o,label:r,iconSrc:a="",extraText:s="",extraAction:l=()=>{},isAddItemBarVisible:c=!0,topContent:d=null,bottomContent:h=null,actionContent:u=null}=t,p=jt(t,["className","children","disabled","mode","label","iconSrc","extraText","extraAction","isAddItemBarVisible","topContent","bottomContent","actionContent"]);return et.createElement(xu,Object.assign({className:e,disabled:i,mode:o,label:r,dropdownRender:t=>yu(t,{iconSrc:a,extraText:s,extraAction:l,isAddItemBarVisible:c,topContent:d,bottomContent:h,actionContent:u})},p),n)};vu.Option=xu.Option;const _u=Vn.div`
|
|
504
504
|
padding-top: 15px;
|
|
505
505
|
`,wu=Vn.img`
|
|
506
506
|
margin-right: 5px;
|
|
@@ -918,7 +918,7 @@ padding-top:
|
|
|
918
918
|
${Qn} {
|
|
919
919
|
display: ${t=>"lg"===t.only?"none":"block"};
|
|
920
920
|
}
|
|
921
|
-
`,Gp=t=>{var{className:e,children:n}=t,i=jt(t,["className","children"]);const o=`\n & .ant-steps-item-title {\n padding-right: 0;\n }\n \n & .ant-steps-item-finish
|
|
921
|
+
`,Gp=t=>{var{className:e,children:n}=t,i=jt(t,["className","children"]);const o=`\n & .ant-steps-item-title {\n padding-right: 0;\n }\n \n & .ant-steps-item-finish .ant-steps-item-title {\n ${ri}\n ${gi}\n }\n \n & .ant-steps-item-process .ant-steps-item-title {\n ${ri}\n ${mi}\n }\n\n & .ant-steps-item-wait .ant-steps-item-title {\n ${ri}\n ${gi}\n color: #777777;\n }\n \n & .ant-steps-item-finish .ant-steps-item-icon {\n background: #43CC32;\n }\n \n &.ant-steps-dot .ant-steps-item-icon {\n width: 13px;\n height: 13px;\n }\n \n &.ant-steps-dot .ant-steps-item-section {\n width: unset;\n max-width: 100%;\n }\n \n &.ant-steps-vertical.ant-steps-dot .ant-steps-item-icon {\n margin-top: 6px;\n }\n \n &.ant-steps-dot .ant-steps-item-rail {\n margin-left: 15px;\n top: 4px;\n left: -9px;\n }\n \n & .ant-steps-item-finish .ant-steps-item-rail {\n border-color: #CACACA;\n }\n\n & .ant-steps-item-process .ant-steps-item-rail {\n background: #CACACA;\n }\n \n &.ant-steps-vertical.ant-steps-dot .ant-steps-item-process .ant-steps-item-icon {\n top: 0;\n left: 0;\n }\n \n &.ant-steps-vertical .ant-steps-item-icon {\n margin-right: 10px;\n }\n `,r=Ze`
|
|
922
922
|
& .ant-steps-item-title {
|
|
923
923
|
white-space: nowrap;
|
|
924
924
|
width: 100%;
|
|
@@ -1012,7 +1012,7 @@ padding-top:
|
|
|
1012
1012
|
.ant-table-tbody > tr:hover > td {
|
|
1013
1013
|
background: ${We.HOVER_SURFACE};
|
|
1014
1014
|
}
|
|
1015
|
-
`,Zp=t=>{var{className:e,emptyText:n}=t,i=jt(t,["className","emptyText"]);return et.createElement(Dt,Object.assign({className:qe(qp,e),locale:{emptyText:n}},i))},Kp=t=>{var{children:e}=t,
|
|
1015
|
+
`,Zp=t=>{var{className:e,emptyText:n}=t,i=jt(t,["className","emptyText"]);return et.createElement(Dt,Object.assign({className:qe(qp,e),locale:{emptyText:n}},i))},Kp=t=>{var{children:e,items:n}=t,i=jt(t,["children","items"]);const{brand:o}=$i(),r=`\n font-family: ${Vi};\n font-size: 16px;\n font-weight: 400;\n\n &.ant-tabs {\n width: 100%;\n }\n\n .ant-tabs-ink-bar {\n z-index: 0;\n }\n\n .ant-tabs-nav .ant-tabs-tab {\n margin-right: 20px;\n padding-top: 8px;\n padding-bottom: 8px;\n }\n\n .ant-tabs-nav .ant-tabs-tab:hover,\n .ant-tabs-nav .ant-tabs-tab-active .ant-tabs-tab-btn {\n color: ${o.primary.default};\n }\n\n .ant-tabs-nav .ant-tabs-tab-active {\n font-weight: 700;\n font-size: 16px;\n font-family: Red Hat Display;\n }\n \n .ant-tabs-ink-bar {\n background-color: ${o.primary.default}; \n }\n `,a=null!=n?n:e?(()=>{const t=[];return et.Children.forEach(e,e=>{var n,i;if(!et.isValidElement(e))return;const o=e.props,{tab:r,key:a,children:s}=o,l=jt(o,["tab","key","children"]);t.push(Object.assign({key:String(null!==(i=null!==(n=e.key)&&void 0!==n?n:a)&&void 0!==i?i:""),label:r,children:s},l))}),t})():void 0;return et.createElement(bt,Object.assign({className:`${Ze(r)}`,items:a},i))};Kp.TabPane=bt.TabPane;const Jp=({initialSeconds:t,blinkActivationSeconds:e,shouldRepeat:n,onTimesUp:i,children:o})=>{const[r,a]=lt(!1),[s,l]=lt(t),[c,d]=lt(void 0),[h,u]=lt(!0),p=Date.now()+1e3*s;return dt(()=>{h&&(d(setInterval(()=>{const t=(new Date).getTime(),n=p-t,i=Math.ceil(n/1e3);i>=0&&l(i),e&&i<=e&&a(!0)},1e3)),u(!1))},[h]),dt(()=>{s<=0&&void 0!==c&&(clearInterval(c),d(void 0),a(!1),i&&i(),n&&(l(t),u(!0)))},[c,s]),o(r,s)};function Qp(t){var{disabled:e=!1,label:n,required:i=!1,optional:o=!1,size:r="large",error:a=!1,helperText:s,showInfoIcon:l,onInfoClick:c}=t,d=jt(t,["disabled","label","required","optional","size","error","helperText","showInfoIcon","onInfoClick"]);const h=$i(),{height:u,borderRadius:p,padding:f}=Ui[r],m=`\n -webkit-font-smoothing: antialiased;\n height: ${u} !important;\n width: 100% !important;\n\n ${e?"\n pointer-events: none !important;\n ":""}\n\n &.ant-picker {\n border-radius: ${p} !important;\n border-color: ${a?h.color.status.critical:h.color.base.line} !important;\n padding: ${f} !important;\n transition: 0.3s all ease !important;\n\n &:hover {\n border-color: ${h.color.base.primary2} !important;\n }\n\n &.ant-picker-focused {\n border-color: ${h.color.base.primary2} !important;\n box-shadow: none !important;\n -webkit-box-shadow: none !important;\n }\n }\n\n &.ant-picker > .ant-picker-input {\n font-family: ${Vi} !important;\n font-style: normal !important;\n font-weight: normal !important;\n font-size: 14px !important;\n line-height: 22px !important;\n color: ${h.color.base.onNeutral} !important;\n }\n\n & .ant-picker-input > input {\n font-size: 14px !important;\n color: ${h.color.base.onNeutral} !important;\n }\n\n & .ant-picker-input > input::placeholder {\n font-size: 14px !important;\n color: ${h.color.component.placeholderInput} !important;\n }\n\n &.ant-picker.ant-picker-disabled {\n background: ${h.color.surface.disabledSurface} !important;\n border: 1px solid ${h.color.base.line} !important;\n }\n\n & .ant-picker-input > input[disabled] {\n color: ${h.color.base.onNeutral} !important;\n -webkit-text-fill-color: ${h.color.base.onNeutral} !important;\n }\n\n & .ant-picker-cell-in-view {\n &.ant-picker-cell-today .ant-picker-cell-inner {\n &:before {\n border-color: ${h.color.base.primary2} !important;\n }\n }\n\n &ant-picker-cell-range-end .ant-picker-cell-inner,\n &ant-picker-cell-range-start .ant-picker-cell-inner,\n &ant-picker-cell-selected .ant-picker-cell-inner {\n background: ${h.color.base.primary2} !important;\n }\n }\n `,g=`\n .ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner {\n background-color: ${h.color.base.primary2} !important;\n }\n `,b=et.createElement(Hh,{icon:"date_range",size:"m",color:h.color.base.onNeutral});return et.createElement("div",null,et.createElement(Cu,{label:n,required:i,optional:o,showInfoIcon:l,onInfoClick:c}),et.createElement(Et,Object.assign({className:`${Ze(m)}`,popupClassName:Ze(g),disabled:e,suffixIcon:b,format:"DD-MM-YYYY"},d)),et.createElement(Du,{text:s,error:a}))}var tf={Group:function(t){var{className:e=""}=t,n=jt(t,["className"]);const i=`\n &.ant-checkbox-group {\n width: 100% !important;\n }\n\n & .ant-checkbox-group-item {\n display: flex !important;\n align-items: flex-start !important;\n\n border: 1px solid ${Ei.brand.line.base} !important;\n border-radius: 5px !important;\n\n &:hover {\n border: 1px solid ${Ei.brand.primary.default} !important;\n }\n\n &:focus-within {\n border: 1px solid ${Ei.brand.primary.default} !important;\n }\n\n &:not(:last-child) {\n margin-bottom: 10px !important;\n width: 100% !important;\n }\n }\n\n & .ant-checkbox-wrapper-checked {\n border: 1px solid ${Ei.brand.primary.default} !important;\n }\n\n & .ant-checkbox-wrapper {\n padding-left: 16px !important;\n padding-top: 11px !important;\n padding-bottom: 11px !important;\n line-height: 1.6 !important;\n color: ${Rn.BLACK} !important;\n font-family: ${Vi} !important;\n }\n\n & .ant-checkbox {\n margin-top: 4px !important;\n }\n\n & .ant-checkbox + span {\n padding-left: 10px !important;\n padding-right: 10px !important;\n }\n\n & .ant-checkbox-checked .ant-checkbox-inner {\n background-color: ${Ei.brand.primary.illustration} !important;\n border-color: ${Ei.brand.primary.default} !important;\n }\n\n & .ant-checkbox-inner {\n border-radius: 5px !important;\n border: 1px solid ${Ei.brand.primary.default} !important;\n }\n `;return et.createElement(Ct.Group,Object.assign({className:`${Ze(i)} ${e}`},n))}};const ef=({title:t="No results found",subtitle:e,info:n,svgUniqueId:i="randomString"})=>et.createElement(nf,null,et.createElement(Ot,{image:et.createElement(It,{id:i,height:80,width:130}),imageStyle:{marginBottom:10,display:"block",margin:"auto"},description:!1}),t&&et.createElement(of,null,t),e&&et.createElement(rf,null,e),n&&et.createElement(sf,null,n)),nf=Vn.div`
|
|
1016
1016
|
width: 100%;
|
|
1017
1017
|
padding-top: 4px;
|
|
1018
1018
|
display: block;
|
|
@@ -1238,7 +1238,7 @@ padding-top:
|
|
|
1238
1238
|
border-radius: 5px !important;
|
|
1239
1239
|
|
|
1240
1240
|
${a&&"\n & > .ant-card-body {\n display: flex !important;\n flex-direction: row !important;\n align-items: center !important;\n }\n "} ${r&&"\n & > .ant-card-body > div {\n display: flex !important;\n flex-direction: column-reverse !important;\n }\n "};
|
|
1241
|
-
`;return et.createElement(s,{type:n},a&&a,et.createElement("div",null,et.createElement(Ji,{style:{marginBottom:r?"0":"5px"}},t),et.createElement(qi,{style:{marginBottom:r?"5px":"0"}},e)))},Tf=t=>{var{className:e}=t,n=jt(t,["className"]);return et.createElement(Tt,Object.assign({},n,{className:qe(Ze("\n
|
|
1241
|
+
`;return et.createElement(s,{type:n},a&&a,et.createElement("div",null,et.createElement(Ji,{style:{marginBottom:r?"0":"5px"}},t),et.createElement(qi,{style:{marginBottom:r?"5px":"0"}},e)))},Tf=t=>{var{className:e}=t,n=jt(t,["className"]);return et.createElement(Tt,Object.assign({},n,{className:qe(Ze("\n &.ant-timeline .ant-timeline-item {\n .ant-timeline-item-icon {\n top: 40px;\n }\n\n .ant-timeline-item-rail {\n top: 40px;\n bottom: -40px;\n }\n\n .ant-timeline-item-content {\n margin-left: 20px;\n }\n }\n "),e)}))};function Af({index:t,primaryProps:e,size:n,skipProps:i,step:o,tooltipProps:r,backProps:a}){const{title:s,content:l,data:c}=o;return et.createElement(Pf,{role:r.role},et.createElement(Rf,null,et.createElement(Lf,null,et.createElement(tn.Label,{size:"md"},s),et.createElement(Nf,{role:i.role,onClick:i.onClick},et.createElement(Hh,{icon:"close",size:"m"}))),et.createElement(tn.Body,{size:"md"},l)),et.createElement(If,null,et.createElement(Ff,null,Array.from({length:n},(e,n)=>0===t&&!0===(null==c?void 0:c.skipZeroIndex)?et.createElement(et.Fragment,null):et.createElement(zf,{key:n,isActive:n===t}))),et.createElement(Yf,null,a&&et.createElement(Bf,{typographyType:"label",size:"md",role:null==a?void 0:a.role,isDisabled:0===t,onClick:a.onClick,isUnderlined:!1},"Back"),et.createElement(lf,{typographyType:"label",size:"md",role:e.role,onClick:e.onClick,isUnderlined:!1},"Next"))))}Tf.Item=Tt.Item;const Pf=Vn.div`
|
|
1242
1242
|
background-color: ${Ei.color.surface.secondaryNeutral};
|
|
1243
1243
|
border-radius: 8px;
|
|
1244
1244
|
display: flex;
|