"use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[858],{4858:(bp,ir,hn)=>{hn.d(ir,{j:()=>pp,u:()=>mp});var O=hn(4438);const we=function or(i,e){return i===e||i!=i&&e!=e},Me=function rr(i,e){for(var t=i.length;t--;)if(we(i[t][0],e))return t;return-1};var lr=Array.prototype.splice;function Rt(i){var e=-1,t=null==i?0:i.length;for(this.clear();++e-1},Rt.prototype.set=function pr(i,e){var t=this.__data__,n=Me(t,i);return n<0?(++this.size,t.push([i,e])):t[n][1]=e,this};const Se=Rt,dn="object"==typeof global&&global&&global.Object===Object&&global;var Pr="object"==typeof self&&self&&self.Object===Object&&self;const It=dn||Pr||Function("return this")();var Or=It.Symbol,un=Object.prototype,Ar=un.hasOwnProperty,Tr=un.toString,Xt=Or?Or.toStringTag:void 0;var Rr=Object.prototype.toString;var fn=Or?Or.toStringTag:void 0;const Pe=function jr(i){return null==i?void 0===i?"[object Undefined]":"[object Null]":fn&&fn in Object(i)?function Dr(i){var e=Ar.call(i,Xt),t=i[Xt];try{i[Xt]=void 0;var n=!0}catch{}var s=Tr.call(i);return n&&(e?i[Xt]=t:delete i[Xt]),s}(i):function Ir(i){return Rr.call(i)}(i)},Mt=function Nr(i){var e=typeof i;return null!=i&&("object"==e||"function"==e)},li=function Yr(i){if(!Mt(i))return!1;var e=Pe(i);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};var i,Ur=It["__core-js_shared__"],gn=(i=/[^.]+$/.exec(Ur&&Ur.keys&&Ur.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";var qr=Function.prototype.toString;var ta=/^\[object .+?Constructor\]$/,oa=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const aa=function ra(i){return!(!Mt(i)||function Xr(i){return!!gn&&gn in i}(i))&&(li(i)?oa:ta).test(function Zr(i){if(null!=i){try{return qr.call(i)}catch{}try{return i+""}catch{}}return""}(i))},hi=function ha(i,e){var t=function la(i,e){return i?.[e]}(i,e);return aa(t)?t:void 0},pn=hi(It,"Map"),Gt=hi(Object,"create");var xa=Object.prototype.hasOwnProperty;var Ma=Object.prototype.hasOwnProperty;function Ft(i){var e=-1,t=null==i?0:i.length;for(this.clear();++e-1&&i%1==0&&i<=9007199254740991},pi=function Pl(i){return null!=i&&Cn(i.length)&&!li(i)};var On="object"==typeof exports&&exports&&!exports.nodeType&&exports,An=On&&"object"==typeof module&&module&&!module.nodeType&&module,Tn=An&&An.exports===On?It.Buffer:void 0;const Dn=(Tn?Tn.isBuffer:void 0)||function Al(){return!1};var Ln=Function.prototype.toString,zl=Object.prototype.hasOwnProperty,Bl=Ln.call(Object);var j={};j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j["[object Arguments]"]=j["[object Array]"]=j["[object ArrayBuffer]"]=j["[object Boolean]"]=j["[object DataView]"]=j["[object Date]"]=j["[object Error]"]=j["[object Function]"]=j["[object Map]"]=j["[object Number]"]=j["[object Object]"]=j["[object RegExp]"]=j["[object Set]"]=j["[object String]"]=j["[object WeakMap]"]=!1;var En="object"==typeof exports&&exports&&!exports.nodeType&&exports,qt=En&&"object"==typeof module&&module&&!module.nodeType&&module,mi=qt&&qt.exports===En&&dn.process,mc=function(){try{return qt&&qt.require&&qt.require("util").types||mi&&mi.binding&&mi.binding("util")}catch{}}(),In=mc&&mc.isTypedArray;const Fn=In?function fc(i){return function(e){return i(e)}}(In):function dc(i){return Kt(i)&&Cn(i.length)&&!!j[Pe(i)]},bi=function _c(i,e){if(("constructor"!==e||"function"!=typeof i[e])&&"__proto__"!=e)return i[e]};var yc=Object.prototype.hasOwnProperty;const wc=function vc(i,e,t){var n=i[e];(!yc.call(i,e)||!we(n,t)||void 0===t&&!(e in i))&&di(i,e,t)};var Oc=/^(?:0|[1-9]\d*)$/;const zn=function Ac(i,e){var t=typeof i;return!!(e=e??9007199254740991)&&("number"==t||"symbol"!=t&&Oc.test(i))&&i>-1&&i%1==0&&i0){if(++e>=800)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}(Qc);const rh=oh,lh=function ah(i,e){return rh(function Kc(i,e,t){return e=Vn(void 0===e?i.length-1:e,0),function(){for(var n=arguments,s=-1,o=Vn(n.length-e,0),r=Array(o);++s1?t[s-1]:void 0,r=s>2?t[2]:void 0;for(o=i.length>3&&"function"==typeof o?(s--,o):void 0,r&&function ch(i,e,t){if(!Mt(t))return!1;var n=typeof e;return!!("number"==n?pi(t)&&zn(e,t.length):"string"==n&&e in t)&&we(t[e],i)}(t[0],t[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n"u"}function z(i){if(Array.isArray&&Array.isArray(i))return!0;const e=Object.prototype.toString.call(i);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function A(i){return null!==i&&"[object Object]"===Object.prototype.toString.call(i)}const H=i=>("number"==typeof i||i instanceof Number)&&isFinite(+i);function tt(i,e){return H(i)?i:e}function C(i,e){return typeof i>"u"?e:i}const Hn=(i,e)=>"string"==typeof i&&i.endsWith("%")?parseFloat(i)/100*e:+i;function B(i,e,t){if(i&&"function"==typeof i.call)return i.apply(t,e)}function I(i,e,t,n){let s,o,r;if(z(i))if(o=i.length,n)for(s=o-1;s>=0;s--)e.call(t,i[s],s);else for(s=0;si,x:i=>i.x,y:i=>i.y};function mt(i,e){return($n[e]||($n[e]=function _h(i){const e=function xh(i){const e=i.split("."),t=[];let n="";for(const s of e)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(t.push(n),n="");return t}(i);return t=>{for(const n of e){if(""===n)break;t=t&&t[n]}return t}}(e)))(i)}function _i(i){return i.charAt(0).toUpperCase()+i.slice(1)}const et=i=>typeof i<"u",bt=i=>"function"==typeof i,Yn=(i,e)=>{if(i.size!==e.size)return!1;for(const t of i)if(!e.has(t))return!1;return!0},N=Math.PI,F=2*N,vh=F+N,De=Number.POSITIVE_INFINITY,wh=N/180,V=N/2,Qt=N/4,Un=2*N/3,it=Math.log10,rt=Math.sign;function Xn(i){const e=Math.round(i);i=te(i,e,i/1e3)?e:i;const t=Math.pow(10,Math.floor(it(i))),n=i/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t}function jt(i){return!isNaN(parseFloat(i))&&isFinite(i)}function te(i,e,t){return Math.abs(i-e)l&&c=Math.min(e,t)-n&&i<=Math.max(e,t)+n}function vi(i,e,t){t=t||(r=>i[r]1;)o=s+n>>1,t(o)?s=o:n=o;return{lo:s,hi:n}}const ut=(i,e,t,n)=>vi(i,t,n?s=>i[s][e]<=t:s=>i[s][e]vi(i,t,n=>i[n][e]>=t),Zn=["push","pop","shift","splice","unshift"];function Jn(i,e){const t=i._chartjs;if(!t)return;const n=t.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),!(n.length>0)&&(Zn.forEach(o=>{delete i[o]}),delete i._chartjs)}function Qn(i){const e=new Set;let t,n;for(t=0,n=i.length;t"u"?function(i){return i()}:window.requestAnimationFrame;function es(i,e,t){const n=t||(r=>Array.prototype.slice.call(r));let s=!1,o=[];return function(...r){o=n(r),s||(s=!0,ts.call(window,()=>{s=!1,i.apply(e,o)}))}}const wi=i=>"start"===i?"left":"end"===i?"right":"center",G=(i,e,t)=>"start"===i?e:"end"===i?t:(e+t)/2;function is(i,e,t){const n=e.length;let s=0,o=n;if(i._sorted){const{iScale:r,_parsed:a}=i,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(s=X(Math.min(ut(a,r.axis,c).lo,t?n:ut(e,l,r.getPixelForValue(c)).lo),0,n-1)),o=u?X(Math.max(ut(a,r.axis,h,!0).hi+1,t?0:ut(e,l,r.getPixelForValue(h),!0).hi+1),s,n)-s:n-s}return{start:s,count:o}}function ns(i){const{xScale:e,yScale:t,_scaleRanges:n}=i,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==t.min||n.ymax!==t.max;return Object.assign(n,s),o}const Le=i=>0===i||1===i,ss=(i,e,t)=>-Math.pow(2,10*(i-=1))*Math.sin((i-e)*F/t),os=(i,e,t)=>Math.pow(2,-10*i)*Math.sin((i-e)*F/t)+1,ie={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>1-Math.cos(i*V),easeOutSine:i=>Math.sin(i*V),easeInOutSine:i=>-.5*(Math.cos(N*i)-1),easeInExpo:i=>0===i?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>1===i?1:1-Math.pow(2,-10*i),easeInOutExpo:i=>Le(i)?i:i<.5?.5*Math.pow(2,10*(2*i-1)):.5*(2-Math.pow(2,-10*(2*i-1))),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Le(i)?i:ss(i,.075,.3),easeOutElastic:i=>Le(i)?i:os(i,.075,.3),easeInOutElastic:i=>Le(i)?i:i<.5?.5*ss(2*i,.1125,.45):.5+.5*os(2*i-1,.1125,.45),easeInBack:i=>i*i*(2.70158*i-1.70158),easeOutBack:i=>(i-=1)*i*(2.70158*i+1.70158)+1,easeInOutBack(i){let e=1.70158;return(i/=.5)<1?i*i*((1+(e*=1.525))*i-e)*.5:.5*((i-=2)*i*((1+(e*=1.525))*i+e)+2)},easeInBounce:i=>1-ie.easeOutBounce(1-i),easeOutBounce:i=>i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375,easeInOutBounce:i=>i<.5?.5*ie.easeInBounce(2*i):.5*ie.easeOutBounce(2*i-1)+.5};function ne(i){return i+.5|0}const _t=(i,e,t)=>Math.max(Math.min(i,t),e);function se(i){return _t(ne(2.55*i),0,255)}function xt(i){return _t(ne(255*i),0,255)}function ft(i){return _t(ne(i/2.55)/100,0,1)}function rs(i){return _t(ne(100*i),0,100)}const nt={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},Mi=[..."0123456789ABCDEF"],Lh=i=>Mi[15&i],Eh=i=>Mi[(240&i)>>4]+Mi[15&i],Ee=i=>(240&i)>>4==(15&i);const Bh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function as(i,e,t){const n=e*Math.min(t,1-t),s=(o,r=(o+i/30)%12)=>t-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function jh(i,e,t){const n=(s,o=(s+i/60)%6)=>t-t*e*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Nh(i,e,t){const n=as(i,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)n[s]*=1-e-t,n[s]+=e;return n}function Si(i){const t=i.r/255,n=i.g/255,s=i.b/255,o=Math.max(t,n,s),r=Math.min(t,n,s),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=function Vh(i,e,t,n,s){return i===s?(e-t)/n+(ei<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055,Nt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Ie(i,e,t){if(i){let n=Si(i);n[e]=Math.max(0,Math.min(n[e]+n[e]*t,0===e?360:1)),n=Pi(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function ds(i,e){return i&&Object.assign(e||{},i)}function us(i){var e={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(e={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(e.a=xt(i[3]))):(e=ds(i,{r:0,g:0,b:0,a:1})).a=xt(e.a),e}function Qh(i){return"r"===i.charAt(0)?function qh(i){const e=Kh.exec(i);let n,s,o,t=255;if(e){if(e[7]!==n){const r=+e[7];t=e[8]?se(r):_t(255*r,0,255)}return n=+e[1],s=+e[3],o=+e[5],n=255&(e[2]?se(n):_t(n,0,255)),s=255&(e[4]?se(s):_t(s,0,255)),o=255&(e[6]?se(o):_t(o,0,255)),{r:n,g:s,b:o,a:t}}}(i):function $h(i){const e=Bh.exec(i);let n,t=255;if(!e)return;e[5]!==n&&(t=e[6]?se(+e[5]):xt(+e[5]));const s=ls(+e[2]),o=+e[3]/100,r=+e[4]/100;return n="hwb"===e[1]?function Hh(i,e,t){return ki(Nh,i,e,t)}(s,o,r):"hsv"===e[1]?function Wh(i,e,t){return ki(jh,i,e,t)}(s,o,r):Pi(s,o,r),{r:n[0],g:n[1],b:n[2],a:t}}(i)}class Fe{constructor(e){if(e instanceof Fe)return e;const t=typeof e;let n;"object"===t?n=us(e):"string"===t&&(n=function Ih(i){var t,e=i.length;return"#"===i[0]&&(4===e||5===e?t={r:255&17*nt[i[1]],g:255&17*nt[i[2]],b:255&17*nt[i[3]],a:5===e?17*nt[i[4]]:255}:(7===e||9===e)&&(t={r:nt[i[1]]<<4|nt[i[2]],g:nt[i[3]]<<4|nt[i[4]],b:nt[i[5]]<<4|nt[i[6]],a:9===e?nt[i[7]]<<4|nt[i[8]]:255})),t}(e)||function Gh(i){Re||(Re=function Xh(){const i={},e=Object.keys(hs),t=Object.keys(cs);let n,s,o,r,a;for(n=0;n>16&255,o>>8&255,255&o]}return i}(),Re.transparent=[0,0,0,0]);const e=Re[i.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(e)||Qh(e)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var e=ds(this._rgb);return e&&(e.a=ft(e.a)),e}set rgb(e){this._rgb=us(e)}rgbString(){return this._valid?function Zh(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ft(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}(this._rgb):void 0}hexString(){return this._valid?function zh(i){var e=(i=>Ee(i.r)&&Ee(i.g)&&Ee(i.b)&&Ee(i.a))(i)?Lh:Eh;return i?"#"+e(i.r)+e(i.g)+e(i.b)+((i,e)=>i<255?e(i):"")(i.a,e):void 0}(this._rgb):void 0}hslString(){return this._valid?function Uh(i){if(!i)return;const e=Si(i),t=e[0],n=rs(e[1]),s=rs(e[2]);return i.a<255?`hsla(${t}, ${n}%, ${s}%, ${ft(i.a)})`:`hsl(${t}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(e,t){if(e){const n=this.rgb,s=e.rgb;let o;const r=t===o?.5:t,a=2*r-1,l=n.a-s.a,c=((a*l==-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=function Jh(i,e,t){const n=Nt(ft(i.r)),s=Nt(ft(i.g)),o=Nt(ft(i.b));return{r:xt(Ci(n+t*(Nt(ft(e.r))-n))),g:xt(Ci(s+t*(Nt(ft(e.g))-s))),b:xt(Ci(o+t*(Nt(ft(e.b))-o))),a:i.a+t*(e.a-i.a)}}(this._rgb,e._rgb,t)),this}clone(){return new Fe(this.rgb)}alpha(e){return this._rgb.a=xt(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,t=ne(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ie(this._rgb,2,e),this}darken(e){return Ie(this._rgb,2,-e),this}saturate(e){return Ie(this._rgb,1,e),this}desaturate(e){return Ie(this._rgb,1,-e),this}rotate(e){return function Yh(i,e){var t=Si(i);t[0]=ls(t[0]+e),t=Pi(t),i.r=t[0],i.g=t[1],i.b=t[2]}(this._rgb,e),this}}function fs(i){return new Fe(i)}function gs(i){if(i&&"object"==typeof i){const e=i.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function ps(i){return gs(i)?i:fs(i)}function Oi(i){return gs(i)?i:fs(i).saturate(.5).darken(.1).hexString()}const St=Object.create(null),Ai=Object.create(null);function oe(i,e){if(!e)return i;const t=e.split(".");for(let n=0,s=t.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,n)=>Oi(n.backgroundColor),this.hoverBorderColor=(t,n)=>Oi(n.borderColor),this.hoverColor=(t,n)=>Oi(n.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(e)}set(e,t){return Ti(this,e,t)}get(e){return oe(this,e)}describe(e,t){return Ti(Ai,e,t)}override(e,t){return Ti(St,e,t)}route(e,t,n,s){const o=oe(this,e),r=oe(this,n),a="_"+t;Object.defineProperties(o,{[a]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){const l=this[a],c=r[s];return A(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l}}})}}({_scriptable:i=>!i.startsWith("on"),_indexable:i=>"events"!==i,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function ze(i,e,t,n,s){let o=e[s];return o||(o=e[s]=i.measureText(s).width,t.push(s)),o>n&&(n=o),n}function id(i,e,t,n){let s=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),i.save(),i.font=e;let r=0;const a=t.length;let l,c,h,d,u;for(l=0;lt.length){for(l=0;l0&&i.stroke()}}function re(i,e,t){return t=t||.5,!e||i&&i.x>e.left-t&&i.xe.top-t&&i.y0&&""!==o.strokeColor;let l,c;for(i.save(),i.font=s.string,function od(i,e){e.translation&&i.translate(e.translation[0],e.translation[1]),E(e.rotation)||i.rotate(e.rotation),e.color&&(i.fillStyle=e.color),e.textAlign&&(i.textAlign=e.textAlign),e.textBaseline&&(i.textBaseline=e.textBaseline)}(i,o),l=0;l+i||0;function Li(i,e){const t={},n=A(e),s=n?Object.keys(e):e,o=A(i)?n?r=>C(i[r],i[e[r]]):r=>i[r]:()=>i;for(const r of s)t[r]=hd(o(r));return t}function _s(i){return Li(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Ct(i){return Li(i,["topLeft","topRight","bottomLeft","bottomRight"])}function K(i){const e=_s(i);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function U(i,e){let t=C((i=i||{}).size,(e=e||T.font).size);"string"==typeof t&&(t=parseInt(t,10));let n=C(i.style,e.style);n&&!(""+n).match(ld)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:C(i.family,e.family),lineHeight:cd(C(i.lineHeight,e.lineHeight),t),size:t,style:n,weight:C(i.weight,e.weight),string:""};return s.string=function ed(i){return!i||E(i.size)||E(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}(s),s}function le(i,e,t,n){let o,r,a,s=!0;for(o=0,r=i.length;oi[0])){et(n)||(n=Ms("_fallback",i));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:t,_fallback:n,_getTarget:s,override:r=>Ei([r,...i],e,t,n)};return new Proxy(o,{deleteProperty:(r,a)=>(delete r[a],delete r._keys,delete i[0][a],!0),get:(r,a)=>ys(r,a,()=>function xd(i,e,t,n){let s;for(const o of e)if(s=Ms(ud(o,i),t),et(s))return Ri(i,s)?Ii(t,n,i,s):s}(a,e,i,r)),getOwnPropertyDescriptor:(r,a)=>Reflect.getOwnPropertyDescriptor(r._scopes[0],a),getPrototypeOf:()=>Reflect.getPrototypeOf(i[0]),has:(r,a)=>Ss(r).includes(a),ownKeys:r=>Ss(r),set(r,a,l){const c=r._storage||(r._storage=s());return r[a]=c[a]=l,delete r._keys,!0}})}function Vt(i,e,t,n){const s={_cacheable:!1,_proxy:i,_context:e,_subProxy:t,_stack:new Set,_descriptors:xs(i,n),setContext:o=>Vt(i,o,t,n),override:o=>Vt(i.override(o),e,t,n)};return new Proxy(s,{deleteProperty:(o,r)=>(delete o[r],delete i[r],!0),get:(o,r,a)=>ys(o,r,()=>function fd(i,e,t){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=i;let a=n[e];return bt(a)&&r.isScriptable(e)&&(a=function gd(i,e,t,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=t;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);return a.add(i),e=e(o,r||n),a.delete(i),Ri(i,e)&&(e=Ii(s._scopes,s,i,e)),e}(e,a,i,t)),z(a)&&a.length&&(a=function pd(i,e,t,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=t;if(et(o.index)&&n(i))e=e[o.index%e.length];else if(A(e[0])){const l=e,c=s._scopes.filter(h=>h!==l);e=[];for(const h of l){const d=Ii(c,s,i,h);e.push(Vt(d,o,r&&r[i],a))}}return e}(e,a,i,r.isIndexable)),Ri(e,a)&&(a=Vt(a,s,o&&o[e],r)),a}(o,r,a)),getOwnPropertyDescriptor:(o,r)=>o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r),getPrototypeOf:()=>Reflect.getPrototypeOf(i),has:(o,r)=>Reflect.has(i,r),ownKeys:()=>Reflect.ownKeys(i),set:(o,r,a)=>(i[r]=a,delete o[r],!0)})}function xs(i,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=i;return{allKeys:s,scriptable:t,indexable:n,isScriptable:bt(t)?t:()=>t,isIndexable:bt(n)?n:()=>n}}const ud=(i,e)=>i?i+_i(e):e,Ri=(i,e)=>A(e)&&"adapters"!==i&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function ys(i,e,t){if(Object.prototype.hasOwnProperty.call(i,e))return i[e];const n=t();return i[e]=n,n}function vs(i,e,t){return bt(i)?i(e,t):i}const md=(i,e)=>!0===i?e:"string"==typeof i?mt(e,i):void 0;function bd(i,e,t,n,s){for(const o of e){const r=md(t,o);if(r){i.add(r);const a=vs(r._fallback,t,s);if(et(a)&&a!==t&&a!==n)return a}else if(!1===r&&et(n)&&t!==n)return null}return!1}function Ii(i,e,t,n){const s=e._rootScopes,o=vs(e._fallback,t,n),r=[...i,...s],a=new Set;a.add(n);let l=ws(a,r,t,o||t,n);return!(null===l||et(o)&&o!==t&&(l=ws(a,r,o,l,n),null===l))&&Ei(Array.from(a),[""],s,o,()=>function _d(i,e,t){const n=i._getTarget();e in n||(n[e]={});const s=n[e];return z(s)&&A(t)?t:s}(e,t,n))}function ws(i,e,t,n,s){for(;t;)t=bd(i,e,t,n,s);return t}function Ms(i,e){for(const t of e){if(!t)continue;const n=t[i];if(et(n))return n}}function Ss(i){let e=i._keys;return e||(e=i._keys=function yd(i){const e=new Set;for(const t of i)for(const n of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(n);return Array.from(e)}(i._scopes)),e}function ks(i,e,t,n){const{iScale:s}=i,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;ae"x"===i?"y":"x";function wd(i,e,t,n){const s=i.skip?e:i,o=e,r=t.skip?e:t,a=yi(o,s),l=yi(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;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 Ne(i,e,t){return Math.max(Math.min(i,t),e)}function Cd(i,e,t,n,s){let o,r,a,l;if(e.spanGaps&&(i=i.filter(c=>!c.skip)),"monotone"===e.cubicInterpolationMode)!function kd(i,e="x"){const t=Ps(e),n=i.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=Ht(i,0);for(r=0;rwindow.getComputedStyle(i,null),Ad=["top","right","bottom","left"];function Ot(i,e,t){const n={};t=t?"-"+t:"";for(let s=0;s<4;s++){const o=Ad[s];n[o]=parseFloat(i[e+"-"+o+t])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Td=(i,e,t)=>(i>0||e>0)&&(!t||!t.shadowRoot);function At(i,e){if("native"in i)return i;const{canvas:t,currentDevicePixelRatio:n}=e,s=He(t),o="border-box"===s.boxSizing,r=Ot(s,"padding"),a=Ot(s,"border","width"),{x:l,y:c,box:h}=function Dd(i,e){const t=i.touches,n=t&&t.length?t[0]:i,{offsetX:s,offsetY:o}=n;let a,l,r=!1;if(Td(s,o,i.target))a=s,l=o;else{const c=e.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}(i,t),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:g}=e;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*t.width/n),y:Math.round((c-u)/g*t.height/n)}}const zi=i=>Math.round(10*i)/10;function Os(i,e,t){const n=e||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=s/n,i.width=o/n;const r=i.canvas;return r.style&&(t||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),(i.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(i.currentDevicePixelRatio=n,r.height=s,r.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0)}const Rd=function(){let i=!1;try{const e={get passive(){return i=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return i}();function As(i,e){const t=function Od(i,e){return He(i).getPropertyValue(e)}(i,e),n=t&&t.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Tt(i,e,t,n){return{x:i.x+t*(e.x-i.x),y:i.y+t*(e.y-i.y)}}function Id(i,e,t,n){return{x:i.x+t*(e.x-i.x),y:"middle"===n?t<.5?i.y:e.y:"after"===n?t<1?i.y:e.y:t>0?e.y:i.y}}function Fd(i,e,t,n){const s={x:i.cp2x,y:i.cp2y},o={x:e.cp1x,y:e.cp1y},r=Tt(i,s,t),a=Tt(s,o,t),l=Tt(o,e,t),c=Tt(r,a,t),h=Tt(a,l,t);return Tt(c,h,t)}const Ts=new Map;function ce(i,e,t){return function zd(i,e){e=e||{};const t=i+JSON.stringify(e);let n=Ts.get(t);return n||(n=new Intl.NumberFormat(i,e),Ts.set(t,n)),n}(e,t).format(i)}function Wt(i,e,t){return i?function(i,e){return{x:t=>i+i+e-t,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,n)=>t-n,leftForLtr:(t,n)=>t-n}}(e,t):{x:i=>i,setWidth(i){},textAlign:i=>i,xPlus:(i,e)=>i+e,leftForLtr:(i,e)=>i}}function Ds(i,e){let t,n;("ltr"===e||"rtl"===e)&&(t=i.canvas.style,n=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),i.prevTextDirection=n)}function Ls(i,e){void 0!==e&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",e[0],e[1]))}function Es(i){return"angle"===i?{between:ee,compare:kh,normalize:Q}:{between:dt,compare:(e,t)=>e-t,normalize:e=>e}}function Rs({start:i,end:e,count:t,loop:n,style:s}){return{start:i%t,end:e%t,loop:n&&(e-i+1)%t==0,style:s}}function Is(i,e,t){if(!t)return[i];const{property:n,start:s,end:o}=t,r=e.length,{compare:a,between:l,normalize:c}=Es(n),{start:h,end:d,loop:u,style:f}=function Nd(i,e,t){const{property:n,start:s,end:o}=t,{between:r,normalize:a}=Es(n),l=e.length;let u,f,{start:c,end:h,loop:d}=i;if(d){for(c+=l,h+=l,u=0,f=l;ua({chart:e,initial:t.initial,numSteps:r,currentStep:Math.min(n-t.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=ts.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let l,r=o.length-1,a=!1;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(e),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,n,e,"progress")),o.length||(n.running=!1,this._notify(s,n,e,"complete"),n.initial=!1),t+=o.length}),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const n=t.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}};const js="transparent",Xd={boolean:(i,e,t)=>t>.5?e:i,color(i,e,t){const n=ps(i||js),s=n.valid&&ps(e||js);return s&&s.valid?s.mix(n,t).hexString():e},number:(i,e,t)=>i+(e-i)*t};class Gd{constructor(e,t,n,s){const o=t[n];s=le([e.to,s,o,e.from]);const r=le([e.from,o,s]);this._active=!0,this._fn=e.fn||Xd[e.type||typeof r],this._easing=ie[e.easing]||ie.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=le([e.to,t,s,e.from]),this._from=le([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||t1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l))}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let s=0;s"onProgress"!==i&&"onComplete"!==i&&"fn"!==i}),T.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),T.describe("animations",{_fallback:"animation"}),T.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:i=>0|i}}}});class Ns{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!A(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(n=>{const s=e[n];if(!A(s))return;const o={};for(const r of Zd)o[r]=s[r];(z(s.properties)&&s.properties||[n]).forEach(r=>{(r===n||!t.has(r))&&t.set(r,o)})})}_animateOptions(e,t){const n=t.options,s=function Qd(i,e){if(!e)return;let t=i.options;if(t)return t.$shared&&(i.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t;i.options=e}(e,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&function Jd(i,e){const t=[],n=Object.keys(e);for(let s=0;s{e.options=n},()=>{}),o}_createAnimations(e,t){const n=this._properties,s=[],o=e.$animations||(e.$animations={}),r=Object.keys(t),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if("$"===c.charAt(0))continue;if("options"===c){s.push(...this._animateOptions(e,t));continue}const h=t[c];let d=o[c];const u=n.get(c);if(d){if(u&&d.active()){d.update(u,h,a);continue}d.cancel()}u&&u.duration?(o[c]=d=new Gd(u,e,c,h),s.push(d)):e[c]=h}return s}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const n=this._createAnimations(e,t);return n.length?(gt.add(this._chart,n),!0):void 0}}function Vs(i,e){const t=i&&i.options||{},n=t.reverse,s=void 0===t.min?e:0,o=void 0===t.max?e:0;return{start:n?o:s,end:n?s:o}}function Hs(i,e){const t=[],n=i._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s0||!t&&o<0)return s.index}return null}function Us(i,e){const{chart:t,_cachedMeta:n}=i,s=t._stacks||(t._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=function nu(i,e,t){return`${i.id}.${e.id}.${t.stack||t.type}`}(o,r,n),d=e.length;let u;for(let f=0;ft[n].axis===e).shift()}function he(i,e){const t=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){e=e||i._parsed;for(const s of e){const o=s._stacks;if(!o||void 0===o[n]||void 0===o[n][t])return;delete o[n][t]}}}const ji=i=>"reset"===i||"none"===i,Xs=(i,e)=>e?i:Object.assign({},i);let at=(()=>{class i{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=$s(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&he(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,s=this.getDataset(),o=(u,f,g,p)=>"x"===u?f:"r"===u?p:g,r=n.xAxisID=C(s.xAxisID,Bi(t,"x")),a=n.yAxisID=C(s.yAxisID,Bi(t,"y")),l=n.rAxisID=C(s.rAxisID,Bi(t,"r")),c=n.indexAxis,h=n.iAxisID=o(c,r,a,l),d=n.vAxisID=o(c,a,r,l);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(h),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Jn(this._data,this),t._stacked&&he(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),s=this._data;if(A(n))this._data=function iu(i){const e=Object.keys(i),t=new Array(e.length);let n,s,o;for(n=0,s=e.length;n{const n="_onData"+_i(t),s=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return i._chartjs.listeners.forEach(a=>{"function"==typeof a[n]&&a[n](...o)}),r}})}))}(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,s=this.getDataset();let o=!1;this._dataCheck();const r=n._stacked;n._stacked=$s(n.vScale,n),n.stack!==s.stack&&(o=!0,he(n),n.stack=s.stack),this._resyncElements(t),(o||r!==n._stacked)&&Us(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:s,_data:o}=this,{iScale:r,_stacked:a}=s,l=r.axis;let d,u,f,c=0===t&&n===o.length||s._sorted,h=t>0&&s._parsed[t-1];if(!1===this._parsing)s._parsed=o,s._sorted=!0,f=o;else{f=z(o[t])?this.parseArrayData(s,o,t,n):A(o[t])?this.parseObjectData(s,o,t,n):this.parsePrimitiveData(s,o,t,n);const g=()=>null===u[l]||h&&u[l]i&&!e.hidden&&e._stacked&&{keys:Hs(this.chart,!0),values:null})(n,s),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=function su(i){const{min:e,max:t,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY}}(l);let f,g;function p(){g=o[f];const m=g[l.axis];return!H(g[t.axis])||d>m||u=0;--f)if(!p()){this.updateRangeFromParsed(h,t,g,c);break}return h}getAllParsedValues(t){const n=this._cachedMeta._parsed,s=[];let o,r,a;for(o=0,r=n.length;o=0&&tthis.getContext(s,o),u);return m.$shared&&(m.$shared=c,r[a]=Object.freeze(Xs(m,c))),m}_resolveAnimations(t,n,s){const o=this.chart,r=this._cachedDataOpts,a=`animation-${n}`,l=r[a];if(l)return l;let c;if(!1!==o.options.animation){const d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),u);c=d.createResolver(f,this.getContext(t,s,n))}const h=new Ns(o,c&&c.animations);return c&&c._cacheable&&(r[a]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||ji(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const s=this.resolveDataElementOptions(t,n),o=this._sharedOptions,r=this.getSharedOptions(s),a=this.includeOptions(n,r)||r!==o;return this.updateSharedOptions(r,n,s),{sharedOptions:r,includeOptions:a}}updateElement(t,n,s,o){ji(o)?Object.assign(t,s):this._resolveAnimations(n,o).update(t,s)}updateSharedOptions(t,n,s){t&&!ji(n)&&this._resolveAnimations(void 0,n).update(t,s)}_setStyle(t,n,s,o){t.active=o;const r=this.getStyle(n,o);this._resolveAnimations(n,s,o).update(t,{options:!o&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,n,s){this._setStyle(t,s,"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 n=this._data,s=this._cachedMeta.data;for(const[l,c,h]of this._syncList)this[l](c,h);this._syncList=[];const o=s.length,r=n.length,a=Math.min(r,o);a&&this.parse(0,a),r>o?this._insertElements(o,r-o,t):r{for(h.length+=n,l=h.length-1;l>=a;l--)h[l]=h[l-n]};for(c(r),l=t;ls-o))}return i._cache.$bar}(e,i.type);let s,o,r,a,n=e._length;const l=()=>{32767===r||-32768===r||(et(a)&&(n=Math.min(n,Math.abs(r-a)||n)),a=r)};for(s=0,o=t.length;sMath.abs(a)&&(l=a,c=r),e[t.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}(i,e,t,n):e[t.axis]=t.parse(i,n),e}function Ks(i,e,t,n){const s=i.iScale,o=i.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=t,h=t+n;ci.x,t="left",n="right"):(e=i.base{class i extends at{parsePrimitiveData(t,n,s,o){return Ks(t,n,s,o)}parseArrayData(t,n,s,o){return Ks(t,n,s,o)}parseObjectData(t,n,s,o){const{iScale:r,vScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h="x"===r.axis?l:c,d="x"===a.axis?l:c,u=[];let f,g,p,m;for(f=s,g=s+o;fc.controller.options.grouped),r=s.options.stacked,a=[],l=c=>{const h=c.controller.getParsed(n),d=h&&h[c.vScale.axis];if(E(d)||isNaN(d))return!0};for(const c of o)if((void 0===n||!l(c))&&((!1===r||-1===a.indexOf(c.stack)||void 0===r&&void 0===c.stack)&&a.push(c.stack),c.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,s){const o=this._getStacks(t,s),r=void 0!==n?o.indexOf(n):-1;return-1===r?o.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,s=n.iScale,o=[];let r,a;for(r=0,a=n.data.length;r=t?1:-1)}(p,n,a)*r,d===a&&(b-=p/2);const _=n.getPixelForDecimal(0),v=n.getPixelForDecimal(1),y=Math.min(_,v),x=Math.max(_,v);b=Math.max(Math.min(b,x),y),g=b+p}if(b===n.getPixelForValue(a)){const _=rt(p)*n.getLineWidthForValue(a)/2;b+=_,p-=_}return{size:p,base:b,head:g,center:g+p/2}}_calculateBarIndexPixels(t,n){const s=n.scale,o=this.options,r=o.skipNull,a=C(o.maxBarThickness,1/0);let l,c;if(n.grouped){const h=r?this._getStackCount(t):n.stackCount,d="flex"===o.barThickness?function uu(i,e,t,n){const s=e.pixels,o=s[i];let r=i>0?s[i-1]:null,a=i{class i extends at{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,s,o){const r=super.parsePrimitiveData(t,n,s,o);for(let a=0;a=0;--s)n=Math.max(n,t[s].size(this.resolveDataElementOptions(s))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,{xScale:s,yScale:o}=n,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:n.label,value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,s,o){const r="reset"===o,{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(n,o),d=a.axis,u=l.axis;for(let f=n;f""}}}},i})(),Js=(()=>{class i extends at{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const s=this.getDataset().data,o=this._cachedMeta;if(!1===this._parsing)o._parsed=s;else{let a,l,r=c=>+s[c];if(A(s[t])){const{key:c="value"}=this._parsing;r=h=>+mt(s[h],c)}for(a=t,l=t+n;a"string"==typeof i&&i.endsWith("%")?parseFloat(i)/100:i/e)(this.options.cutout,l),1),h=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:m}=function vu(i,e,t){let n=1,s=1,o=0,r=0;if(eee(v,a,l,!0)?1:Math.max(y,y*t,x,x*t),g=(v,y,x)=>ee(v,a,l,!0)?-1:Math.min(y,y*t,x,x*t),p=f(0,c,d),m=f(V,h,u),b=g(N,c,d),_=g(N+V,h,u);n=(p-b)/2,s=(m-_)/2,o=-(p+b)/2,r=-(m+_)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}(u,d,c),v=Math.max(Math.min((s.width-a)/f,(s.height-a)/g)/2,0),y=Hn(this.options.radius,v),w=(y-Math.max(y*c,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*y,this.offsetY=m*y,o.total=this.calculateTotal(),this.outerRadius=y-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(r,0,r.length,t)}_circumference(t,n){const s=this.options,o=this._cachedMeta,r=this._getCircumference();return n&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||null===o._parsed[t]||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*r/F)}updateElements(t,n,s,o){const r="reset"===o,a=this.chart,l=a.chartArea,d=(l.left+l.right)/2,u=(l.top+l.bottom)/2,f=r&&a.options.animation.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(n,o);let v,_=this._getRotation();for(v=0;v0&&!isNaN(t)?F*(Math.abs(t)/n):0}getLabelAndValue(t){const s=this.chart,o=s.data.labels||[],r=ce(this._cachedMeta._parsed[t],s.options.locale);return{label:o[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const s=this.chart;let o,r,a,l,c;if(!t)for(o=0,r=s.data.datasets.length;o"spacing"!==e,_indexable:e=>"spacing"!==e},i.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((s,o)=>{const a=e.getDatasetMeta(0).controller.getStyle(o);return{text:s,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(e){let t=e.label;const n=": "+e.formattedValue;return z(t)?(t=t.slice(),t[0]+=n):t+=n,t}}}}},i})(),wu=(()=>{class i extends at{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:s,data:o=[],_dataset:r}=n,a=this.chart._animationsDisabled;let{start:l,count:c}=is(n,o,a);this._drawStart=l,this._drawCount=c,ns(n)&&(l=0,c=o.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!r._decimated,s.points=o;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:h},t),this.updateElements(o,l,c,t)}updateElements(t,n,s,o){const r="reset"===o,{iScale:a,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(n,o),f=a.axis,g=l.axis,{spanGaps:p,segment:m}=this.options,b=jt(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||r||"none"===o;let v=n>0&&this.getParsed(n-1);for(let y=n;y0&&Math.abs(w[f]-v[f])>b,m&&(M.parsed=w,M.raw=h.data[y]),u&&(M.options=d||this.resolveDataElementOptions(y,x.active?"active":o)),_||this.updateElement(x,y,M,o),v=w}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,s=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return s;const r=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(s,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}return i.id="line",i.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},i.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}},i})(),Mu=(()=>{class i extends at{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const s=this.chart,o=s.data.labels||[],r=ce(this._cachedMeta._parsed[t].r,s.options.locale);return{label:o[t]||"",value:r}}parseObjectData(t,n,s,o){return ks.bind(this)(t,n,s,o)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return this._cachedMeta.data.forEach((s,o)=>{const r=this.getParsed(o).r;!isNaN(r)&&this.chart.getDataVisibility(o)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,s=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(o/2,0),l=(r-Math.max(s.cutoutPercentage?r/100*s.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,n,s,o){const r="reset"===o,a=this.chart,c=a.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,u=h.yCenter,f=h.getIndexAngle(0)-.5*N;let p,g=f;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(t,n,s){return this.chart.getDataVisibility(t)?st(this.resolveDataElementOptions(t,n).angle||s):0}}return i.id="polarArea",i.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},i.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((s,o)=>{const a=e.getDatasetMeta(0).controller.getStyle(o);return{text:s,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label:e=>e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}},i})(),Su=(()=>{class i extends Js{}return i.id="pie",i.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"},i})(),ku=(()=>{class i extends at{getLabelAndValue(t){const n=this._cachedMeta.vScale,s=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(s[n.axis])}}parseObjectData(t,n,s,o){return ks.bind(this)(t,n,s,o)}update(t){const n=this._cachedMeta,s=n.dataset,o=n.data||[],r=n.iScale.getLabels();if(s.points=o,"resize"!==t){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0),this.updateElement(s,void 0,{_loop:!0,_fullLoop:r.length===o.length,options:a},t)}this.updateElements(o,0,o.length,t)}updateElements(t,n,s,o){const r=this._cachedMeta.rScale,a="reset"===o;for(let l=n;l{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}ot.defaults={},ot.defaultRoutes=void 0;const Qs={values:i=>z(i)?i:""+i,numeric(i,e,t){if(0===i)return"0";const n=this.chart.options.locale;let s,o=i;if(t.length>1){const c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=function Pu(i,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&i!==Math.floor(i)&&(t=i-Math.floor(i)),t}(i,t)}const r=it(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ce(i,n,l)},logarithmic(i,e,t){if(0===i)return"0";const n=i/Math.pow(10,Math.floor(it(i)));return 1===n||2===n||5===n?Qs.numeric.call(this,i,e,t):""}};var We={formatters:Qs};function $e(i,e,t,n,s){const o=C(n,0),r=Math.min(C(s,i.length),i.length);let l,c,h,a=0;for(t=Math.ceil(t),s&&(l=s-n,t=l/Math.floor(l/t)),h=o;h<0;)a++,h=Math.round(o+a*t);for(c=Math.max(o,0);ce.lineWidth,tickColor:(i,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:We.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),T.route("scale.ticks","color","","color"),T.route("scale.grid","color","","borderColor"),T.route("scale.grid","borderColor","","borderColor"),T.route("scale.title","color","","color"),T.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&"callback"!==i&&"parser"!==i,_indexable:i=>"borderDash"!==i&&"tickBorderDash"!==i}),T.describe("scales",{_fallback:"scale"}),T.describe("scale.ticks",{_scriptable:i=>"backdropPadding"!==i&&"callback"!==i,_indexable:i=>"backdropPadding"!==i});const to=(i,e,t)=>"top"===e||"left"===e?i[e]+t:i[e]-t;function eo(i,e){const t=[],n=i.length/e,s=i.length;let o=0;for(;or+a)))return l}function de(i){return i.drawTicks?i.tickLength:0}function io(i,e){if(!i.display)return 0;const t=U(i.font,e),n=K(i.padding);return(z(i.text)?i.text.length:1)*t.lineHeight+n.height}function Bu(i,e,t){let n=wi(i);return(t&&"right"!==e||!t&&"right"===e)&&(n=(i=>"left"===i?"right":"right"===i?"left":i)(n)),n}class Dt extends ot{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:s}=this;return e=tt(e,Number.POSITIVE_INFINITY),t=tt(t,Number.NEGATIVE_INFINITY),n=tt(n,Number.POSITIVE_INFINITY),s=tt(s,Number.NEGATIVE_INFINITY),{min:tt(e,n),max:tt(t,s),minDefined:H(e),maxDefined:H(t)}}getMinMax(e){let r,{min:t,max:n,minDefined:s,maxDefined:o}=this.getUserBounds();if(s&&o)return{min:t,max:n};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;ln?n:t,n=s&&t>n?t:n,{min:tt(t,tt(n,t)),max:tt(n,tt(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){B(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function dd(i,e,t){const{min:n,max:s}=i,o=Hn(e,(s-n)/2),r=(a,l)=>t&&0===a?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=an)return function Du(i,e,t,n){let r,s=0,o=t[0];for(n=Math.ceil(n),r=0;rs-o).pop(),e}(n);for(let r=0,a=o.length-1;rs)return l}return Math.max(s,1)}(s,e,n);if(o>0){let h,d;const u=o>1?Math.round((a-r)/(o-1)):null;for($e(e,l,c,E(u)?0:r-u,r),h=0,d=o-1;h=o||n<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=X(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/n:f/(n-1),d+6>a&&(a=f/(n-(e.offset?.5:1)),l=this.maxHeight-de(e.grid)-t.padding-io(e.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=xi(Math.min(Math.asin(X((h.highest.height+6)/a,-1,1)),Math.asin(X(l/c,-1,1))-Math.asin(X(u/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){B(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){B(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=io(s,t.options.font);if(a?(e.width=this.maxWidth,e.height=de(o)+l):(e.height=this.maxHeight,e.width=de(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=2*n.padding,g=st(this.labelRotation),p=Math.cos(g),m=Math.sin(g);a?e.height=Math.min(this.maxHeight,e.height+(n.mirror?0:m*d.width+p*u.height)+f):e.width=Math.min(this.maxWidth,e.width+(n.mirror?0:p*d.width+m*u.height)+f),this._calculatePadding(c,h,m,p)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=0!==this.labelRotation,c="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=s*e.width,f=n*t.height):(u=n*e.height,f=s*t.width):"start"===o?f=t.width:"end"===o?u=e.width:"inner"!==o&&(u=e.width/2,f=t.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=t.height/2,d=e.height/2;"start"===o?(h=0,d=e.height):"end"===o&&(h=t.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){B(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t{const n=t.gc,s=n.length/2;let o;if(s>e){for(o=0;o({width:o[M]||0,height:r[M]||0});return{first:w(0),last:w(t-1),widest:w(y),highest:w(x),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return function Ph(i){return X(i,-32768,32767)}(this._alignToPixels?kt(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&ea*s?a/n:l/s:l*s0}_computeGridLineItems(e){const t=this.axis,n=this.chart,s=this.options,{grid:o,position:r}=s,a=o.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),d=de(o),u=[],f=o.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,m=function(P){return kt(n,P,g)};let b,_,v,y,x,w,M,S,k,L,R,D;if("top"===r)b=m(this.bottom),w=this.bottom-d,S=b-p,L=m(e.top)+p,D=e.bottom;else if("bottom"===r)b=m(this.top),L=e.top,D=m(e.bottom)-p,w=b+p,S=this.top+d;else if("left"===r)b=m(this.right),x=this.right-d,M=b-p,k=m(e.left)+p,R=e.right;else if("right"===r)b=m(this.left),k=e.left,R=m(e.right)-p,x=b+p,M=this.left+d;else if("x"===t){if("center"===r)b=m((e.top+e.bottom)/2+.5);else if(A(r)){const P=Object.keys(r)[0];b=m(this.chart.scales[P].getPixelForValue(r[P]))}L=e.top,D=e.bottom,w=b+p,S=w+d}else if("y"===t){if("center"===r)b=m((e.left+e.right)/2);else if(A(r)){const P=Object.keys(r)[0];b=m(this.chart.scales[P].getPixelForValue(r[P]))}x=b-p,M=x-d,k=e.left,R=e.right}const $=C(s.ticks.maxTicksLimit,h),Z=Math.max(1,Math.ceil(h/$));for(_=0;_o.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(t.display)for(o=0,r=s.length;o{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]:[{z:t,draw:s=>{this.draw(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,r;for(o=0,r=t.length;o{const n=t.split("."),s=n.pop(),o=[i].concat(n).join("."),r=e[t].split("."),a=r.pop(),l=r.join(".");T.route(o,s,l,a)})}(e,i.defaultRoutes),i.descriptors&&T.describe(e,i.descriptors)}(e,r,n),this.override&&T.override(e.id,e.overrides)),r}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,s=this.scope;n in t&&delete t[n],s&&n in T[s]&&(delete T[s][n],this.override&&delete St[n])}}var lt=new class Wu{constructor(){this.controllers=new Ye(at,"datasets",!0),this.elements=new Ye(ot,"elements"),this.plugins=new Ye(Object,"plugins"),this.scales=new Ye(Dt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,n){[...t].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(e,o,s):I(s,r=>{const a=n||this._getRegistryForType(r);this._exec(e,a,r)})})}_exec(e,t,n){const s=_i(e);B(n["before"+s],[],n),t[e](n),B(n["after"+s],[],n)}_getRegistryForType(e){for(let t=0;t{class i extends at{update(t){const n=this._cachedMeta,{data:s=[]}=n,o=this.chart._animationsDisabled;let{start:r,count:a}=is(n,s,o);if(this._drawStart=r,this._drawCount=a,ns(n)&&(r=0,a=s.length),this.options.showLine){const{dataset:l,_dataset:c}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=s;const h=this.resolveDatasetElementOptions(t);h.segment=this.options.segment,this.updateElement(l,void 0,{animated:!o,options:h},t)}this.updateElements(s,r,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=lt.getElement("line")),super.addElements()}updateElements(t,n,s,o){const r="reset"===o,{iScale:a,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,d=this.resolveDataElementOptions(n,o),u=this.getSharedOptions(d),f=this.includeOptions(o,u),g=a.axis,p=l.axis,{spanGaps:m,segment:b}=this.options,_=jt(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||"none"===o;let y=n>0&&this.getParsed(n-1);for(let x=n;x0&&Math.abs(M[g]-y[g])>_,b&&(S.parsed=M,S.raw=h.data[x]),f&&(S.options=u||this.resolveDataElementOptions(x,w.active?"active":o)),v||this.updateElement(w,x,S,o),y=M}this.updateSharedOptions(u,o,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let c=n.length-1;c>=0;--c)l=Math.max(l,n[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const s=t.dataset,o=s.options&&s.options.borderWidth||0;if(!n.length)return o;const r=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,r,a)/2}}return i.id="scatter",i.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},i.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:e=>"("+e.label+", "+e.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}},i})()});function Lt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Yu={_date:(()=>{class i{constructor(t){this.options=t||{}}init(t){}formats(){return Lt()}parse(t,n){return Lt()}format(t,n){return Lt()}add(t,n,s){return Lt()}diff(t,n,s){return Lt()}startOf(t,n,s){return Lt()}endOf(t,n){return Lt()}}return i.override=function(e){Object.assign(i.prototype,e)},i})()};function Uu(i,e,t,n){const{controller:s,data:o,_sorted:r}=i,a=s._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const l=a._reversePixels?Ch:ut;if(!n)return l(o,e,t);if(s._sharedOptions){const c=o[0],h="function"==typeof c.getRange&&c.getRange(e);if(h){const d=l(o,e,t-h),u=l(o,e,t+h);return{lo:d.lo,hi:u.hi}}}}return{lo:0,hi:o.length-1}}function ue(i,e,t,n,s){const o=i.getSortedVisibleDatasetMetas(),r=t[e];for(let a=0,l=o.length;a{l[r](e[t],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(e.x,e.y,s))}),n&&!a?[]:o}var qu={evaluateInteractionItems:ue,modes:{index(i,e,t,n){const s=At(e,i),o=t.axis||"x",r=t.includeInvisible||!1,a=t.intersect?Vi(i,s,o,n,r):Hi(i,s,o,!1,n,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,e,t,n){const s=At(e,i),o=t.axis||"xy",r=t.includeInvisible||!1;let a=t.intersect?Vi(i,s,o,n,r):Hi(i,s,o,!1,n,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;hVi(i,At(e,i),t.axis||"xy",n,t.includeInvisible||!1),nearest:(i,e,t,n)=>Hi(i,At(e,i),t.axis||"xy",t.intersect,n,t.includeInvisible||!1),x:(i,e,t,n)=>no(i,At(e,i),"x",t.intersect,n),y:(i,e,t,n)=>no(i,At(e,i),"y",t.intersect,n)}};const so=["left","top","right","bottom"];function fe(i,e){return i.filter(t=>t.pos===e)}function oo(i,e){return i.filter(t=>-1===so.indexOf(t.pos)&&t.box.axis===e)}function ge(i,e){return i.sort((t,n)=>{const s=e?n:t,o=e?t:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function ro(i,e,t,n){return Math.max(i[t],e[t])+Math.max(i[n],e[n])}function ao(i,e){i.top=Math.max(i.top,e.top),i.left=Math.max(i.left,e.left),i.bottom=Math.max(i.bottom,e.bottom),i.right=Math.max(i.right,e.right)}function ef(i,e,t,n){const{pos:s,box:o}=t,r=i.maxPadding;if(!A(s)){t.size&&(i[s]-=t.size);const d=n[t.stack]||{size:0,count:1};d.size=Math.max(d.size,t.horizontal?o.height:o.width),t.size=d.size/d.count,i[s]+=t.size}o.getPadding&&ao(r,o.getPadding());const a=Math.max(0,e.outerWidth-ro(r,i,"left","right")),l=Math.max(0,e.outerHeight-ro(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,t.horizontal?{same:c,other:h}:{same:h,other:c}}function sf(i,e){const t=e.maxPadding;return function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(e[r],t[r])}),o}(i?["left","right"]:["top","bottom"])}function pe(i,e,t,n){const s=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;oc.box.fullSize),!0),n=ge(fe(e,"left"),!0),s=ge(fe(e,"right")),o=ge(fe(e,"top"),!0),r=ge(fe(e,"bottom")),a=oo(e,"x"),l=oo(e,"y");return{fullSize:t,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:fe(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}(i.boxes),l=a.vertical,c=a.horizontal;I(i.boxes,p=>{"function"==typeof p.beforeLayout&&p.beforeLayout()});const h=l.reduce((p,m)=>m.box.options&&!1===m.box.options.display?p:p+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);ao(u,K(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),g=function Qu(i,e){const t=function Ju(i){const e={};for(const t of i){const{stack:n,pos:s,stackWeight:o}=t;if(!n||!so.includes(s))continue;const r=e[n]||(e[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return e}(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=i.length;o{const m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class co{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,s){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):n)}}isAttached(e){return!0}updateConfig(e){}}class of extends co{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Xe="$chartjs",rf={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ho=i=>null===i||""===i,uo=!!Rd&&{passive:!0};function cf(i,e,t){i.canvas.removeEventListener(e,t,uo)}function Ge(i,e){for(const t of i)if(t===e||t.contains(e))return!0}function df(i,e,t){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ge(a.addedNodes,n),r=r&&!Ge(a.removedNodes,n);r&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function uf(i,e,t){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ge(a.removedNodes,n),r=r&&!Ge(a.addedNodes,n);r&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const me=new Map;let fo=0;function go(){const i=window.devicePixelRatio;i!==fo&&(fo=i,me.forEach((e,t)=>{t.currentDevicePixelRatio!==i&&e()}))}function pf(i,e,t){const n=i.canvas,s=n&&Fi(n);if(!s)return;const o=es((a,l)=>{const c=s.clientWidth;t(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;0===c&&0===h||o(c,h)});return r.observe(s),function ff(i,e){me.size||window.addEventListener("resize",go),me.set(i,e)}(i,o),r}function Wi(i,e,t){t&&t.disconnect(),"resize"===e&&function gf(i){me.delete(i),me.size||window.removeEventListener("resize",go)}(i)}function mf(i,e,t){const n=i.canvas,s=es(o=>{null!==i.ctx&&t(function hf(i,e){const t=rf[i.type]||i.type,{x:n,y:s}=At(i,e);return{type:t,chart:e,native:i,x:void 0!==n?n:null,y:void 0!==s?s:null}}(o,i))},i,o=>{const r=o[0];return[r,r.offsetX,r.offsetY]});return function lf(i,e,t){i.addEventListener(e,t,uo)}(n,e,s),s}class bf extends co{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(function af(i,e){const t=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Xe]={initial:{height:n,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",ho(s)){const o=As(i,"width");void 0!==o&&(i.width=o)}if(ho(n))if(""===i.style.height)i.height=i.width/(e||2);else{const o=As(i,"height");void 0!==o&&(i.height=o)}}(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t[Xe])return!1;const n=t[Xe].initial;["height","width"].forEach(o=>{const r=n[o];E(r)?t.removeAttribute(o):t.setAttribute(o,r)});const s=n.style||{};return Object.keys(s).forEach(o=>{t.style[o]=s[o]}),t.width=t.width,delete t[Xe],!0}addEventListener(e,t,n){this.removeEventListener(e,t),(e.$proxies||(e.$proxies={}))[t]=({attach:df,detach:uf,resize:pf}[t]||mf)(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),s=n[t];s&&(({attach:Wi,detach:Wi,resize:Wi}[t]||cf)(e,t,s),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,s){return function Ed(i,e,t,n){const s=He(i),o=Ot(s,"margin"),r=Ve(s.maxWidth,i,"clientWidth")||De,a=Ve(s.maxHeight,i,"clientHeight")||De,l=function Ld(i,e,t){let n,s;if(void 0===e||void 0===t){const o=Fi(i);if(o){const r=o.getBoundingClientRect(),a=He(o),l=Ot(a,"border","width"),c=Ot(a,"padding");e=r.width-c.width-l.width,t=r.height-c.height-l.height,n=Ve(a.maxWidth,o,"clientWidth"),s=Ve(a.maxHeight,o,"clientHeight")}else e=i.clientWidth,t=i.clientHeight}return{width:e,height:t,maxWidth:n||De,maxHeight:s||De}}(i,e,t);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const d=Ot(s,"border","width"),u=Ot(s,"padding");c-=u.width+d.width,h-=u.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?Math.floor(c/n):h-o.height),c=zi(Math.min(c,r,l.maxWidth)),h=zi(Math.min(h,a,l.maxHeight)),c&&!h&&(h=zi(c/2)),{width:c,height:h}}(e,t,n,s)}isAttached(e){const t=Fi(e);return!(!t||!t.isConnected)}}class xf{constructor(){this._init=[]}notify(e,t,n,s){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=s?this._descriptors(e).filter(s):this._descriptors(e),r=this._notify(o,e,t,n);return"afterDestroy"===t&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),r}_notify(e,t,n,s){s=s||{};for(const o of e){const r=o.plugin;if(!1===B(r[n],[t,s,o.options],r)&&s.cancelable)return!1}return!0}invalidate(){E(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,s=C(n.options&&n.options.plugins,{}),o=function yf(i){const e={},t=[],n=Object.keys(lt.plugins.items);for(let o=0;oo.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(t,n),e,"stop"),this._notify(s(n,t),e,"start")}}function vf(i,e){return e||!1!==i?!0===i?{}:i:null}function Mf(i,{plugin:e,local:t},n,s){const o=i.pluginScopeKeys(e),r=i.getOptionScopes(n,o);return t&&e.defaults&&r.push(e.defaults),i.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $i(i,e){return((e.datasets||{})[i]||{}).indexAxis||e.indexAxis||(T.datasets[i]||{}).indexAxis||"x"}function Yi(i,e){return"x"===i||"y"===i?i:e.axis||function Pf(i){return"top"===i||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0}(e.position)||i.charAt(0).toLowerCase()}function po(i){const e=i.options||(i.options={});e.plugins=C(e.plugins,{}),e.scales=function Cf(i,e){const t=St[i.type]||{scales:{}},n=e.scales||{},s=$i(i.type,e),o=Object.create(null),r=Object.create(null);return Object.keys(n).forEach(a=>{const l=n[a];if(!A(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Yi(a,l),h=function kf(i,e){return i===e?"_index_":"_value_"}(c,s),d=t.scales||{};o[c]=o[c]||a,r[a]=Jt(Object.create(null),[{axis:c},l,d[c],d[h]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,c=a.indexAxis||$i(l,e),d=(St[l]||{}).scales||{};Object.keys(d).forEach(u=>{const f=function Sf(i,e){let t=i;return"_index_"===i?t=e:"_value_"===i&&(t="x"===e?"y":"x"),t}(u,c),g=a[f+"AxisID"]||o[f]||f;r[g]=r[g]||Object.create(null),Jt(r[g],[{axis:f},n[g],d[u]])})}),Object.keys(r).forEach(a=>{const l=r[a];Jt(l,[T.scales[l.type],T.scale])}),r}(i,e)}function mo(i){return(i=i||{}).datasets=i.datasets||[],i.labels=i.labels||[],i}const bo=new Map,_o=new Set;function Ke(i,e){let t=bo.get(i);return t||(t=e(),bo.set(i,t),_o.add(t)),t}const be=(i,e,t)=>{const n=mt(e,t);void 0!==n&&i.add(n)};class Af{constructor(e){this._config=function Of(i){return(i=i||{}).data=mo(i.data),po(i),i}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=mo(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),po(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Ke(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Ke(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Ke(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id;return Ke(`${this.type}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const n=this._scopeCache;let s=n.get(e);return(!s||t)&&(s=new Map,n.set(e,s)),s}getOptionScopes(e,t,n){const{options:s,type:o}=this,r=this._cachedScopes(e,n),a=r.get(t);if(a)return a;const l=new Set;t.forEach(h=>{e&&(l.add(e),h.forEach(d=>be(l,e,d))),h.forEach(d=>be(l,s,d)),h.forEach(d=>be(l,St[o]||{},d)),h.forEach(d=>be(l,T,d)),h.forEach(d=>be(l,Ai,d))});const c=Array.from(l);return 0===c.length&&c.push(Object.create(null)),_o.has(t)&&r.set(t,c),c}chartOptionScopes(){const{options:e,type:t}=this;return[e,St[t]||{},T.datasets[t]||{},{type:t},T,Ai]}resolveNamedOptions(e,t,n,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=xo(this._resolverCache,e,s);let l=r;(function Df(i,e){const{isScriptable:t,isIndexable:n}=xs(i);for(const s of e){const o=t(s),r=n(s),a=(r||o)&&i[s];if(o&&(bt(a)||Tf(a))||r&&z(a))return!0}return!1})(r,t)&&(o.$shared=!1,l=Vt(r,n=bt(n)?n():n,this.createResolver(e,n,a)));for(const c of t)o[c]=l[c];return o}createResolver(e,t,n=[""],s){const{resolver:o}=xo(this._resolverCache,e,n);return A(t)?Vt(o,t,void 0,s):o}}function xo(i,e,t){let n=i.get(e);n||(n=new Map,i.set(e,n));const s=t.join();let o=n.get(s);return o||(o={resolver:Ei(e,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}const Tf=i=>A(i)&&Object.getOwnPropertyNames(i).reduce((e,t)=>e||bt(i[t]),!1),Ef=["top","bottom","left","right","chartArea"];function yo(i,e){return"top"===i||"bottom"===i||-1===Ef.indexOf(i)&&"x"===e}function vo(i,e){return function(t,n){return t[i]===n[i]?t[e]-n[e]:t[i]-n[i]}}function wo(i){const e=i.chart,t=e.options.animation;e.notifyPlugins("afterRender"),B(t&&t.onComplete,[i],e)}function Rf(i){const e=i.chart,t=e.options.animation;B(t&&t.onProgress,[i],e)}function Mo(i){return Cs()&&"string"==typeof i?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const qe={},So=i=>{const e=Mo(i);return Object.values(qe).filter(t=>t.canvas===e).pop()};function If(i,e,t){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=e){const r=i[s];delete i[s],(t>0||o>e)&&(i[o+t]=r)}}}class Ze{constructor(e,t){const n=this.config=new Af(t),s=Mo(e),o=So(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function _f(i){return!Cs()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?of:bf}(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;this.id=gh(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new xf,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function Th(i,e){let t;return function(...n){return e?(clearTimeout(t),t=setTimeout(i,e,n)):i.apply(this,n),e}}(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],qe[this.id]=this,a&&l?(gt.listen(this,"complete",wo),gt.listen(this,"progress",Rf),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:e,maintainAspectRatio:t},width:n,height:s,_aspectRatio:o}=this;return E(e)?t&&o?o:s?n/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Os(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ms(this.canvas,this.ctx),this}stop(){return gt.stop(this),this}resize(e,t){gt.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,r=this.platform.getMaximumSize(this.canvas,e,t,n.maintainAspectRatio&&this.aspectRatio),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Os(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),B(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){I(this.options.scales||{},(n,s)=>{n.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{});let o=[];t&&(o=o.concat(Object.keys(t).map(r=>{const a=t[r],l=Yi(r,a),c="r"===l,h="x"===l;return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),I(o,r=>{const a=r.options,l=a.id,c=Yi(l,a),h=C(a.type,r.dtype);(void 0===a.position||yo(a.position,c)!==yo(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;l in n&&n[l].type===h?d=n[l]:(d=new(lt.getScale(h))({id:l,type:h,ctx:this.ctx,chart:this}),n[d.id]=d),d.init(a,e)}),I(s,(r,a)=>{r||delete n[a]}),I(n,r=>{q.configure(this,r,r.options),q.addBox(this,r)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((s,o)=>s.index-o.index),n>t){for(let s=t;st.length&&delete this._stacks,e.forEach((n,s)=>{0===t.filter(o=>o===n._dataset).length&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=t.length;n{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(vo("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){I(this.scales,e=>{q.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);(!Yn(t,n)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of t)If(e,s,"_removeElements"===n?-o:o)}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=o=>new Set(e.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=n(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;q.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],I(this.boxes,s=>{n&&"chartArea"===s.position||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let t=0,n=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n=e._clip,s=!n.disabled,o=this.chartArea,r={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(s&&Be(t,{left:!1===n.left?0:o.left-n.left,right:!1===n.right?this.width:o.right+n.right,top:!1===n.top?0:o.top-n.top,bottom:!1===n.bottom?this.height:o.bottom+n.bottom}),e.controller.draw(),s&&je(t),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return re(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,s){const o=qu.modes[t];return"function"==typeof o?o(this,e,n,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let s=n.filter(o=>o&&o._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=yt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const s=n?"show":"hide",o=this.getDatasetMeta(e),r=o.controller._resolveAnimations(void 0,s);et(t)?(o.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),gt.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,o,r),e[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};I(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(l,c)=>{t.addEventListener(this,l,c),e[l]=c},s=(l,c)=>{e[l]&&(t.removeEventListener(this,l,c),delete e[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",a)},t.isAttached(this.canvas)?a():r()}unbindEvents(){I(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},I(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const s=n?"set":"remove";let o,r,a,l;for("dataset"===t&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=e.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Ae(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}_updateHoverStyles(e,t,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(t,e),a=n?e:o(e,t);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=r=>(r.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",n,s))return;const o=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:s=[],options:o}=this,a=this._getActiveElements(e,s,n,t),l=function yh(i){return"mouseup"===i.type||"click"===i.type||"contextmenu"===i.type}(e),c=function Ff(i,e,t,n){return t&&"mouseout"!==i.type?n?e:i:null}(e,this._lastEvent,n,l);n&&(this._lastEvent=null,B(o.onHover,[e,a,this],this),l&&B(o.onClick,[e,a,this],this));const h=!Ae(a,s);return(h||t)&&(this._active=a,this._updateHoverStyles(a,s,t)),this._lastEvent=c,h}_getActiveElements(e,t,n,s){if("mouseout"===e.type)return[];if(!n)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,s)}}const ko=()=>I(Ze.instances,i=>i._plugins.invalidate()),vt=!0;function Po(i,e,t){const{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=e;let c=s/a;i.beginPath(),i.arc(o,r,a,n-c,t+c),l>s?(c=s/l,i.arc(o,r,l,t+c,n-c,!0)):i.arc(o,r,s,t+V,n-V),i.closePath(),i.clip()}function $t(i,e,t,n){return{x:t+i*Math.cos(e),y:n+i*Math.sin(e)}}function Ui(i,e,t,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,d=Math.max(e.outerRadius+n+t-c,0),u=h>0?h+n+t+c:0;let f=0;const g=s-l;if(n){const W=((h>0?h-n:0)+(d>0?d-n:0))/2;f=(g-(0!==W?g*W/(W+n):g))/2}const m=(g-Math.max(.001,g*d-t/N)/d)/2,b=l+m+f,_=s-m-f,{outerStart:v,outerEnd:y,innerStart:x,innerEnd:w}=function Bf(i,e,t,n){const s=function zf(i){return Li(i,["outerStart","outerEnd","innerStart","innerEnd"])}(i.options.borderRadius),o=(t-e)/2,r=Math.min(o,n*e/2),a=l=>{const c=(t-Math.min(o,l))*n/2;return X(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:X(s.innerStart,0,r),innerEnd:X(s.innerEnd,0,r)}}(e,u,d,_-b),M=d-v,S=d-y,k=b+v/M,L=_-y/S,R=u+x,D=u+w,$=b+x/R,Z=_-w/D;if(i.beginPath(),o){if(i.arc(r,a,d,k,L),y>0){const W=$t(S,L,r,a);i.arc(W.x,W.y,y,L,_+V)}const P=$t(D,_,r,a);if(i.lineTo(P.x,P.y),w>0){const W=$t(D,Z,r,a);i.arc(W.x,W.y,w,_+V,Z+Math.PI)}if(i.arc(r,a,u,_-w/u,b+x/u,!0),x>0){const W=$t(R,$,r,a);i.arc(W.x,W.y,x,$+Math.PI,b-V)}const Y=$t(M,b,r,a);if(i.lineTo(Y.x,Y.y),v>0){const W=$t(M,k,r,a);i.arc(W.x,W.y,v,b-V,k)}}else{i.moveTo(r,a);const P=Math.cos(k)*d+r,Y=Math.sin(k)*d+a;i.lineTo(P,Y);const W=Math.cos(L)*d+r,Et=Math.sin(L)*d+a;i.lineTo(W,Et)}i.closePath()}Object.defineProperties(Ze,{defaults:{enumerable:vt,value:T},instances:{enumerable:vt,value:qe},overrides:{enumerable:vt,value:St},registry:{enumerable:vt,value:lt},version:{enumerable:vt,value:"3.9.1"},getChart:{enumerable:vt,value:So},register:{enumerable:vt,value:(...i)=>{lt.add(...i),ko()}},unregister:{enumerable:vt,value:(...i)=>{lt.remove(...i),ko()}}});class Je extends ot{constructor(e){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,e&&Object.assign(this,e)}inRange(e,t,n){const s=this.getProps(["x","y"],n),{angle:o,distance:r}=qn(s,{x:e,y:t}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),u=this.options.spacing/2,g=C(d,l-a)>=F||ee(o,a,l),p=dt(r,c+u,h+u);return g&&p}getCenterPoint(e){const{x:t,y:n,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:l,spacing:c}=this.options,h=(s+o)/2,d=(r+a+c+l)/2;return{x:t+Math.cos(h)*d,y:n+Math.sin(h)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:n}=this,s=(t.offset||0)/2,o=(t.spacing||0)/2,r=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>F?Math.floor(n/F):0,0===n||this.innerRadius<0||this.outerRadius<0)return;e.save();let a=0;if(s){a=s/2;const c=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=N&&(a=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const l=function jf(i,e,t,n,s){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){Ui(i,e,t,n,r+F,s);for(let c=0;ca&&o>a)?n+c-l:c-l}}function $f(i,e,t,n){const{points:s,options:o}=e,{count:r,start:a,loop:l,ilen:c}=Oo(s,t,n),h=function Wf(i){return i.stepped?nd:i.tension||"monotone"===i.cubicInterpolationMode?sd:Hf}(o);let f,g,p,{move:d=!0,reverse:u}=n||{};for(f=0;f<=c;++f)g=s[(a+(u?c-f:f))%r],!g.skip&&(d?(i.moveTo(g.x,g.y),d=!1):h(i,p,g,u,o.stepped),p=g);return l&&(g=s[(a+(u?c:0))%r],h(i,p,g,u,o.stepped)),!!l}function Yf(i,e,t,n){const s=e.points,{count:o,start:r,ilen:a}=Oo(s,t,n),{move:l=!0,reverse:c}=n||{};let u,f,g,p,m,b,h=0,d=0;const _=y=>(r+(c?a-y:y))%o,v=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(f=s[_(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=s[_(u)],f.skip)continue;const y=f.x,x=f.y,w=0|y;w===g?(xm&&(m=x),h=(d*h+y)/++d):(v(),i.lineTo(y,x),g=w,d=0,p=m=x),b=x}v()}function Xi(i){const e=i.options;return i._decimated||i._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||e.borderDash&&e.borderDash.length?$f:Yf}Je.id="arc",Je.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},Je.defaultRoutes={backgroundColor:"backgroundColor"};const Kf="function"==typeof Path2D;let Qe=(()=>{class i extends ot{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,n){const s=this.options;!s.tension&&"monotone"!==s.cubicInterpolationMode||s.stepped||this._pointsUpdated||(Cd(this._points,s,t,s.spanGaps?this._loop:this._fullLoop,n),this._pointsUpdated=!0)}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function Wd(i,e){const t=i.points,n=i.options.spanGaps,s=t.length;if(!s)return[];const o=!!i._loop,{start:r,end:a}=function Vd(i,e,t,n){let s=0,o=e-1;if(t&&!n)for(;ss&&i[o%e].skip;)o--;return o%=e,{start:s,end:o}}(t,s,o,n);return function zs(i,e,t,n){return n&&n.setContext&&t?function $d(i,e,t,n){const s=i._chart.getContext(),o=Bs(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=t.length,c=[];let h=o,d=e[0].start,u=d;function f(g,p,m,b){const _=a?-1:1;if(g!==p){for(g+=l;t[g%l].skip;)g-=_;for(;t[p%l].skip;)p+=_;g%l!=p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),h=b,d=p%l)}}for(const g of e){d=a?d:g.start;let m,p=t[d%l];for(u=d+1;u<=g.end;u++){const b=t[u%l];m=Bs(n.setContext(yt(s,{type:"segment",p0:p,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Yd(m,h)&&f(d,u-1,g.loop,h),p=b,h=m}d"borderDash"!==e&&"fill"!==e},i})();function Ao(i,e,t,n){const s=i.options,{[t]:o}=i.getProps([t],n);return Math.abs(e-o){class i extends ot{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,n,s){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(t-r,2)+Math.pow(n-a,2){Do(e)})}var ag={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,e,t)=>{if(!t.enabled)return void Lo(i);const n=i.width;i.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:a}=s,l=i.getDatasetMeta(o),c=r||s.data;if("y"===le([a,i.options.indexAxis])||!l.controller.supportsDecimation)return;const h=i.scales[l.xAxisID];if("linear"!==h.type&&"time"!==h.type||i.options.parsing)return;let g,{start:d,count:u}=function rg(i,e){const t=e.length;let s,n=0;const{iScale:o}=i,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=X(ut(e,o.axis,r).lo,0,t-1)),s=c?X(ut(e,o.axis,a).hi+1,n,t)-n:t-n,{start:n,count:s}}(l,c);if(u<=(t.threshold||4*n))Do(s);else{switch(E(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}})),t.algorithm){case"lttb":g=function sg(i,e,t,n,s){const o=s.samples||n;if(o>=t)return i.slice(e,e+t);const r=[],a=(t-2)/(o-2);let l=0;const c=e+t-1;let d,u,f,g,p,h=e;for(r[l++]=i[h],d=0;df&&(f=g,u=i[_],p=_);r[l++]=u,h=p}return r[l++]=i[c],r}(c,d,u,n,t);break;case"min-max":g=function og(i,e,t,n){let r,a,l,c,h,d,u,f,g,p,s=0,o=0;const m=[],_=i[e].x,y=i[e+t-1].x-_;for(r=e;rp&&(p=c,u=r),s=(o*s+a.x)/++o;else{const w=r-1;if(!E(d)&&!E(u)){const M=Math.min(d,u),S=Math.max(d,u);M!==f&&M!==w&&m.push({...i[M],x:s}),S!==f&&S!==w&&m.push({...i[S],x:s})}r>0&&w!==f&&m.push(i[w]),m.push(a),h=x,o=0,g=p=c,d=u=f=r}}return m}(c,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}s._decimated=g}})},destroy(i){Lo(i)}};function qi(i,e,t,n){if(n)return;let s=e[i],o=t[i];return"angle"===i&&(s=Q(s),o=Q(o)),{property:i,start:s,end:o}}function Zi(i,e,t){for(;e>i;e--){const n=t[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function Eo(i,e,t,n){return i&&e?n(i[t],e[t]):i?i[t]:e?e[t]:0}function Ro(i,e){let t=[],n=!1;return z(i)?(n=!0,t=i):t=function cg(i,e){const{x:t=null,y:n=null}=i||{},s=e.points,o=[];return e.segments.forEach(({start:r,end:a})=>{a=Zi(r,a,s);const l=s[r],c=s[a];null!==n?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):null!==t&&(o.push({x:t,y:l.y}),o.push({x:t,y:c.y}))}),o}(i,e),t.length?new Qe({points:t,options:{tension:0},_loop:n,_fullLoop:n}):null}function Io(i){return i&&!1!==i.fill}function hg(i,e,t){let s=i[e].fill;const o=[e];let r;if(!t)return s;for(;!1!==s&&-1===o.indexOf(s);){if(!H(s))return s;if(r=i[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function dg(i,e,t){const n=function pg(i){const e=i.options,t=e.fill;let n=C(t&&t.target,t);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(i);if(A(n))return!isNaN(n.value)&&n;let s=parseFloat(n);return H(s)&&Math.floor(s)===s?function ug(i,e,t,n){return("-"===i||"+"===i)&&(t=e+t),!(t===e||t<0||t>=n)&&t}(n[0],e,s,t):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function _g(i,e,t){const n=[];for(let s=0;s=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&Ji(i.ctx,a,o))}},beforeDatasetsDraw(i,e,t){if("beforeDatasetsDraw"!==t.drawTime)return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;Io(o)&&Ji(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,e,t){const n=e.meta.$filler;!Io(n)||"beforeDatasetDraw"!==t.drawTime||Ji(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const No=(i,e)=>{let{boxHeight:t=e,boxWidth:n=e}=i;return i.usePointStyle&&(t=Math.min(t,e),n=i.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:t,itemHeight:Math.max(e,t)}};class Vo extends ot{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=B(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(n=>e.filter(n,this.chart.data))),e.sort&&(t=t.sort((n,s)=>e.sort(n,s,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const n=e.labels,s=U(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=No(n,o);let c,h;t.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,o,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(h,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let d=e;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,p)=>{const m=n+t/2+o.measureText(g.text).width;(0===p||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:m,height:s},c[c.length-1]+=m+a}),d}_fitCols(e,t,n,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-e;let d=a,u=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const _=n+t/2+o.measureText(m.text).width;b>0&&f+s+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,p++,u=f=0),l[b]={left:g,top:f,col:p,width:_,height:s},u=Math.max(u,_),f+=s+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:s},rtl:o}}=this,r=Wt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=G(n,this.left+s,this.right-this.lineWidths[a]);for(const c of t)a!==c.row&&(a=c.row,l=G(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+e+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=G(n,this.top+e+s,this.bottom-this.columnSizes[a].height);for(const c of t)c.col!==a&&(a=c.col,l=G(n,this.top+e+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;Be(e,this),this._draw(),je(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:n,ctx:s}=this,{align:o,labels:r}=e,a=T.color,l=Wt(e.rtl,this.left,this.width),c=U(r.font),{color:h,padding:d}=r,u=c.size,f=u/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=No(r,u),y=this.isHorizontal(),x=this._computeTitleHeight();g=y?{x:G(o,this.left+d,this.right-n[0]),y:this.top+d+x,line:0}:{x:this.left+d,y:G(o,this.top+x+d,this.bottom-t[0].height),line:0},Ds(this.ctx,e.textDirection);const w=b+d;this.legendItems.forEach((M,S)=>{s.strokeStyle=M.fontColor||h,s.fillStyle=M.fontColor||h;const k=s.measureText(M.text).width,L=l.textAlign(M.textAlign||(M.textAlign=r.textAlign)),R=p+f+k;let D=g.x,$=g.y;l.setWidth(this.width),y?S>0&&D+R+d>this.right&&($=g.y+=w,g.line++,D=g.x=G(o,this.left+d,this.right-n[g.line])):S>0&&$+w>this.bottom&&(D=g.x=D+t[g.line].width+d,g.line++,$=g.y=G(o,this.top+x+d,this.bottom-t[g.line].height)),function(M,S,k){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const L=C(k.lineWidth,1);if(s.fillStyle=C(k.fillStyle,a),s.lineCap=C(k.lineCap,"butt"),s.lineDashOffset=C(k.lineDashOffset,0),s.lineJoin=C(k.lineJoin,"miter"),s.lineWidth=L,s.strokeStyle=C(k.strokeStyle,a),s.setLineDash(C(k.lineDash,[])),r.usePointStyle){const R={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:L},D=l.xPlus(M,p/2);bs(s,R,D,S+f,r.pointStyleWidth&&p)}else{const R=S+Math.max((u-m)/2,0),D=l.leftForLtr(M,p),$=Ct(k.borderRadius);s.beginPath(),Object.values($).some(Z=>0!==Z)?ae(s,{x:D,y:R,w:p,h:m,radius:$}):s.rect(D,R,p,m),s.fill(),0!==L&&s.stroke()}s.restore()}(l.x(D),$,M),D=((i,e,t,n)=>i===(n?"left":"right")?t:"center"===i?(e+t)/2:e)(L,D+p+f,y?D+R:this.right,e.rtl),function(M,S,k){Pt(s,k.text,M,S+b/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})}(l.x(D),$,M),y?g.x+=R+d:g.y+=w}),Ls(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,n=U(t.font),s=K(t.padding);if(!t.display)return;const o=Wt(e.rtl,this.left,this.width),r=this.ctx,a=t.position,c=s.top+n.size/2;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=G(e.align,d,this.right-u);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+G(e.align,this.top,this.bottom-g-e.labels.padding-this._computeTitleHeight())}const f=G(a,d,d+u);r.textAlign=o.textAlign(wi(a)),r.textBaseline="middle",r.strokeStyle=t.color,r.fillStyle=t.color,r.font=n.string,Pt(r,t.text,f,h,n)}_computeTitleHeight(){const e=this.options.title,t=U(e.font),n=K(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,s,o;if(dt(e,this.left,this.right)&&dt(t,this.top,this.bottom))for(o=this.legendHitBoxes,n=0;nnull!==i&&null!==e&&i.datasetIndex===e.datasetIndex&&i.index===e.index)(s,n);s&&!o&&B(t.onLeave,[e,s,this],this),this._hoveredItem=n,n&&!o&&B(t.onHover,[e,n,this],this)}else n&&B(t.onClick,[e,n,this],this)}}var Tg={id:"legend",_element:Vo,start(i,e,t){const n=i.legend=new Vo({ctx:i.ctx,options:t,chart:i});q.configure(i,n,t),q.addBox(i,n)},stop(i){q.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,e,t){const n=i.legend;q.configure(i,n,t),n.options=t},afterUpdate(i){const e=i.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(i,e){e.replay||i.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,e,t){const n=e.datasetIndex,s=t.chart;s.isDatasetVisible(n)?(s.hide(n),e.hidden=!0):(s.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const e=i.data.datasets,{labels:{usePointStyle:t,pointStyle:n,textAlign:s,color:o}}=i.legend.options;return i._getSortedDatasetMetas().map(r=>{const a=r.controller.getStyle(t?0:void 0),l=K(a.borderWidth);return{text:e[r.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!r.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:n||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:r.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Qi extends ot{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const s=z(n.text)?n.text.length:1;this._padding=K(n.padding);const o=s*U(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:n,bottom:s,right:o,options:r}=this,a=r.align;let c,h,d,l=0;return this.isHorizontal()?(h=G(a,n,o),d=t+e,c=o-n):("left"===r.position?(h=n+e,d=G(a,s,t),l=-.5*N):(h=o-e,d=G(a,t,s),l=.5*N),c=s-t),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=U(t.font),o=n.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Pt(e,t.text,0,0,n,{color:t.color,maxWidth:l,rotation:c,textAlign:wi(t.align),textBaseline:"middle",translation:[r,a]})}}var Lg={id:"title",_element:Qi,start(i,e,t){!function Dg(i,e){const t=new Qi({ctx:i.ctx,options:e,chart:i});q.configure(i,t,e),q.addBox(i,t),i.titleBlock=t}(i,t)},stop(i){q.removeBox(i,i.titleBlock),delete i.titleBlock},beforeUpdate(i,e,t){const n=i.titleBlock;q.configure(i,n,t),n.options=t},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ei=new WeakMap;var Eg={id:"subtitle",start(i,e,t){const n=new Qi({ctx:i.ctx,options:t,chart:i});q.configure(i,n,t),q.addBox(i,n),ei.set(i,n)},stop(i){q.removeBox(i,ei.get(i)),ei.delete(i)},beforeUpdate(i,e,t){const n=ei.get(i);q.configure(i,n,t),n.options=t},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const _e={average(i){if(!i.length)return!1;let e,t,n=0,s=0,o=0;for(e=0,t=i.length;e-1?i.split("\n"):i}function Rg(i,e){const{element:t,datasetIndex:n,index:s}=e,o=i.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:i,label:r,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:t}}function Ho(i,e){const t=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:r,boxHeight:a}=e,l=U(e.bodyFont),c=U(e.titleFont),h=U(e.footerFont),d=o.length,u=s.length,f=n.length,g=K(e.padding);let p=g.height,m=0,b=n.reduce((y,x)=>y+x.before.length+x.lines.length+x.after.length,0);b+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(p+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let _=0;const v=function(y){m=Math.max(m,t.measureText(y).width+_)};return t.save(),t.font=c.string,I(i.title,v),t.font=l.string,I(i.beforeBody.concat(i.afterBody),v),_=e.displayColors?r+2+e.boxPadding:0,I(n,y=>{I(y.before,v),I(y.lines,v),I(y.after,v)}),_=0,t.font=h.string,I(i.footer,v),t.restore(),m+=g.width,{width:m,height:p}}function zg(i,e,t,n){const{x:s,width:o}=t,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),function Fg(i,e,t,n){const{x:s,width:o}=n,r=t.caretSize+t.caretPadding;if("left"===i&&s+o+r>e.width||"right"===i&&s-o-r<0)return!0}(c,i,e,t)&&(c="center"),c}function Wo(i,e,t){const n=t.yAlign||e.yAlign||function Ig(i,e){const{y:t,height:n}=e;return ti.height-n/2?"bottom":"center"}(i,t);return{xAlign:t.xAlign||e.xAlign||zg(i,e,t,n),yAlign:n}}function $o(i,e,t,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=t,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Ct(r);let g=function Bg(i,e){let{x:t,width:n}=i;return"right"===e?t-=n:"center"===e&&(t-=n/2),t}(e,a);const p=function jg(i,e,t){let{y:n,height:s}=i;return"top"===e?n+=t:n-="bottom"===e?s+t:s/2,n}(e,l,c);return"center"===l?"left"===a?g+=c:"right"===a&&(g-=c):"left"===a?g-=Math.max(h,u)+s:"right"===a&&(g+=Math.max(d,f)+s),{x:X(g,0,n.width-e.width),y:X(p,0,n.height-e.height)}}function ii(i,e,t){const n=K(t.padding);return"center"===e?i.x+i.width/2:"right"===e?i.x+i.width-n.right:i.x+n.left}function Yo(i){return ct([],pt(i))}function Uo(i,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?i.override(t):i}let Xo=(()=>{class i extends ot{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 n=this.chart,s=this.options.setContext(this.getContext()),o=s.enabled&&n.options.animation&&s.animations,r=new Ns(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=function Ng(i,e,t){return yt(i,{tooltip:e,tooltipItems:t,type:"tooltip"})}(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:s}=n,o=s.beforeTitle.apply(this,[t]),r=s.title.apply(this,[t]),a=s.afterTitle.apply(this,[t]);let l=[];return l=ct(l,pt(o)),l=ct(l,pt(r)),l=ct(l,pt(a)),l}getBeforeBody(t,n){return Yo(n.callbacks.beforeBody.apply(this,[t]))}getBody(t,n){const{callbacks:s}=n,o=[];return I(t,r=>{const a={before:[],lines:[],after:[]},l=Uo(s,r);ct(a.before,pt(l.beforeLabel.call(this,r))),ct(a.lines,l.label.call(this,r)),ct(a.after,pt(l.afterLabel.call(this,r))),o.push(a)}),o}getAfterBody(t,n){return Yo(n.callbacks.afterBody.apply(this,[t]))}getFooter(t,n){const{callbacks:s}=n,o=s.beforeFooter.apply(this,[t]),r=s.footer.apply(this,[t]),a=s.afterFooter.apply(this,[t]);let l=[];return l=ct(l,pt(o)),l=ct(l,pt(r)),l=ct(l,pt(a)),l}_createItems(t){const n=this._active,s=this.chart.data,o=[],r=[],a=[];let c,h,l=[];for(c=0,h=n.length;ct.filter(d,u,f,s))),t.itemSort&&(l=l.sort((d,u)=>t.itemSort(d,u,s))),I(l,d=>{const u=Uo(t.callbacks,d);o.push(u.labelColor.call(this,d)),r.push(u.labelPointStyle.call(this,d)),a.push(u.labelTextColor.call(this,d))}),this.labelColors=o,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=l,l}update(t,n){const s=this.options.setContext(this.getContext()),o=this._active;let r,a=[];if(o.length){const l=_e[s.position].call(this,o,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const c=this._size=Ho(this,s),h=Object.assign({},l,c),d=Wo(this.chart,s,h),u=$o(s,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,r={opacity:1,x:u.x,y:u.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,s,o){const r=this.getCaretPosition(t,s,o);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,s){const{xAlign:o,yAlign:r}=this,{caretSize:a,cornerRadius:l}=s,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:u}=Ct(l),{x:f,y:g}=t,{width:p,height:m}=n;let b,_,v,y,x,w;return"center"===r?(x=g+m/2,"left"===o?(b=f,_=b-a,y=x+a,w=x-a):(b=f+p,_=b+a,y=x-a,w=x+a),v=b):(_="left"===o?f+Math.max(c,d)+a:"right"===o?f+p-Math.max(h,u)-a:this.caretX,"top"===r?(y=g,x=y-a,b=_-a,v=_+a):(y=g+m,x=y+a,b=_+a,v=_-a),w=y),{x1:b,x2:_,x3:v,y1:y,y2:x,y3:w}}drawTitle(t,n,s){const o=this.title,r=o.length;let a,l,c;if(r){const h=Wt(s.rtl,this.x,this.width);for(t.x=ii(this,s.titleAlign,s),n.textAlign=h.textAlign(s.titleAlign),n.textBaseline="middle",a=U(s.titleFont),l=s.titleSpacing,n.fillStyle=s.titleColor,n.font=a.string,c=0;c0!==y)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ae(t,{x:b,y:m,w:h,h:c,radius:v}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ae(t,{x:_,y:m+1,w:h-2,h:c-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,m,h,c),t.strokeRect(b,m,h,c),t.fillStyle=a.backgroundColor,t.fillRect(_,m+1,h-2,c-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,n,s){const{body:o}=this,{bodySpacing:r,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:h,boxPadding:d}=s,u=U(s.bodyFont);let f=u.lineHeight,g=0;const p=Wt(s.rtl,this.x,this.width),m=function(k){n.fillText(k,p.x(t.x+g),t.y+f/2),t.y+=f+r},b=p.textAlign(a);let _,v,y,x,w,M,S;for(n.textAlign=a,n.textBaseline="middle",n.font=u.string,t.x=ii(this,b,s),n.fillStyle=s.bodyColor,I(this.beforeBody,m),g=l&&"right"!==b?"center"===a?h/2+d:h+2+d:0,x=0,M=o.length;x0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,s=this.$animations,o=s&&s.x,r=s&&s.y;if(o||r){const a=_e[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Ho(this,t),c=Object.assign({},a,this._size),h=Wo(n,t,c),d=$o(t,c,h,n);(o._to!==d.x||r._to!==d.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},r={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=K(n.padding);n.enabled&&(this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length)&&(t.save(),t.globalAlpha=s,this.drawBackground(r,t,o,n),Ds(t,n.textDirection),r.y+=a.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),Ls(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const s=this._active,o=t.map(({datasetIndex:l,index:c})=>{const h=this.chart.getDatasetMeta(l);if(!h)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:h.data[c],index:c}}),r=!Ae(s,o),a=this._positionChanged(o,n);(r||a)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,s=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,r=this._active||[],a=this._getActiveElements(t,r,n,s),l=this._positionChanged(a,t),c=n||!Ae(a,r)||l;return c&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,s,o){const r=this.options;if("mouseout"===t.type)return[];if(!o)return n;const a=this.chart.getElementsAtEventForMode(t,r.mode,r,s);return r.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:s,caretY:o,options:r}=this,a=_e[r.position].call(this,t,n);return!1!==a&&(s!==a.x||o!==a.y)}}return i.positioners=_e,i})();var Vg={id:"tooltip",_element:Xo,positioners:_e,afterInit(i,e,t){t&&(i.tooltip=new Xo({chart:i,options:t}))},beforeUpdate(i,e,t){i.tooltip&&i.tooltip.initialize(t)},reset(i,e,t){i.tooltip&&i.tooltip.initialize(t)},afterDraw(i){const e=i.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(!1===i.notifyPlugins("beforeTooltipDraw",t))return;e.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",t)}},afterEvent(i,e){i.tooltip&&i.tooltip.handleEvent(e.event,e.replay,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:(i,e)=>e.bodyFont.size,boxWidth:(i,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:ht,title(i){if(i.length>0){const e=i[0],t=e.chart.data.labels,n=t?t.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"!==i&&"itemSort"!==i&&"external"!==i,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Hg=Object.freeze({__proto__:null,Decimation:ag,Filler:Cg,Legend:Tg,SubTitle:Eg,Title:Lg,Tooltip:Vg});class ni extends Dt{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const n=this.getLabels();for(const{index:s,label:o}of t)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(E(e))return null;const n=this.getLabels();return((i,e)=>null===i?null:X(Math.round(i),0,e))(t=isFinite(t)&&n[t]===e?t:function $g(i,e,t,n){const s=i.indexOf(e);return-1===s?((i,e,t,n)=>("string"==typeof e?(t=i.push(e)-1,n.unshift({index:t,label:e})):isNaN(e)&&(t=null),t))(i,e,t,n):s!==i.lastIndexOf(e)?t:s}(n,e,C(t,e),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(n=0),t||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,s=[];let o=this.getLabels();o=0===e&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=e;r<=t;r++)s.push({value:r});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function Go(i,e,{horizontal:t,minRotation:n}){const s=st(n),o=(t?Math.sin(s):Math.cos(s))||.001;return Math.min(e/o,.75*e*(""+i).length)}ni.id="category",ni.defaults={ticks:{callback:ni.prototype.getLabelForValue}};class si extends Dt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return E(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=t?s:l,a=l=>o=n?o:l;if(e){const l=rt(s),c=rt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=1;(o>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(.05*o)),a(o+l),e||r(s-l)}this.min=s,this.max=o}getTickLimit(){const e=this.options.ticks;let s,{maxTicksLimit:t,stepSize:n}=e;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const r=function Ug(i,e){const t=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,g=h-1,{min:p,max:m}=e,b=!E(r),_=!E(a),v=!E(c),y=(m-p)/(d+1);let w,M,S,k,x=Xn((m-p)/g/f)*f;if(x<1e-14&&!b&&!_)return[{value:p},{value:m}];k=Math.ceil(m/x)-Math.floor(p/x),k>g&&(x=Xn(k*x/g/f)*f),E(l)||(w=Math.pow(10,l),x=Math.ceil(x*w)/w),"ticks"===s?(M=Math.floor(p/x)*x,S=Math.ceil(m/x)*x):(M=p,S=m),b&&_&&o&&function Sh(i,e){const t=Math.round(i);return t-e<=i&&t+e>=i}((a-r)/o,x/1e3)?(k=Math.round(Math.min((a-r)/x,h)),x=(a-r)/k,M=r,S=a):v?(M=b?r:M,S=_?a:S,k=c-1,x=(S-M)/k):(k=(S-M)/x,k=te(k,Math.round(k),x/1e3)?Math.round(k):Math.ceil(k));const L=Math.max(Kn(x),Kn(M));w=Math.pow(10,E(l)?L:l),M=Math.round(M*w)/w,S=Math.round(S*w)/w;let R=0;for(b&&(u&&M!==r?(t.push({value:r}),M0?n:null;this._zero=!0}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=H(e)?Math.max(0,e):null,this.max=H(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let n=this.min,s=this.max;const o=l=>n=e?n:l,r=l=>s=t?s:l,a=(l,c)=>Math.pow(10,Math.floor(it(l))+c);n===s&&(n<=0?(o(1),r(10)):(o(a(n,-1)),r(a(s,1)))),n<=0&&o(a(s,-1)),s<=0&&r(a(n,1)),this._zero&&this.min!==this._suggestedMin&&n===a(this.min,0)&&o(a(n,-1)),this.min=n,this.max=s}buildTicks(){const e=this.options,n=function Xg(i,e){const t=Math.floor(it(e.max)),n=Math.ceil(e.max/Math.pow(10,t)),s=[];let o=tt(i.min,Math.pow(10,Math.floor(it(e.min)))),r=Math.floor(it(o)),a=Math.floor(o/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do{s.push({value:o,major:Ko(o)}),++a,10===a&&(a=1,++r,l=r>=0?1:l),o=Math.round(a*Math.pow(10,r)*l)/l}while(rs?{start:e-t,end:e}:{start:e,end:e+t}}function qg(i,e,t,n,s){const o=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t));let a=0,l=0;n.starte.r&&(a=(n.end-e.r)/o,i.r=Math.max(i.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/r,i.b=Math.max(i.b,e.b+l))}function Jg(i){return 0===i||180===i?"center":i<180?"left":"right"}function Qg(i,e,t){return"right"===t?i-=e:"center"===t&&(i-=e/2),i}function tp(i,e,t){return 90===t||270===t?i-=e/2:(t>270||t<90)&&(i-=e),i}function Zo(i,e,t,n){const{ctx:s}=i;if(t)s.arc(i.xCenter,i.yCenter,e,0,F);else{let o=i.getPointPosition(0,e);s.moveTo(o.x,o.y);for(let r=1;r{const s=B(this.options.pointLabels.callback,[t,n],this);return s||0===s?s:""}).filter((t,n)=>this.chart.getDataVisibility(n))}fit(){const e=this.options;e.display&&e.pointLabels.display?function Kg(i){const e={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},t=Object.assign({},e),n=[],s=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?N/o:0;for(let l=0;l=0&&e=0;s--){const o=n.setContext(i.getPointLabelContext(s)),r=U(o.font),{x:a,y:l,textAlign:c,left:h,top:d,right:u,bottom:f}=i._pointLabelItems[s],{backdropColor:g}=o;if(!E(g)){const p=Ct(o.borderRadius),m=K(o.backdropPadding);t.fillStyle=g;const b=h-m.left,_=d-m.top,v=u-h+m.width,y=f-d+m.height;Object.values(p).some(x=>0!==x)?(t.beginPath(),ae(t,{x:b,y:_,w:v,h:y,radius:p}),t.fill()):t.fillRect(b,_,v,y)}Pt(t,i._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),s.display&&this.ticks.forEach((c,h)=>{0!==h&&(a=this.getDistanceFromCenterForValue(c.value),function ip(i,e,t,n){const s=i.ctx,o=e.circular,{color:r,lineWidth:a}=e;!o&&!n||!r||!a||t<0||(s.save(),s.strokeStyle=r,s.lineWidth=a,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),Zo(i,t,o,n),s.closePath(),s.stroke(),s.restore())}(this,s.setContext(this.getContext(h-1)),a,o))}),n.display){for(e.save(),r=o-1;r>=0;r--){const c=n.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(e.lineWidth=d,e.strokeStyle=h,e.setLineDash(c.borderDash),e.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),l=this.getPointPosition(r,a),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,r;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(0===l&&!t.reverse)return;const c=n.setContext(this.getContext(l)),h=U(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){e.font=h.string,r=e.measureText(a.label).width,e.fillStyle=c.backdropColor;const d=K(c.backdropPadding);e.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}Pt(e,a.label,0,-o,h,{color:c.color})}),e.restore()}drawTitle(){}}xe.id="radialLinear",xe.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:We.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:i=>i,padding:5,centerPointLabels:!1}},xe.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},xe.descriptors={angleLines:{_fallback:"grid"}};const oi={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}},J=Object.keys(oi);function sp(i,e){return i-e}function Jo(i,e){if(E(e))return null;const t=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),H(r)||(r="string"==typeof n?t.parse(r,n):t.parse(r)),null===r?null:(s&&(r="week"!==s||!jt(o)&&!0!==o?t.startOf(r,s):t.startOf(r,"isoWeek",o)),+r)}function Qo(i,e,t,n){const s=J.length;for(let o=J.indexOf(i);o=e?t[n]:t[s]]=!0}}else i[e]=!0}function er(i,e,t){const n=[],s={},o=e.length;let r,a;for(r=0;r=0&&(e[l].major=!0);return e}(i,n,s,t):n}let sn=(()=>{class i extends Dt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n){const s=t.time||(t.time={}),o=this._adapter=new Yu._date(t.adapters.date);o.init(n),Jt(s.displayFormats,o.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return void 0===t?null:Jo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,s=t.time.unit||"day";let{min:o,max:r,minDefined:a,maxDefined:l}=this.getUserBounds();function c(h){!a&&!isNaN(h.min)&&(o=Math.min(o,h.min)),!l&&!isNaN(h.max)&&(r=Math.max(r,h.max))}(!a||!l)&&(c(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&c(this.getMinMax(!1))),o=H(o)&&!isNaN(o)?o:+n.startOf(Date.now(),s),r=H(r)&&!isNaN(r)?r:+n.endOf(Date.now(),s)+1,this.min=Math.min(o,r-1),this.max=Math.max(o+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],s=t[t.length-1]),{min:n,max:s}}buildTicks(){const t=this.options,n=t.time,s=t.ticks,o="labels"===s.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const r=this.min,l=function Oh(i,e,t){let n=0,s=i.length;for(;nn&&i[s-1]>t;)s--;return n>0||s=J.indexOf(t);o--){const r=J[o];if(oi[r].common&&i._adapter.diff(s,n,r)>=e-1)return r}return J[t?J.indexOf(t):0]}(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=s.major.enabled&&"year"!==this._unit?function rp(i){for(let e=J.indexOf(i)+1,t=J.length;e+t.value))}initOffsets(t){let o,r,n=0,s=0;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),n=1===t.length?1-o:(this.getDecimalForValue(t[1])-o)/2,r=this.getDecimalForValue(t[t.length-1]),s=1===t.length?r:(r-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=X(n,0,a),s=X(s,0,a),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,n=this.min,s=this.max,o=this.options,r=o.time,a=r.unit||Qo(r.minUnit,n,s,this._getLabelCapacity(n)),l=C(r.stepSize,1),c="week"===a&&r.isoWeekday,h=jt(c)||!0===c,d={};let f,g,u=n;if(h&&(u=+t.startOf(u,"isoWeek",c)),u=+t.startOf(u,h?"day":a),t.diff(s,n,a)>1e5*l)throw new Error(n+" and "+s+" are too far apart with stepSize of "+l+" "+a);const p="data"===o.ticks.source&&this.getDataTimestamps();for(f=u,g=0;fm-b).map(m=>+m)}getLabelForValue(t){const s=this.options.time;return this._adapter.format(t,s.tooltipFormat?s.tooltipFormat:s.displayFormats.datetime)}_tickFormatFunction(t,n,s,o){const r=this.options,a=r.time.displayFormats,l=this._unit,c=this._majorUnit,d=c&&a[c],u=s[n],g=this._adapter.format(t,o||(c&&d&&u&&u.major?d:l&&a[l])),p=r.ticks.callback;return p?B(p,[g,n,s],this):g}generateTickLabels(t){let n,s,o;for(n=0,s=t.length;n0?l:1}getDataTimestamps(){let n,s,t=this._cache.data||[];if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,s=o.length;n=i[n].pos&&e<=i[s].pos&&({lo:n,hi:s}=ut(i,"pos",e)),({pos:o,time:a}=i[n]),({pos:r,time:l}=i[s])):(e>=i[n].time&&e<=i[s].time&&({lo:n,hi:s}=ut(i,"time",e)),({time:o,pos:a}=i[n]),({time:r,pos:l}=i[s]));const c=r-o;return c?a+(l-a)*(e-o)/c:a}class on extends sn{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=ri(t,this.min),this._tableRange=ri(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,s=[],o=[];let r,a,l,c,h;for(r=0,a=e.length;r=t&&c<=n&&s.push(c);if(s.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(r=0,a=s.length;r{const{chart:e,tooltip:t}=i,n=(i=>{let e=i.canvas.parentNode.querySelector("div");if(!e){e=document.createElement("div"),e.classList.add("chartjs-tooltip");const t=document.createElement("table");t.style.margin="0px",e.appendChild(t),i.canvas.parentNode.appendChild(e)}return e})(e);if(0===t.opacity)return void(n.style.opacity=0);if(t.body){const r=t.title||[],a=t.body.map(d=>d.lines),l=document.createElement("thead");l.classList.add("chartjs-tooltip-header"),r.forEach(d=>{const u=document.createElement("tr");u.style.borderWidth=0,u.classList.add("chartjs-tooltip-header-item");const f=document.createElement("th");f.style.borderWidth=0;const g=document.createTextNode(d);f.appendChild(g),u.appendChild(f),l.appendChild(u)});const c=document.createElement("tbody");c.classList.add("chartjs-tooltip-body"),a.forEach((d,u)=>{const f=t.labelColors[u],g=document.createElement("span");g.style.background=f.backgroundColor,g.style.borderColor=f.borderColor,g.style.borderWidth="2px",g.style.marginRight="10px",g.style.height="10px",g.style.width="10px",g.style.display="inline-block";const p=document.createElement("tr");p.classList.add("chartjs-tooltip-body-item");const m=document.createElement("td");m.style.borderWidth=0;const b=document.createTextNode(d);m.appendChild(g),m.appendChild(b),p.appendChild(m),c.appendChild(p)});const h=n.querySelector("table");for(;h.firstChild;)h.firstChild.remove();h.appendChild(l),h.appendChild(c)}const{offsetLeft:s,offsetTop:o}=e.canvas;n.style.opacity=1,n.style.left=s+t.caretX+"px",n.style.top=o+t.caretY+"px",n.style.font=t.options.bodyFont.string,n.style.padding=t.padding+"px "+t.padding+"px"},up=["canvasElement"],fp=["*"];Ze.register($u,ng,Hg,Object.freeze({__proto__:null,CategoryScale:ni,LinearScale:tn,LogarithmicScale:en,RadialLinearScale:xe,TimeScale:sn,TimeSeriesScale:on}));let gp=0,pp=(()=>{class i{get hostClasses(){return{"chart-wrapper":this.wrapper}}constructor(t,n,s,o){this.elementRef=t,this.ngZone=n,this.renderer=s,this.changeDetectorRef=o,this.customTooltips=!0,this.id="c-chartjs-"+gp++,this.plugins=[],this.redraw=!1,this.type="bar",this.wrapper=!0,this.getDatasetAtEvent=new O.bkB,this.getElementAtEvent=new O.bkB,this.getElementsAtEvent=new O.bkB,this.chartRef=new O.bkB}ngAfterViewInit(){this.chartRender()}ngOnChanges(t){t.data&&!t.data.firstChange&&this.chartUpdate()}ngOnDestroy(){this.chartDestroy()}handleClick(t){if(!this.chart)return;const n=this.chart.getElementsAtEventForMode(t,"dataset",{intersect:!0},!1);this.getDatasetAtEvent.emit(n);const s=this.chart.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1);this.getElementAtEvent.emit(s);const o=this.chart.getElementsAtEventForMode(t,"index",{intersect:!0},!1);this.getElementsAtEvent.emit(o)}chartDestroy(){this.chart?.destroy(),this.chartRef.emit(void 0)}chartRender(){if(!this.canvasElement)return;const t=this.canvasElement.nativeElement.getContext("2d");this.ngZone.runOutsideAngular(()=>{const n=this.chartConfig();n&&setTimeout(()=>{this.chart=new Ze(t,n),this.renderer.setStyle(this.canvasElement.nativeElement,"display","block"),this.changeDetectorRef.markForCheck(),this.chartRef.emit(this.chart)})})}chartUpdate(){if(!this.chart)return;if(this.redraw)return this.chartDestroy(),void setTimeout(()=>{this.chartRender()});const t=this.chartConfig();this.options&&Object.assign(this.chart.options??{},t.options??{}),this.chart.config.data||(this.chart.config.data={...t.data},this.chartUpdateOutsideAngular()),this.chart&&(Object.assign(this.chart.config.options??{},t.options??{}),Object.assign(this.chart.config.plugins??[],t.plugins??[]),Object.assign(this.chart.config.data,t.data)),this.chartUpdateOutsideAngular()}chartUpdateOutsideAngular(){setTimeout(()=>{this.ngZone.runOutsideAngular(()=>{this.chart?.update(),this.changeDetectorRef.markForCheck()})})}chartToBase64Image(){return this.chart?.toBase64Image()}chartDataConfig(){return{labels:this.data?.labels??[],datasets:this.data?.datasets??[]}}chartOptions(){return this.options}chartConfig(){return this.chartCustomTooltips(),{data:this.chartDataConfig(),options:this.chartOptions(),plugins:this.plugins,type:this.type}}chartCustomTooltips(){if(this.customTooltips){const t=this.options,n=this.options?.plugins,s=this.options?.plugins?.tooltip;this.options=fh({...t,plugins:{...n,tooltip:{...s,enabled:!1,mode:"index",position:"nearest",external:dp}}})}}static#t=this.\u0275fac=function(n){return new(n||i)(O.rXU(O.aKT),O.rXU(O.SKi),O.rXU(O.sFG),O.rXU(O.gRc))};static#e=this.\u0275cmp=O.VBU({type:i,selectors:[["c-chart"]],viewQuery:function(n,s){if(1&n&&O.GBs(up,5),2&n){let o;O.mGM(o=O.lsd())&&(s.canvasElement=o.first)}},hostVars:6,hostBindings:function(n,s){2&n&&(O.HbH(s.hostClasses),O.xc7("height",s.height,"px")("width",s.width,"px"))},inputs:{customTooltips:"customTooltips",data:"data",height:[O.Mj6.HasDecoratorInputTransform,"height","height",t=>(0,O.Udg)(t,void 0)],id:"id",options:"options",plugins:"plugins",redraw:[O.Mj6.HasDecoratorInputTransform,"redraw","redraw",O.L39],type:"type",width:[O.Mj6.HasDecoratorInputTransform,"width","width",t=>(0,O.Udg)(t,void 0)],wrapper:"wrapper"},outputs:{getDatasetAtEvent:"getDatasetAtEvent",getElementAtEvent:"getElementAtEvent",getElementsAtEvent:"getElementsAtEvent",chartRef:"chartRef"},exportAs:["cChart"],standalone:!0,features:[O.GFd,O.OA$,O.aNF],ngContentSelectors:fp,decls:3,vars:3,consts:[["canvasElement",""],["role","img",2,"display","none",3,"click","height","id","width"]],template:function(n,s){if(1&n){const o=O.RV6();O.NAR(),O.j41(0,"canvas",1,0),O.bIt("click",function(a){return O.eBV(o),O.Njj(s.handleClick(a))}),O.SdG(2),O.k0s()}2&n&&O.Y8G("height",s.height)("id",s.id)("width",s.width)},styles:[".chart-wrapper[_nghost-%COMP%]{display:block}"],changeDetection:0})}return i})(),mp=(()=>{class i{static#t=this.\u0275fac=function(n){return new(n||i)};static#e=this.\u0275mod=O.$C({type:i});static#i=this.\u0275inj=O.G2t({})}return i})()}}]);