(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5cee169e"],{"368d":function(t,e,i){"use strict";i.d(e,"a",(function(){return m}));i("caad");var n=i("dd61"),s=i("2b0e");const o={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},r={ariaLabel:{type:String},ariaDescribedby:{type:String}},a={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...o,...r},h="2"===s["k"][0]?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function l(t){return Object(s["d"])(t)?Object(s["j"])(t):t}function c(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return Object(s["d"])(e)?new Proxy(t,{}):t}function d(t,e){const i=t.options;i&&e&&Object.assign(i,e)}function u(t,e){t.labels=e}function f(t,e,i){const n=[];t.datasets=e.map(e=>{const s=t.datasets.find(t=>t[i]===e[i]);return s&&e.data&&!n.includes(s)?(n.push(s),Object.assign(s,e),s):{...e}})}function b(t,e){const i={labels:[],datasets:[]};return u(i,t.labels),f(i,t.datasets,e),i}const g=Object(s["b"])({props:a,setup(t,e){let{expose:i,slots:o}=e;const r=Object(s["h"])(null),a=Object(s["i"])(null);i({chart:a});const h=()=>{if(!r.value)return;const{type:e,data:i,options:s,plugins:o,datasetIdKey:h}=t,l=b(i,h),d=c(l,i);a.value=new n["f"](r.value,{type:e,data:d,options:{...s},plugins:o})},g=()=>{const e=Object(s["j"])(a.value);e&&(t.destroyDelay>0?setTimeout(()=>{e.destroy(),a.value=null},t.destroyDelay):(e.destroy(),a.value=null))},p=e=>{e.update(t.updateMode)};return Object(s["f"])(h),Object(s["g"])(g),Object(s["l"])([()=>t.options,()=>t.data],(e,i)=>{let[n,o]=e,[r,h]=i;const c=Object(s["j"])(a.value);if(!c)return;let b=!1;if(n){const t=l(n),e=l(r);t&&t!==e&&(d(c,t),b=!0)}if(o){const e=l(o.labels),i=l(h.labels),n=l(o.datasets),s=l(h.datasets);e!==i&&(u(c.config.data,e),b=!0),n&&n!==s&&(f(c.config.data,n,t.datasetIdKey),b=!0)}b&&Object(s["e"])(()=>{p(c)})},{deep:!0}),()=>Object(s["c"])("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:r},[Object(s["c"])("p",{},[o.default?o.default():""])])}});function p(t,e){return n["f"].register(e),Object(s["b"])({props:o,setup(e,i){let{expose:n}=i;const o=Object(s["i"])(null),r=t=>{o.value=null===t||void 0===t?void 0:t.chart};return n({chart:o}),()=>Object(s["c"])(g,h({ref:r},{type:t,...e}))}})}const m=p("bar",n["b"]);n["g"],n["i"],n["k"],n["m"],n["n"],n["d"],n["o"]},d9fa:function(t,e,i){"use strict";i.d(e,"a",(function(){return X}));i("13d5"),i("ac1f");var n=i("e369"),s=i("dd61"),o=function(){if("undefined"!==typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var t=window.screen;if(t)return(t.deviceXDPI||1)/(t.logicalXDPI||1)}return 1}(),r={toTextLines:function(t){var e,i=[];t=[].concat(t);while(t.length)e=t.pop(),"string"===typeof e?i.unshift.apply(i,e.split("\n")):Array.isArray(e)?t.push.apply(t,e):Object(n["Lb"])(t)||i.unshift(""+e);return i},textSize:function(t,e,i){var n,s=[].concat(e),o=s.length,r=t.font,a=0;for(t.font=i.string,n=0;ni.right&&(n|=d),ei.bottom&&(n|=u),n}function g(t,e){var i,n,s,o=t.x0,r=t.y0,a=t.x1,h=t.y1,l=b(o,r,e),g=b(a,h,e);while(1){if(!(l|g)||l&g)break;i=l||g,i&f?(n=o+(a-o)*(e.top-r)/(h-r),s=e.top):i&u?(n=o+(a-o)*(e.bottom-r)/(h-r),s=e.bottom):i&d?(s=r+(h-r)*(e.right-o)/(a-o),n=e.right):i&c&&(s=r+(h-r)*(e.left-o)/(a-o),n=e.left),i===l?(o=n,r=s,l=b(o,r,e)):(a=n,h=s,g=b(a,h,e))}return{x0:o,x1:a,y0:r,y1:h}}function p(t,e){var i,n,s=e.anchor,o=t;return e.clamp&&(o=g(o,e.area)),"start"===s?(i=o.x0,n=o.y0):"end"===s?(i=o.x1,n=o.y1):(i=(o.x0+o.x1)/2,n=(o.y0+o.y1)/2),h(i,n,t.vx,t.vy,e.align)}var m={arc:function(t,e){var i=(t.startAngle+t.endAngle)/2,n=Math.cos(i),s=Math.sin(i),o=t.innerRadius,r=t.outerRadius;return p({x0:t.x+n*o,y0:t.y+s*o,x1:t.x+n*r,y1:t.y+s*r,vx:n,vy:s},e)},point:function(t,e){var i=a(t,e.origin),n=i.x*t.options.radius,s=i.y*t.options.radius;return p({x0:t.x-n,y0:t.y-s,x1:t.x+n,y1:t.y+s,vx:i.x,vy:i.y},e)},bar:function(t,e){var i=a(t,e.origin),n=t.x,s=t.y,o=0,r=0;return t.horizontal?(n=Math.min(t.x,t.base),o=Math.abs(t.base-t.x)):(s=Math.min(t.y,t.base),r=Math.abs(t.base-t.y)),p({x0:n,y0:s+r,x1:n+o,y1:s,vx:i.x,vy:i.y},e)},fallback:function(t,e){var i=a(t,e.origin);return p({x0:t.x,y0:t.y,x1:t.x+(t.width||0),y1:t.y+(t.height||0),vx:i.x,vy:i.y},e)}},x=r.rasterize;function _(t){var e=t.borderWidth||0,i=t.padding,n=t.size.height,s=t.size.width,o=-s/2,r=-n/2;return{frame:{x:o-i.left-e,y:r-i.top-e,w:s+i.width+2*e,h:n+i.height+2*e},text:{x:o,y:r,w:s,h:n}}}function y(t,e){var i=e.chart.getDatasetMeta(e.datasetIndex).vScale;if(!i)return null;if(void 0!==i.xCenter&&void 0!==i.yCenter)return{x:i.xCenter,y:i.yCenter};var n=i.getBasePixel();return t.horizontal?{x:n,y:null}:{x:null,y:n}}function v(t){return t instanceof s["a"]?m.arc:t instanceof s["l"]?m.point:t instanceof s["c"]?m.bar:m.fallback}function O(t,e,i,n,s,o){var r=Math.PI/2;if(o){var a=Math.min(o,s/2,n/2),h=e+a,l=i+a,c=e+n-a,d=i+s-a;t.moveTo(e,l),h=0;--i)for(s=t[i].$layout,n=i-1;n>=0&&s._visible;--n)o=t[n].$layout,o._visible&&s._box.intersects(o._box)&&e(s,o);return t}function I(t){var e,i,n,s,o,r,a;for(e=0,i=t.length;et.getProps([e],!0)[e]}),o=n.geometry(),r=T(a,n.model(),o),s._box.update(r,o,n.rotation()));return R(t,(function(t,e){var i=t._hidable,n=e._hidable;i&&n||n?e._visible=!1:i&&(t._visible=!1)}))}Object(n["w"])(E.prototype,{center:function(){var t=this._rect;return{x:t.x+t.w/2,y:t.y+t.h/2}},update:function(t,e,i){this._rotation=i,this._rect={x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},contains:function(t){var e=this,i=1,n=e._rect;return t=D(t,e.center(),-e._rotation),!(t.xn.x+n.w+2*i||t.y>n.y+n.h+2*i)},intersects:function(t){var e,i,n,s=this._points(),o=t._points(),r=[L(s[0],s[1]),L(s[0],s[3])];for(this._rotation!==t._rotation&&r.push(L(o[0],o[1]),L(o[0],o[3])),e=0;e=0;--i)if(n=t[i].$layout,n&&n._visible&&n._box.contains(e))return t[i];return null},draw:function(t,e){var i,n,s,o,r,a;for(i=0,n=e.length;in({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=n["Sb"].call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((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 i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var o=new s;const r="transparent",a={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const s=Object(n["Db"])(t||r),o=s.valid&&Object(n["Db"])(e||r);return o&&o.valid?o.mix(s,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class h{constructor(t,e,i,s){const o=e[i];s=Object(n["C"])([t.to,s,o,t.from]);const r=Object(n["C"])([t.from,o,s]);this._active=!0,this._fn=t.fn||a[t.type||typeof r],this._easing=n["Fb"][t.easing]||n["Fb"].linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Object(n["C"])([t.to,e,s,t.from]),this._from=Object(n["C"])([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),n["Eb"].set("animations",{colors:{type:"color",properties:c},numbers:{type:"number",properties:l}}),n["Eb"].describe("animations",{_fallback:"animation"}),n["Eb"].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 u{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Object(n["Jb"])(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Object(n["Jb"])(s))return;const o={};for(const t of d)o[t]=s[t];(Object(n["Cb"])(s.properties)&&s.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=b(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&f(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let d=s[l];const u=i.get(l);if(d){if(u&&d.active()){d.update(u,c,r);continue}d.cancel()}u&&u.duration?(s[l]=d=new h(u,t,l,c),n.push(d)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(o.add(this._chart,i),!0):void 0}}function f(t,e){const i=[],n=Object.keys(e);for(let s=0;s0||!i&&e<0)return s.index}return null}function k(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,h=o.axis,l=r.axis,c=O(o,r,n),d=e.length;let u;for(let f=0;fi[t].axis===e).shift()}function P(t,e){return Object(n["Ib"])(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function C(t,e,i){return Object(n["Ib"])(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function D(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const A=t=>"reset"===t||"none"===t,L=(t,e)=>e?t:Object.assign({},t),E=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:x(i,!0),values:null};class T{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=v(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&D(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,o=e.xAxisID=Object(n["Wb"])(i.xAxisID,S(t,"x")),r=e.yAxisID=Object(n["Wb"])(i.yAxisID,S(t,"y")),a=e.rAxisID=Object(n["Wb"])(i.rAxisID,S(t,"r")),h=e.indexAxis,l=e.iAxisID=s(h,o,r,a),c=e.vAxisID=s(h,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&&Object(n["Vb"])(this._data,this),t._stacked&&D(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Object(n["Jb"])(e))this._data=y(e);else if(i!==e){if(i){Object(n["Vb"])(i,this);const t=this._cachedMeta;D(t),t._parsed=[]}e&&Object.isExtensible(e)&&Object(n["Mb"])(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=v(e.vScale,e),e.stack!==i.stack&&(n=!0,D(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&k(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let h,l,c,d=0===t&&e===s.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,c=s;else{c=Object(n["Cb"])(s[t])?this.parseArrayData(i,s,t,e):Object(n["Jb"])(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const o=()=>null===l[a]||u&&l[a]e||d=0;--u)if(!b()){this.updateRangeFromParsed(l,t,f,h);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=e.length;s=0&&tthis.getContext(i,s),g=l.resolveNamedOptions(u,f,b,d);return g.$shared&&(g.$shared=h,o[r]=Object.freeze(L(g,h))),g}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o="animation-"+e,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const h=new u(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||A(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){A(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!A(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[r,a,h]of this._syncList)this[r](a,h);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;rt-e))}return t._cache.$bar}function I(t){const e=t.iScale,i=R(e,t.type);let s,o,r,a,h=e._length;const l=()=>{32767!==r&&-32768!==r&&(Object(n["Kb"])(a)&&(h=Math.min(h,Math.abs(r-a)||h)),a=r)};for(s=0,o=i.length;s0?s[t-1]:null,a=tMath.abs(a)&&(h=a,l=r),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:s,end:o,min:r,max:a}}function B(t,e,i,s){return Object(n["Cb"])(t)?W(t,e,i,s):e[i.axis]=i.parse(t,s),e}function V(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,h=[];let l,c,d,u;for(l=i,c=i+n;l=i?1:-1)}function $(t){let e,i,n,s,o;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.baset.controller.options.grouped),o=i.options.stacked,r=[],a=t=>{const i=t.controller.getParsed(e),s=i&&i[t.vScale.axis];if(Object(n["Lb"])(s)||isNaN(s))return!0};for(const n of s)if((void 0===e||!a(n))&&((!1===o||-1===r.indexOf(n.stack)||void 0===o&&void 0===n.stack)&&r.push(n.stack),n.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),r=n.getLabelForValue(s.y),a=s._custom;return{label:e.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:h}=this._getSharedOptions(e,n),l=o.axis,c=r.axis;for(let d=e;dObject(n["Qb"])(t,h,l,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>Object(n["Qb"])(t,h,l,!0)?-1:Math.min(e,e*i,s,s*i),p=b(0,c,u),m=b(n["i"],d,f),x=g(n["q"],c,u),_=g(n["q"]+n["i"],d,f);s=(p-x)/2,o=(m-_)/2,r=-(p+x)/2,a=-(m+_)/2}return{ratioX:s,ratioY:o,offsetX:r,offsetY:a}}G.id="bubble",G.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},G.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};class Q extends T{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let o,r,a=t=>+i[t];if(Object(n["Jb"])(i[t])){const{key:t="value"}=this._parsing;a=e=>+Object(n["Gb"])(i[e],t)}for(o=t,r=t+e;o0&&!isNaN(t)?n["u"]*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Object(n["Pb"])(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Q.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0),o=s.controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){let e=t.label;const i=": "+t.formattedValue;return Object(n["Cb"])(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class tt extends T{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:h}=Object(n["Rb"])(e,s,r);this._drawStart=a,this._drawCount=h,Object(n["Xb"])(e)&&(a=0,h=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(s,a,h,t)}updateElements(t,e,i,s){const o="reset"===s,{iScale:r,vScale:a,_stacked:h,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,s),u=r.axis,f=a.axis,{spanGaps:b,segment:g}=this.options,p=Object(n["Yb"])(b)?b:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||o||"none"===s;let x=e>0&&this.getParsed(e-1);for(let _=e;_0&&Math.abs(i[u]-x[u])>p,g&&(b.parsed=i,b.raw=l.data[_]),d&&(b.options=c||this.resolveDataElementOptions(_,e.active?"active":s)),m||this.updateElement(e,_,b,s),x=i}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}tt.id="line",tt.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},tt.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class et extends T{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Object(n["Pb"])(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return n["Zb"].bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(ne.max&&(e.max=n))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),r=(s-o)/t.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,s){const o="reset"===s,r=this.chart,a=r.options,h=a.animation,l=this._cachedMeta.rScale,c=l.xCenter,d=l.yCenter,u=l.getIndexAngle(0)-.5*n["q"];let f,b=u;const g=360/this.countVisibleElements();for(f=0;f{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Object(n["Ub"])(this.resolveDataElementOptions(t,e).angle||i):0}}et.id="polarArea",et.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},et.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0),o=s.controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){return 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 it extends Q{}it.id="pie",it.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class nt extends T{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return n["Zb"].bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let r=e;r{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}st.defaults={},st.defaultRoutes=void 0;const ot={values(t){return Object(n["Cb"])(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let o,r=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),r=rt(t,i)}const a=Object(n["ac"])(Math.abs(r)),h=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:o,minimumFractionDigits:h,maximumFractionDigits:h};return Object.assign(l,this.options.ticks.format),Object(n["Pb"])(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=t/Math.pow(10,Math.floor(Object(n["ac"])(t)));return 1===s||2===s||5===s?ot.numeric.call(this,t,e,i):""}};function rt(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var at={formatters:ot};function ht(t,e){const i=t.options.ticks,s=i.maxTicksLimit||lt(t),o=i.major.enabled?dt(e):[],r=o.length,a=o[0],h=o[r-1],l=[];if(r>s)return ut(e,l,o,r/s),l;const c=ct(o,e,s);if(r>0){let t,i;const s=r>1?Math.round((h-a)/(r-1)):null;for(ft(e,l,c,Object(n["Lb"])(s)?0:a-s,a),t=0,i=r-1;to)return t}return Math.max(o,1)}function dt(t){const e=[];let i,n;for(i=0,n=t.length;ie.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:at.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n["Eb"].route("scale.ticks","color","","color"),n["Eb"].route("scale.grid","color","","borderColor"),n["Eb"].route("scale.grid","borderColor","","borderColor"),n["Eb"].route("scale.title","color","","color"),n["Eb"].describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),n["Eb"].describe("scales",{_fallback:"scale"}),n["Eb"].describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const gt=t=>"left"===t?"right":"right"===t?"left":t,pt=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function mt(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;or+a)))return l}function _t(t,e){Object(n["r"])(t,t=>{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;ss?s:i,s=o&&i>s?i:s,{min:Object(n["c"])(i,Object(n["c"])(s,i)),max:Object(n["c"])(s,Object(n["c"])(i,s))}}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(){Object(n["d"])(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Object(n["e"])(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=a=o||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,f=Object(n["f"])(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/i:f/(i-1),d+6>r&&(r=f/(i-(t.offset?.5:1)),a=this.maxHeight-yt(t.grid)-e.padding-vt(t.title,this.chart.options.font),h=Math.sqrt(d*d+u*u),l=Object(n["g"])(Math.min(Math.asin(Object(n["f"])((c.highest.height+6)/r,-1,1)),Math.asin(Object(n["f"])(a/h,-1,1))-Math.asin(Object(n["f"])(u/h,-1,1)))),l=Math.max(s,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){Object(n["d"])(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Object(n["d"])(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const r=vt(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=yt(o)+r):(t.height=this.maxHeight,t.width=yt(o)+r),i.display&&this.ticks.length){const{first:e,last:s,widest:o,highest:r}=this._getLabelSizes(),h=2*i.padding,l=Object(n["Ub"])(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(a){const e=i.mirror?0:d*o.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+h)}else{const e=i.mirror?0:c*o.width+d*r.height;t.width=Math.min(this.maxWidth,t.width+e+h)}this._calculatePadding(e,s,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,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,h="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;a?h?(c=n*t.width,d=i*e.height):(c=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?c=t.width:"inner"!==s&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_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(){Object(n["d"])(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e({width:o[t]||0,height:r[t]||0});return{first:O(0),last:O(e-1),widest:O(y),highest:O(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 Object(n["j"])(this._alignToPixels?Object(n["k"])(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*s?a/i:h/s:h*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:r}=s,a=o.offset,h=this.isHorizontal(),l=this.ticks,c=l.length+(a?1:0),d=yt(o),u=[],f=o.setContext(this.getContext()),b=f.drawBorder?f.borderWidth:0,g=b/2,p=function(t){return Object(n["k"])(i,t,b)};let m,x,_,y,v,O,w,j,M,k,S,P;if("top"===r)m=p(this.bottom),O=this.bottom-d,j=m-g,k=p(t.top)+g,P=t.bottom;else if("bottom"===r)m=p(this.top),k=t.top,P=p(t.bottom)-g,O=m+g,j=this.top+d;else if("left"===r)m=p(this.right),v=this.right-d,w=m-g,M=p(t.left)+g,S=t.right;else if("right"===r)m=p(this.left),M=t.left,S=p(t.right)-g,v=m+g,w=this.left+d;else if("x"===e){if("center"===r)m=p((t.top+t.bottom)/2+.5);else if(Object(n["Jb"])(r)){const t=Object.keys(r)[0],e=r[t];m=p(this.chart.scales[t].getPixelForValue(e))}k=t.top,P=t.bottom,O=m+g,j=O+d}else if("y"===e){if("center"===r)m=p((t.left+t.right)/2);else if(Object(n["Jb"])(r)){const t=Object.keys(r)[0],e=r[t];m=p(this.chart.scales[t].getPixelForValue(e))}v=m-g,w=v-d,M=t.left,S=t.right}const C=Object(n["Wb"])(s.ticks.maxTicksLimit,c),D=Math.max(1,Math.ceil(c/C));for(x=0;xe.value===t);if(n>=0){const t=e.setContext(this.getContext(n));return t.lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s{const s=i.split("."),o=s.pop(),r=[t].concat(s).join("."),a=e[i].split("."),h=a.pop(),l=a.join(".");n["Eb"].route(r,o,l,h)})}function Dt(t){return"id"in t&&"defaults"in t}class At{constructor(){this.controllers=new St(T,"datasets",!0),this.elements=new St(st,"elements"),this.plugins=new St(Object,"plugins"),this.scales=new St(kt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):Object(n["r"])(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const s=Object(n["x"])(t);Object(n["d"])(i["before"+s],[],i),e[t](i),Object(n["d"])(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let y=e;y0&&Math.abs(i[f]-_[f])>m,p&&(c.parsed=i,c.raw=l.data[y]),u&&(c.options=d||this.resolveDataElementOptions(y,e.active?"active":s)),x||this.updateElement(e,y,c,s),_=i}this.updateSharedOptions(d,s,c)}getMaxOverflow(){const 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}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}Et.id="scatter",Et.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Et.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Tt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Rt{constructor(t){this.options=t||{}}init(t){}formats(){return Tt()}parse(t,e){return Tt()}format(t,e){return Tt()}add(t,e,i){return Tt()}diff(t,e,i){return Tt()}startOf(t,e,i){return Tt()}endOf(t,e){return Tt()}}Rt.override=function(t){Object.assign(Rt.prototype,t)};var It={_date:Rt};function zt(t,e,i,s){const{controller:o,data:r,_sorted:a}=t,h=o._cachedMeta.iScale;if(h&&e===h.axis&&"r"!==e&&a&&r.length){const t=h._reversePixels?n["z"]:n["A"];if(!s)return t(r,e,i);if(o._sharedOptions){const n=r[0],s="function"===typeof n.getRange&&n.getRange(e);if(s){const n=t(r,e,i-s),o=t(r,e,i+s);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function Ft(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let a=0,h=o.length;a{t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:h}),a=a||t.inRange(e.x,e.y,s))}),n&&!a?[]:o}var Yt={evaluateInteractionItems:Ft,modes:{index(t,e,i,s){const o=Object(n["y"])(e,t),r=i.axis||"x",a=i.includeInvisible||!1,h=i.intersect?Bt(t,o,r,s,a):Ht(t,o,r,!1,s,a),l=[];return h.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=h[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,s){const o=Object(n["y"])(e,t),r=i.axis||"xy",a=i.includeInvisible||!1;let h=i.intersect?Bt(t,o,r,s,a):Ht(t,o,r,!1,s,a);if(h.length>0){const e=h[0].datasetIndex,i=t.getDatasetMeta(e).data;h=[];for(let t=0;tt.pos===e)}function qt(t,e){return t.filter(t=>-1===Ut.indexOf(t.pos)&&t.box.axis===e)}function Jt(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function Kt(t){const e=[];let i,n,s,o,r,a;for(i=0,n=(t||[]).length;it.box.fullSize),!0),n=Jt(Xt(e,"left"),!0),s=Jt(Xt(e,"right")),o=Jt(Xt(e,"top"),!0),r=Jt(Xt(e,"bottom")),a=qt(e,"x"),h=qt(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(h).concat(r).concat(a),chartArea:Xt(e,"chartArea"),vertical:n.concat(s).concat(h),horizontal:o.concat(r).concat(a)}}function te(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function ee(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 ie(t,e,i,s){const{pos:o,box:r}=i,a=t.maxPadding;if(!Object(n["Jb"])(o)){i.size&&(t[o]-=i.size);const e=s[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[o]+=i.size}r.getPadding&&ee(a,r.getPadding());const h=Math.max(0,e.outerWidth-te(a,t,"left","right")),l=Math.max(0,e.outerHeight-te(a,t,"top","bottom")),c=h!==t.w,d=l!==t.h;return t.w=h,t.h=l,i.horizontal?{same:c,other:d}:{same:d,other:c}}function ne(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}function se(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function oe(t,e,i,n){const s=[];let o,r,a,h,l,c;for(o=0,r=t.length,l=0;o{"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,u=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/d,hBoxMaxHeight:a/2}),f=Object.assign({},o);ee(f,Object(n["l"])(s));const b=Object.assign({maxPadding:f,w:r,h:a,x:o.left,y:o.top},o),g=Zt(l.concat(c),u);oe(h.fullSize,b,u,g),oe(l,b,u,g),oe(c,b,u,g)&&oe(l,b,u,g),ne(b),ae(h.leftAndTop,b,u,g),b.x+=b.w,b.y+=b.h,ae(h.rightAndBottom,b,u,g),t.chartArea={left:b.left,top:b.top,right:b.left+b.w,bottom:b.top+b.h,height:b.h,width:b.w},Object(n["r"])(h.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(b.w,b.h,{left:0,top:0,right:0,bottom:0})})}};class le{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class ce extends le{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const de="$chartjs",ue={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fe=t=>null===t||""===t;function be(t,e){const i=t.style,s=t.getAttribute("height"),o=t.getAttribute("width");if(t[de]={initial:{height:s,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",fe(o)){const e=Object(n["G"])(t,"width");void 0!==e&&(t.width=e)}if(fe(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Object(n["G"])(t,"height");void 0!==e&&(t.height=e)}return t}const ge=!!n["I"]&&{passive:!0};function pe(t,e,i){t.addEventListener(e,i,ge)}function me(t,e,i){t.canvas.removeEventListener(e,i,ge)}function xe(t,e){const i=ue[t.type]||t.type,{x:s,y:o}=Object(n["y"])(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==o?o:null}}function _e(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function ye(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||_e(i.addedNodes,n),e=e&&!_e(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function ve(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||_e(i.removedNodes,n),e=e&&!_e(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oe=new Map;let we=0;function je(){const t=window.devicePixelRatio;t!==we&&(we=t,Oe.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Me(t,e){Oe.size||window.addEventListener("resize",je),Oe.set(t,e)}function ke(t){Oe.delete(t),Oe.size||window.removeEventListener("resize",je)}function Se(t,e,i){const s=t.canvas,o=s&&Object(n["F"])(s);if(!o)return;const r=Object(n["H"])((t,e)=>{const n=o.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)});return a.observe(o),Me(t,r),a}function Pe(t,e,i){i&&i.disconnect(),"resize"===e&&ke(t)}function Ce(t,e,i){const s=t.canvas,o=Object(n["H"])(e=>{null!==t.ctx&&i(xe(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return pe(s,e,o),o}class De extends le{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(be(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[de])return!1;const i=e[de].initial;["height","width"].forEach(t=>{const s=i[t];Object(n["Lb"])(s)?e.removeAttribute(t):e.setAttribute(t,s)});const s=i.style||{};return Object.keys(s).forEach(t=>{e.style[t]=s[t]}),e.width=e.width,delete e[de],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:ye,detach:ve,resize:Se},o=s[e]||Ce;n[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;const s={attach:Pe,detach:Pe,resize:Pe},o=s[e]||me;o(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Object(n["E"])(t,e,i,s)}isAttached(t){const e=Object(n["F"])(t);return!(!e||!e.isConnected)}}function Ae(t){return!Object(n["J"])()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ce:De}class Le{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(s,t,e,i);return"afterDestroy"===e&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const o of t){const t=o.plugin,r=t[i],a=[e,s,o.options];if(!1===Object(n["d"])(r,a,t)&&s.cancelable)return!1}return!0}invalidate(){Object(n["Lb"])(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=Object(n["Wb"])(i.options&&i.options.plugins,{}),o=Ee(i);return!1!==s||e?Re(t,o,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Ee(t){const e={},i=[],n=Object.keys(Lt.plugins.items);for(let o=0;o{const e=s[t];if(!Object(n["Jb"])(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 h=Ve(t,e),l=We(h,o),c=i.scales||{};r[h]=r[h]||t,a[t]=Object(n["eb"])(Object.create(null),[{axis:h},e,c[h],c[l]])}),t.data.datasets.forEach(i=>{const o=i.type||t.type,h=i.indexAxis||ze(o,e),l=n["v"][o]||{},c=l.scales||{};Object.keys(c).forEach(t=>{const e=Fe(t,h),o=i[e+"AxisID"]||r[e]||e;a[o]=a[o]||Object.create(null),Object(n["eb"])(a[o],[{axis:e},s[o],c[t]])})}),Object.keys(a).forEach(t=>{const e=a[t];Object(n["eb"])(e,[n["Eb"].scales[e.type],n["Eb"].scale])}),a}function He(t){const e=t.options||(t.options={});e.plugins=Object(n["Wb"])(e.plugins,{}),e.scales=Ne(t,e)}function $e(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Ye(t){return t=t||{},t.data=$e(t.data),He(t),t}const Ue=new Map,Xe=new Set;function qe(t,e){let i=Ue.get(t);return i||(i=e(),Ue.set(t,i),Xe.add(i)),i}const Je=(t,e,i)=>{const s=Object(n["Gb"])(e,i);void 0!==s&&t.add(s)};class Ke{constructor(t){this._config=Ye(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=$e(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(),He(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return qe(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return qe(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return qe(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return qe(`${i}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const h=new Set;e.forEach(e=>{t&&(h.add(t),e.forEach(e=>Je(h,t,e))),e.forEach(t=>Je(h,s,t)),e.forEach(t=>Je(h,n["v"][o]||{},t)),e.forEach(t=>Je(h,n["Eb"],t)),e.forEach(t=>Je(h,n["K"],t))});const l=Array.from(h);return 0===l.length&&l.push(Object.create(null)),Xe.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,n["v"][e]||{},n["Eb"].datasets[e]||{},{type:e},n["Eb"],n["K"]]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Ge(this._resolverCache,t,s);let h=r;if(Qe(r,e)){o.$shared=!1,i=Object(n["L"])(i)?i():i;const e=this.createResolver(t,i,a);h=Object(n["M"])(r,i,e)}for(const n of e)o[n]=h[n];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Ge(this._resolverCache,t,i);return Object(n["Jb"])(e)?Object(n["M"])(o,e,void 0,s):o}}function Ge(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const o=i.join();let r=s.get(o);if(!r){const t=Object(n["cb"])(e,i);r={resolver:t,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(o,r)}return r}const Ze=t=>Object(n["Jb"])(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||Object(n["L"])(t[i]),!1);function Qe(t,e){const{isScriptable:i,isIndexable:s}=Object(n["db"])(t);for(const o of e){const e=i(o),r=s(o),a=(r||e)&&t[o];if(e&&(Object(n["L"])(a)||Ze(a))||r&&Object(n["Cb"])(a))return!0}return!1}var ti="3.9.1";const ei=["top","bottom","left","right","chartArea"];function ii(t,e){return"top"===t||"bottom"===t||-1===ei.indexOf(t)&&"x"===e}function ni(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function si(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Object(n["d"])(i&&i.onComplete,[t],e)}function oi(t){const e=t.chart,i=e.options.animation;Object(n["d"])(i&&i.onProgress,[t],e)}function ri(t){return Object(n["J"])()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ai={},hi=t=>{const e=ri(t);return Object.values(ai).filter(t=>t.canvas===e).pop()};function li(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}function ci(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}class di{constructor(t,e){const i=this.config=new Ke(e),s=ri(t),r=hi(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Ae(s)),this.platform.updateConfig(i);const h=this.platform.acquireContext(s,a.aspectRatio),l=h&&h.canvas,c=l&&l.height,d=l&&l.width;this.id=Object(n["fb"])(),this.ctx=h,this.canvas=l,this.width=d,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Le,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Object(n["gb"])(t=>this.update(t),a.resizeDelay||0),this._dataChanges=[],ai[this.id]=this,h&&l?(o.listen(this,"complete",si),o.listen(this,"progress",oi),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return Object(n["Lb"])(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Object(n["hb"])(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Object(n["ib"])(this.canvas,this.ctx),this}stop(){return o.stop(this),this}resize(t,e){o.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),h=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Object(n["hb"])(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),Object(n["d"])(i.onResize,[this,r],this),this.attached&&this._doResize(h)&&this.render())}ensureScalesHaveIDs(){const t=this.options,e=t.scales||{};Object(n["r"])(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let o=[];e&&(o=o.concat(Object.keys(e).map(t=>{const i=e[t],n=Ve(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}}))),Object(n["r"])(o,e=>{const o=e.options,r=o.id,a=Ve(r,o),h=Object(n["Wb"])(o.type,e.dtype);void 0!==o.position&&ii(o.position,a)===ii(e.dposition)||(o.position=e.dposition),s[r]=!0;let l=null;if(r in i&&i[r].type===h)l=i[r];else{const t=Lt.getScale(h);l=new t({id:r,type:h,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(o,t)}),Object(n["r"])(s,(t,e)=>{t||delete i[e]}),Object(n["r"])(i,t=>{he.configure(this,t,t.options),he.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let n=0,l=this.data.datasets.length;n{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ni("z","_idx"));const{_active:a,_lastEvent:h}=this;h?this._eventHandler(h,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Object(n["r"])(this.scales,t=>{he.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Object(n["jb"])(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){const e="_removeElements"===i?-s:s;li(t,n,e)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),s=i(0);for(let o=1;ot.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;he.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Object(n["r"])(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(s&&Object(n["m"])(e,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?this.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&Object(n["o"])(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Object(n["a"])(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=Yt.modes[e];return"function"===typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Object(n["Ib"])(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"===typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Object(n["Kb"])(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(e=>e.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),o.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};Object(n["r"])(this.options.events,t=>i(t,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){Object(n["r"])(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Object(n["r"])(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!Object(n["kb"])(i,e);s&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),h=Object(n["lb"])(t),l=ci(t,this._lastEvent,i,h);i&&(this._lastEvent=null,Object(n["d"])(o.onHover,[t,a,this],this),h&&Object(n["d"])(o.onClick,[t,a,this],this));const c=!Object(n["kb"])(a,s);return(c||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}const ui=()=>Object(n["r"])(di.instances,t=>t._plugins.invalidate()),fi=!0;function bi(t,e,i){const{startAngle:s,pixelMargin:o,x:r,y:a,outerRadius:h,innerRadius:l}=e;let c=o/h;t.beginPath(),t.arc(r,a,h,s-c,i+c),l>o?(c=o/l,t.arc(r,a,l,i+c,s-c,!0)):t.arc(r,a,o,i+n["i"],s-n["i"]),t.closePath(),t.clip()}function gi(t){return Object(n["nb"])(t,["outerStart","outerEnd","innerStart","innerEnd"])}function pi(t,e,i,s){const o=gi(t.options.borderRadius),r=(i-e)/2,a=Math.min(r,s*e/2),h=t=>{const e=(i-Math.min(r,t))*s/2;return Object(n["f"])(t,0,Math.min(r,e))};return{outerStart:h(o.outerStart),outerEnd:h(o.outerEnd),innerStart:Object(n["f"])(o.innerStart,0,a),innerEnd:Object(n["f"])(o.innerEnd,0,a)}}function mi(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function xi(t,e,i,s,o,r){const{x:a,y:h,startAngle:l,pixelMargin:c,innerRadius:d}=e,u=Math.max(e.outerRadius+s+i-c,0),f=d>0?d+s+i+c:0;let b=0;const g=o-l;if(s){const t=d>0?d-s:0,e=u>0?u-s:0,i=(t+e)/2,n=0!==i?g*i/(i+s):g;b=(g-n)/2}const p=Math.max(.001,g*u-i/n["q"])/u,m=(g-p)/2,x=l+m+b,_=o-m-b,{outerStart:y,outerEnd:v,innerStart:O,innerEnd:w}=pi(e,f,u,_-x),j=u-y,M=u-v,k=x+y/j,S=_-v/M,P=f+O,C=f+w,D=x+O/P,A=_-w/C;if(t.beginPath(),r){if(t.arc(a,h,u,k,S),v>0){const e=mi(M,S,a,h);t.arc(e.x,e.y,v,S,_+n["i"])}const e=mi(C,_,a,h);if(t.lineTo(e.x,e.y),w>0){const e=mi(C,A,a,h);t.arc(e.x,e.y,w,_+n["i"],A+Math.PI)}if(t.arc(a,h,f,_-w/f,x+O/f,!0),O>0){const e=mi(P,D,a,h);t.arc(e.x,e.y,O,D+Math.PI,x-n["i"])}const i=mi(j,x,a,h);if(t.lineTo(i.x,i.y),y>0){const e=mi(j,k,a,h);t.arc(e.x,e.y,y,x-n["i"],k)}}else{t.moveTo(a,h);const e=Math.cos(k)*u+a,i=Math.sin(k)*u+h;t.lineTo(e,i);const n=Math.cos(S)*u+a,s=Math.sin(S)*u+h;t.lineTo(n,s)}t.closePath()}function _i(t,e,i,s,o){const{fullCircles:r,startAngle:a,circumference:h}=e;let l=e.endAngle;if(r){xi(t,e,i,s,a+n["u"],o);for(let e=0;e{Lt.add(...t),ui()}},unregister:{enumerable:fi,value:(...t)=>{Lt.remove(...t),ui()}}});class Oi extends st{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:o,distance:r}=Object(n["D"])(s,{x:t,y:e}),{startAngle:a,endAngle:h,innerRadius:l,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,f=Object(n["Wb"])(d,h-a),b=f>=n["u"]||Object(n["Qb"])(o,a,h),g=Object(n["mb"])(r,l+u,c+u);return b&&g}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:h}=this.options,l=(n+s)/2,c=(o+r+h+a)/2;return{x:e+Math.cos(l)*c,y:i+Math.sin(l)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>n["u"]?Math.floor(i/n["u"]):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*a,Math.sin(e)*a),this.circumference>=n["q"]&&(a=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const h=_i(t,this,a,o,r);vi(t,this,a,o,h,r),t.restore()}}function wi(t,e,i=e){t.lineCap=Object(n["Wb"])(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Object(n["Wb"])(i.borderDash,e.borderDash)),t.lineDashOffset=Object(n["Wb"])(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Object(n["Wb"])(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Object(n["Wb"])(i.borderWidth,e.borderWidth),t.strokeStyle=Object(n["Wb"])(i.borderColor,e.borderColor)}function ji(t,e,i){t.lineTo(i.x,i.y)}function Mi(t){return t.stepped?n["ub"]:t.tension||"monotone"===t.cubicInterpolationMode?n["vb"]:ji}function ki(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,h=Math.max(s,r),l=Math.min(o,a),c=sa&&o>a;return{count:n,start:h,loop:e.loop,ilen:l(r+(l?a-t:t))%o,_=()=>{f!==b&&(t.lineTo(p,b),t.lineTo(p,f),t.lineTo(p,g))};for(h&&(d=s[x(0)],t.moveTo(d.x,d.y)),c=0;c<=a;++c){if(d=s[x(c)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ib&&(b=i),p=(m*p+e)/++m):(_(),t.lineTo(e,i),u=n,m=0,f=b=i),g=i}_()}function Ci(t){const e=t.options,i=e.borderDash&&e.borderDash.length,n=!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i;return n?Pi:Si}function Di(t){return t.stepped?n["rb"]:t.tension||"monotone"===t.cubicInterpolationMode?n["sb"]:n["tb"]}function Ai(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),wi(t,e.options),t.stroke(s)}function Li(t,e,i,n){const{segments:s,options:o}=e,r=Ci(e);for(const a of s)wi(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}Oi.id="arc",Oi.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},Oi.defaultRoutes={backgroundColor:"backgroundColor"};const Ei="function"===typeof Path2D;function Ti(t,e,i,n){Ei&&!e.options.segment?Ai(t,e,i,n):Li(t,e,i,n)}class Ri extends st{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Object(n["ob"])(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Object(n["pb"])(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,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],o=this.points,r=Object(n["qb"])(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],h=Di(i);let l,c;for(l=0,c=r.length;l"borderDash"!==t&&"fill"!==t};class zi extends st{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:o}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-o,2){let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}},Ji=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Ki extends st{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Object(n["d"])(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=Object(n["p"])(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:h}=qi(i,o);let l,c;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(r,o,a,h)+10):(c=this.maxHeight,l=this._fitCols(r,o,a,h)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],h=this.lineWidths=[0],l=n+r;let c=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-l;return this.legendItems.forEach((t,f)=>{const b=i+e/2+s.measureText(t.text).width;(0===f||h[h.length-1]+b+2*r>o)&&(c+=l,h[h.length-(f>0?0:1)]=0,u+=l,d++),a[f]={left:0,top:u,row:d,width:b,height:n},h[h.length-1]+=b+r}),c}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],h=this.columnSizes=[],l=o-t;let c=r,d=0,u=0,f=0,b=0;return this.legendItems.forEach((t,o)=>{const g=i+e/2+s.measureText(t.text).width;o>0&&u+n+2*r>l&&(c+=d+r,h.push({width:d,height:u}),f+=d+r,b++,d=u=0),a[o]={left:f,top:u,col:b,width:g,height:n},d=Math.max(d,g),u+=n+r}),c+=d,h.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Object(n["N"])(o,this.left,this.width);if(this.isHorizontal()){let o=0,a=Object(n["t"])(i,this.left+s,this.right-this.lineWidths[o]);for(const h of e)o!==h.row&&(o=h.row,a=Object(n["t"])(i,this.left+s,this.right-this.lineWidths[o])),h.top+=this.top+t+s,h.left=r.leftForLtr(r.x(a),h.width),a+=h.width+s}else{let o=0,a=Object(n["t"])(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const h of e)h.col!==o&&(o=h.col,a=Object(n["t"])(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),h.top=a,h.left+=this.left+s,h.left=r.leftForLtr(r.x(h.left),h.width),a+=h.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Object(n["m"])(t,this),this._draw(),Object(n["o"])(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=n["Eb"].color,h=Object(n["N"])(t.rtl,this.left,this.width),l=Object(n["p"])(r.font),{color:c,padding:d}=r,u=l.size,f=u/2;let b;this.drawTitle(),s.textAlign=h.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:g,boxHeight:p,itemHeight:m}=qi(r,u),x=function(t,e,i){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const o=Object(n["Wb"])(i.lineWidth,1);if(s.fillStyle=Object(n["Wb"])(i.fillStyle,a),s.lineCap=Object(n["Wb"])(i.lineCap,"butt"),s.lineDashOffset=Object(n["Wb"])(i.lineDashOffset,0),s.lineJoin=Object(n["Wb"])(i.lineJoin,"miter"),s.lineWidth=o,s.strokeStyle=Object(n["Wb"])(i.strokeStyle,a),s.setLineDash(Object(n["Wb"])(i.lineDash,[])),r.usePointStyle){const a={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:o},l=h.xPlus(t,g/2),c=e+f;Object(n["R"])(s,a,l,c,r.pointStyleWidth&&g)}else{const r=e+Math.max((u-p)/2,0),a=h.leftForLtr(t,g),l=Object(n["zb"])(i.borderRadius);s.beginPath(),Object.values(l).some(t=>0!==t)?Object(n["xb"])(s,{x:a,y:r,w:g,h:p,radius:l}):s.rect(a,r,g,p),s.fill(),0!==o&&s.stroke()}s.restore()},_=function(t,e,i){Object(n["n"])(s,i.text,t,e+m/2,l,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();b=y?{x:Object(n["t"])(o,this.left+d,this.right-i[0]),y:this.top+d+v,line:0}:{x:this.left+d,y:Object(n["t"])(o,this.top+v+d,this.bottom-e[0].height),line:0},Object(n["O"])(this.ctx,t.textDirection);const O=m+d;this.legendItems.forEach((a,l)=>{s.strokeStyle=a.fontColor||c,s.fillStyle=a.fontColor||c;const u=s.measureText(a.text).width,p=h.textAlign(a.textAlign||(a.textAlign=r.textAlign)),m=g+f+u;let w=b.x,j=b.y;h.setWidth(this.width),y?l>0&&w+m+d>this.right&&(j=b.y+=O,b.line++,w=b.x=Object(n["t"])(o,this.left+d,this.right-i[b.line])):l>0&&j+O>this.bottom&&(w=b.x=w+e[b.line].width+d,b.line++,j=b.y=Object(n["t"])(o,this.top+v+d,this.bottom-e[b.line].height));const M=h.x(w);x(M,j,a),w=Object(n["P"])(p,w+g+f,y?w+m:this.right,t.rtl),_(h.x(w),j,a),y?b.x+=m+d:b.y+=O}),Object(n["Q"])(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Object(n["p"])(e.font),s=Object(n["l"])(e.padding);if(!e.display)return;const o=Object(n["N"])(t.rtl,this.left,this.width),r=this.ctx,a=e.position,h=i.size/2,l=s.top+h;let c,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+l,d=Object(n["t"])(t.align,d,this.right-u);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+Object(n["t"])(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=Object(n["t"])(a,d,d+u);r.textAlign=o.textAlign(Object(n["s"])(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Object(n["n"])(r,e.text,f,c,i)}_computeTitleHeight(){const t=this.options.title,e=Object(n["p"])(t.font),i=Object(n["l"])(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(Object(n["mb"])(t,this.left,this.right)&&Object(n["mb"])(e,this.top,this.bottom))for(o=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:o,color:r}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const a=t.controller.getStyle(i?0:void 0),h=Object(n["l"])(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:(h.width+h.height)/4,strokeStyle:a.borderColor,pointStyle:s||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)}}};class Qi extends st{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=Object(n["Cb"])(i.text)?i.text.length:1;this._padding=Object(n["l"])(i.padding);const o=s*Object(n["p"])(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:r}=this,a=r.align;let h,l,c,d=0;return this.isHorizontal()?(l=Object(n["t"])(a,i,o),c=e+t,h=o-i):("left"===r.position?(l=i+t,c=Object(n["t"])(a,s,e),d=-.5*n["q"]):(l=o-t,c=Object(n["t"])(a,e,s),d=.5*n["q"]),h=s-e),{titleX:l,titleY:c,maxWidth:h,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Object(n["p"])(e.font),s=i.lineHeight,o=s/2+this._padding.top,{titleX:r,titleY:a,maxWidth:h,rotation:l}=this._drawArgs(o);Object(n["n"])(t,e.text,0,0,i,{color:e.color,maxWidth:h,rotation:l,textAlign:Object(n["s"])(e.align),textBaseline:"middle",translation:[r,a]})}}function tn(t,e){const i=new Qi({ctx:t.ctx,options:e,chart:t});he.configure(t,i,e),he.addBox(t,i),t.titleBlock=i}var en={id:"title",_element:Qi,start(t,e,i){tn(t,i)},stop(t){const e=t.titleBlock;he.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;he.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;const nn={average(t){if(!t.length)return!1;let e,i,n=0,s=0,o=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function rn(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function an(t,e){const i=t.chart.ctx,{body:s,footer:o,title:r}=t,{boxWidth:a,boxHeight:h}=e,l=Object(n["p"])(e.bodyFont),c=Object(n["p"])(e.titleFont),d=Object(n["p"])(e.footerFont),u=r.length,f=o.length,b=s.length,g=Object(n["l"])(e.padding);let p=g.height,m=0,x=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(x+=t.beforeBody.length+t.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),x){const t=e.displayColors?Math.max(h,l.lineHeight):l.lineHeight;p+=b*t+(x-b)*l.lineHeight+(x-1)*e.bodySpacing}f&&(p+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let _=0;const y=function(t){m=Math.max(m,i.measureText(t).width+_)};return i.save(),i.font=c.string,Object(n["r"])(t.title,y),i.font=l.string,Object(n["r"])(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?a+2+e.boxPadding:0,Object(n["r"])(s,t=>{Object(n["r"])(t.before,y),Object(n["r"])(t.lines,y),Object(n["r"])(t.after,y)}),_=0,i.font=d.string,Object(n["r"])(t.footer,y),i.restore(),m+=g.width,{width:m,height:p}}function hn(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}function ln(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||("right"===t&&s-o-r<0||void 0)}function cn(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:h}}=t;let l="center";return"center"===n?l=s<=(a+h)/2?"left":"right":s<=o/2?l="left":s>=r-o/2&&(l="right"),ln(l,t,e,i)&&(l="center"),l}function dn(t,e,i){const n=i.yAlign||e.yAlign||hn(t,i);return{xAlign:i.xAlign||e.xAlign||cn(t,e,i,n),yAlign:n}}function un(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}function fn(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}function bn(t,e,i,s){const{caretSize:o,caretPadding:r,cornerRadius:a}=t,{xAlign:h,yAlign:l}=i,c=o+r,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:b}=Object(n["zb"])(a);let g=un(e,h);const p=fn(e,l,c);return"center"===l?"left"===h?g+=c:"right"===h&&(g-=c):"left"===h?g-=Math.max(d,f)+o:"right"===h&&(g+=Math.max(u,b)+o),{x:Object(n["f"])(g,0,s.width-e.width),y:Object(n["f"])(p,0,s.height-e.height)}}function gn(t,e,i){const s=Object(n["l"])(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function pn(t){return sn([],on(t))}function mn(t,e,i){return Object(n["Ib"])(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}function xn(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class _n extends st{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,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new u(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=mn(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let r=[];return r=sn(r,on(n)),r=sn(r,on(s)),r=sn(r,on(o)),r}getBeforeBody(t,e){return pn(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return Object(n["r"])(t,t=>{const e={before:[],lines:[],after:[]},n=xn(i,t);sn(e.before,on(n.beforeLabel.call(this,t))),sn(e.lines,n.label.call(this,t)),sn(e.after,on(n.afterLabel.call(this,t))),s.push(e)}),s}getAfterBody(t,e){return pn(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let r=[];return r=sn(r,on(n)),r=sn(r,on(s)),r=sn(r,on(o)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],r=[];let a,h,l=[];for(a=0,h=e.length;at.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),Object(n["r"])(l,e=>{const i=xn(t.callbacks,e);s.push(i.labelColor.call(this,e)),o.push(i.labelPointStyle.call(this,e)),r.push(i.labelTextColor.call(this,e))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=nn[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=an(this,i),r=Object.assign({},t,e),a=dn(this.chart,i,r),h=bn(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:h,topRight:l,bottomLeft:c,bottomRight:d}=Object(n["zb"])(a),{x:u,y:f}=t,{width:b,height:g}=e;let p,m,x,_,y,v;return"center"===o?(y=f+g/2,"left"===s?(p=u,m=p-r,_=y+r,v=y-r):(p=u+b,m=p+r,_=y-r,v=y+r),x=p):(m="left"===s?u+Math.max(h,c)+r:"right"===s?u+b-Math.max(l,d)-r:this.caretX,"top"===o?(_=f,y=_-r,p=m-r,x=m+r):(_=f+g,y=_+r,p=m+r,x=m-r),v=_),{x1:p,x2:m,x3:x,y1:_,y2:y,y3:v}}drawTitle(t,e,i){const s=this.title,o=s.length;let r,a,h;if(o){const l=Object(n["N"])(i.rtl,this.x,this.width);for(t.x=gn(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=Object(n["p"])(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,h=0;h0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Object(n["xb"])(t,{x:e,y:g,w:l,h:h,radius:a}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Object(n["xb"])(t,{x:i,y:g+1,w:l-2,h:h-2,radius:a}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,g,l,h),t.strokeRect(e,g,l,h),t.fillStyle=r.backgroundColor,t.fillRect(i,g+1,l-2,h-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:h,boxWidth:l,boxPadding:c}=i,d=Object(n["p"])(i.bodyFont);let u=d.lineHeight,f=0;const b=Object(n["N"])(i.rtl,this.x,this.width),g=function(i){e.fillText(i,b.x(t.x+f),t.y+u/2),t.y+=u+o},p=b.textAlign(r);let m,x,_,y,v,O,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=gn(this,p,i),e.fillStyle=i.bodyColor,Object(n["r"])(this.beforeBody,g),f=a&&"right"!==p?"center"===r?l/2+c:l+2+c:0,y=0,O=s.length;y0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=nn[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=an(this,t),r=Object.assign({},i,this._size),a=dn(e,t,r),h=bn(t,r,a,e);n._to===h.x&&s._to===h.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=Object(n["l"])(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),Object(n["O"])(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Object(n["Q"])(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),o=!Object(n["kb"])(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),h=e||!Object(n["kb"])(r,o)||a;return h&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),h}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e;const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=nn[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}_n.positioners=nn;var yn={id:"tooltip",_element:_n,positioners:nn,afterInit(t,e,i){i&&(t.tooltip=new _n({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",i))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:n["S"],title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const vn=(t,e,i,n)=>("string"===typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function On(t,e,i,n){const s=t.indexOf(e);if(-1===s)return vn(t,e,i,n);const o=t.lastIndexOf(e);return s!==o?i:s}const wn=(t,e)=>null===t?null:Object(n["f"])(Math.round(t),0,e);class jn extends kt{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:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Object(n["Lb"])(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:On(i,t,Object(n["Wb"])(e,t),this._addedLabels),wn(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)n.push({value:o});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Mn(t,e){const i=[],s=1e-14,{bounds:o,step:r,min:a,max:h,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:f}=t,b=r||1,g=d-1,{min:p,max:m}=e,x=!Object(n["Lb"])(a),_=!Object(n["Lb"])(h),y=!Object(n["Lb"])(c),v=(m-p)/(u+1);let O,w,j,M,k=Object(n["V"])((m-p)/g/b)*b;if(kg&&(k=Object(n["V"])(M*k/g/b)*b),Object(n["Lb"])(l)||(O=Math.pow(10,l),k=Math.ceil(k*O)/O),"ticks"===o?(w=Math.floor(p/k)*k,j=Math.ceil(m/k)*k):(w=p,j=m),x&&_&&r&&Object(n["W"])((h-a)/r,k/1e3)?(M=Math.round(Math.min((h-a)/k,d)),k=(h-a)/M,w=a,j=h):y?(w=x?a:w,j=_?h:j,M=c-1,k=(j-w)/M):(M=(j-w)/k,M=Object(n["X"])(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(Object(n["Y"])(k),Object(n["Y"])(w));O=Math.pow(10,Object(n["Lb"])(l)?S:l),w=Math.round(w*O)/O,j=Math.round(j*O)/O;let P=0;for(x&&(f&&w!==a?(i.push({value:a}),ws=e?s:t,a=t=>o=i?o:t;if(t){const t=Object(n["Tb"])(s),e=Object(n["Tb"])(o);t<0&&e<0?a(0):t>0&&e>0&&r(0)}if(s===o){let e=1;(o>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*o)),a(o+e),t||r(s-e)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},o=this._range||this,r=Mn(s,o);return"ticks"===t.bounds&&Object(n["U"])(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Object(n["Pb"])(t,this.chart.options.locale,this.options.ticks.format)}}class Pn extends Sn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Object(n["Hb"])(t)?t:0,this.max=Object(n["Hb"])(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Object(n["Ub"])(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Cn(t){const e=t/Math.pow(10,Math.floor(Object(n["ac"])(t)));return 1===e}function Dn(t,e){const i=Math.floor(Object(n["ac"])(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),o=[];let r=Object(n["c"])(t.min,Math.pow(10,Math.floor(Object(n["ac"])(e.min)))),a=Math.floor(Object(n["ac"])(r)),h=Math.floor(r/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{o.push({value:r,major:Cn(r)}),++h,10===h&&(h=1,++a,l=a>=0?1:l),r=Math.round(h*Math.pow(10,a)*l)/l}while(a0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Object(n["Hb"])(t)?Math.max(0,t):null,this.max=Object(n["Hb"])(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=e=>i=t?i:e,r=t=>s=e?s:t,a=(t,e)=>Math.pow(10,Math.floor(Object(n["ac"])(t))+e);i===s&&(i<=0?(o(1),r(10)):(o(a(i,-1)),r(a(s,1)))),i<=0&&o(a(s,-1)),s<=0&&r(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&o(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Dn(e,this);return"ticks"===t.bounds&&Object(n["U"])(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return void 0===t?"0":Object(n["Pb"])(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Object(n["ac"])(t),this._valueRange=Object(n["ac"])(this.max)-Object(n["ac"])(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Object(n["ac"])(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Ln(t){const e=t.ticks;if(e.display&&t.display){const t=Object(n["l"])(e.backdropPadding);return Object(n["Wb"])(e.font&&e.font.size,n["Eb"].font.size)+t.height}return 0}function En(t,e,i){return i=Object(n["Cb"])(i)?i:[i],{w:Object(n["Z"])(t,e.string,i),h:i.length*e.lineHeight}}function Tn(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:ts?{start:e-i,end:e}:{start:e,end:e+i}}function Rn(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},i=Object.assign({},e),s=[],o=[],r=t._pointLabels.length,a=t.options.pointLabels,h=a.centerPointLabels?n["q"]/r:0;for(let l=0;le.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(h=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+h))}function zn(t,e,i){const s=[],o=t._pointLabels.length,r=t.options,a=Ln(r)/2,h=t.drawingArea,l=r.pointLabels.centerPointLabels?n["q"]/o:0;for(let c=0;c270||i<90)&&(t-=e),t}function Vn(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let o=e-1;o>=0;o--){const e=s.setContext(t.getPointLabelContext(o)),r=Object(n["p"])(e.font),{x:a,y:h,textAlign:l,left:c,top:d,right:u,bottom:f}=t._pointLabelItems[o],{backdropColor:b}=e;if(!Object(n["Lb"])(b)){const t=Object(n["zb"])(e.borderRadius),s=Object(n["l"])(e.backdropPadding);i.fillStyle=b;const o=c-s.left,r=d-s.top,a=u-c+s.width,h=f-d+s.height;Object.values(t).some(t=>0!==t)?(i.beginPath(),Object(n["xb"])(i,{x:o,y:r,w:a,h:h,radius:t}),i.fill()):i.fillRect(o,r,a,h)}Object(n["n"])(i,t._pointLabels[o],a,h+r.lineHeight/2,r,{color:e.color,textAlign:l,textBaseline:"middle"})}}function Nn(t,e,i,s){const{ctx:o}=t;if(i)o.arc(t.xCenter,t.yCenter,e,0,n["u"]);else{let i=t.getPointPosition(0,e);o.moveTo(i.x,i.y);for(let n=1;n{const i=Object(n["d"])(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?Rn(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){const e=n["u"]/(this._pointLabels.length||1),i=this.options.startAngle||0;return Object(n["Bb"])(t*e+Object(n["Ub"])(i))}getDistanceFromCenterForValue(t){if(Object(n["Lb"])(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(Object(n["Lb"])(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{if(0!==e){r=this.getDistanceFromCenterForValue(t.value);const i=n.setContext(this.getContext(e-1));Hn(this,i,r,s)}}),i.display){for(t.save(),o=s-1;o>=0;o--){const n=i.setContext(this.getPointLabelContext(o)),{color:s,lineWidth:h}=n;h&&s&&(t.lineWidth=h,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,a)=>{if(0===a&&!e.reverse)return;const h=i.setContext(this.getContext(a)),l=Object(n["p"])(h.font);if(o=this.getDistanceFromCenterForValue(this.ticks[a].value),h.showLabelBackdrop){t.font=l.string,r=t.measureText(s.label).width,t.fillStyle=h.backdropColor;const e=Object(n["l"])(h.backdropPadding);t.fillRect(-r/2-e.left,-o-l.size/2-e.top,r+e.width,l.size+e.height)}Object(n["n"])(t,s.label,0,-o,l,{color:h.color})}),t.restore()}drawTitle(){}}Yn.id="radialLinear",Yn.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:at.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}},Yn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Yn.descriptors={angleLines:{_fallback:"grid"}};const Un={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}},Xn=Object.keys(Un);function qn(t,e){return t-e}function Jn(t,e){if(Object(n["Lb"])(e))return null;const i=t._adapter,{parser:s,round:o,isoWeekday:r}=t._parseOpts;let a=e;return"function"===typeof s&&(a=s(a)),Object(n["Hb"])(a)||(a="string"===typeof s?i.parse(a,s):i.parse(a)),null===a?null:(o&&(a="week"!==o||!Object(n["Yb"])(r)&&!0!==r?i.startOf(a,o):i.startOf(a,"isoWeek",r)),+a)}function Kn(t,e,i,n){const s=Xn.length;for(let o=Xn.indexOf(t);o=Xn.indexOf(i);o--){const i=Xn[o];if(Un[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Xn[i?Xn.indexOf(i):0]}function Zn(t){for(let e=Xn.indexOf(t)+1,i=Xn.length;e=e?i[s]:i[o];t[r]=!0}}else t[e]=!0}function ts(t,e,i,n){const s=t._adapter,o=+s.startOf(e[0].value,n),r=e[e.length-1].value;let a,h;for(a=o;a<=r;a=+s.add(a,1,n))h=i[a],h>=0&&(e[h].major=!0);return e}function es(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r+t.value))}initOffsets(t){let e,i,s=0,o=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),o=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;s=Object(n["f"])(s,0,r),o=Object(n["f"])(o,0,r),this._offsets={start:s,end:o,factor:1/(s+1+o)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||Kn(o.minUnit,e,i,this._getLabelCapacity(e)),a=Object(n["Wb"])(o.stepSize,1),h="week"===r&&o.isoWeekday,l=Object(n["Yb"])(h)||!0===h,c={};let d,u,f=e;if(l&&(f=+t.startOf(f,"isoWeek",h)),f=+t.startOf(f,l?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const b="data"===s.ticks.source&&this.getDataTimestamps();for(d=f,u=0;dt-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const o=this.options,r=o.time.displayFormats,a=this._unit,h=this._majorUnit,l=a&&r[a],c=h&&r[h],d=i[e],u=h&&c&&d&&d.major,f=this._adapter.format(t,s||(u?c:l)),b=o.ticks.callback;return b?Object(n["d"])(b,[f,e,i],this):f}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[h].pos&&e<=t[l].pos&&({lo:h,hi:l}=Object(n["A"])(t,"pos",e)),({pos:s,time:r}=t[h]),({pos:o,time:a}=t[l])):(e>=t[h].time&&e<=t[l].time&&({lo:h,hi:l}=Object(n["A"])(t,"time",e)),({time:s,pos:r}=t[h]),({time:o,pos:a}=t[l]));const c=o-s;return c?r+(a-r)*(e-s)/c:r}is.id="time",is.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class ss extends is{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=ns(e,this.min),this._tableRange=ns(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,h,l;for(o=0,r=t.length;o=e&&h<=i&&n.push(h);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;o("number"===typeof t||t instanceof Number)&&isFinite(+t);function l(t,e){return h(t)?t:e}function c(t,e){return"undefined"===typeof t?e:t}const d=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,u=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function f(t,e,i){if(t&&"function"===typeof t.call)return t.apply(i,e)}function b(t,e,i,n){let s,o,h;if(r(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function w(t,e){const i=O[e]||(O[e]=j(e));return i(t)}function j(t){const e=M(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}function M(t){const e=t.split("."),i=[];let n="";for(const s of e)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}function k(t){return t.charAt(0).toUpperCase()+t.slice(1)}const S=t=>"undefined"!==typeof t,P=t=>"function"===typeof t,C=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function D(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const A=Math.PI,L=2*A,E=L+A,T=Number.POSITIVE_INFINITY,R=A/180,I=A/2,z=A/4,F=2*A/3,W=Math.log10,B=Math.sign;function V(t){const e=Math.round(t);t=$(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(W(t))),n=t/i,s=n<=1?1:n<=2?2:n<=5?5:10;return s*i}function N(t){const e=[],i=Math.sqrt(t);let n;for(n=1;nt-e).pop(),e}function H(t){return!isNaN(parseFloat(t))&&isFinite(t)}function $(t,e,i){return Math.abs(t-e)=t}function U(t,e,i){let n,s,o;for(n=0,s=t.length;nh&&l=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function st(t,e,i){i=i||(i=>t[i]1)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const ot=(t,e,i,n)=>st(t,i,n?n=>t[n][e]<=i:n=>t[n][e]st(t,i,n=>t[n][e]>=i);function at(t,e,i){let n=0,s=t.length;while(nn&&t[s-1]>i)s--;return n>0||s{const i="_onData"+k(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const s=n.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"===typeof t[i]&&t[i](...e)}),s}})}))}function ct(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ht.forEach(e=>{delete t[e]}),delete t._chartjs)}function dt(t){const e=new Set;let i,n;for(i=0,n=t.length;iArray.prototype.slice.call(t));let s=!1,o=[];return function(...i){o=n(i),s||(s=!0,ut.call(window,()=>{s=!1,t.apply(e,o)}))}}function bt(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}const gt=t=>"start"===t?"left":"end"===t?"right":"center",pt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,mt=(t,e,i,n)=>{const s=n?"left":"right";return t===s?i:"center"===t?(e+i)/2:e};function xt(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,_parsed:a}=t,h=r.axis,{min:l,max:c,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(s=et(Math.min(ot(a,r.axis,l).lo,i?n:ot(e,h,r.getPixelForValue(l)).lo),0,n-1)),o=u?et(Math.max(ot(a,r.axis,c,!0).hi+1,i?0:ot(e,h,r.getPixelForValue(c),!0).hi+1),s,n)-s:n-s}return{start:s,count:o}}function _t(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const yt=t=>0===t||1===t,vt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*L/i),Ot=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*L/i)+1,wt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*I),easeOutSine:t=>Math.sin(t*I),easeInOutSine:t=>-.5*(Math.cos(A*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>yt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>yt(t)?t:vt(t,.075,.3),easeOutElastic:t=>yt(t)?t:Ot(t,.075,.3),easeInOutElastic(t){const e=.1125,i=.45;return yt(t)?t:t<.5?.5*vt(2*t,e,i):.5+.5*Ot(2*t-1,e,i)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-wt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*wt.easeInBounce(2*t):.5*wt.easeOutBounce(2*t-1)+.5}; /*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * Released under the MIT License */ function jt(t){return t+.5|0}const Mt=(t,e,i)=>Math.max(Math.min(t,i),e);function kt(t){return Mt(jt(2.55*t),0,255)}function St(t){return Mt(jt(255*t),0,255)}function Pt(t){return Mt(jt(t/2.55)/100,0,1)}function Ct(t){return Mt(jt(100*t),0,100)}const Dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},At=[..."0123456789ABCDEF"],Lt=t=>At[15&t],Et=t=>At[(240&t)>>4]+At[15&t],Tt=t=>(240&t)>>4===(15&t),Rt=t=>Tt(t.r)&&Tt(t.g)&&Tt(t.b)&&Tt(t.a);function It(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*Dt[t[1]],g:255&17*Dt[t[2]],b:255&17*Dt[t[3]],a:5===i?17*Dt[t[4]]:255}:7!==i&&9!==i||(e={r:Dt[t[1]]<<4|Dt[t[2]],g:Dt[t[3]]<<4|Dt[t[4]],b:Dt[t[5]]<<4|Dt[t[6]],a:9===i?Dt[t[7]]<<4|Dt[t[8]]:255})),e}const zt=(t,e)=>t<255?e(t):"";function Ft(t){var e=Rt(t)?Lt:Et;return t?"#"+e(t.r)+e(t.g)+e(t.b)+zt(t.a,e):void 0}const Wt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Bt(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function Vt(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function Nt(t,e,i){const n=Bt(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function Ht(t,e,i,n,s){return t===s?(e-i)/n+(e.5?c/(2-o-r):c/(o+r),h=Ht(i,n,s,c,o),h=60*h+.5),[0|h,l||0,a]}function Yt(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(St)}function Ut(t,e,i){return Yt(Bt,t,e,i)}function Xt(t,e,i){return Yt(Nt,t,e,i)}function qt(t,e,i){return Yt(Vt,t,e,i)}function Jt(t){return(t%360+360)%360}function Kt(t){const e=Wt.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?kt(+e[5]):St(+e[5]));const s=Jt(+e[2]),o=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?Xt(s,o,r):"hsv"===e[1]?qt(s,o,r):Ut(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function Gt(t,e){var i=$t(t);i[0]=Jt(i[0]+e),i=Ut(i),t.r=i[0],t.g=i[1],t.b=i[2]}function Zt(t){if(!t)return;const e=$t(t),i=e[0],n=Ct(e[1]),s=Ct(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${Pt(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}const Qt={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},te={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function ee(){const t={},e=Object.keys(te),i=Object.keys(Qt);let n,s,o,r,a;for(n=0;n>16&255,o>>8&255,255&o]}return t}let ie;function ne(t){ie||(ie=ee(),ie.transparent=[0,0,0,0]);const e=ie[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const se=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function oe(t){const e=se.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?kt(t):Mt(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?kt(i):Mt(i,0,255)),n=255&(e[4]?kt(n):Mt(n,0,255)),s=255&(e[6]?kt(s):Mt(s,0,255)),{r:i,g:n,b:s,a:o}}}function re(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Pt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const ae=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,he=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function le(t,e,i){const n=he(Pt(t.r)),s=he(Pt(t.g)),o=he(Pt(t.b));return{r:St(ae(n+i*(he(Pt(e.r))-n))),g:St(ae(s+i*(he(Pt(e.g))-s))),b:St(ae(o+i*(he(Pt(e.b))-o))),a:t.a+i*(e.a-t.a)}}function ce(t,e,i){if(t){let n=$t(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=Ut(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function de(t,e){return t?Object.assign(e||{},t):t}function ue(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=St(t[3]))):(e=de(t,{r:0,g:0,b:0,a:1}),e.a=St(e.a)),e}function fe(t){return"r"===t.charAt(0)?oe(t):Kt(t)}class be{constructor(t){if(t instanceof be)return t;const e=typeof t;let i;"object"===e?i=ue(t):"string"===e&&(i=It(t)||ne(t)||fe(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=de(this._rgb);return t&&(t.a=Pt(t.a)),t}set rgb(t){this._rgb=ue(t)}rgbString(){return this._valid?re(this._rgb):void 0}hexString(){return this._valid?Ft(this._rgb):void 0}hslString(){return this._valid?Zt(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,h=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-h,i.r=255&h*i.r+s*n.r+.5,i.g=255&h*i.g+s*n.g+.5,i.b=255&h*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=le(this._rgb,t._rgb,e)),this}clone(){return new be(this.rgb)}alpha(t){return this._rgb.a=St(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=jt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ce(this._rgb,2,t),this}darken(t){return ce(this._rgb,2,-t),this}saturate(t){return ce(this._rgb,1,t),this}desaturate(t){return ce(this._rgb,1,-t),this}rotate(t){return Gt(this._rgb,t),this}}function ge(t){return new be(t)}function pe(t){if(t&&"object"===typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function me(t){return pe(t)?t:ge(t)}function xe(t){return pe(t)?t:ge(t).saturate(.5).darken(.1).hexString()}const _e=Object.create(null),ye=Object.create(null);function ve(t,e){if(!e)return t;const i=e.split(".");for(let n=0,s=i.length;nt.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>xe(e.backgroundColor),this.hoverBorderColor=(t,e)=>xe(e.borderColor),this.hoverColor=(t,e)=>xe(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return Oe(this,t,e)}get(t){return ve(this,t)}describe(t,e){return Oe(ye,t,e)}override(t,e){return Oe(_e,t,e)}route(t,e,i,n){const s=ve(this,t),o=ve(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return a(t)?Object.assign({},e,t):c(t,e)},set(t){this[r]=t}}})}}var je=new we({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Me(t){return!t||o(t.size)||o(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function ke(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Se(t,e,i,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let a=0;const h=i.length;let l,c,d,u,f;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Le(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==a.strokeColor;let c,d;for(t.save(),t.font=s.string,Fe(t,a),c=0;c+t||0;function Ye(t,e){const i={},n=a(e),s=n?Object.keys(e):e,o=a(t)?n?i=>c(t[i],t[e[i]]):e=>t[e]:()=>t;for(const r of s)i[r]=$e(o(r));return i}function Ue(t){return Ye(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Xe(t){return Ye(t,["topLeft","topRight","bottomLeft","bottomRight"])}function qe(t){const e=Ue(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Je(t,e){t=t||{},e=e||je.font;let i=c(t.size,e.size);"string"===typeof i&&(i=parseInt(i,10));let n=c(t.style,e.style);n&&!(""+n).match(Ne)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:c(t.family,e.family),lineHeight:He(c(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:c(t.weight,e.weight),string:""};return s.string=Me(s),s}function Ke(t,e,i,n){let s,o,a,h=!0;for(s=0,o=t.length;si&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function Ze(t,e){return Object.assign(Object.create(t),e)}function Qe(t,e=[""],i=t,n,s=(()=>t[0])){S(n)||(n=gi("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:s,override:s=>Qe([s,...t],e,i,n)};return new Proxy(o,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,n){return si(i,n,()=>bi(n,e,t,i))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return pi(t).includes(e)},ownKeys(t){return pi(t)},set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function ti(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ei(t,n),setContext:e=>ti(t,e,i,n),override:s=>ti(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return si(t,e,()=>oi(t,e,i))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,n){return t[i]=n,delete e[i],!0}})}function ei(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:P(i)?i:()=>i,isIndexable:P(n)?n:()=>n}}const ii=(t,e)=>t?t+k(e):e,ni=(t,e)=>a(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function si(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function oi(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=t;let h=n[e];return P(h)&&a.isScriptable(e)&&(h=ri(e,h,t,i)),r(h)&&h.length&&(h=ai(e,h,t,a.isIndexable)),ni(e,h)&&(h=ti(h,s,o&&o[e],a)),h}function ri(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(o,r||n),a.delete(t),ni(t,e)&&(e=di(s._scopes,s,t,e)),e}function ai(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:h}=i;if(S(o.index)&&n(t))e=e[o.index%e.length];else if(a(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const a of i){const i=di(n,s,t,a);e.push(ti(i,o,r&&r[t],h))}}return e}function hi(t,e,i){return P(t)?t(e,i):t}const li=(t,e)=>!0===t?e:"string"===typeof t?w(e,t):void 0;function ci(t,e,i,n,s){for(const o of e){const e=li(i,o);if(e){t.add(e);const o=hi(e._fallback,i,s);if(S(o)&&o!==i&&o!==n)return o}else if(!1===e&&S(n)&&i!==n)return null}return!1}function di(t,e,i,n){const s=e._rootScopes,o=hi(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let h=ui(a,r,i,o||i,n);return null!==h&&((!S(o)||o===i||(h=ui(a,r,o,h,n),null!==h))&&Qe(Array.from(a),[""],s,o,()=>fi(e,i,n)))}function ui(t,e,i,n,s){while(i)i=ci(t,e,i,n,s);return i}function fi(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return r(s)&&a(i)?i:s}function bi(t,e,i,n){let s;for(const o of e)if(s=gi(ii(o,t),i),S(s))return ni(t,s)?di(i,n,t,s):s}function gi(t,e){for(const i of e){if(!i)continue;const e=i[t];if(S(e))return e}}function pi(t){let e=t._keys;return e||(e=t._keys=mi(t._scopes)),e}function mi(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}function xi(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,h,l,c;for(a=0,h=n;ae"x"===t?"y":"x";function Oi(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=G(o,s),h=G(r,o);let l=a/(a+h),c=h/(a+h);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const d=n*l,u=n*c;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function wi(t,e,i){const n=t.length;let s,o,r,a,h,l=yi(t,0);for(let c=0;c!t.skip)),"monotone"===e.cubicInterpolationMode)Mi(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;owindow.getComputedStyle(t,null);function Ei(t,e){return Li(t).getPropertyValue(e)}const Ti=["top","right","bottom","left"];function Ri(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Ti[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Ii=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function zi(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,h=!1;if(Ii(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,h=!0}return{x:r,y:a,box:h}}function Fi(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=Li(i),o="border-box"===s.boxSizing,r=Ri(s,"padding"),a=Ri(s,"border","width"),{x:h,y:l,box:c}=zi(t,i),d=r.left+(c&&a.left),u=r.top+(c&&a.top);let{width:f,height:b}=e;return o&&(f-=r.width+a.width,b-=r.height+a.height),{x:Math.round((h-d)/f*i.width/n),y:Math.round((l-u)/b*i.height/n)}}function Wi(t,e,i){let n,s;if(void 0===e||void 0===i){const o=Di(t);if(o){const t=o.getBoundingClientRect(),r=Li(o),a=Ri(r,"border","width"),h=Ri(r,"padding");e=t.width-h.width-a.width,i=t.height-h.height-a.height,n=Ai(r.maxWidth,o,"clientWidth"),s=Ai(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||T,maxHeight:s||T}}const Bi=t=>Math.round(10*t)/10;function Vi(t,e,i,n){const s=Li(t),o=Ri(s,"margin"),r=Ai(s.maxWidth,t,"clientWidth")||T,a=Ai(s.maxHeight,t,"clientHeight")||T,h=Wi(t,e,i);let{width:l,height:c}=h;if("content-box"===s.boxSizing){const t=Ri(s,"border","width"),e=Ri(s,"padding");l-=e.width+t.width,c-=e.height+t.height}return l=Math.max(0,l-o.width),c=Math.max(0,n?Math.floor(l/n):c-o.height),l=Bi(Math.min(l,r,h.maxWidth)),c=Bi(Math.min(c,a,h.maxHeight)),l&&!c&&(c=Bi(l/2)),{width:l,height:c}}function Ni(t,e,i){const n=e||1,s=Math.floor(t.height*n),o=Math.floor(t.width*n);t.height=s/n,t.width=o/n;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Hi=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function $i(t,e){const i=Ei(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Yi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ui(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Xi(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=Yi(t,s,i),a=Yi(s,o,i),h=Yi(o,e,i),l=Yi(r,a,i),c=Yi(a,h,i);return Yi(l,c,i)}const qi=new Map;function Ji(t,e){e=e||{};const i=t+JSON.stringify(e);let n=qi.get(i);return n||(n=new Intl.NumberFormat(t,e),qi.set(i,n)),n}function Ki(t,e,i){return Ji(e,i).format(t)}const Gi=function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}},Zi=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Qi(t,e,i){return t?Gi(e,i):Zi()}function tn(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function en(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function nn(t){return"angle"===t?{between:tt,compare:Z,normalize:Q}:{between:nt,compare:(t,e)=>t-e,normalize:t=>t}}function sn({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i===0,style:s}}function on(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=nn(n),h=e.length;let l,c,{start:d,end:u,loop:f}=t;if(f){for(d+=h,u+=h,l=0,c=h;lh(s,m,g)&&0!==a(s,m),v=()=>0===a(o,g)||h(o,m,g),O=()=>x||y(),w=()=>!x||v();for(let j=c,M=c;j<=d;++j)p=e[j%r],p.skip||(g=l(p[n]),g!==m&&(x=h(g,s,o),null===_&&O()&&(_=0===a(g,s)?j:M),null!==_&&w()&&(b.push(sn({start:_,end:j,loop:u,count:r,style:f})),_=null),M=j,m=g));return null!==_&&b.push(sn({start:_,end:d,loop:u,count:r,style:f})),b}function an(t,e){const i=[],n=t.segments;for(let s=0;ss&&t[o%e].skip)o--;return o%=e,{start:s,end:o}}function ln(t,e,i,n){const s=t.length,o=[];let r,a=e,h=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?h.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,h.skip&&(e=r)),h=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}function cn(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=hn(i,s,o,n);if(!0===n)return dn(t,[{start:r,end:a,loop:o}],i,e);const h=a