license-kit
Version:
Aggregate license notes of OSS libraries used in your Node.js project, analyze & visualize OSS licenses with AI-turbocharged tooling
1 lines • 159 kB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[288],{54492:(t,e,i)=>{i.d(e,{A6:()=>P,Bs:()=>tK,E8:()=>es,FN:()=>t8,No:()=>t6,OJ:()=>eN,P$:()=>O,PP:()=>ez,dN:()=>ex,h9:()=>E,kc:()=>eI,m_:()=>eT,pr:()=>eX,s$:()=>ey,t1:()=>tX});var s=i(69837);class a{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){let a=e.listeners[s],n=e.duration;a.forEach(s=>s({chart:t,initial:e.initial,numSteps:n,currentStep:Math.min(i-e.start,n)}))}_refresh(){this._request||(this._running=!0,this._request=s.r.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{let a;if(!i.running||!i.items.length)return;let n=i.items,r=n.length-1,o=!1;for(;r>=0;--r)(a=n[r])._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),o=!0):(n[r]=n[n.length-1],n.pop());o&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!!e&&!!e.running&&!!e.items.length}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var n=new a;let r="transparent",o={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let a=(0,s.c)(t||r),n=a.valid&&(0,s.c)(e||r);return n&&n.valid?n.mix(a,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class l{constructor(t,e,i,a){let n=e[i];a=(0,s.a)([t.to,a,n,t.from]);let r=(0,s.a)([t.from,n,a]);this._active=!0,this._fn=t.fn||o[t.type||typeof r],this._easing=s.e[t.easing]||s.e.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=a,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let a=this._target[this._prop],n=i-this._start,r=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=(0,s.a)([t.to,e,a,t.from]),this._from=(0,s.a)([t.from,a,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e,i=t-this._start,s=this._duration,a=this._prop,n=this._from,r=this._loop,o=this._to;if(this._active=n!==o&&(r||i<s),!this._active){this._target[a]=o,this._notify(!0);return}if(i<0){this._target[a]=n;return}e=i/s%2,e=r&&e>1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[a]=this._fn(n,o,e)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class h{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,s.i)(t))return;let e=Object.keys(s.d.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(a=>{let n=t[a];if(!(0,s.i)(n))return;let r={};for(let t of e)r[t]=n[t];((0,s.b)(n.properties)&&n.properties||[a]).forEach(t=>{t!==a&&i.has(t)||i.set(t,r)})})}_animateOptions(t,e){let i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i){t.options=e;return}return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!s)return[];let a=this._createAnimations(s,i);return i.$shared&&(function(t,e){let i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){let a=t[s[e]];a&&a.active()&&i.push(a.wait())}return Promise.all(i)})(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){let i,s=this._properties,a=[],n=t.$animations||(t.$animations={}),r=Object.keys(e),o=Date.now();for(i=r.length-1;i>=0;--i){let h=r[i];if("$"===h.charAt(0))continue;if("options"===h){a.push(...this._animateOptions(t,e));continue}let d=e[h],c=n[h],u=s.get(h);if(c)if(u&&c.active()){c.update(u,d,o);continue}else c.cancel();if(!u||!u.duration){t[h]=d;continue}n[h]=c=new l(u,t,h,d),a.push(c)}return a}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);let i=this._createAnimations(t,e);if(i.length)return n.add(this._chart,i),!0}}function d(t,e){let i=t&&t.options||{},s=i.reverse,a=void 0===i.min?e:0,n=void 0===i.max?e:0;return{start:s?n:a,end:s?a:n}}function c(t,e){let i,s,a=[],n=t._getSortedDatasetMetas(e);for(i=0,s=n.length;i<s;++i)a.push(n[i].index);return a}function u(t,e,i,a={}){let n,r,o,l,h=t.keys,d="single"===a.mode;if(null===e)return;let c=!1;for(n=0,r=h.length;n<r;++n){if((o=+h[n])===i){if(c=!0,a.all)continue;break}l=t.values[o],(0,s.g)(l)&&(d||0===e||(0,s.s)(e)===(0,s.s)(l))&&(e+=l)}return c||a.all?e:0}function g(t,e){let i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function p(t,e,i,s){for(let a of e.getMatchingVisibleMetas(s).reverse()){let e=t[a.index];if(i&&e>0||!i&&e<0)return a.index}return null}function f(t,e){let i,{chart:s,_cachedMeta:a}=t,n=s._stacks||(s._stacks={}),{iScale:r,vScale:o,index:l}=a,h=r.axis,d=o.axis,c=`${r.id}.${o.id}.${a.stack||a.type}`,u=e.length;for(let t=0;t<u;++t){let s=e[t],{[h]:r,[d]:u}=s;(i=(s._stacks||(s._stacks={}))[d]=function(t,e,i){let s=t[e]||(t[e]={});return s[i]||(s[i]={})}(n,c,r))[l]=u,i._top=p(i,o,!0,a.type),i._bottom=p(i,o,!1,a.type),(i._visualValues||(i._visualValues={}))[l]=u}}function m(t,e){let i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function x(t,e){let i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s)for(let a of e=e||t._parsed){let t=a._stacks;if(!t||void 0===t[s]||void 0===t[s][i])return;delete t[s][i],void 0!==t[s]._visualValues&&void 0!==t[s]._visualValues[i]&&delete t[s]._visualValues[i]}}let b=t=>"reset"===t||"none"===t,_=(t,e)=>e?t:Object.assign({},t);class v{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=g(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&x(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),a=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=(0,s.v)(i.xAxisID,m(t,"x")),r=e.yAxisID=(0,s.v)(i.yAxisID,m(t,"y")),o=e.rAxisID=(0,s.v)(i.rAxisID,m(t,"r")),l=e.indexAxis,h=e.iAxisID=a(l,n,r,o),d=e.vAxisID=a(l,r,n,o);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&(0,s.u)(this._data,this),t._stacked&&x(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,s.i)(e)){let t=this._cachedMeta;this._data=function(t,e){let i,s,a,{iScale:n,vScale:r}=e,o="x"===n.axis?"x":"y",l="x"===r.axis?"x":"y",h=Object.keys(t),d=Array(h.length);for(i=0,s=h.length;i<s;++i)a=h[i],d[i]={[o]:a,[l]:t[a]};return d}(e,t)}else if(i!==e){if(i){(0,s.u)(i,this);let t=this._cachedMeta;x(t),t._parsed=[]}e&&Object.isExtensible(e)&&(0,s.l)(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let a=e._stacked;e._stacked=g(e.vScale,e),e.stack!==i.stack&&(s=!0,x(e),e.stack=i.stack),this._resyncElements(t),(s||a!==e._stacked)&&(f(this,e._parsed),e._stacked=g(e.vScale,e))}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let i,a,n,{_cachedMeta:r,_data:o}=this,{iScale:l,_stacked:h}=r,d=l.axis,c=0===t&&e===o.length||r._sorted,u=t>0&&r._parsed[t-1];if(!1===this._parsing)r._parsed=o,r._sorted=!0,n=o;else{n=(0,s.b)(o[t])?this.parseArrayData(r,o,t,e):(0,s.i)(o[t])?this.parseObjectData(r,o,t,e):this.parsePrimitiveData(r,o,t,e);let l=()=>null===a[d]||u&&a[d]<u[d];for(i=0;i<e;++i)r._parsed[i+t]=a=n[i],c&&(l()&&(c=!1),u=a);r._sorted=c}h&&f(this,n)}parsePrimitiveData(t,e,i,s){let a,n,{iScale:r,vScale:o}=t,l=r.axis,h=o.axis,d=r.getLabels(),c=r===o,u=Array(s);for(a=0;a<s;++a)n=a+i,u[a]={[l]:c||r.parse(d[n],n),[h]:o.parse(e[n],n)};return u}parseArrayData(t,e,i,s){let a,n,r,{xScale:o,yScale:l}=t,h=Array(s);for(a=0;a<s;++a)r=e[n=a+i],h[a]={x:o.parse(r[0],n),y:l.parse(r[1],n)};return h}parseObjectData(t,e,i,a){let n,r,o,{xScale:l,yScale:h}=t,{xAxisKey:d="x",yAxisKey:c="y"}=this._parsing,u=Array(a);for(n=0;n<a;++n)o=e[r=n+i],u[n]={x:l.parse((0,s.f)(o,d),r),y:h.parse((0,s.f)(o,c),r)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let s=this.chart,a=this._cachedMeta,n=e[t.axis];return u({keys:c(s,!0),values:e._stacks[t.axis]._visualValues},n,a.index,{mode:i})}updateRangeFromParsed(t,e,i,s){let a=i[e.axis],n=null===a?NaN:a,r=s&&i._stacks[e.axis];s&&r&&(s.values=r,n=u(s,a,this._cachedMeta.index)),t.min=Math.min(t.min,n),t.max=Math.max(t.max,n)}getMinMax(t,e){let i,a,n,r=this._cachedMeta,o=r._parsed,l=r._sorted&&t===r.iScale,h=o.length,d=this._getOtherScale(t),u=(n=this.chart,e&&!r.hidden&&r._stacked&&{keys:c(n,!0),values:null}),g={min:1/0,max:-1/0},{min:p,max:f}=function(t){let{min:e,max:i,minDefined:s,maxDefined:a}=t.getUserBounds();return{min:s?e:-1/0,max:a?i:1/0}}(d);function m(){let e=(a=o[i])[d.axis];return!(0,s.g)(a[t.axis])||p>e||f<e}for(i=0;i<h&&(m()||(this.updateRangeFromParsed(g,t,a,u),!l));++i);if(l){for(i=h-1;i>=0;--i)if(!m()){this.updateRangeFromParsed(g,t,a,u);break}}return g}getAllParsedValues(t){let e,i,a,n=this._cachedMeta._parsed,r=[];for(e=0,i=n.length;e<i;++e)a=n[e][t.axis],(0,s.g)(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,i=e.iScale,s=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:s?""+s.getLabelForValue(a[s.axis]):""}}_update(t){var e;let i,a,n,r,o=this._cachedMeta;this.update(t||"default"),e=(0,s.v)(this.options.clip,function(t,e,i){if(!1===i)return!1;let s=d(t,i),a=d(e,i);return{top:a.end,right:s.end,bottom:a.start,left:s.start}}(o.xScale,o.yScale,this.getMaxOverflow())),(0,s.i)(e)?(i=e.top,a=e.right,n=e.bottom,r=e.left):i=a=n=r=e,o._clip={top:i,right:a,bottom:n,left:r,disabled:!1===e}}update(t){}draw(){let t,e=this._ctx,i=this.chart,s=this._cachedMeta,a=s.data||[],n=i.chartArea,r=[],o=this._drawStart||0,l=this._drawCount||a.length-o,h=this.options.drawActiveElementsOnTop;for(s.dataset&&s.dataset.draw(e,n,o,l),t=o;t<o+l;++t){let i=a[t];i.hidden||(i.active&&h?r.push(i):i.draw(e,n))}for(t=0;t<r.length;++t)r[t].draw(e,n)}getStyle(t,e){let i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){var a,n,r;let o,l=this.getDataset();if(t>=0&&t<this._cachedMeta.data.length){let e=this._cachedMeta.data[t];(o=e.$context||(a=this.getContext(),e.$context=(0,s.j)(a,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"}))).parsed=this.getParsed(t),o.raw=l.data[t],o.index=o.dataIndex=t}else(o=this.$context||(this.$context=(n=this.chart.getContext(),r=this.index,(0,s.j)(n,{active:!1,dataset:void 0,datasetIndex:r,index:r,mode:"default",type:"dataset"})))).dataset=l,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){let a="active"===e,n=this._cachedDataOpts,r=t+"-"+e,o=n[r],l=this.enableOptionSharing&&(0,s.h)(i);if(o)return _(o,l);let h=this.chart.config,d=h.datasetElementScopeKeys(this._type,t),c=a?[`${t}Hover`,"hover",t,""]:[t,""],u=h.getOptionScopes(this.getDataset(),d),g=Object.keys(s.d.elements[t]),p=()=>this.getContext(i,a,e),f=h.resolveNamedOptions(u,g,p,c);return f.$shared&&(f.$shared=l,n[r]=Object.freeze(_(f,l))),f}_resolveAnimations(t,e,i){let s,a=this.chart,n=this._cachedDataOpts,r=`animation-${e}`,o=n[r];if(o)return o;if(!1!==a.options.animation){let a=this.chart.config,n=a.datasetAnimationScopeKeys(this._type,e),r=a.getOptionScopes(this.getDataset(),n);s=a.createResolver(r,this.getContext(t,i,e))}let l=new h(a,s&&s.animations);return s&&s._cacheable&&(n[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||b(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,a=this.getSharedOptions(i),n=this.includeOptions(e,a)||a!==s;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:n}}updateElement(t,e,i,s){b(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!b(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;let a=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];let s=i.length,a=e.length,n=Math.min(a,s);n&&this.parse(0,n),a>s?this._insertElements(s,a-s,t):a<s&&this._removeElements(a,s-a)}_insertElements(t,e,i=!0){let s,a=this._cachedMeta,n=a.data,r=t+e,o=t=>{for(t.length+=e,s=t.length-1;s>=r;s--)t[s]=t[s-e]};for(o(n),s=t;s<r;++s)n[s]=new this.dataElementType;this._parsing&&o(a._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,e);i._stacked&&x(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function y(t,e,i,a){return(0,s.b)(t)?!function(t,e,i,s){let a=i.parse(t[0],s),n=i.parse(t[1],s),r=Math.min(a,n),o=Math.max(a,n),l=r,h=o;Math.abs(r)>Math.abs(o)&&(l=o,h=r),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:a,end:n,min:r,max:o}}(t,e,i,a):e[i.axis]=i.parse(t,a),e}function M(t,e,i,s){let a,n,r,o,l=t.iScale,h=t.vScale,d=l.getLabels(),c=l===h,u=[];for(a=i,n=i+s;a<n;++a)o=e[a],(r={})[l.axis]=c||l.parse(d[a],a),u.push(y(o,r,h,a));return u}function k(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function w(t,e,i,s){var a,n,r;return s?D((a=t,n=e,r=i,t=a===n?r:a===r?n:a),i,e):D(t,e,i)}function D(t,e,i){return"start"===t?e:"end"===t?i:t}class P extends v{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return M(t,e,i,s)}parseArrayData(t,e,i,s){return M(t,e,i,s)}parseObjectData(t,e,i,a){let n,r,o,l,{iScale:h,vScale:d}=t,{xAxisKey:c="x",yAxisKey:u="y"}=this._parsing,g="x"===h.axis?c:u,p="x"===d.axis?c:u,f=[];for(n=i,r=i+a;n<r;++n)l=e[n],(o={})[h.axis]=h.parse((0,s.f)(l,g),n),f.push(y((0,s.f)(l,p),o,d,n));return f}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);let a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let{iScale:e,vScale:i}=this._cachedMeta,s=this.getParsed(t),a=s._custom,n=k(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+e.getLabelForValue(s[e.axis]),value:n}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){let e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,a){let n="reset"===a,{index:r,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),h=o.isHorizontal(),d=this._getRuler(),{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,a);for(let g=e;g<e+i;g++){let e=this.getParsed(g),i=n||(0,s.k)(e[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),p=this._calculateBarIndexPixels(g,d),f=(e._stacks||{})[o.axis],m={horizontal:h,base:i.base,enableBorderRadius:!f||k(e._custom)||r===f._top||r===f._bottom,x:h?i.head:p.center,y:h?p.center:i.head,height:h?p.size:Math.abs(i.size),width:h?Math.abs(i.size):p.size};u&&(m.options=c||this.resolveDataElementOptions(g,t[g].active?"active":a));let x=m.options||t[g].options;!function(t,e,i,s){let a,n,r,o,l,h=e.borderSkipped,d={};if(!h){t.borderSkipped=d;return}if(!0===h){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:c,end:u,reverse:g,top:p,bottom:f}=(t.horizontal?(a=t.base>t.x,n="left",r="right"):(a=t.base<t.y,n="bottom",r="top"),a?(o="end",l="start"):(o="start",l="end"),{start:n,end:r,reverse:a,top:o,bottom:l});"middle"===h&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?h=p:(i._bottom||0)===s?h=f:(d[w(f,c,u,g)]=!0,h=p)),d[w(h,c,u,g)]=!0,t.borderSkipped=d}(m,x,f,r),function(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?.33*(1===i):e}(m,x,d.ratio),this.updateElement(t[g],g,m,a)}}_getStacks(t,e){let{iScale:i}=this._cachedMeta,a=i.getMatchingVisibleMetas(this._type).filter(t=>t.controller.options.grouped),n=i.options.stacked,r=[],o=this._cachedMeta.controller.getParsed(e),l=o&&o[i.axis],h=t=>{let e=t._parsed.find(t=>t[i.axis]===l),a=e&&e[t.vScale.axis];if((0,s.k)(a)||isNaN(a))return!0};for(let i of a)if(!(void 0!==e&&h(i))&&((!1===n||-1===r.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&r.push(i.stack),i.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){let t={},e=this.getFirstScaleIdForIndexAxis();for(let i of this.chart.data.datasets)t[(0,s.v)("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){let s=this._getStacks(t,i),a=void 0!==e?s.indexOf(e):-1;return -1===a?s.length-1:a}_getRuler(){let t,e,i=this.options,a=this._cachedMeta,n=a.iScale,r=[];for(t=0,e=a.data.length;t<e;++t)r.push(n.getPixelForValue(this.getParsed(t)[n.axis],t));let o=i.barThickness;return{min:o||function(t){let e,i,a,n,r=t.iScale,o=function(t,e){if(!t._cache.$bar){let i=t.getMatchingVisibleMetas(e),a=[];for(let e=0,s=i.length;e<s;e++)a=a.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=(0,s._)(a.sort((t,e)=>t-e))}return t._cache.$bar}(r,t.type),l=r._length,h=()=>{32767!==a&&-32768!==a&&((0,s.h)(n)&&(l=Math.min(l,Math.abs(a-n)||l)),n=a)};for(e=0,i=o.length;e<i;++e)a=r.getPixelForValue(o[e]),h();for(e=0,n=void 0,i=r.ticks.length;e<i;++e)a=r.getPixelForTick(e),h();return l}(a),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:i.grouped,ratio:o?1:i.categoryPercentage*i.barPercentage}}_calculateBarValuePixels(t){let e,i,{_cachedMeta:{vScale:a,_stacked:n,index:r},options:{base:o,minBarLength:l}}=this,h=o||0,d=this.getParsed(t),c=d._custom,u=k(c),g=d[a.axis],p=0,f=n?this.applyStack(a,d,n):g;f!==g&&(p=f-g,f=g),u&&(g=c.barStart,f=c.barEnd-c.barStart,0!==g&&(0,s.s)(g)!==(0,s.s)(c.barEnd)&&(p=0),p+=g);let m=(0,s.k)(o)||u?p:o,x=a.getPixelForValue(m);if(Math.abs(i=(e=this.chart.getDataVisibility(t)?a.getPixelForValue(p+f):x)-x)<l){var b;i=(0!==(b=i)?(0,s.s)(b):(a.isHorizontal()?1:-1)*(a.min>=h?1:-1))*l,g===h&&(x-=i/2);let t=a.getPixelForDecimal(0),o=a.getPixelForDecimal(1),c=Math.min(t,o);e=(x=Math.max(Math.min(x,Math.max(t,o)),c))+i,n&&!u&&(d._stacks[a.axis]._visualValues[r]=a.getValueForPixel(e)-a.getValueForPixel(x))}if(x===a.getPixelForValue(h)){let t=(0,s.s)(i)*a.getLineWidthForValue(h)/2;x+=t,i-=t}return{size:i,base:x,head:e,center:e+i/2}}_calculateBarIndexPixels(t,e){let i,a,n=e.scale,r=this.options,o=r.skipNull,l=(0,s.v)(r.maxBarThickness,1/0),h=this._getAxisCount();if(e.grouped){let n=o?this._getStackCount(t):e.stackCount,d="flex"===r.barThickness?function(t,e,i,s){let a=e.pixels,n=a[t],r=t>0?a[t-1]:null,o=t<a.length-1?a[t+1]:null,l=i.categoryPercentage;null===r&&(r=n-(null===o?e.end-e.start:o-n)),null===o&&(o=n+n-r);let h=n-(n-Math.min(r,o))/2*l;return{chunk:Math.abs(o-r)/2*l/s,ratio:i.barPercentage,start:h}}(t,e,r,n*h):function(t,e,i,a){let n,r,o=i.barThickness;return(0,s.k)(o)?(n=e.min*i.categoryPercentage,r=i.barPercentage):(n=o*a,r=1),{chunk:n/a,ratio:r,start:e.pixels[t]-n/2}}(t,e,r,n*h),c="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,u=this._getAxis().indexOf((0,s.v)(c,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+u;i=d.start+d.chunk*g+d.chunk/2,a=Math.min(l,d.chunk*d.ratio)}else i=n.getPixelForValue(this.getParsed(t)[n.axis],t),a=Math.min(l,e.min*e.ratio);return{base:i-a/2,head:i+a/2,center:i,size:a}}draw(){let t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length,a=0;for(;a<s;++a)null===this.getParsed(a)[e.axis]||i[a].hidden||i[a].draw(this._ctx)}}class S extends v{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){let a=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<a.length;t++)a[t]._custom=this.resolveDataElementOptions(t+i).radius;return a}parseArrayData(t,e,i,a){let n=super.parseArrayData(t,e,i,a);for(let t=0;t<n.length;t++){let a=e[i+t];n[t]._custom=(0,s.v)(a[2],this.resolveDataElementOptions(t+i).radius)}return n}parseObjectData(t,e,i,a){let n=super.parseObjectData(t,e,i,a);for(let t=0;t<n.length;t++){let a=e[i+t];n[t]._custom=(0,s.v)(a&&a.r&&+a.r,this.resolveDataElementOptions(t+i).radius)}return n}getMaxOverflow(){let t=this._cachedMeta.data,e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:a}=e,n=this.getParsed(t),r=s.getLabelForValue(n.x),o=a.getLabelForValue(n.y),l=n._custom;return{label:i[t]||"",value:"("+r+", "+o+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){let a="reset"===s,{iScale:n,vScale:r}=this._cachedMeta,{sharedOptions:o,includeOptions:l}=this._getSharedOptions(e,s),h=n.axis,d=r.axis;for(let c=e;c<e+i;c++){let e=t[c],i=!a&&this.getParsed(c),u={},g=u[h]=a?n.getPixelForDecimal(.5):n.getPixelForValue(i[h]),p=u[d]=a?r.getBasePixel():r.getPixelForValue(i[d]);u.skip=isNaN(g)||isNaN(p),l&&(u.options=o||this.resolveDataElementOptions(c,e.active?"active":s),a&&(u.options.radius=0)),this.updateElement(e,c,u,s)}}resolveDataElementOptions(t,e){let i=this.getParsed(t),a=super.resolveDataElementOptions(t,e);a.$shared&&(a=Object.assign({},a,{$shared:!1}));let n=a.radius;return"active"!==e&&(a.radius=0),a.radius+=(0,s.v)(i&&i._custom,n),a}}class C extends v{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((e,a)=>{let n=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,fontColor:s,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let i=this.getDataset().data,a=this._cachedMeta;if(!1===this._parsing)a._parsed=i;else{let n,r,o=t=>+i[t];if((0,s.i)(i[t])){let{key:t="value"}=this._parsing;o=e=>+(0,s.f)(i[e],t)}for(n=t,r=t+e;n<r;++n)a._parsed[n]=o(n)}}_getRotation(){return(0,s.t)(this.options.rotation-90)}_getCircumference(){return(0,s.t)(this.options.circumference)}_getRotationExtents(){let t=s.T,e=-s.T;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){let s=this.chart.getDatasetMeta(i).controller,a=s._getRotation(),n=s._getCircumference();t=Math.min(t,a),e=Math.max(e,a+n)}return{rotation:t,circumference:e-t}}update(t){let{chartArea:e}=this.chart,i=this._cachedMeta,a=i.data,n=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,r=Math.max((Math.min(e.width,e.height)-n)/2,0),o=Math.min((0,s.m)(this.options.cutout,r),1),l=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:c,ratioY:u,offsetX:g,offsetY:p}=function(t,e,i){let a=1,n=1,r=0,o=0;if(e<s.T){let l=t+e,h=Math.cos(t),d=Math.sin(t),c=Math.cos(l),u=Math.sin(l),g=(e,a,n)=>(0,s.p)(e,t,l,!0)?1:Math.max(a,a*i,n,n*i),p=(e,a,n)=>(0,s.p)(e,t,l,!0)?-1:Math.min(a,a*i,n,n*i),f=g(0,h,c),m=g(s.H,d,u),x=p(s.P,h,c),b=p(s.P+s.H,d,u);a=(f-x)/2,n=(m-b)/2,r=-(f+x)/2,o=-(m+b)/2}return{ratioX:a,ratioY:n,offsetX:r,offsetY:o}}(d,h,o),f=Math.max(Math.min((e.width-n)/c,(e.height-n)/u)/2,0),m=(0,s.n)(this.options.radius,f),x=Math.max(m*o,0),b=(m-x)/this._getVisibleDatasetWeightTotal();this.offsetX=g*m,this.offsetY=p*m,i.total=this.calculateTotal(),this.outerRadius=m-b*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-b*l,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){let i=this.options,a=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===a._parsed[t]||a.data[t].hidden?0:this.calculateCircumference(a._parsed[t]*n/s.T)}updateElements(t,e,i,s){let a,n="reset"===s,r=this.chart,o=r.chartArea,l=r.options.animation,h=(o.left+o.right)/2,d=(o.top+o.bottom)/2,c=n&&l.animateScale,u=c?0:this.innerRadius,g=c?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(e,s),m=this._getRotation();for(a=0;a<e;++a)m+=this._circumference(a,n);for(a=e;a<e+i;++a){let e=this._circumference(a,n),i=t[a],r={x:h+this.offsetX,y:d+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:g,innerRadius:u};f&&(r.options=p||this.resolveDataElementOptions(a,i.active?"active":s)),m+=e,this.updateElement(i,a,r,s)}}calculateTotal(){let t,e=this._cachedMeta,i=e.data,s=0;for(t=0;t<i.length;t++){let a=e._parsed[t];null!==a&&!isNaN(a)&&this.chart.getDataVisibility(t)&&!i[t].hidden&&(s+=Math.abs(a))}return s}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?s.T*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,a=i.data.labels||[],n=(0,s.o)(e._parsed[t],i.options.locale);return{label:a[t]||"",value:n}}getMaxBorderWidth(t){let e,i,s,a,n,r=0,o=this.chart;if(!t){for(e=0,i=o.data.datasets.length;e<i;++e)if(o.isDatasetVisible(e)){t=(s=o.getDatasetMeta(e)).data,a=s.controller;break}}if(!t)return 0;for(e=0,i=t.length;e<i;++e)"inner"!==(n=a.resolveDataElementOptions(e)).borderAlign&&(r=Math.max(r,n.borderWidth||0,n.hoverBorderWidth||0));return r}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){let t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max((0,s.v)(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class A extends v{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:a=[],_dataset:n}=e,r=this.chart._animationsDisabled,{start:o,count:l}=(0,s.q)(e,a,r);this._drawStart=o,this._drawCount=l,(0,s.w)(e)&&(o=0,l=a.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=a;let h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:h},t),this.updateElements(a,o,l,t)}updateElements(t,e,i,a){let n="reset"===a,{iScale:r,vScale:o,_stacked:l,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:c}=this._getSharedOptions(e,a),u=r.axis,g=o.axis,{spanGaps:p,segment:f}=this.options,m=(0,s.x)(p)?p:1/0,x=this.chart._animationsDisabled||n||"none"===a,b=e+i,_=t.length,v=e>0&&this.getParsed(e-1);for(let i=0;i<_;++i){let p=t[i],_=x?p:{};if(i<e||i>=b){_.skip=!0;continue}let y=this.getParsed(i),M=(0,s.k)(y[g]),k=_[u]=r.getPixelForValue(y[u],i),w=_[g]=n||M?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,y,l):y[g],i);_.skip=isNaN(k)||isNaN(w)||M,_.stop=i>0&&Math.abs(y[u]-v[u])>m,f&&(_.parsed=y,_.raw=h.data[i]),c&&(_.options=d||this.resolveDataElementOptions(i,p.active?"active":a)),x||this.updateElement(p,i,_,a),v=y}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];return s.length?Math.max(i,s[0].size(this.resolveDataElementOptions(0)),s[s.length-1].size(this.resolveDataElementOptions(s.length-1)))/2:i}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class L extends v{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((e,a)=>{let n=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,fontColor:s,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,a=i.data.labels||[],n=(0,s.o)(e._parsed[t].r,i.options.locale);return{label:a[t]||"",value:n}}parseObjectData(t,e,i,a){return s.y.bind(this)(t,e,i,a)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:1/0,max:-1/0};return t.data.forEach((t,i)=>{let s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,s=Math.max(Math.min(e.right-e.left,e.bottom-e.top)/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),n=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-n*this.index,this.innerRadius=this.outerRadius-n}updateElements(t,e,i,a){let n,r="reset"===a,o=this.chart,l=o.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,c=h.yCenter,u=h.getIndexAngle(0)-.5*s.P,g=u,p=360/this.countVisibleElements();for(n=0;n<e;++n)g+=this._computeAngle(n,a,p);for(n=e;n<e+i;n++){let e=t[n],i=g,s=g+this._computeAngle(n,a,p),f=o.getDataVisibility(n)?h.getDistanceFromCenterForValue(this.getParsed(n).r):0;g=s,r&&(l.animateScale&&(f=0),l.animateRotate&&(i=s=u));let m={x:d,y:c,innerRadius:0,outerRadius:f,startAngle:i,endAngle:s,options:this.resolveDataElementOptions(n,e.active?"active":a)};this.updateElement(e,n,m,a)}}countVisibleElements(){let t=this._cachedMeta,e=0;return t.data.forEach((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?(0,s.t)(this.resolveDataElementOptions(t,e).angle||i):0}}class O extends C{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class E extends v{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,a){return s.y.bind(this)(t,e,i,a)}update(t){let e=this._cachedMeta,i=e.dataset,s=e.data||[],a=e.iScale.getLabels();if(i.points=s,"resize"!==t){let e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);let n={_loop:!0,_fullLoop:a.length===s.length,options:e};this.updateElement(i,void 0,n,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){let a=this._cachedMeta.rScale,n="reset"===s;for(let r=e;r<e+i;r++){let e=t[r],i=this.resolveDataElementOptions(r,e.active?"active":s),o=a.getPointPositionForValue(r,this.getParsed(r).r),l=n?a.xCenter:o.x,h=n?a.yCenter:o.y,d={x:l,y:h,angle:o.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,r,d,s)}}}class T extends v{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:a}=e,n=this.getParsed(t),r=s.getLabelForValue(n.x),o=a.getLabelForValue(n.y);return{label:i[t]||"",value:"("+r+", "+o+")"}}update(t){let e=this._cachedMeta,{data:i=[]}=e,a=this.chart._animationsDisabled,{start:n,count:r}=(0,s.q)(e,i,a);if(this._drawStart=n,this._drawCount=r,(0,s.w)(e)&&(n=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:s,_dataset:n}=e;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!n._decimated,s.points=i;let r=this.resolveDatasetElementOptions(t);r.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:r},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,n,r,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,a){let n="reset"===a,{iScale:r,vScale:o,_stacked:l,_dataset:h}=this._cachedMeta,d=this.resolveDataElementOptions(e,a),c=this.getSharedOptions(d),u=this.includeOptions(a,c),g=r.axis,p=o.axis,{spanGaps:f,segment:m}=this.options,x=(0,s.x)(f)?f:1/0,b=this.chart._animationsDisabled||n||"none"===a,_=e>0&&this.getParsed(e-1);for(let d=e;d<e+i;++d){let e=t[d],i=this.getParsed(d),f=b?e:{},v=(0,s.k)(i[p]),y=f[g]=r.getPixelForValue(i[g],d),M=f[p]=n||v?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,i,l):i[p],d);f.skip=isNaN(y)||isNaN(M)||v,f.stop=d>0&&Math.abs(i[g]-_[g])>x,m&&(f.parsed=i,f.raw=h.data[d]),u&&(f.options=c||this.resolveDataElementOptions(d,e.active?"active":a)),b||this.updateElement(e,d,f,a),_=i}this.updateSharedOptions(c,a,d)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}let i=t.dataset,s=i.options&&i.options.borderWidth||0;return e.length?Math.max(s,e[0].size(this.resolveDataElementOptions(0)),e[e.length-1].size(this.resolveDataElementOptions(e.length-1)))/2:s}}function F(){throw Error("This method is not implemented: Check that a complete date adapter is provided.")}class z{static override(t){Object.assign(z.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return F()}parse(){return F()}format(){return F()}add(){return F()}diff(){return F()}startOf(){return F()}endOf(){return F()}}var R={_date:z};function V(t,e,i,a,n){let r=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=r.length;t<i;++t){let{index:i,data:l}=r[t],{lo:h,hi:d}=function(t,e,i,a){let{controller:n,data:r,_sorted:o}=t,l=n._cachedMeta.iScale,h=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&e===l.axis&&"r"!==e&&o&&r.length){let o=l._reversePixels?s.A:s.B;if(a){if(n._sharedOptions){let t=r[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){let t=o(r,e,i-s),a=o(r,e,i+s);return{lo:t.lo,hi:a.hi}}}}else{let a=o(r,e,i);if(h){let{vScale:e}=n._cachedMeta,{_parsed:i}=t,r=i.slice(0,a.lo+1).reverse().findIndex(t=>!(0,s.k)(t[e.axis]));a.lo-=Math.max(0,r);let o=i.slice(a.hi).findIndex(t=>!(0,s.k)(t[e.axis]));a.hi+=Math.max(0,o)}return a}}return{lo:0,hi:r.length-1}}(r[t],e,o,n);for(let t=h;t<=d;++t){let e=l[t];e.skip||a(e,i,t)}}}function I(t,e,i,a,n){let r=[];return(n||t.isPointInArea(e))&&V(t,i,e,function(i,o,l){(n||(0,s.C)(i,t.chartArea,0))&&i.inRange(e.x,e.y,a)&&r.push({element:i,datasetIndex:o,index:l})},!0),r}function B(t,e,i,a,n,r){let o;return r||t.isPointInArea(e)?"r"!==i||a?function(t,e,i,s,a,n){let r=[],o=function(t){let e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){return Math.sqrt(Math.pow(e?Math.abs(t.x-s.x):0,2)+Math.pow(i?Math.abs(t.y-s.y):0,2))}}(i),l=1/0;return V(t,i,e,function(i,h,d){let c=i.inRange(e.x,e.y,a);if(s&&!c)return;let u=i.getCenterPoint(a);if(!(n||t.isPointInArea(u))&&!c)return;let g=o(e,u);g<l?(r=[{element:i,datasetIndex:h,index:d}],l=g):g===l&&r.push({element:i,datasetIndex:h,index:d})}),r}(t,e,i,a,n,r):(o=[],V(t,i,e,function(t,i,a){let{startAngle:r,endAngle:l}=t.getProps(["startAngle","endAngle"],n),{angle:h}=(0,s.D)(t,{x:e.x,y:e.y});(0,s.p)(h,r,l)&&o.push({element:t,datasetIndex:i,index:a})}),o):[]}function H(t,e,i,s,a){let n=[],r="x"===i?"inXRange":"inYRange",o=!1;return(V(t,i,e,(t,s,l)=>{t[r]&&t[r](e[i],a)&&(n.push({element:t,datasetIndex:s,index:l}),o=o||t.inRange(e.x,e.y,a))}),s&&!o)?[]:n}var W={modes:{index(t,e,i,a){let n=(0,s.z)(e,t),r=i.axis||"x",o=i.includeInvisible||!1,l=i.intersect?I(t,n,r,a,o):B(t,n,r,!1,a,o),h=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=l[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})}),h):[]},dataset(t,e,i,a){let n=(0,s.z)(e,t),r=i.axis||"xy",o=i.includeInvisible||!1,l=i.intersect?I(t,n,r,a,o):B(t,n,r,!1,a,o);if(l.length>0){let e=l[0].datasetIndex,i=t.getDatasetMeta(e).data;l=[];for(let t=0;t<i.length;++t)l.push({element:i[t],datasetIndex:e,index:t})}return l},point(t,e,i,a){let n=(0,s.z)(e,t);return I(t,n,i.axis||"xy",a,i.includeInvisible||!1)},nearest(t,e,i,a){let n=(0,s.z)(e,t),r=i.axis||"xy",o=i.includeInvisible||!1;return B(t,n,r,i.intersect,a,o)},x(t,e,i,a){let n=(0,s.z)(e,t);return H(t,n,"x",i.intersect,a)},y(t,e,i,a){let n=(0,s.z)(e,t);return H(t,n,"y",i.intersect,a)}}};let j=["left","top","right","bottom"];function N(t,e){return t.filter(t=>t.pos===e)}function $(t,e){return t.filter(t=>-1===j.indexOf(t.pos)&&t.box.axis===e)}function U(t,e){return t.sort((t,i)=>{let s=e?i:t,a=e?t:i;return s.weight===a.weight?s.index-a.index:s.weight-a.weight})}function Q(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function X(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 G(t,e,i,a){let n,r,o,l,h,d,c=[];for(n=0,r=t.length,h=0;n<r;++n){(l=(o=t[n]).box).update(o.width||e.w,o.height||e.h,function(t,e){let i=e.maxPadding;var s=t?["left","right"]:["top","bottom"];let a={left:0,top:0,right:0,bottom:0};return s.forEach(t=>{a[t]=Math.max(e[t],i[t])}),a}(o.horizontal,e));let{same:r,other:u}=function(t,e,i,a){let{pos:n,box:r}=i,o=t.maxPadding;if(!(0,s.i)(n)){i.size&&(t[n]-=i.size);let e=a[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[n]+=i.size}r.getPadding&&X(o,r.getPadding());let l=Math.max(0,e.outerWidth-Q(o,t,"left","right")),h=Math.max(0,e.outerHeight-Q(o,t,"top","bottom")),d=l!==t.w,c=h!==t.h;return t.w=l,t.h=h,i.horizontal?{same:d,other:c}:{same:c,other:d}}(e,i,o,a);h|=r&&c.length,d=d||u,l.fullSize||c.push(o)}return h&&G(c,e,i,a)||d}function q(t,e,i,s,a){t.top=i,t.left=e,t.right=e+s,t.bottom=i+a,t.width=s,t.height=a}function Y(t,e,i,a){let n=i.padding,{x:r,y:o}=e;for(let l of t){let t=l.box,h=a[l.stack]||{count:1,placed:0,weight:1},d=l.stackWeight/h.weight||1;if(l.horizontal){let a=e.w*d,r=h.size||t.height;(0,s.h)(h.start)&&(o=h.start),t.fullSize?q(t,n.left,o,i.outerWidth-n.right-n.left,r):q(t,e.left+h.placed,o,a,r),h.start=o,h.placed+=a,o=t.bottom}else{let a=e.h*d,o=h.size||t.width;(0,s.h)(h.start)&&(r=h.start),t.fullSize?q(t,r,n.top,o,i.outerHeight-n.bottom-n.top):q(t,r,e.top+h.placed,o,a),h.start=r,h.placed+=a,r=t.right}}e.x=r,e.y=o}var K={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,a){if(!t)return;let n=(0,s.E)(t.options.layout.padding),r=Math.max(e-n.width,0),o=Math.max(i-n.height,0),l=function(t){let e=function(t){let e,i,s,a,n,r,o=[];for(e=0,i=(t||[]).length;e<i;++e)s=t[e],({position:a,options:{stack:n,stackWeight:r=1}}=s),o.push({index:e,box:s,pos:a,horizontal:s.isHorizontal(),weight:s.weight,stack:n&&a+n,stackWeight:r});return o}(t),i=U(e.filter(t=>t.box.fullSize),!0),s=U(N(e,"left"),!0),a=U(N(e,"right")),n=U(N(e,"top"),!0),r=U(N(e,"bottom")),o=$(e,"x"),l=$(e,"y");return{fullSize:i,leftAndTop:s.concat(n),rightAndBottom:a.concat(l).concat(r).concat(o),chartArea:N(e,"chartArea"),vertical:s.concat(a).concat(l),horizontal:n.concat(r).concat(o)}}(t.boxes),h=l.vertical,d=l.horizontal;(0,s.F)(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let c=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/(h.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1),hBoxMaxHeight:o/2}),u=Object.assign({},n);X(u,(0,s.E)(a));let g=Object.assign({maxPadding:u,w:r,h:o,x:n.left,y:n.top},n),p=function(t,e){let i,s,a,n=function(t){let e={};for(let i of t){let{stack:t,pos:s,stackWeight:a}=i;if(!t||!j.includes(s))continue;let n=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});n.count++,n.weight+=a}return e}(t),{vBoxMaxWidth:r,hBoxMaxHeight:o}=e;for(i=0,s=t.length;i<s;++i){let{fullSize:s}=(a=t[i]).box,l=n[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*r:s&&e.availableWidth,a.height=o):(a.width=r,a.height=h?h*o:s&&e.availableHeight)}return n}(h.concat(d),c);G(l.fullSize,g,c,p),G(h,g,c,p),G(d,g,c,p)&&G(h,g,c,p);let f=g.maxPadding;function m(t){let e=Math.max(f[t]-g[t],0);return g[t]+=e,e}g.y+=m("top"),g.x+=m("left"),m("right"),m("bottom"),Y(l.leftAndTop,g,c,p),g.x+=g.w,g.y+=g.h,Y(l.rightAndBottom,g,c,p),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},(0,s.F)(l.chartArea,e=>{let i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class J{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Z extends J{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}let tt="$chartjs",te={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ti=t=>null===t||""===t,ts=!!s.K&&{passive:!0};function ta(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function tn(t,e,i){let s=t.canvas,a=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||ta(i.addedNodes,s))&&!ta(i.removedNodes,s);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function tr(t,e,i){let s=t.canvas,a=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||ta(i.removedNodes,s))&&!ta(i.addedNodes,s);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}let to=new Map,tl=0;function th(){let t=window.devicePixelRatio;t!==tl&&(tl=t,to.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function td(t,e,i){let a=t.canvas,n=a&&(0,s.I)(a);if(!n)return;let r=(0,s.L)((t,e)=>{let s=n.clientWidth;i(t,e),s<n.clientWidth&&i()},window),o=new ResizeObserver(t=>{let e=t[0],i=e.contentRect.width,s=e.contentRect.height;(0!==i||0!==s)&&r(i,s)});return o.observe(n),to.size||window.addEventListener("resize",th),to.set(t,r),o}function tc(t,e,i){i&&i.disconnect(),"resize"===e&&(to.delete(t),to.size||window.removeEventListener("resize",th))}function tu(t,e,i){let a=t.canvas,n=(0,s.L)(e=>{null!==t.ctx&&i(function(t,e){let i=te[t.type]||t.type,{x:a,y:n}=(0,s.z)(t,e);return{type:i,chart:e,native:t,x:void 0!==a?a:null,y:void 0!==n?n:null}}(e,t))},t);return a&&a.addEventListener(e,n,ts),n}class tg extends J{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(!function(t,e){let i=t.style,a=t.getAttribute("height"),n=t.getAttribute("width");if(t[tt]={initial:{height:a,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",ti(n)){let e=(0,s.J)(t,"width");void 0!==e&&(t.width=e)}if(ti(a))if(""===t.style.height)t.height=t.width/(e||2);else{let e=(0,s.J)(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[tt])return!1;let i=e[tt].initial;["height","width"].forEach(t=>{let a=i[t];(0,s.k)(a)?e.removeAttribute(t):e.setAttribute(t,a)});let a=i.style||{};return Object.keys(a).forEach(t=>{e.style[t]=a[t]}),e.width=e.width,delete e[tt],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),a={attach:tn,detach:tr,resize:td}[e]||tu;s[e]=a(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];s&&((({attach:tc,detach:tc,resize:tc})[e]||function(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,ts)})(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,a){return(0,s.G)(t,e,i,a)}isAttached(t){let e=t&&(0,s.I)(t);return!!(e&&e.isConnected)}}class tp{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,s.x)(this.x)&&(0,s.x)(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}function tf(t,e,i,a,n){let r,o,l,h=(0,s.v)(a,0),d=Math.min((0,s.v)(n,t.length),t.length),c=0;for(i=Math.ceil(i),n&&(i=(r=n-a)/Math.floor(r/i)),l=h;l<0;)l=Math.round(h+ ++c*i);for(o=Math.max(h,0);o<d;o++)o===l&&(e.push(t[o]),l=Math.round(h+ ++c*i))}let tm=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e