!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,function(){"use strict";const C="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function O(e,i,t){const s=t||(t=>Array.prototype.slice.call(t));let a=!1,r;return function(...t){r=s(t),a||(a=!0,C.call(window,()=>{a=!1,e.apply(i,r)}))}}function A(e,i){let s;return function(...t){return i?(clearTimeout(s),s=setTimeout(e,i,t)):e.apply(this,t),i}}const T=t=>"start"===t?"left":"end"===t?"right":"center",L=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,W=(t,e,i,s)=>{return t===(s?"left":"right")?i:"center"===t?(e+i)/2:e};var n=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,i,s,t){const a=i.listeners[t],r=i.duration;a.forEach(t=>t({chart:e,initial:i.initial,numSteps:r,currentStep:Math.min(s-i.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=C.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((s,a)=>{if(s.running&&s.items.length){const r=s.items;let t=r.length-1,e=!1,i;for(;0<=t;--t)(i=r[t])._active?(i._total>s.duration&&(s.duration=i._total),i.tick(n),e=!0):(r[t]=r[r.length-1],r.pop());e&&(a.draw(),this._notify(a,s,n,"progress")),r.length||(s.running=!1,this._notify(a,s,n,"complete"),s.initial=!1),o+=r.length}}),this._lastDate=n,0===o&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return 0<this._getAnims(t).items.length}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;t=this._charts.get(t);return!!(t&&t.running&&t.items.length)}stop(e){const i=this._charts.get(e);if(i&&i.items.length){const s=i.items;let t=s.length-1;for(;0<=t;--t)s[t].cancel();i.items=[],this._notify(e,i,Date.now(),"complete")}}remove(t){return this._charts.delete(t)}};const r={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},N="0123456789ABCDEF",H=t=>N[15&t],j=t=>N[(240&t)>>4]+N[15&t],Y=t=>(240&t)>>4==(15&t);function $(t){e=t;var e=Y(e.r)&&Y(e.g)&&Y(e.b)&&Y(e.a)?H:j;return t&&"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):"")}function U(t){return t+.5|0}const X=(t,e,i)=>Math.max(Math.min(t,i),e);function q(t){return X(U(2.55*t),0,255)}function K(t){return X(U(255*t),0,255)}function G(t){return X(U(t/2.55)/100,0,1)}function Z(t){return X(U(100*t),0,100)}const Q=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const J=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function tt(i,t,s){const a=t*Math.min(s,1-s);t=(t,e=(t+i/30)%12)=>s-a*Math.max(Math.min(e-3,9-e,1),-1);return[t(0),t(8),t(4)]}function et(i,s,a){var t=(t,e=(t+i/60)%6)=>a-a*s*Math.max(Math.min(e,4-e,1),0);return[t(5),t(3),t(1)]}function it(t,e,i){const s=tt(t,1,.5);let a;for(1<e+i&&(e*=a=1/(e+i),i*=a),a=0;a<3;a++)s[a]*=1-e-i,s[a]+=e;return s}function st(t){var e=t.r/255,i=t.g/255,t=t.b/255,s=Math.max(e,i,t),a=Math.min(e,i,t),r=(s+a)/2;let n,o,h;return s!==a&&(h=s-a,o=.5<r?h/(2-s-a):h/(s+a),n=60*(n=s===e?(i-t)/h+(i<t?6:0):s===i?(t-e)/h+2:(e-i)/h+4)+.5),[0|n,o||0,r]}function at(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(K)}function rt(t,e,i){return at(tt,t,e,i)}function nt(t){return(t%360+360)%360}function ot(t){var e,i,s,t=J.exec(t);let a=255,r;if(t)return t[5]!==r&&(a=(t[6]?q:K)(+t[5])),e=nt(+t[2]),i=+t[3]/100,s=+t[4]/100,{r:(r="hwb"===t[1]?at(it,e,i,s):"hsv"===t[1]?at(et,e,i,s):rt(e,i,s))[0],g:r[1],b:r[2],a:a}}const ht={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},lt={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let ct;function dt(t){ct||((ct=function(){const t={};var e=Object.keys(lt),i=Object.keys(ht);let s,a,r,n,o;for(s=0;s<e.length;s++){for(n=o=e[s],a=0;a<i.length;a++)r=i[a],o=o.replace(r,ht[r]);r=parseInt(lt[n],16),t[o]=[r>>16&255,r>>8&255,255&r]}return t}()).transparent=[0,0,0,0]);t=ct[t.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}function ut(e,i,s){if(e){let t=st(e);t[i]=Math.max(0,Math.min(t[i]+t[i]*s,0===i?360:1)),t=rt(t),e.r=t[0],e.g=t[1],e.b=t[2]}}function gt(t,e){return t&&Object.assign(e||{},t)}function ft(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?3<=t.length&&(e={r:t[0],g:t[1],b:t[2],a:255},3<t.length&&(e.a=K(t[3]))):(e=gt(t,{r:0,g:0,b:0,a:1})).a=K(e.a),e}function pt(a){if("r"!==a.charAt(0))return ot(a);{var r,a=Q.exec(a);let t=255,e,i,s;if(a)return a[7]!==e&&(r=+a[7],t=255&(a[8]?q(r):255*r)),e=+a[1],i=+a[3],s=+a[5],e=255&(a[2]?q(e):e),i=255&(a[4]?q(i):i),s=255&(a[6]?q(s):s),{r:e,g:i,b:s,a:t}}}class mt{constructor(t){if(t instanceof mt)return t;var e,i,s=typeof t;let a;"object"==s?a=ft(t):"string"==s&&(a=(i=(s=t).length,"#"===s[0]&&(4===i||5===i?e={r:255&17*r[s[1]],g:255&17*r[s[2]],b:255&17*r[s[3]],a:5===i?17*r[s[4]]:255}:7!==i&&9!==i||(e={r:r[s[1]]<<4|r[s[2]],g:r[s[3]]<<4|r[s[4]],b:r[s[5]]<<4|r[s[6]],a:9===i?r[s[7]]<<4|r[s[8]]:255})),e||dt(t)||pt(t))),this._rgb=a,this._valid=!!a}get valid(){return this._valid}get rgb(){var t=gt(this._rgb);return t&&(t.a=G(t.a)),t}set rgb(t){this._rgb=ft(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${G(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?$(this._rgb):this._rgb}hslString(){if(!this._valid)return this._rgb;var t,e,i,s=this._rgb;return s?(i=st(s),t=i[0],e=Z(i[1]),i=Z(i[2]),s.a<255?`hsla(${t}, ${e}%, ${i}%, ${G(s.a)})`:`hsl(${t}, ${e}%, ${i}%)`):void 0}mix(t,e){if(t){const a=this.rgb;var t=t.rgb,e=void 0===e?.5:e,i=2*e-1,s=a.a-t.a,i=(1+(i*s==-1?i:(i+s)/(1+i*s)))/2,s=1-i;a.r=255&i*a.r+s*t.r+.5,a.g=255&i*a.g+s*t.g+.5,a.b=255&i*a.b+s*t.b+.5,a.a=e*a.a+(1-e)*t.a,this.rgb=a}return this}clone(){return new mt(this.rgb)}alpha(t){return this._rgb.a=K(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb;var e=U(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ut(this._rgb,2,t),this}darken(t){return ut(this._rgb,2,-t),this}saturate(t){return ut(this._rgb,1,t),this}desaturate(t){return ut(this._rgb,1,-t),this}rotate(t){var e,i;return e=this._rgb,t=t,(i=st(e))[0]=nt(i[0]+t),i=rt(i),e.r=i[0],e.g=i[1],e.b=i[2],this}}function vt(t){return new mt(t)}const xt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function bt(t){return xt(t)?t:vt(t)}function _t(t){return xt(t)?t:vt(t).saturate(.5).darken(.1).hexString()}function t(){}const yt=function(){let t=0;return function(){return t++}}();function P(t){return null==t}function I(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function F(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const p=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function l(t,e){return p(t)?t:e}function B(t,e){return void 0===t?e:t}const wt=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,Mt=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function c(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function M(t,e,i,s){let a,r,n;if(I(t))if(r=t.length,s)for(a=r-1;0<=a;a--)e.call(i,t[a],a);else for(a=0;a<r;a++)e.call(i,t[a],a);else if(F(t))for(n=Object.keys(t),r=n.length,a=0;a<r;a++)e.call(i,t[n[a]],n[a])}function kt(t,e){let i,s,a,r;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(a=t[i],r=e[i],a.datasetIndex!==r.datasetIndex||a.index!==r.index)return!1;return!0}function St(e){if(I(e))return e.map(St);if(F(e)){const a=Object.create(null);var i=Object.keys(e),s=i.length;let t=0;for(;t<s;++t)a[i[t]]=St(e[i[t]]);return a}return e}function Pt(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function Dt(t,e,i,s){var a;Pt(t)&&(a=e[t],i=i[t],F(a)&&F(i)?Ct(a,i,s):e[t]=St(i))}function Ct(i,s,a){var e=I(s)?s:[s],r=e.length;if(!F(i))return i;const n=(a=a||{}).merger||Dt;for(let t=0;t<r;++t)if(F(s=e[t])){var o=Object.keys(s);for(let t=0,e=o.length;t<e;++t)n(o[t],i,s,a)}return i}function Ot(t,e){return Ct(t,e,{merger:At})}function At(t,e,i){var s;Pt(t)&&(s=e[t],i=i[t],F(s)&&F(i)?Ot(s,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=St(i)))}const Tt="",Lt=".";function Rt(t,e){e=t.indexOf(Lt,e);return-1===e?t.length:e}function Et(t,e){if(e===Tt)return t;let i=0,s=Rt(e,i);for(;t&&s>i;)t=t[e.substr(i,s-i)],i=s+1,s=Rt(e,i);return t}function It(t){return t.charAt(0).toUpperCase()+t.slice(1)}const g=t=>void 0!==t,d=t=>"function"==typeof t,zt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},Ft=Object.create(null),Bt=Object.create(null);function Vt(i,t){if(!t)return i;var s=t.split(".");for(let t=0,e=s.length;t<e;++t){var a=s[t];i=i[a]||(i[a]=Object.create(null))}return i}function Wt(t,e,i){return"string"==typeof e?Ct(Vt(t,e),i):Ct(Vt(t,""),e)}var R=new class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>_t(e.backgroundColor),this.hoverBorderColor=(t,e)=>_t(e.borderColor),this.hoverColor=(t,e)=>_t(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},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.describe(t)}set(t,e){return Wt(this,t,e)}get(t){return Vt(this,t)}describe(t,e){return Wt(Bt,t,e)}override(t,e){return Wt(Ft,t,e)}route(t,e,i,s){t=Vt(this,t);const a=Vt(this,i),r="_"+e;Object.defineProperties(t,{[r]:{value:t[e],writable:!0},[e]:{enumerable:!0,get(){var t=this[r],e=a[s];return F(t)?Object.assign({},e,t):B(t,e)},set(t){this[r]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});const _=Math.PI,m=2*_,Nt=m+_,Ht=Number.POSITIVE_INFINITY,jt=_/180,y=_/2,Yt=_/4,$t=2*_/3,u=Math.log10,S=Math.sign;function Ut(t){var e=Math.round(t),e=(t=Kt(t,e,t/1e3)?e:t,Math.pow(10,Math.floor(u(t)))),t=t/e;return(t<=1?1:t<=2?2:t<=5?5:10)*e}function Xt(t){const e=[];var i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s==0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}function qt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Kt(t,e,i){return Math.abs(t-e)<i}function Gt(t,e){var i=Math.round(t);return i-e<=t&&t<=i+e}function Zt(t,e,i){let s,a,r;for(s=0,a=t.length;s<a;s++)r=t[s][i],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function z(t){return t*(_/180)}function Qt(t){return t*(180/_)}function Jt(i){if(p(i)){let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}}function te(t,e){var i=e.x-t.x,e=e.y-t.y,t=Math.sqrt(i*i+e*e);let s=Math.atan2(e,i);return s<-.5*_&&(s+=m),{angle:s,distance:t}}function ee(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ie(t,e){return(t-e+Nt)%m-_}function h(t){return(t%m+m)%m}function se(t,e,i,s){var t=h(t),e=h(e),i=h(i),a=h(e-t),r=h(i-t),n=h(t-e),o=h(t-i);return t===e||t===i||s&&e===i||r<a&&n<o}function f(t,e,i){return Math.max(e,Math.min(i,t))}function ae(t){return f(t,-32768,32767)}function v(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function re(t){return!t||P(t.size)||P(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function ne(t,e,i,s,a){let r=e[a];return r||(r=e[a]=t.measureText(a).width,i.push(a)),s=r>s?r:s}function oe(t,e,i,s){let a=(s=s||{}).data=s.data||{},r=s.garbageCollect=s.garbageCollect||[],n=(s.font!==e&&(a=s.data={},r=s.garbageCollect=[],s.font=e),t.save(),t.font=e,0);var o=i.length;let h,l,c,d,u;for(h=0;h<o;h++)if(null!=(d=i[h])&&!0!==I(d))n=ne(t,a,r,n,d);else if(I(d))for(l=0,c=d.length;l<c;l++)null==(u=d[l])||I(u)||(n=ne(t,a,r,n,u));t.restore();var g=r.length/2;if(g>i.length){for(h=0;h<g;h++)delete a[r[h]];r.splice(0,g)}return n}function he(t,e,i){t=t.currentDevicePixelRatio,i=0!==i?Math.max(i/2,.5):0;return Math.round((e-i)*t)/t+i}function le(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function ce(t,e,i,s){let a,r,n,o,h;const l=e.pointStyle;var c=e.rotation,d=e.radius;let u=(c||0)*jt;if(l&&"object"==typeof l&&("[object HTMLImageElement]"===(a=l.toString())||"[object HTMLCanvasElement]"===a))return t.save(),t.translate(i,s),t.rotate(u),t.drawImage(l,-l.width/2,-l.height/2,l.width,l.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),l){default:t.arc(i,s,d,0,m),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(u)*d,s-Math.cos(u)*d),u+=$t,t.lineTo(i+Math.sin(u)*d,s-Math.cos(u)*d),u+=$t,t.lineTo(i+Math.sin(u)*d,s-Math.cos(u)*d),t.closePath();break;case"rectRounded":h=.516*d,o=d-h,r=Math.cos(u+Yt)*o,n=Math.sin(u+Yt)*o,t.arc(i-r,s-n,h,u-_,u-y),t.arc(i+n,s-r,h,u-y,u),t.arc(i+r,s+n,h,u,u+y),t.arc(i-n,s+r,h,u+y,u+_),t.closePath();break;case"rect":if(!c){o=Math.SQRT1_2*d,t.rect(i-o,s-o,2*o,2*o);break}u+=Yt;case"rectRot":r=Math.cos(u)*d,n=Math.sin(u)*d,t.moveTo(i-r,s-n),t.lineTo(i+n,s-r),t.lineTo(i+r,s+n),t.lineTo(i-n,s+r),t.closePath();break;case"crossRot":u+=Yt;case"cross":r=Math.cos(u)*d,n=Math.sin(u)*d,t.moveTo(i-r,s-n),t.lineTo(i+r,s+n),t.moveTo(i+n,s-r),t.lineTo(i-n,s+r);break;case"star":r=Math.cos(u)*d,n=Math.sin(u)*d,t.moveTo(i-r,s-n),t.lineTo(i+r,s+n),t.moveTo(i+n,s-r),t.lineTo(i-n,s+r),u+=Yt,r=Math.cos(u)*d,n=Math.sin(u)*d,t.moveTo(i-r,s-n),t.lineTo(i+r,s+n),t.moveTo(i+n,s-r),t.lineTo(i-n,s+r);break;case"line":r=Math.cos(u)*d,n=Math.sin(u)*d,t.moveTo(i-r,s-n),t.lineTo(i+r,s+n);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(u)*d,s+Math.sin(u)*d)}t.fill(),0<e.borderWidth&&t.stroke()}}function de(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function ue(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function ge(t){t.restore()}function fe(t,e,i,s,a){if(!e)return t.lineTo(i.x,i.y);var r;"middle"===a?(r=(e.x+i.x)/2,t.lineTo(r,e.y),t.lineTo(r,i.y)):"after"===a!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y),t.lineTo(i.x,i.y)}function pe(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function me(t,e,i,s,a,r={}){var n=I(e)?e:[e],o=0<r.strokeWidth&&""!==r.strokeColor;let h,l;t.save(),t.font=a.string;var e=t,c=r;for(c.translation&&e.translate(c.translation[0],c.translation[1]),P(c.rotation)||e.rotate(c.rotation),c.color&&(e.fillStyle=c.color),c.textAlign&&(e.textAlign=c.textAlign),c.textBaseline&&(e.textBaseline=c.textBaseline),h=0;h<n.length;++h){l=n[h],o&&(r.strokeColor&&(t.strokeStyle=r.strokeColor),P(r.strokeWidth)||(t.lineWidth=r.strokeWidth),t.strokeText(l,i,s,r.maxWidth)),t.fillText(l,i,s,r.maxWidth),m=p=u=f=d=m=v=m=p=f=g=void 0;var d,u,g=t,f=i,p=s,m=l,v=r;(v.strikethrough||v.underline)&&(m=g.measureText(m),d=f-m.actualBoundingBoxLeft,f=f+m.actualBoundingBoxRight,u=p-m.actualBoundingBoxAscent,p=p+m.actualBoundingBoxDescent,m=v.strikethrough?(u+p)/2:p,g.strokeStyle=g.fillStyle,g.beginPath(),g.lineWidth=v.decorationWidth||2,g.moveTo(d,m),g.lineTo(f,m),g.stroke()),s+=a.lineHeight}t.restore()}function ve(t,e){var{x:e,y:i,w:s,h:a,radius:r}=e;t.arc(e+r.topLeft,i+r.topLeft,r.topLeft,-y,_,!0),t.lineTo(e,i+a-r.bottomLeft),t.arc(e+r.bottomLeft,i+a-r.bottomLeft,r.bottomLeft,_,y,!0),t.lineTo(e+s-r.bottomRight,i+a),t.arc(e+s-r.bottomRight,i+a-r.bottomRight,r.bottomRight,y,0,!0),t.lineTo(e+s,i+r.topRight),t.arc(e+s-r.topRight,i+r.topRight,r.topRight,0,-y,!0),t.lineTo(e+r.topLeft,i)}function xe(e,i,t){t=t||(t=>e[t]<i);let s=e.length-1,a=0;for(var r;1<s-a;)t(r=a+s>>1)?a=r:s=r;return{lo:a,hi:s}}const x=(e,i,s)=>xe(e,s,t=>e[t][i]<s),be=(e,i,s)=>xe(e,s,t=>e[t][i]>=s);function _e(t,e,i){let s=0,a=t.length;for(;s<a&&t[s]<e;)s++;for(;a>s&&t[a-1]>i;)a--;return 0<s||a<t.length?t.slice(s,a):t}const ye=["push","pop","shift","splice","unshift"];function we(a,t){a._chartjs?a._chartjs.listeners.push(t):(Object.defineProperty(a,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ye.forEach(t=>{const i="_onData"+It(t),s=a[t];Object.defineProperty(a,t,{configurable:!0,enumerable:!1,value(...e){var t=s.apply(this,e);return a._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),t}})}))}function Me(e,t){var i=e._chartjs;if(i){const s=i.listeners;i=s.indexOf(t);-1!==i&&s.splice(i,1),0<s.length||(ye.forEach(t=>{delete e[t]}),delete e._chartjs)}}function ke(t){const e=new Set;let i,s;for(i=0,s=t.length;i<s;++i)e.add(t[i]);return e.size===s?t:Array.from(e)}function Se(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Pe(t){let e=t.parentNode;return e=e&&"[object ShadowRoot]"===e.toString()?e.host:e}function De(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const Ce=t=>window.getComputedStyle(t,null);function Oe(t,e){return Ce(t).getPropertyValue(e)}const Ae=["top","right","bottom","left"];function Te(e,i,s){const a={};s=s?"-"+s:"";for(let t=0;t<4;t++){var r=Ae[t];a[r]=parseFloat(e[i+"-"+r+s])||0}return a.width=a.left+a.right,a.height=a.top+a.bottom,a}const Le=(t,e,i)=>(0<t||0<e)&&(!i||!i.shadowRoot);function Re(t,e){var{canvas:i,currentDevicePixelRatio:s}=e,a=Ce(i),r="border-box"===a.boxSizing,n=Te(a,"padding"),a=Te(a,"border","width"),{x:t,y:o,box:h}=function(t,e){var i=(t=t.native||t).touches,{offsetX:s,offsetY:a}=i=i&&i.length?i[0]:t;let r=!1,n,o;return Le(s,a,t.target)?(n=s,o=a):(t=e.getBoundingClientRect(),n=i.clientX-t.left,o=i.clientY-t.top,r=!0),{x:n,y:o,box:r}}(t,i),l=n.left+(h&&a.left),h=n.top+(h&&a.top);let{width:c,height:d}=e;return r&&(c-=n.width+a.width,d-=n.height+a.height),{x:Math.round((t-l)/c*i.width/s),y:Math.round((o-h)/d*i.height/s)}}const Ee=t=>Math.round(10*t)/10;function Ie(t,e,i,s){var a=Ce(t),r=Te(a,"margin"),n=De(a.maxWidth,t,"clientWidth")||Ht,o=De(a.maxHeight,t,"clientHeight")||Ht,t=function(t,e,i){let s,a;if(void 0===e||void 0===i){const l=Pe(t);var r,n,o,h;l?(r=l.getBoundingClientRect(),o=Te(n=Ce(l),"border","width"),h=Te(n,"padding"),e=r.width-h.width-o.width,i=r.height-h.height-o.height,s=De(n.maxWidth,l,"clientWidth"),a=De(n.maxHeight,l,"clientHeight")):(e=t.clientWidth,i=t.clientHeight)}return{width:e,height:i,maxWidth:s||Ht,maxHeight:a||Ht}}(t,e,i);let{width:h,height:l}=t;return"content-box"===a.boxSizing&&(e=Te(a,"border","width"),i=Te(a,"padding"),h-=i.width+e.width,l-=i.height+e.height),h=Math.max(0,h-r.width),l=Math.max(0,s?Math.floor(h/s):l-r.height),h=Ee(Math.min(h,n,t.maxWidth)),l=Ee(Math.min(l,o,t.maxHeight)),h&&!l&&(l=Ee(h/2)),{width:h,height:l}}function ze(t,e,i){var e=e||1,s=Math.floor(t.height*e),a=Math.floor(t.width*e);t.height=s/e,t.width=a/e;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==e||r.height!==s||r.width!==a)&&(t.currentDevicePixelRatio=e,r.height=s,r.width=a,t.ctx.setTransform(e,0,0,e,0,0),!0)}var Fe=function(){let t=!1;try{var e={get passive(){return!(t=!0)}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Be(t,e){const i=Oe(t,e);t=i&&i.match(/^(\d+)(\.\d+)?px$/);return t?+t[1]:void 0}function Ve(t,e){return"native"in t?{x:t.x,y:t.y}:Re(t,e)}function We(t,i,e,s,a){var r=t.getSortedVisibleDatasetMetas(),n=e[i];for(let t=0,e=r.length;t<e;++t){var{index:o,data:h}=r[t],{lo:l,hi:c}=function(t,e,i,s){var{controller:t,data:a,_sorted:r}=t,n=t._cachedMeta.iScale;if(n&&e===n.axis&&r&&a.length){const o=n._reversePixels?be:x;if(!s)return o(a,e,i);if(t._sharedOptions){const h=a[0];r="function"==typeof h.getRange&&h.getRange(e);if(r)return n=o(a,e,i-r),s=o(a,e,i+r),{lo:n.lo,hi:s.hi}}}return{lo:0,hi:a.length-1}}(r[t],i,n,a);for(let t=l;t<=c;++t){var d=h[t];d.skip||s(d,o,t)}}}function Ne(t,s,e,a){const r=[];if(!de(s,t.chartArea,t._minPadding))return r;return We(t,e,s,function(t,e,i){t.inRange(s.x,s.y,a)&&r.push({element:t,datasetIndex:e,index:i})},!0),r}function He(a,r,t,n,o){const h=function(t){const s=-1!==t.indexOf("x"),a=-1!==t.indexOf("y");return function(t,e){var i=s?Math.abs(t.x-e.x):0,t=a?Math.abs(t.y-e.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(t,2))}}(t);let l=Number.POSITIVE_INFINITY,c=[];if(!de(r,a.chartArea,a._minPadding))return c;return We(a,t,r,function(t,e,i){var s;n&&!t.inRange(r.x,r.y,o)||(de(s=t.getCenterPoint(o),a.chartArea,a._minPadding)||t.inRange(r.x,r.y,o))&&((s=h(r,s))<l?(c=[{element:t,datasetIndex:e,index:i}],l=s):s===l&&c.push({element:t,datasetIndex:e,index:i}))}),c}function je(t,e,i,s){const a=Ve(e,t),r=[],n=i.axis,o="x"===n?"inXRange":"inYRange";let h=!1;var l,c,d,u=(t,e,i)=>{t[o](a[n],s)&&r.push({element:t,datasetIndex:e,index:i}),t.inRange(a.x,a.y,s)&&(h=!0)},g=t.getSortedVisibleDatasetMetas();for(let t=0,e=g.length;t<e;++t){({index:l,data:c}=g[t]);for(let t=0,e=c.length;t<e;++t)(d=c[t]).skip||u(d,l,t)}return i.intersect&&!h?[]:r}var Ye={modes:{index(t,e,i,s){var e=Ve(e,t),a=i.axis||"x";const r=i.intersect?Ne(t,e,a,s):He(t,e,a,!1,s),n=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{var e=r[0].index,i=t.data[e];i&&!i.skip&&n.push({element:i,datasetIndex:t.index,index:e})}),n):[]},dataset(t,e,i,s){var e=Ve(e,t),a=i.axis||"xy";let r=i.intersect?Ne(t,e,a,s):He(t,e,a,!1,s);if(0<r.length){var n=r[0].datasetIndex,o=t.getDatasetMeta(n).data;r=[];for(let t=0;t<o.length;++t)r.push({element:o[t],datasetIndex:n,index:t})}return r},point(t,e,i,s){return Ne(t,Ve(e,t),i.axis||"xy",s)},nearest(t,e,i,s){return He(t,Ve(e,t),i.axis||"xy",i.intersect,s)},x(t,e,i,s){return je(t,e,{axis:"x",intersect:i.intersect},s)},y(t,e,i,s){return je(t,e,{axis:"y",intersect:i.intersect},s)}}};const $e=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Ue=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Xe(t,e){var i=(""+t).match($e);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const qe=t=>+t||0;function Ke(e,i){const t={};var s=F(i),a=s?Object.keys(i):i;const r=F(e)?s?t=>B(e[t],e[i[t]]):t=>e[t]:()=>e;for(const n of a)t[n]=qe(r(n));return t}function Ge(t){return Ke(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ze(t){return Ke(t,["topLeft","topRight","bottomLeft","bottomRight"])}function V(t){const e=Ge(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function E(t,e){e=e||R.font;let i=B((t=t||{}).size,e.size),s=("string"==typeof i&&(i=parseInt(i,10)),B(t.style,e.style));s&&!(""+s).match(Ue)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const a={family:B(t.family,e.family),lineHeight:Xe(B(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:B(t.weight,e.weight),string:""};return a.string=re(a),a}function Qe(t,e,i,s){let a=!0,r,n,o;for(r=0,n=t.length;r<n;++r)if(void 0!==(o=t[r])&&(void 0!==e&&"function"==typeof o&&(o=o(e),a=!1),void 0!==i&&I(o)&&(o=o[i%o.length],a=!1),void 0!==o))return s&&!a&&(s.cacheable=!1),o}function Je(t,e,i){var{min:t,max:s}=t,e=Mt(e,(s-t)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(t,-Math.abs(e)),max:a(s,e)}}function w(t,e){return Object.assign(Object.create(t),e)}const ti=["left","top","right","bottom"];function ei(t,e){return t.filter(t=>t.pos===e)}function ii(t,e){return t.filter(t=>-1===ti.indexOf(t.pos)&&t.box.axis===e)}function si(t,s){return t.sort((t,e)=>{var i=s?e:t,t=s?t:e;return i.weight===t.weight?i.index-t.index:i.weight-t.weight})}function ai(t,e){var i=function(t){const e={};for(const r of t){var{stack:i,pos:s,stackWeight:a}=r;if(i&&ti.includes(s)){const n=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});n.count++,n.weight+=a}}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:a}=e;let r,n,o;for(r=0,n=t.length;r<n;++r){var h=(o=t[r]).box["fullSize"],l=i[o.stack],l=l&&o.stackWeight/l.weight;o.horizontal?(o.width=l?l*s:h&&e.availableWidth,o.height=a):(o.width=s,o.height=l?l*a:h&&e.availableHeight)}return i}function ri(t){const e=function(t){const e=[];let i,s,a,r,n,o;for(i=0,s=(t||[]).length;i<s;++i)({position:r,options:{stack:n,stackWeight:o=1}}=a=t[i]),e.push({index:i,box:a,pos:r,horizontal:a.isHorizontal(),weight:a.weight,stack:n&&r+n,stackWeight:o});return e}(t);t=si(e.filter(t=>t.box.fullSize),!0);const i=si(ei(e,"left"),!0),s=si(ei(e,"right")),a=si(ei(e,"top"),!0);var r=si(ei(e,"bottom")),n=ii(e,"x"),o=ii(e,"y");return{fullSize:t,leftAndTop:i.concat(a),rightAndBottom:s.concat(o).concat(r).concat(n),chartArea:ei(e,"chartArea"),vertical:i.concat(s).concat(o),horizontal:a.concat(r).concat(n)}}function ni(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function oi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function hi(t,e,i,s){const a=[];let r,n,o,h,l,c;for(r=0,n=t.length,l=0;r<n;++r){o=t[r],(h=o.box).update(o.width||e.w,o.height||e.h,function(t,i){const s=i.maxPadding;function e(t){const e={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{e[t]=Math.max(i[t],s[t])}),e}return e(t?["left","right"]:["top","bottom"])}(o.horizontal,e));var{same:d,other:u}=function(t,e,i,s){const{pos:a,box:r}=i;var n=t.maxPadding;if(!F(a)){i.size&&(t[a]-=i.size);const h=s[i.stack]||{size:0,count:1};h.size=Math.max(h.size,i.horizontal?r.height:r.width),i.size=h.size/h.count,t[a]+=i.size}r.getPadding&&oi(n,r.getPadding());var s=Math.max(0,e.outerWidth-ni(n,t,"left","right")),e=Math.max(0,e.outerHeight-ni(n,t,"top","bottom")),n=s!==t.w,o=e!==t.h;return t.w=s,t.h=e,i.horizontal?{same:n,other:o}:{same:o,other:n}}(e,i,o,s);l|=d&&a.length,c=c||u,h.fullSize||a.push(o)}return l&&hi(a,e,i,s)||c}function li(t,e,i,s,a){t.top=i,t.left=e,t.right=e+s,t.bottom=i+a,t.width=s,t.height=a}function ci(t,e,i,s){var a=i.padding;let{x:r,y:n}=e;for(const d of t){var o=d.box;const u=s[d.stack]||{count:1,placed:0,weight:1};var h,l,c=d.stackWeight/u.weight||1;d.horizontal?(l=e.w*c,h=u.size||o.height,g(u.start)&&(n=u.start),o.fullSize?li(o,a.left,n,i.outerWidth-a.right-a.left,h):li(o,e.left+u.placed,n,l,h),u.start=n,u.placed+=l,n=o.bottom):(h=e.h*c,l=u.size||o.width,g(u.start)&&(r=u.start),o.fullSize?li(o,r,a.top,l,i.outerHeight-a.bottom-a.top):li(o,r,e.top+u.placed,l,h),u.start=r,u.placed+=h,r=o.right)}e.x=r,e.y=n}R.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var a={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){e=t.boxes?t.boxes.indexOf(e):-1;-1!==e&&t.boxes.splice(e,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(i,t,e,s){if(i){var a=V(i.options.layout.padding),r=Math.max(t-a.width,0),n=Math.max(e-a.height,0),o=ri(i.boxes);const u=o.vertical;var h=o.horizontal,l=(M(i.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}),u.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1),t=Object.freeze({outerWidth:t,outerHeight:e,padding:a,availableWidth:r,availableHeight:n,vBoxMaxWidth:r/2/l,hBoxMaxHeight:n/2}),e=Object.assign({},a);oi(e,V(s));const g=Object.assign({maxPadding:e,w:r,h:n,x:a.left,y:a.top},a);l=ai(u.concat(h),t);hi(o.fullSize,g,t,l),hi(u,g,t,l),hi(h,g,t,l)&&hi(u,g,t,l);{var c=g;const f=c.maxPadding;function d(t){var e=Math.max(f[t]-c[t],0);return c[t]+=e,e}c.y+=d("top"),c.x+=d("left"),d("right"),d("bottom")}ci(o.leftAndTop,g,t,l),g.x+=g.w,g.y+=g.h,ci(o.rightAndBottom,g,t,l),i.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},M(o.chartArea,t=>{const e=t.box;Object.assign(e,i.chartArea),e.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}}};function di(o,h=[""],e=o,i,a=()=>o[0]){g(i)||(i=yi("_fallback",o));var t={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:o,_rootScopes:e,_fallback:i,_getTarget:a,override:t=>di([t,...o],h,e,i)};return new Proxy(t,{deleteProperty(t,e){return delete t[e],delete t._keys,delete o[0][e],!0},get(r,n){return mi(r,n,()=>{var t,e=n,i=o,s=r;for(const a of h)if(t=yi(fi(a,e),i),g(t))return pi(e,t)?bi(i,s,e,t):t})},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(o[0])},has(t,e){return wi(t).includes(e)},ownKeys(t){return wi(t)},set(t,e,i){const s=t._storage||(t._storage=a());return t[e]=s[e]=i,delete t._keys,!0}})}function ui(s,e,i,a){var t={_cacheable:!1,_proxy:s,_context:e,_subProxy:i,_stack:new Set,_descriptors:gi(s,a),setContext:t=>ui(s,t,i,a),override:t=>ui(s.override(t),e,i,a)};return new Proxy(t,{deleteProperty(t,e){return delete t[e],delete s[e],!0},get(h,l,c){return mi(h,l,()=>{{var e=h,i=l,s=c;const{_proxy:a,_context:r,_subProxy:n,_descriptors:o}=e;let t=a[i];return I(t=d(t)&&o.isScriptable(i)?function(t,e,i,s){const{_proxy:a,_context:r,_subProxy:n,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);o.add(t),e=e(r,n||s),o.delete(t),pi(t,e)&&(e=bi(a._scopes,a,t,e));return e}(i,t,e,s):t)&&t.length&&(t=function(t,e,i,s){const{_proxy:a,_context:r,_subProxy:n,_descriptors:o}=i;if(g(r.index)&&s(t))e=e[r.index%e.length];else if(F(e[0])){const c=e;var h=a._scopes.filter(t=>t!==c);e=[];for(const d of c){var l=bi(h,a,t,d);e.push(ui(l,r,n&&n[t],o))}}return e}(i,t,e,o.isIndexable)),t=pi(i,t)?ui(t,r,n&&n[i],o):t}})},getOwnPropertyDescriptor(t,e){return t._descriptors.allKeys?Reflect.has(s,e)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,e)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(t,e){return Reflect.has(s,e)},ownKeys(){return Reflect.ownKeys(s)},set(t,e,i){return s[e]=i,delete t[e],!0}})}function gi(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:i,indexable:s,isScriptable:d(i)?i:()=>i,isIndexable:d(s)?s:()=>s}}const fi=(t,e)=>t?t+It(e):e,pi=(t,e)=>F(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function mi(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];i=i();return t[e]=i}function vi(t,e,i){return d(t)?t(e,i):t}function xi(t,e,i,s){for(const n of e){a=i,r=n;r=!0===a?r:"string"==typeof a?Et(r,a):void 0;if(r){t.add(r);a=vi(r._fallback,i,r);if(g(a)&&a!==i&&a!==s)return a}else if(!1===r&&g(s)&&i!==s)return null}var a,r;return!1}function bi(t,a,r,n){var e=a._rootScopes,i=vi(a._fallback,r,n),t=[...t,...e];const s=new Set;s.add(n);var o=_i(s,t,r,i||r);return null!==o&&((!g(i)||i===r||null!==_i(s,t,i,o))&&di(Array.from(s),[""],e,i,()=>{{var t=a,e=r,i=n;const s=t._getTarget();return e in s||(s[e]={}),I(t=s[e])&&F(i)?i:t}}))}function _i(t,e,i,s){for(;i;)i=xi(t,e,i,s);return i}function yi(t,e){for(const s of e)if(s){var i=s[t];if(g(i))return i}}function wi(t){let e=t._keys;return e=e||(t._keys=function(t){const e=new Set;for(const i of t)for(const s of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(s);return Array.from(e)}(t._scopes))}const Mi=Number.EPSILON||1e-14,ki=(t,e)=>e<t.length&&!t[e].skip&&t[e],Si=t=>"x"===t?"y":"x";function Pi(t,e,i,s){var t=t.skip?e:t,a=e,e=i.skip?e:i,i=ee(a,t),r=ee(e,a);let n=i/(i+r),o=r/(i+r);n=isNaN(n)?0:n,o=isNaN(o)?0:o;i=s*n,r=s*o;return{previous:{x:a.x-i*(e.x-t.x),y:a.y-i*(e.y-t.y)},next:{x:a.x+r*(e.x-t.x),y:a.y+r*(e.y-t.y)}}}function Di(t,r="x"){var e,i=Si(r),s=t.length;const a=Array(s).fill(0),n=Array(s);let o,h,l,c=ki(t,0);for(o=0;o<s;++o)h=l,l=c,c=ki(t,o+1),l&&(c&&(e=c[r]-l[r],a[o]=0!=e?(c[i]-l[i])/e:0),n[o]=h?c?S(a[o-1])!==S(a[o])?0:(a[o-1]+a[o])/2:a[o-1]:a[o]);{var d=t,u=a,g=n,f,p,m,v=d.length;let e=ki(d,0);for(let t=0;t<v-1;++t)m=e,e=ki(d,t+1),m&&e&&(Kt(u[t],0,Mi)?g[t]=g[t+1]=0:(m=g[t]/u[t],f=g[t+1]/u[t],(p=Math.pow(m,2)+Math.pow(f,2))<=9||(p=3/Math.sqrt(p),g[t]=m*p*u[t],g[t+1]=f*p*u[t])))}{var[x,b,_="x"]=[t,n,r],y,w,M=Si(_),k=x.length;let e,i,s,a=ki(x,0);for(let t=0;t<k;++t)i=s,s=a,a=ki(x,t+1),s&&(y=s[_],w=s[M],i&&(e=(y-i[_])/3,s["cp1"+_]=y-e,s["cp1"+M]=w-e*b[t]),a&&(e=(a[_]-y)/3,s["cp2"+_]=y+e,s["cp2"+M]=w+e*b[t]));return}}function Ci(t,e,i){return Math.max(Math.min(t,i),e)}function Oi(n,e,o,i,t){let s,a,r,h;if(e.spanGaps&&(n=n.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)Di(n,t);else{let t=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)r=n[s],h=Pi(t,r,n[Math.min(s+1,a-(i?0:1))%a],e.tension),r.cp1x=h.previous.x,r.cp1y=h.previous.y,r.cp2x=h.next.x,r.cp2y=h.next.y,t=r}if(e.capBezierPoints){var l=n;var c=o;let t,e,i,s,a,r=de(l[0],c);for(t=0,e=l.length;t<e;++t)a=s,s=r,r=t<e-1&&de(l[t+1],c),s&&(i=l[t],a&&(i.cp1x=Ci(i.cp1x,c.left,c.right),i.cp1y=Ci(i.cp1y,c.top,c.bottom)),r&&(i.cp2x=Ci(i.cp2x,c.left,c.right),i.cp2y=Ci(i.cp2y,c.top,c.bottom)))}}const Ai=t=>0===t||1===t,Ti=(t,e,i)=>-(Math.pow(2,10*--t)*Math.sin((t-e)*m/i)),Li=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*m/i)+1,Ri={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-(--t*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>--t*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*y),easeOutSine:t=>Math.sin(t*y),easeInOutSine:t=>-.5*(Math.cos(_*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ai(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>1<=t?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1- --t*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ai(t)?t:Ti(t,.075,.3),easeOutElastic:t=>Ai(t)?t:Li(t,.075,.3),easeInOutElastic(t){return Ai(t)?t:t<.5?.5*Ti(2*t,.1125,.45):.5+.5*Li(2*t-1,.1125,.45)},easeInBack(t){return t*t*(2.70158*t-1.70158)},easeOutBack(t){return--t*t*(2.70158*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Ri.easeOutBounce(1-t),easeOutBounce(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Ri.easeInBounce(2*t):.5*Ri.easeOutBounce(2*t-1)+.5};function Ei(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ii(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:("middle"===s?i<.5?t:e:"after"===s?i<1?t:e:0<i?e:t).y}}function zi(t,e,i,s){var a={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},t=Ei(t,a,i),a=Ei(a,r,i),r=Ei(r,e,i),e=Ei(t,a,i),t=Ei(a,r,i);return Ei(e,t,i)}const Fi=new Map;function Bi(t,e,i){return function(t,e){e=e||{};var i=t+JSON.stringify(e);let s=Fi.get(i);return s||(s=new Intl.NumberFormat(t,e),Fi.set(i,s)),s}(e,i).format(t)}function Vi(t,e,i){return t?(s=e,a=i,{x(t){return s+s+a-t},setWidth(t){a=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}):{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}};var s,a}function Wi(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(s=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function Ni(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Hi(t){return"angle"===t?{between:se,compare:ie,normalize:h}:{between:v,compare:(t,e)=>t-e,normalize:t=>t}}function ji({start:t,end:e,count:i,loop:s,style:a}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:a}}function Yi(i,s,t){if(!t)return[i];const{property:a,start:r,end:n}=t;var o=s.length;const{compare:h,between:l,normalize:c}=Hi(a);var{start:i,end:d,loop:u,style:g}=function(t,e,i){var{property:s,start:a,end:r}=i;const{between:n,normalize:o}=Hi(s);var h=e.length;let{start:l,end:c,loop:d}=t,u,g;if(d){for(l+=h,c+=h,u=0,g=h;u<g&&n(o(e[l%h][s]),a,r);++u)l--,c--;l%=h,c%=h}return c<l&&(c+=h),{start:l,end:c,loop:d,style:t.style}}(i,s,t);const f=[];let p,m=null,v,x,b;var _=()=>p||l(r,b,v)&&0!==h(r,b),y=()=>!p||0===h(n,v)||l(n,b,v);for(let t=i,e=i;t<=d;++t)(x=s[t%o]).skip||(v=c(x[a]))!==b&&(p=l(v,r,n),null!==(m=null===m&&_()?0===h(v,r)?t:e:m)&&y()&&(f.push(ji({start:m,end:t,loop:u,count:o,style:g})),m=null),e=t,b=v);return null!==m&&f.push(ji({start:m,end:d,loop:u,count:o,style:g})),f}function $i(e,i){const s=[];var a=e.segments;for(let t=0;t<a.length;t++){var r=Yi(a[t],e.points,i);r.length&&s.push(...r)}return s}function Ui(t,e){var i=t.points,s=t.options.spanGaps,a=i.length;if(!a)return[];var r=!!t._loop,{start:n,end:o}=function(t,e,i,s){let a=0,r=e-1;if(i&&!s)for(;a<e&&!t[a].skip;)a++;for(;a<e&&t[a].skip;)a++;for(a%=e,i&&(r+=a);r>a&&t[r%e].skip;)r--;return r%=e,{start:a,end:r}}(i,a,r,s);return Xi(t,!0===s?[{start:n,end:o,loop:r}]:function(t,e,i,s){var a=t.length;const r=[];let n=e,o=t[e],h;for(h=e+1;h<=i;++h){var l=t[h%a];l.skip||l.stop?o.skip||(s=!1,r.push({start:e%a,end:(h-1)%a,loop:s}),e=n=l.stop?h:null):(n=h,o.skip&&(e=h)),o=l}return null!==n&&r.push({start:e%a,end:n%a,loop:s}),r}(i,n,o<n?o+a:o,!!t._fullLoop&&0===n&&o===a-1),i,e)}function Xi(t,i,s,a){if(a&&a.setContext&&s){var o,h=i,l=s,c=a;const g=t._chart.getContext(),f=qi(t.options),{_datasetIndex:p,options:{spanGaps:m}}=t,v=l.length,x=[];let r=f,n=h[0].start,e=n;function d(t,e,i,s){var a=m?-1:1;if(t!==e){for(t+=v;l[t%v].skip;)t-=a;for(;l[e%v].skip;)e+=a;t%v!=e%v&&(x.push({start:t%v,end:e%v,loop:i,style:s}),r=s,n=e%v)}}for(const b of h){n=m?n:b.start;let t=l[n%v];for(e=n+1;e<=b.end;e++){var u=l[e%v];!function(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}(o=qi(c.setContext(w(g,{type:"segment",p0:t,p1:u,p0DataIndex:(e-1)%v,p1DataIndex:e%v,datasetIndex:p}))),r)||d(n,e-1,b.loop,r),t=u,r=o}n<e-1&&d(n,e-1,b.loop,r)}return x}return i}function qi(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}var Ki=Object.freeze({__proto__:null,easingEffects:Ri,color:bt,getHoverColor:_t,noop:t,uid:yt,isNullOrUndef:P,isArray:I,isObject:F,isFinite:p,finiteOrDefault:l,valueOrDefault:B,toPercentage:wt,toDimension:Mt,callback:c,each:M,_elementsEqual:kt,clone:St,_merger:Dt,merge:Ct,mergeIf:Ot,_mergerIf:At,_deprecated:function(t,e,i,s){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+s+'" instead')},resolveObjectKey:Et,_capitalize:It,defined:g,isFunction:d,setsEqual:zt,toFontString:re,_measureText:ne,_longestText:oe,_alignPixel:he,clearCanvas:le,drawPoint:ce,_isPointInArea:de,clipArea:ue,unclipArea:ge,_steppedLineTo:fe,_bezierCurveTo:pe,renderText:me,addRoundedRectPath:ve,_lookup:xe,_lookupByKey:x,_rlookupByKey:be,_filterBetween:_e,listenArrayEvents:we,unlistenArrayEvents:Me,_arrayUnique:ke,_createResolver:di,_attachContext:ui,_descriptors:gi,splineCurve:Pi,splineCurveMonotone:Di,_updateBezierControlPoints:Oi,_isDomSupported:Se,_getParentNode:Pe,getStyle:Oe,getRelativePosition:Re,getMaximumSize:Ie,retinaScale:ze,supportsEventListenerOptions:Fe,readUsedSize:Be,fontString:function(t,e,i){return e+" "+t+"px "+i},requestAnimFrame:C,throttled:O,debounce:A,_toLeftRightCenter:T,_alignStartEnd:L,_textX:W,_pointInLine:Ei,_steppedInterpolation:Ii,_bezierInterpolation:zi,formatNumber:Bi,toLineHeight:Xe,_readValueToProps:Ke,toTRBL:Ge,toTRBLCorners:Ze,toPadding:V,toFont:E,resolve:Qe,_addGrace:Je,createContext:w,PI:_,TAU:m,PITAU:Nt,INFINITY:Ht,RAD_PER_DEG:jt,HALF_PI:y,QUARTER_PI:Yt,TWO_THIRDS_PI:$t,log10:u,sign:S,niceNum:Ut,_factorize:Xt,isNumber:qt,almostEquals:Kt,almostWhole:Gt,_setMinAndMaxByKey:Zt,toRadians:z,toDegrees:Qt,_decimalPlaces:Jt,getAngleFromPoint:te,distanceBetweenPoints:ee,_angleDiff:ie,_normalizeAngle:h,_angleBetween:se,_limitValue:f,_int16Range:ae,_isBetween:v,getRtlAdapter:Vi,overrideTextDirection:Wi,restoreTextDirection:Ni,_boundSegment:Yi,_boundSegments:$i,_computeSegments:Ui});class Gi{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Zi extends Gi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Qi="$chartjs",Ji={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ts=t=>null===t||""===t;const es=!!Fe&&{passive:!0};function is(t,e,i){t.canvas.removeEventListener(e,i,es)}function ss(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function as(t,e,s){const a=t.canvas,i=new MutationObserver(t=>{let e=!1;for(const i of t)e=(e=e||ss(i.addedNodes,a))&&!ss(i.removedNodes,a);e&&s()});return i.observe(document,{childList:!0,subtree:!0}),i}function rs(t,e,s){const a=t.canvas,i=new MutationObserver(t=>{let e=!1;for(const i of t)e=(e=e||ss(i.removedNodes,a))&&!ss(i.addedNodes,a);e&&s()});return i.observe(document,{childList:!0,subtree:!0}),i}const ns=new Map;let os=0;function hs(){const i=window.devicePixelRatio;i!==os&&(os=i,ns.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function ls(t,e,s){var i=t.canvas;const a=i&&Pe(i);if(a){const r=O((t,e)=>{var i=a.clientWidth;s(t,e),i<a.clientWidth&&s()},window),n=new ResizeObserver(t=>{var t=t[0],e=t.contentRect.width,t=t.contentRect.height;0===e&&0===t||r(e,t)});return n.observe(a),i=t,t=r,ns.size||window.addEventListener("resize",hs),ns.set(i,t),n}}function cs(t,e,i){i&&i.disconnect(),"resize"===e&&(i=t,ns.delete(i),ns.size||window.removeEventListener("resize",hs))}function ds(e,t,i){var s=e.canvas,a=O(t=>{null!==e.ctx&&i(function(t,e){var i=Ji[t.type]||t.type,{x:s,y:a}=Re(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==a?a:null}}(t,e))},e,t=>{t=t[0];return[t,t.offsetX,t.offsetY]});return s.addEventListener(t,a,es),a}class us extends Gi{acquireContext(t,e){var i=t&&t.getContext&&t.getContext("2d");if(i&&i.canvas===t){{const r=t.style;var s=t.getAttribute("height"),a=t.getAttribute("width");t[Qi]={initial:{height:s,width:a,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",r.boxSizing=r.boxSizing||"border-box",ts(a)&&void 0!==(a=Be(t,"width"))&&(t.width=a),ts(s)&&(""===t.style.height?t.height=t.width/(e||2):void 0!==(a=Be(t,"height"))&&(t.height=a))}return i}return null}releaseContext(t){const i=t.canvas;if(!i[Qi])return!1;const s=i[Qi].initial,e=(["height","width"].forEach(t=>{var e=s[t];P(e)?i.removeAttribute(t):i.setAttribute(t,e)}),s.style||{});return Object.keys(e).forEach(t=>{i.style[t]=e[t]}),i.width=i.width,delete i[Qi],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={});const a={attach:as,detach:rs,resize:ls}[e]||ds;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={});var s=i[e];if(s){const a={attach:cs,detach:cs,resize:cs}[e]||is;a(t,e,s),i[e]=void 0}}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Ie(t,e,i,s)}isAttached(t){t=Pe(t);return!(!t||!t.isConnected)}}function gs(t){return!Se()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Zi:us}Fe=Object.freeze({__proto__:null,_detectPlatform:gs,BasePlatform:Gi,BasicPlatform:Zi,DomPlatform:us});const fs="transparent",ps={boolean(t,e,i){return.5<i?e:t},color(t,e,i){t=bt(t||fs);const s=t.valid&&bt(e||fs);return s&&s.valid?s.mix(t,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class ms{constructor(t,e,i,s){var a=e[i],a=(s=Qe([t.to,s,a,t.from]),Qe([t.from,a,s]));this._active=!0,this._fn=t.fn||ps[t.type||typeof a],this._easing=Ri[t.easing]||Ri.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){var s,a,r;this._active&&(this._notify(!1),s=this._target[this._prop],a=i-this._start,r=this._duration-a,this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Qe([t.to,e,s,t.from]),this._from=Qe([t.from,s,e]))}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){var t=t-this._start,e=this._duration,i=this._prop,s=this._from,a=this._loop,r=this._to;let n;if(this._active=s!==r&&(a||t<e),!this._active)return this._target[i]=r,void this._notify(!0);t<0?this._target[i]=s:(n=t/e%2,n=a&&1<n?2-n:n,n=this._easing(Math.min(1,Math.max(0,n))),this._target[i]=this._fn(s,r,n))}wait(){const i=this._promises||(this._promises=[]);return new Promise((t,e)=>{i.push({res:t,rej:e})})}_notify(t){var e=t?"res":"rej";const i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}R.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const vs=Object.keys(R.animation);R.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),R.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),R.describe("animations",{_fallback:"animation"}),R.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class xs{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(a){if(F(a)){const r=this._properties;Object.getOwnPropertyNames(a).forEach(e=>{const t=a[e];if(F(t)){const i={};for(const s of vs)i[s]=t[s];(I(t.properties)&&t.properties||[e]).forEach(t=>{t!==e&&r.has(t)||r.set(t,i)})}})}}_animateOptions(t,e){const i=e.options;e=function(e,i){if(i){let t=e.options;if(t)return t.$shared&&(e.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t;e.options=i}}(t,i);if(!e)return[];e=this._createAnimations(e,i);return i.$shared&&function(e,t){const i=[],s=Object.keys(t);for(let t=0;t<s.length;t++){const a=e[s[t]];a&&a.active()&&i.push(a.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),e}_createAnimations(e,i){const s=this._properties,a=[],r=e.$animations||(e.$animations={});var t=Object.keys(i),n=Date.now();let o;for(o=t.length-1;0<=o;--o){const c=t[o];if("$"!==c.charAt(0))if("options"===c)a.push(...this._animateOptions(e,i));else{var h=i[c];let t=r[c];var l=s.get(c);if(t){if(l&&t.active()){t.update(l,h,n);continue}t.cancel()}l&&l.duration?(r[c]=t=new ms(l,e,c,h),a.push(t)):e[c]=h}}return a}update(t,e){{if(0!==this._properties.size)return(t=this._createAnimations(t,e)).length?(n.add(this._chart,t),!0):void 0;Object.assign(t,e)}}}function bs(t,e){var t=t&&t.options||{},i=t.reverse,s=void 0===t.min?e:0,t=void 0===t.max?e:0;return{start:i?t:s,end:i?s:t}}function _s(t,e){const i=[];var s=t._getSortedDatasetMetas(e);let a,r;for(a=0,r=s.length;a<r;++a)i.push(s[a].index);return i}function ys(t,e,i,s={}){var a=t.keys,r="single"===s.mode;let n,o,h,l;if(null!==e){for(n=0,o=a.length;n<o;++n){if((h=+a[n])===i){if(s.all)continue;break}l=t.values[h],p(l)&&(r||0===e||S(e)===S(l))&&(e+=l)}return e}}function ws(t,e){t=t&&t.options.stacked;return t||void 0===t&&void 0!==e.stack}function Ms(t,e,i,s){for(const r of e.getMatchingVisibleMetas(s).reverse()){var a=t[r.index];if(i&&0<a||!i&&a<0)return r.index}return null}function ks(t,e){const{chart:i,_cachedMeta:s}=t;var a,r=i._stacks||(i._stacks={}),{iScale:t,vScale:n,index:o}=s,h=t.axis,l=n.axis,c=(a=s,`${t.id}.${n.id}.`+(a.stack||a.type)),d=e.length;let u;for(let t=0;t<d;++t){const p=e[t];var{[h]:g,[l]:f}=p;const m=p._stacks||(p._stacks={});(u=m[l]=function(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}(r,c,g))[o]=f,u._top=Ms(u,n,!0,s.type),u._bottom=Ms(u,n,!1,s.type)}}function Ss(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function Ps(t,e){var i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s)for(const a of e=e||t._parsed){const r=a._stacks;if(!r||void 0===r[s]||void 0===r[s][i])return;delete r[s][i]}}const Ds=t=>"reset"===t||"none"===t,Cs=(t,e)=>e?t:Object.assign({},t);class e{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ws(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Ps(this._cachedMeta),this.index=t}linkScales(){var t=this.chart;const e=this._cachedMeta;var i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,a=e.xAxisID=B(i.xAxisID,Ss(t,"x")),r=e.yAxisID=B(i.yAxisID,Ss(t,"y")),i=e.rAxisID=B(i.rAxisID,Ss(t,"r")),t=e.indexAxis,n=e.iAxisID=s(t,a,r,i),s=e.vAxisID=s(t,r,a,i);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(i),e.iScale=this.getScaleForId(n),e.vScale=this.getScaleForId(s)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){var e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){var t=this._cachedMeta;this._data&&Me(this._data,this),t._stacked&&Ps(t)}_dataCheck(){const t=this.getDataset();var e=t.data||(t.data=[]),i=this._data;if(F(e))this._data=function(t){var e=Object.keys(t);const i=new Array(e.length);let s,a,r;for(s=0,a=e.length;s<a;++s)r=e[s],i[s]={x:r,y:t[r]};return i}(e);else if(i!==e){if(i){Me(i,this);const s=this._cachedMeta;Ps(s),s._parsed=[]}e&&Object.isExtensible(e)&&we(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta;var i=this.getDataset();let s=!1;this._dataCheck();var a=e._stacked;e._stacked=ws(e.vScale,e),e.stack!==i.stack&&(s=!0,Ps(e),e.stack=i.stack),this._resyncElements(t),!s&&a===e._stacked||ks(this,e._parsed)}configure(){const t=this.chart.config;var e=t.datasetScopeKeys(this._type),e=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(e,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this;var{iScale:a,_stacked:r}=i;const n=a.axis;let o=0===t&&e===s.length||i._sorted,h=0<t&&i._parsed[t-1],l,c,d;if(!1===this._parsing)i._parsed=s,i._sorted=!0,d=s;else{d=I(s[t])?this.parseArrayData(i,s,t,e):F(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);for(l=0;l<e;++l)i._parsed[l+t]=c=d[l],o&&((null===c[n]||h&&c[n]<h[n])&&(o=!1),h=c);i._sorted=o}r&&ks(this,d)}parsePrimitiveData(t,e,i,s){const{iScale:a,vScale:r}=t;var n=a.axis,o=r.axis,h=a.getLabels(),l=a===r;const c=new Array(s);let d,u,g;for(d=0,u=s;d<u;++d)g=d+i,c[d]={[n]:l||a.parse(h[g],g),[o]:r.parse(e[g],g)};return c}parseArrayData(t,e,i,s){const{xScale:a,yScale:r}=t,n=new Array(s);let o,h,l,c;for(o=0,h=s;o<h;++o)c=e[l=o+i],n[o]={x:a.parse(c[0],l),y:r.parse(c[1],l)};return n}parseObjectData(t,e,i,s){const{xScale:a,yScale:r}=t;var{xAxisKey:n="x",yAxisKey:o="y"}=this._parsing;const h=new Array(s);let l,c,d,u;for(l=0,c=s;l<c;++l)u=e[d=l+i],h[l]={x:a.parse(Et(u,n),d),y:r.parse(Et(u,o),d)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){var s=this.chart,a=this._cachedMeta,r=e[t.axis];return ys({keys:_s(s,!0),values:e._stacks[t.axis]},r,a.index,{mode:i})}updateRangeFromParsed(t,e,i,s){var a=i[e.axis];let r=null===a?NaN:a;i=s&&i._stacks[e.axis];s&&i&&(s.values=i,r=ys(s,a,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(e,t){var i=this._cachedMeta;const s=i._parsed;var a=i._sorted&&e===i.iScale,r=s.length;const n=this._getOtherScale(e);i=i,o=this.chart;var o,h=t&&!i.hidden&&i._stacked&&{keys:_s(o,!0),values:null},l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};const{min:c,max:d}=function(t){var{min:t,max:e,minDefined:i,maxDefined:s}=t.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}(n);let u,g;function f(){var t=(g=s[u])[n.axis];return!p(g[e.axis])||c>t||d<t}for(u=0;u<r&&(f()||(this.updateRangeFromParsed(l,e,g,h),!a));++u);if(a)for(u=r-1;0<=u;--u)if(!f()){this.updateRangeFromParsed(l,e,g,h);break}return l}getAllParsedValues(t){var e=this._cachedMeta._parsed;const i=[];let s,a,r;for(s=0,a=e.length;s<a;++s)r=e[s][t.axis],p(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){var e=this._cachedMeta;const i=e.iScale,s=e.vScale;e=this.getParsed(t);return{label:i?""+i.getLabelForValue(e[i.axis]):"",value:s?""+s.getLabelForValue(e[s.axis]):""}}_update(t){const e=this._cachedMeta;var i,s;this.update(t||"default"),e._clip=function(t){let e,i,s,a;return F(t)?(e=t.top,i=t.right,s=t.bottom,a=t.left):e=i=s=a=t,{top:e,right:i,bottom:s,left:a,disabled:!1===t}}(B(this.options.clip,(t=e.xScale,i=e.yScale,!1!==(s=this.getMaxOverflow())&&(t=bs(t,s),{top:(i=bs(i,s)).end,right:t.end,bottom:i.start,left:t.start}))))}update(t){}draw(){var t=this._ctx,e=this.chart;const i=this._cachedMeta;var s=i.data||[],a=e.chartArea;const r=[];var n=this._drawStart||0,o=this._drawCount||s.length-n;let h;for(i.dataset&&i.dataset.draw(t,a,n,o),h=n;h<n+o;++h){const l=s[h];l.hidden||(l.active?r.push(l):l.draw(t,a))}for(h=0;h<r.length;++h)r[h].draw(t,a)}getStyle(t,e){e=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(e):this.resolveDataElementOptions(t||0,e)}getContext(t,e,i){var s,a,r=this.getDataset();let n;if(0<=t&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];(n=o.$context||(o.$context=(s=this.getContext(),a=o,w(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:a,index:t,mode:"default",type:"data"})))).parsed=this.getParsed(t),n.raw=r.data[t],n.index=n.dataIndex=t}else(n=this.$context||(this.$context=(s=this.chart.getContext(),a=this.index,w(s,{active:!1,dataset:void 0,datasetIndex:a,index:a,mode:"default",type:"dataset"})))).dataset=r,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,a=this._cachedDataOpts;var e=t+"-"+e,r=a[e],n=this.enableOptionSharing&&g(i);if(r)return Cs(r,n);const o=this.chart.config;var r=o.datasetElementScopeKeys(this._type,t),h=s?[t+"Hover","hover",t,""]:[t,""],r=o.getOptionScopes(this.getDataset(),r),t=Object.keys(R.elements[t]);const l=o.resolveNamedOptions(r,t,()=>this.getContext(i,s),h);return l.$shared&&(l.$shared=n,a[e]=Object.freeze(Cs(l,n))),l}_resolveAnimations(t,e,i){var s=this.chart;const a=this._cachedDataOpts;var r="animation-"+e,n=a[r];if(n)return n;let o;if(!1!==s.options.animation){const h=this.chart.config;n=h.datasetAnimationScopeKeys(this._type,e),n=h.getOptionScopes(this.getDataset(),n);o=h.createResolver(n,this.getContext(t,i,e))}n=new xs(s,o&&o.animations);return o&&o._cacheable&&(a[r]=Object.freeze(n)),n}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ds(t)||this.chart._animationsDisabled}updateElement(t,e,i,s){Ds(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ds(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;var a=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){var e,i,s,a=this._data,r=this._cachedMeta.data;for([e,i,s]of this._syncList)this[e](i,s);this._syncList=[];var r=r.length,a=a.length,n=Math.min(a,r);n&&this.parse(0,n),r<a?this._insertElements(r,a-r,t):a<r&&this._removeElements(a,r-a)}_insertElements(t,e,i=!0){var s=this._cachedMeta;const a=s.data,r=t+e;let n;var o=t=>{for(t.length+=e,n=t.length-1;n>=r;n--)t[n]=t[n-e]};for(o(a),n=t;n<r;++n)a[n]=new this.dataElementType;this._parsing&&o(s._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;var s;this._parsing&&(s=i._parsed.splice(t,e),i._stacked&&Ps(i,s)),i.data.splice(t,e)}_sync(t){var e,i,s;this._parsing?this._syncList.push(t):([e,i,s]=t,this[e](i,s)),this.chart._dataChanges.push([this.index,...t])}_onDataPush(){var t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);e=arguments.length-2;e&&this._sync(["_insertElements",t,e])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}e.defaults={},e.prototype.datasetElementType=null,e.prototype.dataElementType=null;class i{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){var{x:t,y:e}=this.getProps(["x","y"],t);return{x:t,y:e}}hasValue(){return qt(this.x)&&qt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}i.defaults={},i.defaultRoutes=void 0;const Os={values(t){return I(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";var s=this.chart.options.locale;let a,r=t;1<i.length&&(((n=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value)))<1e-4||1e15<n)&&(a="scientific"),r=function(t,e){let i=3<e.length?e[2].value-e[1].value:e[1].value-e[0].value;1<=Math.abs(i)&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i));var n=u(Math.abs(r)),i=Math.max(Math.min(-1*Math.floor(n),20),0),n={notation:a,minimumFractionDigits:i,maximumFractionDigits:i};return Object.assign(n,this.options.ticks.format),Bi(t,s,n)},logarithmic(t,e,i){if(0===t)return"0";var s=t/Math.pow(10,Math.floor(u(t)));return 1==s||2==s||5==s?Os.numeric.call(this,t,e,i):""}};var As={formatters:Os};function Ts(i,s){var a=i.options.ticks,r=a.maxTicksLimit||(o=(i=i).options.offset,r=i._tickSize(),o=i._length/r+(o?0:1),i=i._maxLength/r,Math.floor(Math.min(o,i))),n=a.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(s):[],o=n.length,i=n[0],a=n[o-1],h=[];if(r<o){{var l=s;var c=h;var d=n;var u=o/r;let t=0,e=d[0],i;for(u=Math.ceil(u),i=0;i<l.length;i++)i===e&&(c.push(l[i]),t++,e=d[t*u])}return h}var g=function(t,e,i){var t=function(t){var e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),s=e.length/i;if(!t)return Math.max(s,1);var a=Xt(t);for(let t=0,e=a.length-1;t<e;t++){var r=a[t];if(s<r)return r}return Math.max(s,1)}(n,s,r);if(0<o){let t,e;var f=1<o?Math.round((a-i)/(o-1)):null;for(Ls(s,h,g,P(f)?0:i-f,i),t=0,e=o-1;t<e;t++)Ls(s,h,g,n[t],n[t+1]);return Ls(s,h,g,a,P(f)?s.length:a+f),h}return Ls(s,h,g),h}function Ls(t,e,i,s,a){var r=B(s,0),n=Math.min(B(a,t.length),t.length);let o=0,h,l,c;for(i=Math.ceil(i),a&&(i=(h=a-s)/Math.floor(h/i)),c=r;c<0;)o++,c=Math.round(r+o*i);for(l=Math.max(r,0);l<n;l++)l===c&&(e.push(t[l]),o++,c=Math.round(r+o*i))}R.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:As.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),R.route("scale.ticks","color","","color"),R.route("scale.grid","color","","borderColor"),R.route("scale.grid","borderColor","","borderColor"),R.route("scale.title","color","","color"),R.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),R.describe("scales",{_fallback:"scale"}),R.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Rs=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Es(t,e){const i=[];var s=t.length/e,a=t.length;let r=0;for(;r<a;r+=s)i.push(t[Math.floor(r)]);return i}function Is(t){return t.drawTicks?t.tickLength:0}function zs(t,e){if(!t.display)return 0;var e=E(t.font,e),i=V(t.padding);return(I(t.text)?t.text.length:1)*e.lineHeight+i.height}class Fs extends i{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){var{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this,t=l(t,Number.POSITIVE_INFINITY),e=l(e,Number.NEGATIVE_INFINITY),i=l(i,Number.POSITIVE_INFINITY),s=l(s,Number.NEGATIVE_INFINITY);return{min:l(t,i),max:l(e,s),minDefined:p(t),maxDefined:p(e)}}getMinMax(i){let{min:s,max:a,minDefined:r,maxDefined:n}=this.getUserBounds();var o;if(r&&n)return{min:s,max:a};const h=this.getMatchingVisibleMetas();for(let t=0,e=h.length;t<e;++t)o=h[t].controller.getMinMax(this,i),r||(s=Math.min(s,o.min)),n||(a=Math.max(a,o.max));return s=n&&s>a?a:s,a=r&&s>a?s:a,{min:l(s,l(a,s)),max:l(a,l(s,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){c(this.options.beforeUpdate,[this])}update(t,e,i){var{beginAtZero:s,grace:a,ticks:r}=this.options,n=r.sampleSize,t=(this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Je(this,a,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks(),n<this.ticks.length);this._convertTicksToLabels(t?Es(this.ticks,n):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=Ts(this,this.ticks),this._labelSizes=null),t&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){c(this.options.afterUpdate,[this])}beforeSetDimensions(){c(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){c(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),c(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){c(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){var e=this.options.ticks;let i,s,a;for(i=0,s=t.length;i<s;i++)(a=t[i]).label=c(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){c(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){c(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){var t,e,i,s,a=this.options,r=a.ticks,n=this.ticks.length,o=r.minRotation||0,h=r.maxRotation;let l=o;!this._isVisible()||!r.display||h<=o||n<=1||!this.isHorizontal()?this.labelRotation=o:(e=(t=this._getLabelSizes()).widest.width,i=t.highest.height,s=f(this.chart.width-e,0,this.maxWidth),(a.offset?this.maxWidth/n:s/(n-1))<e+6&&(s=s/(n-(a.offset?.5:1)),n=this.maxHeight-Is(a.grid)-r.padding-zs(a.title,this.chart.options.font),r=Math.sqrt(e*e+i*i),l=Qt(Math.min(Math.asin(f((t.highest.height+6)/s,-1,1)),Math.asin(f(n/r,-1,1))-Math.asin(f(i/r,-1,1)))),l=Math.max(o,Math.min(h,l))),this.labelRotation=l)}afterCalculateLabelRotation(){c(this.options.afterCalculateLabelRotation,[this])}beforeFit(){c(this.options.beforeFit,[this])}fit(){const t={width:0,height:0};var e,i,s,a,r,{chart:n,options:{ticks:o,title:h,grid:l}}=this,c=this._isVisible(),d=this.isHorizontal();c&&(c=zs(h,n.options.font),d?(t.width=this.maxWidth,t.height=Is(l)+c):(t.height=this.maxHeight,t.width=Is(l)+c),o.display&&this.ticks.length&&({first:h,last:l,widest:c,highest:e}=this._getLabelSizes(),i=2*o.padding,a=z(this.labelRotation),s=Math.cos(a),a=Math.sin(a),d?(r=o.mirror?0:a*c.width+s*e.height,t.height=Math.min(this.maxHeight,t.height+r+i)):(r=o.mirror?0:s*c.width+a*e.height,t.width=Math.min(this.maxWidth,t.width+r+i)),this._calculatePadding(h,l,a,s))),this._handleMargins(),d?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(i,s,a,r){var{ticks:{align:n,padding:o},position:h}=this.options,l=0!==this.labelRotation,h="top"!==h&&"x"===this.axis;if(this.isHorizontal()){var c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let t=0,e=0;l?e=h?(t=r*i.width,a*s.height):(t=a*i.height,r*s.width):"start"===n?e=s.width:"end"===n?t=i.width:(t=i.width/2,e=s.width/2),this.paddingLeft=Math.max((t-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((e-d+o)*this.width/(this.width-d),0)}else{let t=s.height/2,e=i.height/2;"start"===n?(t=0,e=i.height):"end"===n&&(t=s.height,e=0),this.paddingTop=t+o,this.paddingBottom=e+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){c(this.options.afterFit,[this])}isHorizontal(){var{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)P(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){var i=this.options.ticks.sampleSize;let t=this.ticks;i<t.length&&(t=Es(t,i)),this._labelSizes=e=this._computeLabelSizes(t,t.length)}return e}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:s}=this,a=[],r=[];let n=0,o=0,h,l,c,d,u,g,f,p,m,v,x;for(h=0;h<e;++h){if(d=t[h].label,u=this._resolveTickFontOptions(h),i.font=g=u.string,f=s[g]=s[g]||{data:{},gc:[]},p=u.lineHeight,m=v=0,P(d)||I(d)){if(I(d))for(l=0,c=d.length;l<c;++l)P(x=d[l])||I(x)||(m=ne(i,f.data,f.gc,m,x),v+=p)}else m=ne(i,f.data,f.gc,m,d),v=p;a.push(m),r.push(v),n=Math.max(m,n),o=Math.max(v,o)}_=s,b=e,M(_,t=>{const e=t.gc;var i=e.length/2;let s;if(b<i){for(s=0;s<i;++s)delete t.data[e[s]];e.splice(0,i)}});var b,_=a.indexOf(n),y=r.indexOf(o),w=t=>({width:a[t]||0,height:r[t]||0});return{first:w(0),last:w(e-1),widest:w(_),highest:w(y),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);t=this._startPixel+t*this._length;return ae(this._alignToPixels?he(this.chart,t,0):t)}getDecimalForPixel(t){t=(t-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){var{min:t,max:e}=this;return t<0&&e<0?e:0<t&&0<e?t:0}getContext(t){var e,i=this.ticks||[];if(0<=t&&t<i.length){const s=i[t];return s.$context||(s.$context=(i=this.getContext(),e=s,w(i,{tick:e,index:t,type:"tick"})))}return this.$context||(this.$context=w(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){var t=this.options.ticks,e=z(this.labelRotation),i=Math.abs(Math.cos(e)),e=Math.abs(Math.sin(e)),s=this._getLabelSizes(),t=t.autoSkipPadding||0,a=s?s.widest.width+t:0,s=s?s.highest.height+t:0;return this.isHorizontal()?a*e<s*i?a/i:s/e:s*e<a*i?s/i:a/e}_isVisible(){var t=this.options.display;return"auto"!==t?!!t:0<this.getMatchingVisibleMetas().length}_computeGridLineItems(t){var e=this.axis;const i=this.chart;var s=this.options;const{grid:a,position:r}=s;var n=a.offset,o=this.isHorizontal(),h=this.ticks.length+(n?1:0),l=Is(a);const c=[];var d=a.setContext(this.getContext());const u=d.drawBorder?d.borderWidth:0;function g(t){return he(i,t,u)}var f,p,d=u/2;let m,v,x,b,_,y,w,M,k,S,P,D;"top"===r?(m=g(this.bottom),y=this.bottom-l,M=m-d,S=g(t.top)+d,D=t.bottom):"bottom"===r?(m=g(this.top),S=t.top,D=g(t.bottom)-d,y=m+d,M=this.top+l):"left"===r?(m=g(this.right),_=this.right-l,w=m-d,k=g(t.left)+d,P=t.right):"right"===r?(m=g(this.left),k=t.left,P=g(t.right)-d,_=m+d,w=this.left+l):"x"===e?("center"===r?m=g((t.top+t.bottom)/2+.5):F(r)&&(p=r[f=Object.keys(r)[0]],m=g(this.chart.scales[f].getPixelForValue(p))),S=t.top,D=t.bottom,y=m+d,M=y+l):"y"===e&&("center"===r?m=g((t.left+t.right)/2):F(r)&&(p=r[f=Object.keys(r)[0]],m=g(this.chart.scales[f].getPixelForValue(p))),_=m-d,w=_-l,k=t.left,P=t.right);var e=B(s.ticks.maxTicksLimit,h),C=Math.max(1,Math.ceil(h/e));for(v=0;v<h;v+=C){var O=a.setContext(this.getContext(v)),A=O.lineWidth,T=O.color,L=a.borderDash||[],R=O.borderDashOffset,E=O.tickWidth,I=O.tickColor,z=O.tickBorderDash||[],O=O.tickBorderDashOffset;void 0!==(x=function(t,e,i){var s=t.ticks.length,a=Math.min(e,s-1),r=t._startPixel,n=t._endPixel;let o=t.getPixelForTick(a),h;if(!(i&&(h=1===s?Math.max(o-r,n-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(a-1))/2,(o+=a<e?h:-h)<r-1e-6||o>n+1e-6)))return o}(this,v,n))&&(b=he(i,x,A),o?_=w=k=P=b:y=M=S=D=b,c.push({tx1:_,ty1:y,tx2:w,ty2:M,x1:k,y1:S,x2:P,y2:D,width:A,color:T,borderDash:L,borderDashOffset:R,tickWidth:E,tickColor:I,tickBorderDash:z,tickBorderDashOffset:O}))}return this._ticksLength=h,this._borderValue=m,c}_computeLabelItems(t){var e=this.axis,i=this.options;const{position:s,ticks:a}=i;var r,n=this.isHorizontal(),o=this.ticks,{align:h,crossAlign:l,padding:c,mirror:d}=a,i=Is(i.grid),u=i+c,c=d?-c:u,g=-z(this.labelRotation);const f=[];let p,m,v,x,b,_,y,w,M,k,S,P="middle";"top"===s?(b=this.bottom-c,_=this._getXAxisLabelAlignment()):"bottom"===s?(b=this.top+c,_=this._getXAxisLabelAlignment()):"left"===s?(c=this._getYAxisLabelAlignment(i),_=c.textAlign,x=c.x):"right"===s?(c=this._getYAxisLabelAlignment(i),_=c.textAlign,x=c.x):"x"===e?("center"===s?b=(t.top+t.bottom)/2+u:F(s)&&(r=s[c=Object.keys(s)[0]],b=this.chart.scales[c].getPixelForValue(r)+u),_=this._getXAxisLabelAlignment()):"y"===e&&("center"===s?x=(t.left+t.right)/2-u:F(s)&&(r=s[c=Object.keys(s)[0]],x=this.chart.scales[c].getPixelForValue(r)),_=this._getYAxisLabelAlignment(i).textAlign),"y"===e&&("start"===h?P="top":"end"===h&&(P="bottom"));var D=this._getLabelSizes();for(p=0,m=o.length;p<m;++p){v=o[p].label;var C=a.setContext(this.getContext(p)),O=(y=this.getPixelForTick(p)+a.labelOffset,M=(w=this._resolveTickFontOptions(p)).lineHeight,(k=I(v)?v.length:1)/2),A=C.color,T=C.textStrokeColor,L=C.textStrokeWidth;n?(x=y,S="top"===s?"near"===l||0!=g?-k*M+M/2:"center"===l?-D.highest.height/2-O*M+M:-D.highest.height+M/2:"near"===l||0!=g?M/2:"center"===l?D.highest.height/2-O*M:D.highest.height-k*M,d&&(S*=-1)):(b=y,S=(1-k)*M/2);let i;if(C.showLabelBackdrop){var O=V(C.backdropPadding),R=D.heights[p],E=D.widths[p];let t=b+S-O.top,e=x-O.left;switch(P){case"middle":t-=R/2;break;case"bottom":t-=R}switch(_){case"center":e-=E/2;break;case"right":e-=E}i={left:e,top:t,width:E+O.width,height:R+O.height,color:C.backdropColor}}f.push({rotation:g,label:v,font:w,color:A,strokeColor:T,strokeWidth:L,textOffset:S,textAlign:_,textBaseline:P,translation:[x,b],backdrop:i})}return f}_getXAxisLabelAlignment(){var{position:t,ticks:e}=this.options;if(-z(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align&&(i="right"),i}_getYAxisLabelAlignment(t){var{position:e,ticks:{crossAlign:i,mirror:s,padding:a}}=this.options,t=t+a,r=this._getLabelSizes().widest.width;let n,o;return"left"===e?s?(o=this.right+a,"near"===i?n="left":"center"===i?(n="center",o+=r/2):(n="right",o+=r)):(o=this.right-t,"near"===i?n="right":"center"===i?(n="center",o-=r/2):(n="left",o=this.left)):"right"===e?s?(o=this.left+a,"near"===i?n="right":"center"===i?(n="center",o-=r/2):(n="left",o-=r)):(o=this.left+t,"near"===i?n="left":"center"===i?(n="center",o+=r/2):(n="right",o=this.right)):n="right",{textAlign:n,x:o}}_computeLabelArea(){var t,e;if(!this.options.ticks.mirror)return t=this.chart,e=this.options.position,"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:a,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,a,r),t.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const i=this.ticks;var s=i.findIndex(t=>t.value===e);return 0<=s?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){var e=this.options.grid;const s=this.ctx;var i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,r;var n=(t,e,i)=>{i.width&&i.color&&(s.save(),s.lineWidth=i.width,s.strokeStyle=i.color,s.setLineDash(i.borderDash||[]),s.lineDashOffset=i.borderDashOffset,s.beginPath(),s.moveTo(t.x,t.y),s.lineTo(e.x,e.y),s.stroke(),s.restore())};if(e.display)for(a=0,r=i.length;a<r;++a){var o=i[a];e.drawOnChartArea&&n({x:o.x1,y:o.y1},{x:o.x2,y:o.y2},o),e.drawTicks&&n({x:o.tx1,y:o.ty1},{x:o.tx2,y:o.ty2},{color:o.tickColor,width:o.tickWidth,borderDash:o.tickBorderDash,borderDashOffset:o.tickBorderDashOffset})}}drawBorder(){const{chart:a,ctx:r,options:{grid:n}}=this;var o=n.setContext(this.getContext()),h=n.drawBorder?o.borderWidth:0;if(h){var l=n.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let t,e,i,s;this.isHorizontal()?(t=he(a,this.left,h)-h/2,e=he(a,this.right,l)+l/2,i=s=c):(i=he(a,this.top,h)-h/2,s=he(a,this.bottom,l)+l/2,t=e=c),r.save(),r.lineWidth=o.borderWidth,r.strokeStyle=o.borderColor,r.beginPath(),r.moveTo(t,i),r.lineTo(e,s),r.stroke(),r.restore()}}drawLabels(i){if(this.options.ticks.display){const l=this.ctx;var s=this._computeLabelArea(),a=(s&&ue(l,s),this._labelItems||(this._labelItems=this._computeLabelItems(i)));let t,e;for(t=0,e=a.length;t<e;++t){var r=a[t],n=r.font,o=r.label,h=(r.backdrop&&(l.fillStyle=r.backdrop.color,l.fillRect(r.backdrop.left,r.backdrop.top,r.backdrop.width,r.backdrop.height)),r.textOffset);me(l,o,0,h,n,r)}s&&ge(l)}}drawTitle(){var{ctx:e,options:{position:i,title:s,reverse:a}}=this;if(s.display){var r=E(s.font),n=V(s.padding),o=s.align;let t=r.lineHeight/2;"bottom"===i||"center"===i||F(i)?(t+=n.bottom,I(s.text)&&(t+=r.lineHeight*(s.text.length-1))):t+=n.top;var{titleX:n,titleY:h,maxWidth:l,rotation:c}=function(t,e,i,s){var{top:a,left:r,bottom:n,right:o,chart:h}=t;const{chartArea:l,scales:c}=h;let d=0,u,g,f;var p,m,h=n-a,v=o-r;return t.isHorizontal()?(g=L(s,r,o),f=F(i)?(m=i[p=Object.keys(i)[0]],c[p].getPixelForValue(m)+h-e):"center"===i?(l.bottom+l.top)/2+h-e:Rs(t,i,e),u=o-r):(g=F(i)?(m=i[p=Object.keys(i)[0]],c[p].getPixelForValue(m)-v+e):"center"===i?(l.left+l.right)/2-v+e:Rs(t,i,e),f=L(s,n,a),d="left"===i?-y:y),{titleX:g,titleY:f,maxWidth:u,rotation:d}}(this,t,i,o);me(e,s.text,0,0,r,{color:s.color,maxWidth:l,rotation:c,textAlign:function(t,e,i){let s=T(t);return s=i&&"right"!==e||!i&&"right"===e?"left"===(t=s)?"right":"right"===t?"left":t:s}(o,i,a),textBaseline:"middle",translation:[n,h]})}}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){var t=this.options,e=t.ticks&&t.ticks.z||0,t=B(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===Fs.prototype.draw?[{z:t,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:t+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){var e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID";const s=[];let a,r;for(a=0,r=e.length;a<r;++a){var n=e[a];n[i]!==this.id||t&&n.type!==t||s.push(n)}return s}_resolveTickFontOptions(t){return E(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){var t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Bs{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){var e=Object.getPrototypeOf(t);let i;"id"in(a=e)&&"defaults"in a&&(i=this.register(e));const s=this.items;var a=t.id,e=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);if(a in s)return e;var a=s[a]=t,r=e,n=i;{var o,h;n=Ct(Object.create(null),[n?R.get(n):{},R.get(r),a.defaults]),R.set(r,n),a.defaultRoutes&&(o=r,h=a.defaultRoutes,Object.keys(h).forEach(t=>{const e=t.split(".");var i=e.pop(),s=[o].concat(e).join(".");const a=h[t].split(".");var t=a.pop(),r=a.join(".");R.route(s,i,r,t)}))}return a.descriptors&&R.describe(r,a.descriptors),this.override&&R.override(t.id,t.overrides),e}get(t){return this.items[t]}unregister(t){const e=this.items;var t=t.id,i=this.scope;t in e&&delete e[t],i&&t in R[i]&&(delete R[i][t],this.override&&delete Ft[t])}}var b=new class{constructor(){this.controllers=new Bs(e,"datasets",!0),this.elements=new Bs(i,"elements"),this.plugins=new Bs(Object,"plugins"),this.scales=new Bs(Fs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(i,t,s){[...t].forEach(t=>{const e=s||this._getRegistryForType(t);s||e.isForType(t)||e===this.plugins&&t.id?this._exec(i,e,t):M(t,t=>{var e=s||this._getRegistryForType(t);this._exec(i,e,t)})})}_exec(t,e,i){var s=It(t);c(i["before"+s],[],i),e[t](i),c(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(t,e,i){e=e.get(t);if(void 0===e)throw new Error('"'+t+'" is not a registered '+i+".");return e}};class Vs{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));s=s?this._descriptors(t).filter(s):this._descriptors(t),i=this._notify(s,t,e,i);return"destroy"===e&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),i}_notify(t,e,i,s){s=s||{};for(const r of t){var a=r.plugin;if(!1===c(a[i],[e,s,r.options],a)&&s.cancelable)return!1}return!0}invalidate(){P(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;var e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){var i=t&&t.config,s=B(i.options&&i.options.plugins,{}),i=function(t){const e=[],i=Object.keys(b.plugins.items);for(let t=0;t<i.length;t++)e.push(b.getPlugin(i[t]));var s=t.plugins||[];for(let t=0;t<s.length;t++){var a=s[t];-1===e.indexOf(a)&&e.push(a)}return e}(i);if(!1!==s||e){var a=t,r=i,n=s,o=e;const c=[],d=a.getContext();for(let t=0;t<r.length;t++){var h=r[t],l=h.id,l=function(t,e){return e||!1!==t?!0!==t?t:{}:null}(n[l],o);null!==l&&c.push({plugin:h,options:function(t,e,i,s){e=t.pluginScopeKeys(e),i=t.getOptionScopes(i,e);return t.createResolver(i,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}(a.config,h,l,d)})}return c}return[]}_notifyStateChanges(t){var e=this._oldCache||[],i=this._cache,s=(t,i)=>t.filter(e=>!i.some(t=>e.plugin.id===t.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Ws(t,e){var i=R.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ns(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(e=e.position)||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0)||t.charAt(0).toLowerCase()}function Hs(e,i){const r=Ft[e.type]||{scales:{}},n=i.scales||{},o=Ws(e.type,i),h=Object.create(null),l=Object.create(null);return Object.keys(n).forEach(t=>{var e=n[t];if(!F(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);var i=Ns(t,e),s=(s=i,a=o,s===a?"_index_":"_value_"),a=r.scales||{};h[i]=h[i]||t,l[t]=Ot(Object.create(null),[{axis:i},e,a[i],a[s]])}),e.data.datasets.forEach(s=>{var t=s.type||e.type;const a=s.indexAxis||Ws(t,i),r=(Ft[t]||{}).scales||{};Object.keys(r).forEach(t=>{var e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),i=s[e+"AxisID"]||h[e]||e;l[i]=l[i]||Object.create(null),Ot(l[i],[{axis:e},n[i],r[t]])})}),Object.keys(l).forEach(t=>{t=l[t];Ot(t,[R.scales[t.type],R.scale])}),l}function js(t){const e=t.options||(t.options={});e.plugins=B(e.plugins,{}),e.scales=Hs(t,e)}function Ys(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const $s=new Map,Us=new Set;function Xs(t,e){let i=$s.get(t);return i||(i=e(),$s.set(t,i),Us.add(i)),i}const qs=(t,e,i)=>{e=Et(e,i);void 0!==e&&t.add(e)};class Ks{constructor(t){this._config=((t=(t=t)||{}).data=Ys(t.data),js(t),t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ys(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){var t=this._config;this.clearCache(),js(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Xs(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Xs(t+".transition."+e,()=>[[`datasets.${t}.transitions.`+e,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Xs(t+"-"+e,()=>[[`datasets.${t}.elements.`+e,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Xs(this.type+"-plugin-"+e,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(e,t,i){const{options:s,type:a}=this,r=this._cachedScopes(e,i);i=r.get(t);if(i)return i;const n=new Set,o=(t.forEach(t=>{e&&(n.add(e),t.forEach(t=>qs(n,e,t))),t.forEach(t=>qs(n,s,t)),t.forEach(t=>qs(n,Ft[a]||{},t)),t.forEach(t=>qs(n,R,t)),t.forEach(t=>qs(n,Bt,t))}),Array.from(n));return 0===o.length&&o.push(Object.create(null)),Us.has(t)&&r.set(t,o),o}chartOptionScopes(){var{options:t,type:e}=this;return[t,Ft[e]||{},R.datasets[e]||{},{type:e},R,Bt]}resolveNamedOptions(t,e,i,s=[""]){const a={$shared:!0};var{resolver:s,subPrefixes:r}=Gs(this._resolverCache,t,s);let n=s;!function(t,e){const{isScriptable:i,isIndexable:s}=gi(t);for(const o of e){var a=i(o),r=s(o),n=(r||a)&&t[o];if(a&&(d(n)||Zs(n))||r&&I(n))return 1}return}(s,e)||(a.$shared=!1,i=d(i)?i():i,t=this.createResolver(t,i,r),n=ui(s,i,t));for(const o of e)a[o]=n[o];return a}createResolver(t,e,i=[""],s){t=Gs(this._resolverCache,t,i).resolver;return F(e)?ui(t,e,void 0,s):t}}function Gs(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));t=i.join();let a=s.get(t);return a||(e=di(e,i),a={resolver:e,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(t,a)),a}const Zs=i=>F(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||d(i[e]),!1);const Qs=["top","bottom","left","right","chartArea"];function Js(t,e){return"top"===t||"bottom"===t||-1===Qs.indexOf(t)&&"x"===e}function ta(i,s){return function(t,e){return t[i]===e[i]?t[s]-e[s]:t[i]-e[i]}}function ea(t){const e=t.chart;var i=e.options.animation;e.notifyPlugins("afterRender"),c(i&&i.onComplete,[t],e)}function ia(t){var e=t.chart,i=e.options.animation;c(i&&i.onProgress,[t],e)}function sa(t){return Se()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t=t&&t.canvas?t.canvas:t}const aa={},ra=t=>{const e=sa(t);return Object.values(aa).filter(t=>t.canvas===e).pop()};class s{constructor(t,e){const i=this.config=new Ks(e);e=sa(t),t=ra(e);if(t)throw new Error("Canvas is already in use. Chart with ID '"+t.id+"' must be destroyed before the canvas can be reused.");var t=i.createResolver(i.chartOptionScopes(),this.getContext()),e=(this.platform=new(i.platform||gs(e)),this.platform.updateConfig(i),this.platform.acquireContext(e,t.aspectRatio)),s=e&&e.canvas,a=s&&s.height,r=s&&s.width;this.id=yt(),this.ctx=e,this.canvas=s,this.width=r,this.height=a,this._options=t,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 Vs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=A(t=>this.update(t),t.resizeDelay||0),this._dataChanges=[],aa[this.id]=this,e&&s?(n.listen(this,"complete",ea),n.listen(this,"progress",ia),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){var{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:a}=this;return P(t)?e&&a?a:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ze(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return le(this.canvas,this.ctx),this}stop(){return n.stop(this),this}resize(t,e){n.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){var i=this.options,s=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(s,t,e,a),t=i.devicePixelRatio||this.platform.getDevicePixelRatio(),e=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,ze(this,t,!0)&&(this.notifyPlugins("resize",{size:s}),c(i.onResize,[this,s],this),this.attached&&this._doResize(e)&&this.render())}ensureScalesHaveIDs(){M(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const o=this.options,s=o.scales,h=this.scales,l=Object.keys(h).reduce((t,e)=>(t[e]=!1,t),{});let t=[];M(t=s?t.concat(Object.keys(s).map(t=>{var e=s[t],t=Ns(t,e),i="r"===t,t="x"===t;return{options:e,dposition:i?"chartArea":t?"bottom":"left",dtype:i?"radialLinear":t?"category":"linear"}})):t,t=>{const e=t.options;var i=e.id,s=Ns(i,e),a=B(e.type,t.dtype);void 0!==e.position&&Js(e.position,s)===Js(t.dposition)||(e.position=t.dposition),l[i]=!0;let r=null;if(i in h&&h[i].type===a)r=h[i];else{const n=b.getScale(a);r=new n({id:i,type:a,ctx:this.ctx,chart:this}),h[r.id]=r}r.init(e,o)}),M(l,(t,e)=>{t||delete h[e]}),M(h,t=>{a.configure(this,t,t.options),a.addBox(this,t)})}_updateMetasets(){const t=this._metasets;var e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),e<i){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(ta("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach((e,t)=>{0===i.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(t)})}buildOrUpdateControllers(){const e=[];var i=this.data.datasets;let s,t;for(this._removeUnreferencedMetasets(),s=0,t=i.length;s<t;s++){var a=i[s];let t=this.getDatasetMeta(s);var r=a.type||this.config.type;if(t.type&&t.type!==r&&(this._destroyDatasetMeta(s),t=this.getDatasetMeta(s)),t.type=r,t.indexAxis=a.indexAxis||Ws(r,this.options),t.order=a.order||0,t.index=s,t.label=""+a.label,t.visible=this.isDatasetVisible(s),t.controller)t.controller.updateIndex(s),t.controller.linkScales();else{const n=b.getController(r);var{datasetElementType:a,dataElementType:r}=R.datasets[r];Object.assign(n.prototype,{dataElementType:b.getElement(r),datasetElementType:a&&b.getElement(a)}),t.controller=new n(this,s),e.push(t.controller)}}return this._updateMetasets(),e}_resetElements(){M(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();var s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1!==this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})){const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const o=this.getDatasetMeta(t)["controller"];var r=!a&&-1===n.indexOf(o);o.buildOrUpdateElements(r),i=Math.max(+o.getMaxOverflow(),i)}i=this._minPadding=s.layout.autoPadding?i:0,this._updateLayout(i),a||M(n,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ta("z","_idx")),this._lastEvent&&this._eventHandler(this._lastEvent,!0),this.render()}}_updateScales(){M(this.scales,t=>{a.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){var t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);zt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){var t,e,i,s=this["_hiddenIndices"];for({method:t,start:e,count:i}of this._getUniformDataChanges()||[]){var a="_removeElements"===t?-i:i,r=(h=l=o=n=r=void 0,s),n=e,o=a;for(const c of Object.keys(r)){var h,l=+c;n<=l&&(h=r[c],delete r[c],(0<o||n<l)&&(r[l+o]=h))}}}_getUniformDataChanges(){const t=this._dataChanges;if(t&&t.length){this._dataChanges=[];var e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),s=i(0);for(let t=1;t<e;t++)if(!zt(s,i(t)))return;return Array.from(s).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}}_updateLayout(t){if(!1!==this.notifyPlugins("beforeLayout",{cancelable:!0})){a.update(this,this.width,this.height,t);t=this.chartArea;const e=t.width<=0||t.height<=0;this._layers=[],M(this.boxes,t=>{e&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}}_updateDatasets(i){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:i,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,e=this.data.datasets.length;t<e;++t)this._updateDataset(t,d(i)?i({datasetIndex:t}):i);this.notifyPlugins("afterDatasetsUpdate",{mode:i})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(n.has(this)?this.attached&&!n.running(this)&&n.start(this):(this.draw(),ea({chart:this})))}draw(){let t;var e,i;if(this._resizeBeforeDraw&&({width:e,height:i}=this._resizeBeforeDraw,this._resize(e,i),this._resizeBeforeDraw=null),this.clear(),!(this.width<=0||this.height<=0)&&!1!==this.notifyPlugins("beforeDraw",{cancelable:!0})){const s=this._layers;for(t=0;t<s.length&&s[t].z<=0;++t)s[t].draw(this.chartArea);for(this._drawDatasets();t<s.length;++t)s[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}}_getSortedDatasetMetas(t){var e=this._sortedMetasets;const i=[];let s,a;for(s=0,a=e.length;s<a;++s){var r=e[s];t&&!r.visible||i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1!==this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){var e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;0<=t;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}}_drawDataset(t){var e=this.ctx,i=t._clip,s=!i.disabled,a=this.chartArea;const r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(s&&ue(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),s&&ge(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,i,s){const a=Ye.modes[e];return"function"==typeof a?a(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=w(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){var e=this.data.datasets[t];if(!e)return!1;t=this.getDatasetMeta(t);return"boolean"==typeof t.hidden?!t.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(e,t,i){const s=i?"show":"hide",a=this.getDatasetMeta(e),r=a.controller._resolveAnimations(void 0,s);g(t)?(a.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),r.update(a,{visible:i}),this.update(t=>t.datasetIndex===e?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),n.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){var{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),le(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete aa[this.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const i=this._listeners,s=this.platform,e=(t,e)=>{s.addEventListener(this,t,e),i[t]=e},a=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};M(this.options.events,t=>e(t,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const i=this._responsiveListeners,s=this.platform,t=(t,e)=>{s.addEventListener(this,t,e),i[t]=e},e=(t,e)=>{i[t]&&(s.removeEventListener(this,t,e),delete i[t])},a=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const n=()=>{e("attach",n),this.attached=!0,this.resize(),t("resize",a),t("detach",r)};r=()=>{this.attached=!1,e("resize",a),this._stop(),this._resize(0,0),t("attach",n)},(s.isAttached(this.canvas)?n:r)()}unbindEvents(){M(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},M(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){var s=i?"set":"remove";let a,r,n,o;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex)).controller["_"+s+"DatasetHoverStyle"](),n=0,o=t.length;n<o;++n){const h=(r=t[n])&&this.getDatasetMeta(r.datasetIndex).controller;h&&h[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){var e=this._active||[],t=t.map(({datasetIndex:t,index:e})=>{var i=this.getDatasetMeta(t);if(i)return{datasetIndex:t,element:i.data[e],index:e};throw new Error("No dataset found at index "+t)});kt(t,e)||(this._active=t,this._updateHoverStyles(t,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){var s=this.options.hover,a=(t,i)=>t.filter(e=>!i.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),r=a(e,t),i=i?t:a(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),i.length&&s.mode&&this.updateHoverStyle(i,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0};var s=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1!==this.notifyPlugins("beforeEvent",i,s))return t=this._handleEvent(e,t),i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(t||i.changed)&&this.render(),this}_handleEvent(t,e){var{_active:i=[],options:s}=this,a=s.hover;let r=[];let n=null;return"mouseout"!==t.type&&(r=this.getElementsAtEventForMode(t,a.mode,a,e),n="click"===t.type?this._lastEvent:t),this._lastEvent=null,de(t,this.chartArea,this._minPadding)&&(c(s.onHover,[t,r,this],this),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||c(s.onClick,[t,r,this],this)),((a=!kt(r,i))||e)&&(this._active=r,this._updateHoverStyles(r,i,e)),this._lastEvent=n,a}}const na=()=>M(s.instances,t=>t._plugins.invalidate());function oa(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Object.defineProperties(s,{defaults:{enumerable:!0,value:R},instances:{enumerable:!0,value:aa},overrides:{enumerable:!0,value:Ft},registry:{enumerable:!0,value:b},version:{enumerable:!0,value:"3.6.1"},getChart:{enumerable:!0,value:ra},register:{enumerable:!0,value:(...t)=>{b.add(...t),na()}},unregister:{enumerable:!0,value:(...t)=>{b.remove(...t),na()}}});class ha{constructor(t){this.options=t||{}}formats(){return oa()}parse(t,e){return oa()}format(t,e){return oa()}add(t,e,i){return oa()}diff(t,e,i){return oa()}startOf(t,e,i){return oa()}endOf(t,e){return oa()}}ha.override=function(t){Object.assign(ha.prototype,t)};var la={_date:ha};function ca(t){const e=t.iScale;var i=function(s,t){if(!s._cache.$bar){const a=s.getMatchingVisibleMetas(t);let i=[];for(let t=0,e=a.length;t<e;t++)i=i.concat(a[t].controller.getAllParsedValues(s));s._cache.$bar=ke(i.sort((t,e)=>t-e))}return s._cache.$bar}(e,t.type);let s=e._length,a,r,n,o;var h=()=>{32767!==n&&-32768!==n&&(g(o)&&(s=Math.min(s,Math.abs(n-o)||s)),o=n)};for(a=0,r=i.length;a<r;++a)n=e.getPixelForValue(i[a]),h();for(o=void 0,a=0,r=e.ticks.length;a<r;++a)n=e.getPixelForTick(a),h();return s}function da(i,s,a,r){if(I(i)){var n=i;var o=s;var h=a;var l=r;var c=h.parse(n[0],l),n=h.parse(n[1],l),l=Math.min(c,n),d=Math.max(c,n);let t=l,e=d;Math.abs(l)>Math.abs(d)&&(t=d,e=l),o[h.axis]=e,o._custom={barStart:t,barEnd:e,start:c,end:n,min:l,max:d}}else s[a.axis]=a.parse(i,r);return s}function ua(t,e,i,s){const a=t.iScale;var r=t.vScale,n=a.getLabels(),o=a===r;const h=[];let l,c,d,u;for(c=(l=i)+s;l<c;++l)u=e[l],(d={})[a.axis]=o||a.parse(n[l],l),h.push(da(u,d,r,l));return h}function ga(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function fa(t,e,i,s){let a=e.borderSkipped;const r={};var n,o,h,l;a&&({start:e,end:n,reverse:o,top:h,bottom:l}=function(t){let e,i,s,a,r;return s=t.horizontal?(e=t.base>t.x,i="left","right"):(e=t.base<t.y,i="bottom","top"),r=e?(a="end","start"):(a="start","end"),{start:i,end:s,reverse:e,top:a,bottom:r}}(t),"middle"===a&&i&&(t.enableBorderRadius=!0,a=(i._top||0)===s?h:(i._bottom||0)===s?l:(r[pa(l,e,n,o)]=!0,h)),r[pa(a,e,n,o)]=!0),t.borderSkipped=r}function pa(t,e,i,s){var a,r;return t=s?(s=i,ma(t=(a=t)===(r=e)?s:a===s?r:a,i,e)):ma(t,e,i)}function ma(t,e,i){return"start"===t?e:"end"===t?i:t}class va extends e{parsePrimitiveData(t,e,i,s){return ua(t,e,i,s)}parseArrayData(t,e,i,s){return ua(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:a,vScale:r}=t;var{xAxisKey:t="x",yAxisKey:n="y"}=this._parsing,o="x"===a.axis?t:n,h="x"===r.axis?t:n;const l=[];let c,d,u,g;for(d=(c=i)+s;c<d;++c)g=e[c],(u={})[a.axis]=a.parse(Et(g,o),c),l.push(da(Et(g,h),u,r,c));return l}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const{iScale:e,vScale:i}=this._cachedMeta;var t=this.getParsed(t),s=t._custom,s=ga(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(t[i.axis]);return{label:""+e.getLabelForValue(t[e.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){var e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(e,i,s,a){var r="reset"===a;const{index:n,_cachedMeta:{vScale:o}}=this;var h=o.getBasePixel(),l=o.isHorizontal(),c=this._getRuler(),t=this.resolveDataElementOptions(i,a),d=this.getSharedOptions(t),u=this.includeOptions(a,d);this.updateSharedOptions(d,a,t);for(let t=i;t<i+s;t++){var g=this.getParsed(t),f=r||P(g[o.axis])?{base:h,head:h}:this._calculateBarValuePixels(t),p=this._calculateBarIndexPixels(t,c),m=(g._stacks||{})[o.axis];const v={horizontal:l,base:f.base,enableBorderRadius:!m||ga(g._custom)||n===m._top||n===m._bottom,x:l?f.head:p.center,y:l?p.center:f.head,height:l?p.size:Math.abs(f.size),width:l?Math.abs(f.size):p.size};u&&(v.options=d||this.resolveDataElementOptions(t,e[t].active?"active":a));g=v.options||e[t].options;fa(v,g,m,n),[f,p,m]=[v,g["inflateAmount"],c.ratio],f.inflateAmount="auto"===p?1===m?.33:0:p,this.updateElement(e[t],t,v,a)}}_getStacks(t,e){const i=this._cachedMeta.iScale;var s=i.getMatchingVisibleMetas(this._type),a=i.options.stacked,r=s.length;const n=[];let o,h;for(o=0;o<r;++o)if((h=s[o]).controller.options.grouped){if(void 0!==e){var l=h.controller.getParsed(e)[h.controller._cachedMeta.vScale.axis];if(P(l)||isNaN(l))continue}if((!1===a||-1===n.indexOf(h.stack)||void 0===a&&void 0===h.stack)&&n.push(h.stack),h.index===t)break}return n.length||n.push(void 0),n}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i);t=void 0!==e?s.indexOf(e):-1;return-1===t?s.length-1:t}_getRuler(){var t=this.options,e=this._cachedMeta;const i=e.iScale,s=[];let a,r;for(a=0,r=e.data.length;a<r;++a)s.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));var n=t.barThickness;return{min:n||ca(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:n?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i},options:{base:s,minBarLength:a}}=this;var r=s||0,n=this.getParsed(t),o=n._custom,h=ga(o);let l=n[e.axis],c=0,d=i?this.applyStack(e,n,i):l,u,g;d!==l&&(c=d-l,d=l),h&&(l=o.barStart,d=o.barEnd-o.barStart,0!==l&&S(l)!==S(o.barEnd)&&(c=0),c+=l);var n=P(s)||h?c:s;let f=e.getPixelForValue(n);return u=this.chart.getDataVisibility(t)?e.getPixelForValue(c+d):f,g=u-f,Math.abs(g)<a&&(g=(o=g,h=e,n=r,(0!==o?S(o):(h.isHorizontal()?1:-1)*(h.min>=n?1:-1))*a),l===r&&(f-=g/2),u=f+g),f===e.getPixelForValue(r)&&(t=S(g)*e.getLineWidthForValue(r)/2,f+=t,g-=t),{size:g,base:f,head:u,center:u+g/2}}_calculateBarIndexPixels(t,e){const i=e.scale;var s,a=this.options,r=a.skipNull,n=B(a.maxBarThickness,1/0);let o,h;return h=e.grouped?(s=r?this._getStackCount(t):e.stackCount,a=("flex"===a.barThickness?function(t,e,i,s){var a=e.pixels,r=a[t];let n=0<t?a[t-1]:null,o=t<a.length-1?a[t+1]:null;return a=i.categoryPercentage,null===n&&(n=r-(null===o?e.end-e.start:o-r)),null===o&&(o=r+r-n),t=r-(r-Math.min(n,o))/2*a,{chunk:Math.abs(o-n)/2*a/s,ratio:i.barPercentage,start:t}}:function(t,e,i,s){var a=i.barThickness;let r,n;return n=P(a)?(r=e.min*i.categoryPercentage,i.barPercentage):(r=a*s,1),{chunk:r/s,ratio:n,start:e.pixels[t]-r/2}})(t,e,a,s),s=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0),o=a.start+a.chunk*s+a.chunk/2,Math.min(n,a.chunk*a.ratio)):(o=i.getPixelForValue(this.getParsed(t)[i.axis],t),Math.min(n,e.min*e.ratio)),{base:o-h/2,head:o+h/2,center:o,size:h}}draw(){var t=this._cachedMeta,e=t.vScale;const i=t.data;var s=i.length;let a=0;for(;a<s;++a)null!==this.getParsed(a)[e.axis]&&i[a].draw(this._ctx)}}va.id="bar",va.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},va.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class xa extends e{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const a=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<a.length;t++)a[t]._custom=this.resolveDataElementOptions(t+i).radius;return a}parseArrayData(t,e,i,s){const a=super.parseArrayData(t,e,i,s);for(let t=0;t<a.length;t++){var r=e[i+t];a[t]._custom=B(r[2],this.resolveDataElementOptions(t+i).radius)}return a}parseObjectData(t,e,i,s){const a=super.parseObjectData(t,e,i,s);for(let t=0;t<a.length;t++){var r=e[i+t];a[t]._custom=B(r&&r.r&&+r.r,this.resolveDataElementOptions(t+i).radius)}return a}getMaxOverflow(){const e=this._cachedMeta.data;let i=0;for(let t=e.length-1;0<=t;--t)i=Math.max(i,e[t].size(this.resolveDataElementOptions(t))/2);return 0<i&&i}getLabelAndValue(t){var e=this._cachedMeta;const{xScale:i,yScale:s}=e;var t=this.getParsed(t),a=i.getLabelForValue(t.x),r=s.getLabelForValue(t.y),t=t._custom;return{label:e.label,value:"("+a+", "+r+(t?", "+t:"")+")"}}update(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(e,i,s,a){var r="reset"===a;const{iScale:n,vScale:o}=this._cachedMeta;var t=this.resolveDataElementOptions(i,a),h=this.getSharedOptions(t),l=this.includeOptions(a,h),c=n.axis,d=o.axis;for(let t=i;t<i+s;t++){var u=e[t],g=!r&&this.getParsed(t);const p={};var f=p[c]=r?n.getPixelForDecimal(.5):n.getPixelForValue(g[c]),g=p[d]=r?o.getBasePixel():o.getPixelForValue(g[d]);p.skip=isNaN(f)||isNaN(g),l&&(p.options=this.resolveDataElementOptions(t,u.active?"active":a),r&&(p.options.radius=0)),this.updateElement(u,t,p,a)}this.updateSharedOptions(h,a,t)}resolveDataElementOptions(t,e){var i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);t=(s=s.$shared?Object.assign({},s,{$shared:!1}):s).radius;return"active"!==e&&(s.radius=0),s.radius+=B(i&&i._custom,t),s}}xa.id="bubble",xa.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},xa.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};class ba extends e{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(s,a){const r=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=r;else{let t=t=>+r[t];if(F(r[s])){const{key:o="value"}=this._parsing;t=t=>+Et(r[t],o)}let e,i;for(i=(e=s)+a;e<i;++e)n._parsed[e]=t(e)}}_getRotation(){return z(this.options.rotation-90)}_getCircumference(){return z(this.options.circumference)}_getRotationExtents(){let e=m,i=-m;for(let t=0;t<this.chart.data.datasets.length;++t)if(this.chart.isDatasetVisible(t)){const r=this.chart.getDatasetMeta(t).controller;var s=r._getRotation(),a=r._getCircumference();e=Math.min(e,s),i=Math.max(i,s+a)}return{rotation:e,circumference:i-e}}update(t){var e=this.chart["chartArea"];const i=this._cachedMeta;var s=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,r=Math.max((Math.min(e.width,e.height)-a)/2,0),r=Math.min(wt(this.options.cutout,r),1),n=this._getRingWeight(this.index),{circumference:o,rotation:h}=this._getRotationExtents(),{ratioX:h,ratioY:o,offsetX:l,offsetY:c}=function(t,e,s){let i=1,a=1,r=0,n=0;if(e<m){const u=t,g=u+e;var t=Math.cos(u),e=Math.sin(u),o=Math.cos(g),h=Math.sin(g),l=(t,e,i)=>se(t,u,g,!0)?1:Math.max(e,e*s,i,i*s),c=(t,e,i)=>se(t,u,g,!0)?-1:Math.min(e,e*s,i,i*s),d=l(0,t,o),l=l(y,e,h),t=c(_,t,o),o=c(_+y,e,h);i=(d-t)/2,a=(l-o)/2,r=-(d+t)/2,n=-(l+o)/2}return{ratioX:i,ratioY:a,offsetX:r,offsetY:n}}(h,o,r),h=(e.width-a)/h,e=(e.height-a)/o,a=Math.max(Math.min(h,e)/2,0),o=Mt(this.options.radius,a),h=(o-Math.max(o*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=l*o,this.offsetY=c*o,i.total=this.calculateTotal(),this.outerRadius=o-h*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-h*n,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){var i=this.options,s=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*a/m)}updateElements(t,e,i,s){var a="reset"===s,r=this.chart,n=r.chartArea,r=r.options.animation,o=(n.left+n.right)/2,h=(n.top+n.bottom)/2,n=a&&r.animateScale,l=n?0:this.innerRadius,c=n?0:this.outerRadius,r=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(r),u=this.includeOptions(s,d);let g=this._getRotation(),f;for(f=0;f<e;++f)g+=this._circumference(f,a);for(f=e;f<e+i;++f){var p=this._circumference(f,a),m=t[f];const v={x:o+this.offsetX,y:h+this.offsetY,startAngle:g,endAngle:g+p,circumference:p,outerRadius:c,innerRadius:l};u&&(v.options=d||this.resolveDataElementOptions(f,m.active?"active":s)),g+=p,this.updateElement(m,f,v,s)}this.updateSharedOptions(d,s,r)}calculateTotal(){var t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){var a=t._parsed[s];null===a||isNaN(a)||!this.chart.getDataVisibility(s)||e[s].hidden||(i+=Math.abs(a))}return i}calculateCircumference(t){var e=this._cachedMeta.total;return 0<e&&!isNaN(t)?m*(Math.abs(t)/e):0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,s=i.data.labels||[],e=Bi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:e}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,a,r,n,o;if(!t)for(s=0,a=i.data.datasets.length;s<a;++s)if(i.isDatasetVisible(s)){t=(r=i.getDatasetMeta(s)).data,n=r.controller;break}if(!t)return 0;for(s=0,a=t.length;s<a;++s)"inner"!==(o=n.resolveDataElementOptions(s)).borderAlign&&(e=Math.max(e,o.borderWidth||0,o.hoverBorderWidth||0));return e}getMaxOffset(i){let s=0;for(let t=0,e=i.length;t<e;++t){var a=this.resolveDataElementOptions(t);s=Math.max(s,a.offset||0,a.hoverOffset||0)}return s}_getRingWeightOffset(e){let i=0;for(let t=0;t<e;++t)this.chart.isDatasetVisible(t)&&(i+=this._getRingWeight(t));return i}_getRingWeight(t){return Math.max(B(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ba.id="doughnut",ba.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},ba.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},ba.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(a){const t=a.data;if(t.labels.length&&t.datasets.length){const{pointStyle:r}=a.legend.options["labels"];return t.labels.map((t,e)=>{const i=a.getDatasetMeta(0);var s=i.controller.getStyle(e);return{text:t,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:r,hidden:!a.getDataVisibility(e),index:e}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){let e=t.label;t=": "+t.formattedValue;return I(e)?(e=e.slice())[0]+=t:e+=t,e}}}}};class _a extends e{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){var e=this._cachedMeta;const{dataset:i,data:s=[],_dataset:a}=e;var r=this.chart._animationsDisabled;let{start:n,count:o}=function(t,e,i){var s=e.length;let a=0,r=s;if(t._sorted){const{iScale:c,_parsed:d}=t;var t=c.axis,{min:n,max:o,minDefined:h,maxDefined:l}=c.getUserBounds();h&&(a=f(Math.min(x(d,c.axis,n).lo,i?s:x(e,t,c.getPixelForValue(n)).lo),0,s-1)),r=l?f(Math.max(x(d,c.axis,o).hi+1,i?0:x(e,t,c.getPixelForValue(o)).hi+1),a,s)-a:s-a}return{start:a,count:r}}(e,s,r);this._drawStart=n,this._drawCount=o,function(t){var{xScale:e,yScale:i,_scaleRanges:s}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=a,1;t=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,a),t}(e)&&(n=0,o=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=s;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:h},t),this.updateElements(s,n,o,t)}updateElements(e,i,s,a){var r="reset"===a;const{iScale:n,vScale:o,_stacked:h,_dataset:l}=this._cachedMeta;var t=this.resolveDataElementOptions(i,a),c=this.getSharedOptions(t),d=this.includeOptions(a,c),u=n.axis,g=o.axis,{spanGaps:f,segment:p}=this.options,m=qt(f)?f:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||"none"===a;let x=0<i&&this.getParsed(i-1);for(let t=i;t<i+s;++t){var b=e[t],_=this.getParsed(t);const k=v?b:{};var y=P(_[g]),w=k[u]=n.getPixelForValue(_[u],t),M=k[g]=r||y?o.getBasePixel():o.getPixelForValue(h?this.applyStack(o,_,h):_[g],t);k.skip=isNaN(w)||isNaN(M)||y,k.stop=0<t&&_[u]-x[u]>m,p&&(k.parsed=_,k.raw=l.data[t]),d&&(k.options=c||this.resolveDataElementOptions(t,b.active?"active":a)),v||this.updateElement(b,t,k,a),x=_}this.updateSharedOptions(c,a,t)}getMaxOverflow(){var t=this._cachedMeta,e=t.dataset,e=e.options&&e.options.borderWidth||0;const i=t.data||[];if(!i.length)return e;var t=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(e,t,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}_a.id="line",_a.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},_a.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class ya extends e{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,s=i.data.labels||[],e=Bi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:e}}update(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart;var e=t.chartArea,i=t.options,e=Math.min(e.right-e.left,e.bottom-e.top),e=Math.max(e/2,0),i=(e-Math.max(i.cutoutPercentage?e/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=e-i*this.index,this.innerRadius=this.outerRadius-i}updateElements(s,t,e,a){var r="reset"===a;const n=this.chart;var o=this.getDataset(),h=n.options.animation;const l=this._cachedMeta.rScale;var c=l.xCenter,d=l.yCenter,u=l.getIndexAngle(0)-.5*_;let g=u,f;var p=360/this.countVisibleElements();for(f=0;f<t;++f)g+=this._computeAngle(f,a,p);for(f=t;f<t+e;f++){var m=s[f];let t=g,e=g+this._computeAngle(f,a,p),i=n.getDataVisibility(f)?l.getDistanceFromCenterForValue(o.data[f]):0;g=e,r&&(h.animateScale&&(i=0),h.animateRotate&&(t=e=u));var v={x:c,y:d,innerRadius:0,outerRadius:i,startAngle:t,endAngle:e,options:this.resolveDataElementOptions(f,m.active?"active":a)};this.updateElement(m,f,v,a)}}countVisibleElements(){const i=this.getDataset(),t=this._cachedMeta;let s=0;return t.data.forEach((t,e)=>{!isNaN(i.data[e])&&this.chart.getDataVisibility(e)&&s++}),s}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?z(this.resolveDataElementOptions(t,e).angle||i):0}}ya.id="polarArea",ya.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},ya.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(a){const t=a.data;if(t.labels.length&&t.datasets.length){const{pointStyle:r}=a.legend.options["labels"];return t.labels.map((t,e)=>{const i=a.getDatasetMeta(0);var s=i.controller.getStyle(e);return{text:t,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:r,hidden:!a.getDataVisibility(e),index:e}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){return t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class wa extends ba{}wa.id="pie",wa.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ma extends e{getLabelAndValue(t){const e=this._cachedMeta.vScale;var i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset;var s=e.data||[],a=e.iScale.getLabels();if(i.points=s,"resize"!==t){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);a={_loop:!0,_fullLoop:a.length===s.length,options:r};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(e,i,s,a){var r=this.getDataset();const n=this._cachedMeta.rScale;var o="reset"===a;for(let t=i;t<i+s;t++){var h=e[t],l=this.resolveDataElementOptions(t,h.active?"active":a),c=n.getPointPositionForValue(t,r.data[t]),d=o?n.xCenter:c.x,u=o?n.yCenter:c.y,c={x:d,y:u,angle:c.angle,skip:isNaN(d)||isNaN(u),options:l};this.updateElement(h,t,c,a)}}}Ma.id="radar",Ma.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Ma.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class ka extends _a{}ka.id="scatter",ka.defaults={showLine:!1,fill:!1},ka.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Sa=Object.freeze({__proto__:null,BarController:va,BubbleController:xa,DoughnutController:ba,LineController:_a,PolarAreaController:ya,PieController:wa,RadarController:Ma,ScatterController:ka});function Pa(t,e,i){var{startAngle:e,pixelMargin:s,x:a,y:r,outerRadius:n,innerRadius:o}=e,h=s/n;t.beginPath(),t.arc(a,r,n,e-h,i+h),s<o?t.arc(a,r,o,i+(h=s/o),e-h,!0):t.arc(a,r,s,i+y,e-y),t.closePath(),t.clip()}function Da(t,e,i,s){t=Ke(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const a=(i-e)/2;var e=Math.min(a,s*e/2),r=t=>{var e=(i-Math.min(a,t))*s/2;return f(t,0,Math.min(a,e))};return{outerStart:r(t.outerStart),outerEnd:r(t.outerEnd),innerStart:f(t.innerStart,0,e),innerEnd:f(t.innerEnd,0,e)}}function Ca(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function Oa(t,e,i,s,a){var{x:r,y:n,startAngle:o,pixelMargin:h,innerRadius:l}=e,c=Math.max(e.outerRadius+s+i-h,0),h=0<l?l+s+i+h:0;let d=0;var u=a-o,l=(s&&(l=((0<l?l-s:0)+(0<c?c-s:0))/2,d=(u-(0!=l?u*l/(l+s):u))/2),Math.max(.001,u*c-i/_)/c),s=(u-l)/2,i=o+s+d,u=a-s-d,{outerStart:l,outerEnd:o,innerStart:a,innerEnd:s}=Da(e,h,c,u-i),e=c-l,g=c-o,f=i+l/e,p=u-o/g,m=h+a,v=h+s,x=i+a/m,b=u-s/v,g=(t.beginPath(),t.arc(r,n,c,f,p),0<o&&(c=Ca(g,p,r,n),t.arc(c.x,c.y,o,p,u+y)),Ca(v,u,r,n)),p=(t.lineTo(g.x,g.y),0<s&&(c=Ca(v,b,r,n),t.arc(c.x,c.y,s,u+y,b+Math.PI)),t.arc(r,n,h,u-s/h,i+a/h,!0),0<a&&(o=Ca(m,x,r,n),t.arc(o.x,o.y,a,x+Math.PI,i-y)),Ca(e,i,r,n));t.lineTo(p.x,p.y),0<l&&(g=Ca(e,f,r,n),t.arc(g.x,g.y,l,i-y,f)),t.closePath()}function Aa(e,i,t,s,a){var r=i["options"],n="inner"===r.borderAlign;if(r.borderWidth){if(n?(e.lineWidth=2*r.borderWidth,e.lineJoin="round"):(e.lineWidth=r.borderWidth,e.lineJoin="bevel"),i.fullCircles){var o=e;r=i;var h=n;var{x:l,y:c,startAngle:d,pixelMargin:u,fullCircles:g}=r,f=Math.max(r.outerRadius-u,0),u=r.innerRadius+u;let t;for(h&&Pa(o,r,d+m),o.beginPath(),o.arc(l,c,u,d+m,d,!0),t=0;t<g;++t)o.stroke();for(o.beginPath(),o.arc(l,c,f,d,d+m),t=0;t<g;++t)o.stroke()}n&&Pa(e,i,a),Oa(e,i,t,s,a),e.stroke()}}class Ta extends i{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){var{angle:t,distance:e}=te(this.getProps(["x","y"],i),{x:t,y:e}),{startAngle:i,endAngle:s,innerRadius:a,outerRadius:r,circumference:n}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),o=this.options.spacing/2,n=B(n,s-i)>=m||se(t,i,s),t=v(e,a+o,r+o);return n&&t}getCenterPoint(t){var{x:t,y:e,startAngle:i,endAngle:s,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:n,spacing:o}=this.options,i=(i+s)/2,s=(a+r+o+n)/2;return{x:t+Math.cos(i)*s,y:e+Math.sin(i)*s}}tooltipPosition(t){return this.getCenterPoint(t)}draw(e){var{options:i,circumference:s}=this,a=(i.offset||0)/2,r=(i.spacing||0)/2;if(this.pixelMargin="inner"===i.borderAlign?.33:0,this.fullCircles=s>m?Math.floor(s/m):0,!(0===s||this.innerRadius<0||this.outerRadius<0)){e.save();let t=0;a&&(t=a/2,s=(this.startAngle+this.endAngle)/2,e.translate(Math.cos(s)*t,Math.sin(s)*t),this.circumference>=_&&(t=a)),e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor;s=function(e,t,i,s){var{fullCircles:a,startAngle:r,circumference:n}=t;let o=t.endAngle;if(a){Oa(e,t,i,s,r+m);for(let t=0;t<a;++t)e.fill();isNaN(n)||(o=r+n%m,n%m==0&&(o+=m))}return Oa(e,t,i,s,o),e.fill(),o}(e,this,t,r);Aa(e,this,t,r,s),e.restore()}}}function La(t,e,i=e){t.lineCap=B(i.borderCapStyle,e.borderCapStyle),t.setLineDash(B(i.borderDash,e.borderDash)),t.lineDashOffset=B(i.borderDashOffset,e.borderDashOffset),t.lineJoin=B(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=B(i.borderWidth,e.borderWidth),t.strokeStyle=B(i.borderColor,e.borderColor)}function Ra(t,e,i){t.lineTo(i.x,i.y)}function Ea(t,e,i={}){var t=t.length,{start:i=0,end:s=t-1}=i,{start:a,end:r}=e,n=Math.max(i,a),o=Math.min(s,r);return{count:t,start:n,loop:e.loop,ilen:o<n&&!(i<a&&s<a||r<i&&r<s)?t+o-n:o-n}}function Ia(t,e,i,s){var{points:a,options:r}=e,{count:n,start:o,loop:e,ilen:h}=Ea(a,i,s);const l=(i=r).stepped?fe:i.tension||"monotone"===i.cubicInterpolationMode?pe:Ra;let{move:c=!0,reverse:d}=s||{},u,g,f;for(u=0;u<=h;++u)(g=a[(o+(d?h-u:u))%n]).skip||(c?(t.moveTo(g.x,g.y),c=!1):l(t,f,g,d,r.stepped),f=g);return e&&(g=a[(o+(d?h:0))%n],l(t,f,g,d,r.stepped)),!!e}function za(t,e,i,s){var a=e.points;const{count:r,start:n,ilen:o}=Ea(a,i,s),{move:h=!0,reverse:l}=s||{};let c=0,d=0,u,g,f,p,m,v;var x,b,_,y=t=>(n+(l?o-t:t))%r,w=()=>{p!==m&&(t.lineTo(c,m),t.lineTo(c,p),t.lineTo(c,v))};for(h&&(g=a[y(0)],t.moveTo(g.x,g.y)),u=0;u<=o;++u)(g=a[y(u)]).skip||(x=g.x,b=g.y,(_=0|x)===f?(b<p?p=b:b>m&&(m=b),c=(d*c+x)/++d):(w(),t.lineTo(x,b),f=_,d=0,p=m=b),v=b);w()}function Fa(t){var e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?za:Ia}Ta.id="arc",Ta.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},Ta.defaultRoutes={backgroundColor:"backgroundColor"};const Ba="function"==typeof Path2D;function Va(e,i,s,a){if(!Ba||i.options.segment){var t=e;var r=i;var n=s;var o=a;var{segments:h,options:l}=r;const c=Fa(r);for(const d of h)La(t,l,d.style),t.beginPath(),c(t,r,d,{start:n,end:n+o-1})&&t.closePath(),t.stroke()}else{h=e;e=i;i=s;s=a;let t=e._path;t||(t=e._path=new Path2D,e.path(t,i,s)&&t.closePath()),La(h,e.options),h.stroke(t)}}class Wa extends i{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){var i,s=this.options;!s.tension&&"monotone"!==s.cubicInterpolationMode||s.stepped||this._pointsUpdated||(i=s.spanGaps?this._loop:this._fullLoop,Oi(this._points,s,t,i,e),this._pointsUpdated=!0)}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ui(this,this.options.segment))}first(){var t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){var t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(i,s){var a,r=this.options,n=i[s],o=this.points,h=$i(this,{property:s,start:n,end:n});if(h.length){const u=[],g=(a=r).stepped?Ii:a.tension||"monotone"===a.cubicInterpolationMode?zi:Ei;let t,e;for(t=0,e=h.length;t<e;++t){var{start:l,end:c}=h[t],l=o[l],c=o[c];if(l===c)u.push(l);else{var d=Math.abs((n-l[s])/(c[s]-l[s]));const f=g(l,c,d,r.stepped);f[s]=i[s],u.push(f)}}return 1===u.length?u[0]:u}}pathSegment(t,e,i){const s=Fa(this);return s(t,this,e,i)}path(t,e,i){var s=this.segments;const a=Fa(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const n of s)r&=a(t,this,n,{start:e,end:e+i-1});return!!r}draw(t,e,i,s){var a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),Va(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Na(t,e,i,s){var a=t.options,{[i]:t}=t.getProps([i],s);return Math.abs(e-t)<a.radius+a.hitRadius}Wa.id="line",Wa.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Wa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Wa.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class Ha extends i{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){var s=this.options,{x:i,y:a}=this.getProps(["x","y"],i);return Math.pow(t-i,2)+Math.pow(e-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Na(this,t,"x",e)}inYRange(t,e){return Na(this,t,"y",e)}getCenterPoint(t){var{x:t,y:e}=this.getProps(["x","y"],t);return{x:t,y:e}}size(t){var e=(t=t||this.options||{}).radius||0;return 2*((e=Math.max(e,e&&t.hoverRadius||0))+(e&&t.borderWidth||0))}draw(t,e){var i=this.options;this.skip||i.radius<.1||!de(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ce(t,i,this.x,this.y))}getRange(){var t=this.options||{};return t.radius+t.hitRadius}}function ja(t,e){var{x:e,y:i,base:s,width:a,height:r}=t.getProps(["x","y","base","width","height"],e);let n,o,h,l,c;return l=t.horizontal?(c=r/2,n=Math.min(e,s),o=Math.max(e,s),h=i-c,i+c):(c=a/2,n=e-c,o=e+c,h=Math.min(i,s),Math.max(i,s)),{left:n,top:h,right:o,bottom:l}}function Ya(t,e,i,s){return t?0:f(e,i,s)}function $a(t){var e,i,s,a,r,n=ja(t),o=n.right-n.left,h=n.bottom-n.top,l=(e=o/2,l=h/2,s=(i=t).options.borderWidth,i=i.borderSkipped,s=Ge(s),{t:Ya(i.top,s.top,0,l),r:Ya(i.right,s.right,0,e),b:Ya(i.bottom,s.bottom,0,l),l:Ya(i.left,s.left,0,e)}),t=(i=o/2,s=h/2,t=(e=t).getProps(["enableBorderRadius"]).enableBorderRadius,a=e.options.borderRadius,r=Ze(a),i=Math.min(i,s),s=e.borderSkipped,{topLeft:Ya(!(e=t||F(a))||s.top||s.left,r.topLeft,0,i),topRight:Ya(!e||s.top||s.right,r.topRight,0,i),bottomLeft:Ya(!e||s.bottom||s.left,r.bottomLeft,0,i),bottomRight:Ya(!e||s.bottom||s.right,r.bottomRight,0,i)});return{outer:{x:n.left,y:n.top,w:o,h:h,radius:t},inner:{x:n.left+l.l,y:n.top+l.t,w:o-l.l-l.r,h:h-l.t-l.b,radius:{topLeft:Math.max(0,t.topLeft-Math.max(l.t,l.l)),topRight:Math.max(0,t.topRight-Math.max(l.t,l.r)),bottomLeft:Math.max(0,t.bottomLeft-Math.max(l.b,l.l)),bottomRight:Math.max(0,t.bottomRight-Math.max(l.b,l.r))}}}}function Ua(t,e,i,s){var a=null===e,r=null===i,t=t&&!(a&&r)&&ja(t,s);return t&&(a||v(e,t.left,t.right))&&(r||v(i,t.top,t.bottom))}function Xa(t,e){t.rect(e.x,e.y,e.w,e.h)}function qa(t,e,i={}){var s=t.x!==i.x?-e:0,a=t.y!==i.y?-e:0,r=(t.x+t.w!==i.x+i.w?e:0)-s,i=(t.y+t.h!==i.y+i.h?e:0)-a;return{x:t.x+s,y:t.y+a,w:t.w+r,h:t.h+i,radius:t.radius}}Ha.id="point",Ha.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Ha.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Ka extends i{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){var e,{inflateAmount:i,options:{borderColor:s,backgroundColor:a}}=this,{inner:r,outer:n}=$a(this);const o=(e=n.radius).topLeft||e.topRight||e.bottomLeft||e.bottomRight?ve:Xa;t.save(),n.w===r.w&&n.h===r.h||(t.beginPath(),o(t,qa(n,i,r)),t.clip(),o(t,qa(r,-i,n)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),o(t,qa(r,i)),t.fillStyle=a,t.fill(),t.restore()}inRange(t,e,i){return Ua(this,t,e,i)}inXRange(t,e){return Ua(this,t,null,e)}inYRange(t,e){return Ua(this,null,t,e)}getCenterPoint(t){var{x:t,y:e,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(t+i)/2:t,y:s?e:(e+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}Ka.id="bar",Ka.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Ka.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Ga=Object.freeze({__proto__:null,ArcElement:Ta,LineElement:Wa,PointElement:Ha,BarElement:Ka});function Za(t){var e;t._decimated&&(e=t._data,delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e}))}function Qa(t){t.data.datasets.forEach(t=>{Za(t)})}var Ja={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(o,t,h)=>{if(h.enabled){const l=o.width;o.data.datasets.forEach((e,t)=>{var{_data:i,indexAxis:s}=e,t=o.getDatasetMeta(t),a=i||e.data;if("y"!==Qe([s,o.options.indexAxis])&&"line"===t.type){s=o.scales[t.xAxisID];if(("linear"===s.type||"time"===s.type)&&!o.options.parsing){var{start:r,count:n}=function(t,e){var i=e.length;let s=0,a;const r=t["iScale"];var{min:t,max:n,minDefined:o,maxDefined:h}=r.getUserBounds();return o&&(s=f(x(e,r.axis,t).lo,0,i-1)),a=h?f(x(e,r.axis,n).hi+1,s,i)-s:i-s,{start:s,count:a}}(t,a);if(n<=(h.threshold||4*l))Za(e);else{P(i)&&(e._data=a,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}}));let t;switch(h.algorithm){case"lttb":t=function(s,a,r,t,e){var i=e.samples||t;if(r<=i)return s.slice(a,a+r);const n=[];var o=(r-2)/(i-2);let h=0,l=(e=a+r-1,a),c,d,u,g,f;for(n[h++]=s[l],c=0;c<i-2;c++){let t=0,e=0,i;var p=Math.floor((c+1)*o)+1+a,m=Math.min(Math.floor((c+2)*o)+1,r)+a,v=m-p;for(i=p;i<m;i++)t+=s[i].x,e+=s[i].y;t/=v,e/=v;var p=Math.floor(c*o)+1+a,x=Math.min(Math.floor((c+1)*o)+1,r)+a,{x:b,y:_}=s[l];for(u=-1,i=p;i<x;i++)(g=.5*Math.abs((b-t)*(s[i].y-_)-(b-s[i].x)*(e-_)))>u&&(u=g,d=s[i],f=i);n[h++]=d,l=f}return n[h++]=s[e],n}(a,r,n,l,h);break;case"min-max":t=function(t,e,i,s){let a=0,r=0,n,o,h,l,c,d,u,g,f,p;const m=[];var v=t[e].x,x=t[e+i-1].x-v;for(n=e;n<e+i;++n){h=((o=t[n]).x-v)/x*s,l=o.y;var b,_,y,w=0|h;w===c?(l<f?(f=l,d=n):l>p&&(p=l,u=n),a=(r*a+o.x)/++r):(b=n-1,P(d)||P(u)||(_=Math.min(d,u),y=Math.max(d,u),_!==g&&_!==b&&m.push({...t[_],x:a}),y!==g&&y!==b&&m.push({...t[y],x:a})),0<n&&b!==g&&m.push(t[b]),m.push(o),c=w,r=0,f=p=l,d=u=g=n)}return m}(a,r,n,l);break;default:throw new Error(`Unsupported decimation algorithm '${h.algorithm}'`)}e._decimated=t}}}})}else Qa(o)},destroy(t){Qa(t)}};function tr(t,e,i){t=function(t){var e=(t=t.options).fill;let i=B(e&&e.target,e);return!1!==(i=void 0===i?!!t.backgroundColor:i)&&null!==i&&(!0===i?"origin":i)}(t);if(F(t))return!isNaN(t.value)&&t;let s=parseFloat(t);return p(s)&&Math.floor(s)===s?!((s="-"!==t[0]&&"+"!==t[0]?s:e+s)===e||s<0||s>=i)&&s:0<=["origin","start","end","stack","shape"].indexOf(t)&&t}class er{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){var{x:s,y:a,radius:r}=this;return e=e||{start:0,end:m},t.arc(s,a,r,e.end,e.start,!0),!i.bounds}interpolate(t){var{x:e,y:i,radius:s}=this,t=t.angle;return{x:e+Math.cos(t)*s,y:i+Math.sin(t)*s,angle:t}}}function ir(s){if((s.scale||{}).getPointPositionForValue){var a=s;const{scale:h,fill:l}=a;var a=h.options,r=h.getLabels().length;const c=[];var n=a.reverse?h.max:h.min,o=a.reverse?h.min:h.max;let t,e,i;if(i="start"===l?n:"end"===l?o:F(l)?l.value:h.getBaseValue(),a.grid.circular)return e=h.getPointPositionForValue(0,n),new er({x:e.x,y:e.y,radius:h.getDistanceFromCenterForValue(i)});for(t=0;t<r;++t)c.push(h.getPointPositionForValue(t,i));return c}{o=s;const{scale:e={},fill:i}=o;let t=null;return"start"===i?t=e.bottom:"end"===i?t=e.top:F(i)?t=e.getPixelForValue(i.value):e.getBasePixel&&(t=e.getBasePixel()),p(t)?{x:(o=e.isHorizontal())?t:null,y:o?null:t}:null;return}}function sr(t,e,i){for(;t<e;e--){var s=i[e];if(!isNaN(s.x)&&!isNaN(s.y))break}return e}function ar(t){var{scale:t,index:e,line:i}=t,s=[],a=i.segments,r=i.points;const n=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){var a=s[t];if(a.index===e)break;a.hidden||i.unshift(a.dataset)}return i}(t,e);n.push(rr({x:null,y:t.bottom},i));for(let t=0;t<a.length;t++){var o=a[t];for(let t=o.start;t<=o.end;t++){h=void 0;l=void 0;c=void 0;d=void 0;u=void 0;g=void 0;var h=s;var l=r[t];var c=n;const f=[];for(let t=0;t<c.length;t++){var{first:d,last:u,point:g}=function(t,e,i){e=t.interpolate(e,i);if(!e)return{};var s=e[i],a=t.segments,r=t.points;let n=!1,o=!1;for(let t=0;t<a.length;t++){var h=a[t],l=r[h.start][i],h=r[h.end][i];if(v(s,l,h)){n=s===l,o=s===h;break}}return{first:n,last:o,point:e}}(c[t],l,"x");if(!(!g||d&&u))if(d)f.unshift(g);else if(h.push(g),!u)break}h.push(...f)}}return new Wa({points:s,options:{}})}function rr(t,e){let i=[],s=!1;return(i=I(t)?(s=!0,t):function(t,e){const{x:i=null,y:s=null}=t||{},a=e.points,r=[];return e.segments.forEach(({start:t,end:e})=>{e=sr(t,e,a);t=a[t],e=a[e];null!==s?(r.push({x:t.x,y:s}),r.push({x:e.x,y:s})):null!==i&&(r.push({x:i,y:t.y}),r.push({x:i,y:e.y}))}),r}(t,e)).length?new Wa({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function nr(t,e,i){t.beginPath(),e.path(t),t.lineTo(e.last().x,i),t.lineTo(e.first().x,i),t.closePath(),t.clip()}function or(i,s,a,t){if(!t){let t=s[i],e=a[i];return"angle"===i&&(t=h(t),e=h(e)),{property:i,start:t,end:e}}}function hr(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function lr(t,e,i,s){e=e.interpolate(i,s);e&&t.lineTo(e.x,e.y)}function cr(e,t){const{line:i,target:s,property:a,color:r,scale:n}=t;var o,h,l,c;for({source:o,target:h,start:l,end:c}of function(t,e,i){var s=t.segments,a=t.points,r=e.points;const n=[];for(const d of s){var{start:o,end:h}=d,h=sr(o,h,a),l=or(i,a[o],a[h],d.loop);if(e.segments)for(const u of $i(e,l)){var c=or(i,r[u.start],r[u.end],u.loop);for(const g of Yi(d,a,c))n.push({source:g,target:u,start:{[i]:hr(l,c,"start",Math.max)},end:{[i]:hr(l,c,"end",Math.min)}})}else n.push({source:d,target:l,start:a[o],end:a[h]})}return n}(i,s,a)){var{style:{backgroundColor:d=r}={}}=o,u=!0!==s,d=(e.save(),e.fillStyle=d,v=m=f=p=g=f=g=d=void 0,e),g=n,f=u&&or(a,l,c),{top:g,bottom:p}=g.chart.chartArea,{property:f,start:m,end:v}=f||{},f=("x"===f&&(d.beginPath(),d.rect(m,g,v-m,p-g),d.clip()),e.beginPath(),!!i.pathSegment(e,o));let t;u&&(f?e.closePath():lr(e,s,c,a),v=!!s.pathSegment(e,h,{move:f,reverse:!0}),(t=f&&v)||lr(e,s,l,a)),e.closePath(),e.fill(t?"evenodd":"nonzero"),e.restore()}}function dr(t,e,i){var s,a=function(t){var e,i,{chart:s,fill:a,line:r}=t;return p(a)?(e=a,(i=(s=s).getDatasetMeta(e))&&s.isDatasetVisible(e)?i.dataset:null):"stack"===a?ar(t):"shape"===a||((s=ir(t))instanceof er?s:rr(s,r))}(e),{line:e,scale:r,axis:n}=e,o=e.options,h=o.fill,o=o.backgroundColor,{above:h=o,below:o=o}=h||{};a&&e.points.length&&(ue(t,i),s=t,{line:a,target:h,above:o,below:i,area:r,scale:n}=e={line:e,target:a,above:h,below:o,area:i,scale:r,axis:n},e=a._loop?"angle":e.axis,s.save(),"x"===e&&i!==o&&(nr(s,h,r.top),cr(s,{line:a,target:h,color:o,scale:n,property:e}),s.restore(),s.save(),nr(s,h,r.bottom)),cr(s,{line:a,target:h,color:i,scale:n,property:e}),s.restore(),ge(t))}var ur={id:"filler",afterDatasetsUpdate(t,e,i){var s=(t.data.datasets||[]).length;const a=[];let r,n,o,h;for(n=0;n<s;++n)o=(r=t.getDatasetMeta(n)).dataset,h=null,o&&o.options&&o instanceof Wa&&(h={visible:t.isDatasetVisible(n),index:n,fill:tr(o,n,s),chart:t,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=h,a.push(h);for(n=0;n<s;++n)(h=a[n])&&!1!==h.fill&&(h.fill=function(t,e,i){var s;let a=t[e].fill;const r=[e];if(!i)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!p(a))return a;if(!(s=t[a]))return!1;if(s.visible)return a;r.push(a),a=s.fill}return!1}(a,n,i.propagate))},beforeDraw(e,t,i){var s="beforeDraw"===i.drawTime,a=e.getSortedVisibleDatasetMetas(),r=e.chartArea;for(let t=a.length-1;0<=t;--t){const n=a[t].$filler;n&&(n.line.updateControlPoints(r,n.axis),s&&dr(e.ctx,n,r))}},beforeDatasetsDraw(e,t,i){if("beforeDatasetsDraw"===i.drawTime){var s=e.getSortedVisibleDatasetMetas();for(let t=s.length-1;0<=t;--t){var a=s[t].$filler;a&&dr(e.ctx,a,e.chartArea)}}},beforeDatasetDraw(t,e,i){e=e.meta.$filler;e&&!1!==e.fill&&"beforeDatasetDraw"===i.drawTime&&dr(t.ctx,e,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const gr=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class fr extends i{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const i=this.options.labels||{};let t=c(i.generateLabels,[this.chart],this)||[];i.filter&&(t=t.filter(t=>i.filter(t,this.chart.data))),i.sort&&(t=t.sort((t,e)=>i.sort(t,e,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:i,ctx:s}=this;if(i.display){var a=i.labels,r=E(a.font),n=r.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:h}=gr(a,n);let t,e;s.font=r.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(o,n,a,h)+10):(e=this.maxHeight,t=this._fitCols(o,n,a,h)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}else this.width=this.height=0}_fitRows(t,i,s,a){const{ctx:r,maxWidth:n,options:{labels:{padding:o}}}=this,h=this.legendHitBoxes=[],l=this.lineWidths=[0],c=a+o;let d=t,u=(r.textAlign="left",r.textBaseline="middle",-1),g=-c;return this.legendItems.forEach((t,e)=>{t=s+i/2+r.measureText(t.text).width;(0===e||l[l.length-1]+t+2*o>n)&&(d+=c,l[l.length-(0<e?0:1)]=0,g+=c,u++),h[e]={left:0,top:g,row:u,width:t,height:a},l[l.length-1]+=t+o}),d}_fitCols(t,i,s,a){const{ctx:r,maxHeight:e,options:{labels:{padding:n}}}=this,o=this.legendHitBoxes=[],h=this.columnSizes=[],l=e-t;let c=n,d=0,u=0,g=0,f=0;return this.legendItems.forEach((t,e)=>{t=s+i/2+r.measureText(t.text).width;0<e&&u+a+2*n>l&&(c+=d+n,h.push({width:d,height:u}),g+=d+n,f++,d=u=0),o[e]={left:g,top:u,col:f,width:t,height:a},d=Math.max(d,t),u+=a+n}),c+=d,h.push({width:d,height:u}),c}adjustHitBoxes(){if(this.options.display){var i=this._computeTitleHeight(),{legendHitBoxes:s,options:{align:a,labels:{padding:r},rtl:t}}=this;const n=Vi(t,this.left,this.width);if(this.isHorizontal()){let t=0,e=L(a,this.left+r,this.right-this.lineWidths[t]);for(const o of s)t!==o.row&&(t=o.row,e=L(a,this.left+r,this.right-this.lineWidths[t])),o.top+=this.top+i+r,o.left=n.leftForLtr(n.x(e),o.width),e+=o.width+r}else{let t=0,e=L(a,this.top+i+r,this.bottom-this.columnSizes[t].height);for(const h of s)h.col!==t&&(t=h.col,e=L(a,this.top+i+r,this.bottom-this.columnSizes[t].height)),h.top=e,h.left+=this.left+r,h.left=n.leftForLtr(n.x(h.left),h.width),e+=h.height+r}}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){var t;this.options.display&&(ue(t=this.ctx,this),this._draw(),ge(t))}_draw(){const{options:u,columnSizes:g,lineWidths:f,ctx:p}=this,{align:m,labels:v}=u,x=R.color,b=Vi(u.rtl,this.left,this.width),_=E(v.font),{color:y,padding:w}=v,M=_.size,k=M/2;let S;this.drawTitle(),p.textAlign=b.textAlign("left"),p.textBaseline="middle",p.lineWidth=.5,p.font=_.string;const{boxWidth:P,boxHeight:D,itemHeight:C}=gr(v,M),O=this.isHorizontal(),A=this._computeTitleHeight(),T=(S=O?{x:L(m,this.left+w,this.right-f[0]),y:this.top+w+A,line:0}:{x:this.left+w,y:L(m,this.top+A+w,this.bottom-g[0].height),line:0},Wi(this.ctx,u.textDirection),C+w);this.legendItems.forEach((t,e)=>{p.strokeStyle=t.fontColor||y,p.fillStyle=t.fontColor||y;var i=p.measureText(t.text).width,s=b.textAlign(t.textAlign||(t.textAlign=v.textAlign)),i=P+k+i;let a=S.x,r=S.y;b.setWidth(this.width),O?0<e&&a+i+w>this.right&&(r=S.y+=T,S.line++,a=S.x=L(m,this.left+w,this.right-f[S.line])):0<e&&r+T>this.bottom&&(a=S.x=a+g[S.line].width+w,S.line++,r=S.y=L(m,this.top+A+w,this.bottom-g[S.line].height));var n,o,h,l,c,d,e=b.x(a);e=e,c=r,d=t,isNaN(P)||P<=0||isNaN(D)||D<0||(p.save(),n=B(d.lineWidth,1),p.fillStyle=B(d.fillStyle,x),p.lineCap=B(d.lineCap,"butt"),p.lineDashOffset=B(d.lineDashOffset,0),p.lineJoin=B(d.lineJoin,"miter"),p.lineWidth=n,p.strokeStyle=B(d.strokeStyle,x),p.setLineDash(B(d.lineDash,[])),v.usePointStyle?(o={radius:P*Math.SQRT2/2,pointStyle:d.pointStyle,rotation:d.rotation,borderWidth:n},h=b.xPlus(e,P/2),l=c+k,ce(p,o,h,l)):(o=c+Math.max((M-D)/2,0),h=b.leftForLtr(e,P),l=Ze(d.borderRadius),p.beginPath(),Object.values(l).some(t=>0!==t)?ve(p,{x:h,y:o,w:P,h:D,radius:l}):p.rect(h,o,P,D),p.fill(),0!==n&&p.stroke()),p.restore()),a=W(s,a+P+k,O?a+i:this.right,u.rtl),c=b.x(a),e=r,d=t,me(p,d.text,c,e+C/2,_,{strikethrough:d.hidden,textAlign:b.textAlign(d.textAlign)}),O?S.x+=i+w:S.y+=T}),Ni(this.ctx,u.textDirection)}drawTitle(){var s=this.options,a=s.title,r=E(a.font),n=V(a.padding);if(a.display){const l=Vi(s.rtl,this.left,this.width),c=this.ctx;var o=a.position,h=r.size/2,n=n.top+h;let t,e=this.left,i=this.width;this.isHorizontal()?(i=Math.max(...this.lineWidths),t=this.top+n,e=L(s.align,e,this.right-i)):(h=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0),t=n+L(s.align,this.top,this.bottom-h-s.labels.padding-this._computeTitleHeight()));n=L(o,e,e+i);c.textAlign=l.textAlign(T(o)),c.textBaseline="middle",c.strokeStyle=a.color,c.fillStyle=a.color,c.font=r.string,me(c,a.text,n,t,r)}}_computeTitleHeight(){var t=this.options.title,e=E(t.font),i=V(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,a;if(v(t,this.left,this.right)&&v(e,this.top,this.bottom))for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(v(t,(s=a[i]).left,s.left+s.width)&&v(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){var e,i,s,a,r=this.options;i=t.type,e=r,("mousemove"===i&&(e.onHover||e.onLeave)||e.onClick&&("click"===i||"mouseup"===i))&&(e=this._getLegendItemAt(t.x,t.y),"mousemove"===t.type?(i=this._hoveredItem,a=e,s=null!==(s=i)&&null!==a&&s.datasetIndex===a.datasetIndex&&s.index===a.index,i&&!s&&c(r.onLeave,[t,i,this],this),(this._hoveredItem=e)&&!s&&c(r.onHover,[t,e,this],this)):e&&c(r.onClick,[t,e,this],this))}}var pr={id:"legend",_element:fr,start(t,e,i){var s=t.legend=new fr({ctx:t.ctx,options:i,chart:t});a.configure(t,s,i),a.addBox(t,s)},stop(t){a.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;a.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){var s=e.datasetIndex;const a=i.chart;a.isDatasetVisible(s)?(a.hide(s),e.hidden=!0):(a.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const s=t.data.datasets,{usePointStyle:a,pointStyle:r,textAlign:n,color:o}=t.legend.options["labels"];return t._getSortedDatasetMetas().map(t=>{var e=t.controller.getStyle(a?0:void 0),i=V(e.borderWidth);return{text:s[t.index].label,fillStyle:e.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:(i.width+i.height)/4,strokeStyle:e.borderColor,pointStyle:r||e.pointStyle,rotation:e.rotation,textAlign:n||e.textAlign,borderRadius:0,datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class mr extends i{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){var i=this.options;this.left=0,this.top=0,i.display?(this.width=this.right=t,this.height=this.bottom=e,t=I(i.text)?i.text.length:1,this._padding=V(i.padding),e=t*E(i.font).lineHeight+this._padding.height,this.isHorizontal()?this.height=e:this.width=e):this.width=this.height=this.right=this.bottom=0}isHorizontal(){var t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){var{top:e,left:i,bottom:s,right:a,options:r}=this,n=r.align;let o=0,h,l,c;return h=this.isHorizontal()?(l=L(n,i,a),c=e+t,a-i):(o="left"===r.position?(l=i+t,c=L(n,s,e),-.5*_):(l=a-t,c=L(n,e,s),.5*_),s-e),{titleX:l,titleY:c,maxWidth:h,rotation:o}}draw(){var t,e,i,s,a,r=this.ctx,n=this.options;n.display&&(e=(t=E(n.font)).lineHeight/2+this._padding.top,{titleX:e,titleY:i,maxWidth:s,rotation:a}=this._drawArgs(e),me(r,n.text,0,0,t,{color:n.color,maxWidth:s,rotation:a,textAlign:T(n.align),textBaseline:"middle",translation:[e,i]}))}}var vr={id:"title",_element:mr,start(t,e,i){var s;t=t,i=i,s=new mr({ctx:t.ctx,options:i,chart:t}),a.configure(t,s,i),a.addBox(t,s),t.titleBlock=s},stop(t){var e=t.titleBlock;a.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;a.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const xr=new WeakMap;var br={id:"subtitle",start(t,e,i){var s=new mr({ctx:t.ctx,options:i,chart:t});a.configure(t,s,i),a.addBox(t,s),xr.set(t,s)},stop(t){a.removeBox(t,xr.get(t)),xr.delete(t)},beforeUpdate(t,e,i){const s=xr.get(t);a.configure(t,s,i),s.options=i},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 _r={average(t){if(!t.length)return!1;let e,i,s=0,a=0,r=0;for(e=0,i=t.length;e<i;++e){const o=t[e].element;var n;o&&o.hasValue()&&(n=o.tooltipPosition(),s+=n.x,a+=n.y,++r)}return{x:s/r,y:a/r}},nearest(t,e){if(!t.length)return!1;let i=e.x,s=e.y,a=Number.POSITIVE_INFINITY,r,n,o;for(r=0,n=t.length;r<n;++r){const c=t[r].element;var h;c&&c.hasValue()&&((h=ee(e,c.getCenterPoint()))<a&&(a=h,o=c))}var l;return o&&(l=o.tooltipPosition(),i=l.x,s=l.y),{x:i,y:s}}};function o(t,e){return e&&(I(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function k(t){return("string"==typeof t||t instanceof String)&&-1<t.indexOf("\n")?t.split("\n"):t}function yr(t,e){const i=t._chart.ctx,{body:s,footer:a,title:r}=t;var{boxWidth:n,boxHeight:o}=e,h=E(e.bodyFont),l=E(e.titleFont),c=E(e.footerFont),d=r.length,u=a.length,g=s.length,f=V(e.padding);let p=f.height,m=0;var v=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);v+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*l.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),v&&(d=e.displayColors?Math.max(o,h.lineHeight):h.lineHeight,p+=g*d+(v-g)*h.lineHeight+(v-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let x=0;function b(t){m=Math.max(m,i.measureText(t).width+x)}return i.save(),i.font=l.string,M(t.title,b),i.font=h.string,M(t.beforeBody.concat(t.afterBody),b),x=e.displayColors?n+2+e.boxPadding:0,M(s,t=>{M(t.before,b),M(t.lines,b),M(t.after,b)}),x=0,i.font=c.string,M(t.footer,b),i.restore(),{width:m+=f.width,height:p}}function wr(t,e,i,s){var{x:a,width:r}=i,{width:n,chartArea:{left:o,right:h}}=t;let l="center";return"center"===s?l=a<=(o+h)/2?"left":"right":a<=r/2?l="left":n-r/2<=a&&(l="right"),l=function(t,e,i,s){var{x:s,width:a}=s,i=i.caretSize+i.caretPadding;return"left"===t&&s+a+i>e.width||"right"===t&&s-a-i<0}(l,t,e,i)?"center":l}function Mr(t,e,i){var s=e.yAlign||function(t,e){var{y:e,height:i}=e;return e<i/2?"top":e>t.height-i/2?"bottom":"center"}(t,i);return{xAlign:e.xAlign||wr(t,e,i,s),yAlign:s}}function kr(t,e,i,s){var{caretSize:t,caretPadding:a,cornerRadius:r}=t,{xAlign:i,yAlign:n}=i,a=t+a,{topLeft:r,topRight:o,bottomLeft:h,bottomRight:l}=Ze(r);let c=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,i);var d=function(t,e,i){let{y:s,height:a}=t;return"top"===e?s+=i:s-="bottom"===e?a+i:a/2,s}(e,n,a);return"center"===n?"left"===i?c+=a:"right"===i&&(c-=a):"left"===i?c-=Math.max(r,h)+t:"right"===i&&(c+=Math.max(o,l)+t),{x:f(c,0,s.width-e.width),y:f(d,0,s.height-e.height)}}function Sr(t,e,i){i=V(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function Pr(t){return o([],k(t))}function Dr(t,e){e=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return e?t.override(e):t}class Cr extends i{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,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(){var t=this._cachedAnimations;if(t)return t;var t=this._chart,e=this.options.setContext(this.getContext()),t=e.enabled&&t.options.animation&&e.animations,e=new xs(this._chart,t);return t._cacheable&&(this._cachedAnimations=Object.freeze(e)),e}getContext(){return this.$context||(this.$context=(t=this._chart.getContext(),i=(e=this)._tooltipItems,w(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const i=e["callbacks"];var e=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),t=i.afterTitle.apply(this,[t]),e=o([],k(e));return e=o(e,k(s)),o(e,k(t))}getBeforeBody(t,e){return Pr(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const s=e["callbacks"],a=[];return M(t,t=>{var e={before:[],lines:[],after:[]};const i=Dr(s,t);o(e.before,k(i.beforeLabel.call(this,t))),o(e.lines,i.label.call(this,t)),o(e.after,k(i.afterLabel.call(this,t))),a.push(e)}),a}getAfterBody(t,e){return Pr(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const i=e["callbacks"];var e=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),t=i.afterFooter.apply(this,[t]),e=o([],k(e));return e=o(e,k(s)),o(e,k(t))}_createItems(s){var t=this._active;const a=this._chart.data,i=[],r=[],n=[];let e=[],o,h;for(o=0,h=t.length;o<h;++o)e.push(function(t,e){var{element:e,datasetIndex:i,index:s}=e;const a=t.getDatasetMeta(i).controller;var{label:r,value:n}=a.getLabelAndValue(s);return{chart:t,label:r,parsed:a.getParsed(s),raw:t.data.datasets[i].data[s],formattedValue:n,dataset:a.getDataset(),dataIndex:s,datasetIndex:i,element:e}}(this._chart,t[o]));return s.filter&&(e=e.filter((t,e,i)=>s.filter(t,e,i,a))),M(e=s.itemSort?e.sort((t,e)=>s.itemSort(t,e,a)):e,t=>{const e=Dr(s.callbacks,t);i.push(e.labelColor.call(this,t)),r.push(e.labelPointStyle.call(this,t)),n.push(e.labelTextColor.call(this,t))}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=n,this.dataPoints=e}update(t,e){const i=this.options.setContext(this.getContext());var s,a,r,n=this._active;let o,h=[];n.length?(n=_r[i.position].call(this,n,this._eventPosition),h=this._createItems(i),this.title=this.getTitle(h,i),this.beforeBody=this.getBeforeBody(h,i),this.body=this.getBody(h,i),this.afterBody=this.getAfterBody(h,i),this.footer=this.getFooter(h,i),s=this._size=yr(this,i),r=Object.assign({},n,s),a=Mr(this._chart,i,r),r=kr(i,r,a,this._chart),this.xAlign=a.xAlign,this.yAlign=a.yAlign,o={opacity:1,x:r.x,y:r.y,width:s.width,height:s.height,caretX:n.x,caretY:n.y}):0!==this.opacity&&(o={opacity:0}),this._tooltipItems=h,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this._chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){t=this.getCaretPosition(t,i,s);e.lineTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineTo(t.x3,t.y3)}getCaretPosition(t,e,i){var{xAlign:s,yAlign:a}=this,{caretSize:i,cornerRadius:r}=i,{topLeft:r,topRight:n,bottomLeft:o,bottomRight:h}=Ze(r),{x:t,y:l}=t,{width:e,height:c}=e;let d,u,g,f,p,m;return"center"===a?(p=l+c/2,m="left"===s?(d=t,u=d-i,f=p+i,p-i):(d=t+e,u=d+i,f=p-i,p+i),g=d):(u="left"===s?t+Math.max(r,o)+i:"right"===s?t+e-Math.max(n,h)-i:this.caretX,g="top"===a?(f=l,p=f-i,d=u-i,u+i):(f=l+c,p=f+i,d=u+i,u-i),m=f),{x1:d,x2:u,x3:g,y1:f,y2:p,y3:m}}drawTitle(t,e,i){var s=this.title,a=s.length;let r,n,o;if(a){const h=Vi(i.rtl,this.x,this.width);for(t.x=Sr(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",r=E(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,o=0;o<a;++o)e.fillText(s[o],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n,o+1===a&&(t.y+=i.titleMarginBottom-n)}}_drawColorBox(t,e,i,s,a){var r,n=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:h,boxWidth:l,boxPadding:c}=a,d=E(a.bodyFont),u=Sr(this,"left",a),u=s.x(u),d=h<d.lineHeight?(d.lineHeight-h)/2:0,e=e.y+d;a.usePointStyle?(d={radius:Math.min(l,h)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},o=s.leftForLtr(u,l)+l/2,r=e+h/2,t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,ce(t,d,o,r),t.strokeStyle=n.borderColor,t.fillStyle=n.backgroundColor,ce(t,d,o,r)):(t.lineWidth=n.borderWidth||1,t.strokeStyle=n.borderColor,t.setLineDash(n.borderDash||[]),t.lineDashOffset=n.borderDashOffset||0,d=s.leftForLtr(u,l-c),o=s.leftForLtr(s.xPlus(u,1),l-c-2),r=Ze(n.borderRadius),Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,ve(t,{x:d,y:e,w:l,h:h,radius:r}),t.fill(),t.stroke(),t.fillStyle=n.backgroundColor,t.beginPath(),ve(t,{x:o,y:e+1,w:l-2,h:h-2,radius:r}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(d,e,l,h),t.strokeRect(d,e,l,h),t.fillStyle=n.backgroundColor,t.fillRect(o,e+1,l-2,h-2))),t.fillStyle=this.labelTextColors[i]}drawBody(e,i,t){var s=this["body"];const{bodySpacing:a,bodyAlign:r,displayColors:n,boxHeight:o,boxWidth:h,boxPadding:l}=t;var c=E(t.bodyFont);let d=c.lineHeight,u=0;const g=Vi(t.rtl,this.x,this.width);function f(t){i.fillText(t,g.x(e.x+u),e.y+d/2),e.y+=d+a}var p=g.textAlign(r);let m,v,x,b,_,y,w;for(i.textAlign=r,i.textBaseline="middle",i.font=c.string,e.x=Sr(this,p,t),i.fillStyle=t.bodyColor,M(this.beforeBody,f),u=n&&"right"!==p?"center"===r?h/2+l:h+2+l:0,b=0,y=s.length;b<y;++b){for(m=s[b],v=this.labelTextColors[b],i.fillStyle=v,M(m.before,f),x=m.lines,n&&x.length&&(this._drawColorBox(i,e,b,g,t),d=Math.max(c.lineHeight,o)),_=0,w=x.length;_<w;++_)f(x[_]),d=c.lineHeight;M(m.after,f)}u=0,d=c.lineHeight,M(this.afterBody,f),e.y-=a}drawFooter(t,e,i){var s=this.footer,a=s.length;let r,n;if(a){const o=Vi(i.rtl,this.x,this.width);for(t.x=Sr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=o.textAlign(i.footerAlign),e.textBaseline="middle",r=E(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,n=0;n<a;++n)e.fillText(s[n],o.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){var{xAlign:a,yAlign:r}=this,{x:n,y:o}=t,{width:h,height:l}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:g}=Ze(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(n+c,o),"top"===r&&this.drawCaret(t,e,i,s),e.lineTo(n+h-d,o),e.quadraticCurveTo(n+h,o,n+h,o+d),"center"===r&&"right"===a&&this.drawCaret(t,e,i,s),e.lineTo(n+h,o+l-g),e.quadraticCurveTo(n+h,o+l,n+h-g,o+l),"bottom"===r&&this.drawCaret(t,e,i,s),e.lineTo(n+u,o+l),e.quadraticCurveTo(n,o+l,n,o+l-u),"center"===r&&"left"===a&&this.drawCaret(t,e,i,s),e.lineTo(n,o+c),e.quadraticCurveTo(n,o,n+c,o),e.closePath(),e.fill(),0<s.borderWidth&&e.stroke()}_updateAnimationTarget(t){var e,i,s,a=this._chart,r=this.$animations,n=r&&r.x,r=r&&r.y;(n||r)&&(e=_r[t.position].call(this,this._active,this._eventPosition))&&(i=this._size=yr(this,t),s=kr(t,s=Object.assign({},e,this._size),t=Mr(a,t,s),a),n._to===s.x&&r._to===s.y||(this.xAlign=t.xAlign,this.yAlign=t.yAlign,this.width=i.width,this.height=i.height,this.caretX=e.x,this.caretY=e.y,this._resolveAnimations().update(this,s)))}draw(t){var e=this.options.setContext(this.getContext());let i=this.opacity;if(i){this._updateAnimationTarget(e);var s={width:this.width,height:this.height};const n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;var a=V(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),Wi(t,e.textDirection),n.y+=a.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),Ni(t,e.textDirection),t.restore())}}getActiveElements(){return this._active||[]}setActiveElements(t,e){var i=this._active,t=t.map(({datasetIndex:t,index:e})=>{var i=this._chart.getDatasetMeta(t);if(i)return{datasetIndex:t,element:i.data[e],index:e};throw new Error("Cannot find a dataset at index "+t)}),i=!kt(i,t),s=this._positionChanged(t,e);(i||s)&&(this._active=t,this._eventPosition=e,this.update(!0))}handleEvent(t,e){var i=this.options,s=this._active||[];let a=[];"mouseout"!==t.type&&(a=this._chart.getElementsAtEventForMode(t,i.mode,i,e),i.reverse&&a.reverse());var r=this._positionChanged(a,t);return(s=e||!kt(a,s)||r)&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}_positionChanged(t,e){var{caretX:i,caretY:s,options:a}=this,a=_r[a.position].call(this,t,e);return!1!==a&&(i!==a.x||s!==a.y)}}Cr.positioners=_r;var Or={id:"tooltip",_element:Cr,positioners:_r,afterInit(t,e,i){i&&(t.tooltip=new Cr({_chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;var i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){var i;t.tooltip&&(i=e.replay,t.tooltip.handleEvent(e.event,i)&&(e.changed=!0))},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:t,title(t){if(0<t.length){var t=t[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(0<i&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:t,beforeBody:t,beforeLabel:t,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");t=t.formattedValue;return P(t)||(e+=t),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex);t=e.controller.getStyle(t.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex);t=e.controller.getStyle(t.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:t,afterBody:t,beforeFooter:t,footer:t,afterFooter:t}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ja=Object.freeze({__proto__:null,Decimation:Ja,Filler:ur,Legend:pr,SubTitle:br,Title:vr,Tooltip:Or});function Ar(t,e,i,s){var a,r,n,o=t.indexOf(e);return-1===o?(a=t,n=i,s=s,"string"==typeof(r=e)?(n=a.push(r)-1,s.unshift({index:n,label:r})):isNaN(r)&&(n=null),n):o!==t.lastIndexOf(e)?i:o}class Tr extends Fs{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){var e=this._addedLabels;if(e.length){const a=this.getLabels();for(var{index:i,label:s}of e)a[i]===s&&a.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(P(t))return null;var i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Ar(i,t,B(e,t),this._addedLabels),t=e,e=i.length-1,null===t?null:f(Math.round(t),0,e)}determineDataLimits(){var{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){var e=this.min,i=this.max,t=this.options.offset;const s=[];let a=this.getLabels();a=0===e&&i===a.length-1?a:a.slice(e,i+1),this._valueRange=Math.max(a.length-(t?0:1),1),this._startValue=this.min-(t?.5:0);for(let t=e;t<=i;t++)s.push({value:t});return s}getLabelForValue(t){var e=this.getLabels();return 0<=t&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return null===(t="number"!=typeof t?this.parse(t):t)?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Lr(t,e,{horizontal:i,minRotation:s}){s=z(s),i=(i?Math.sin(s):Math.cos(s))||.001;return Math.min(e/i,.75*e*(""+t).length)}Tr.id="category",Tr.defaults={ticks:{callback:Tr.prototype.getLabelForValue}};class Rr extends Fs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return P(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){var e=this.options["beginAtZero"];const{minDefined:i,maxDefined:s}=this.getUserBounds();let{min:a,max:r}=this;var t,n,o=t=>a=i?a:t,h=t=>r=s?r:t;if(e&&(t=S(a),n=S(r),t<0&&n<0?h(0):0<t&&0<n&&o(0)),a===r){let t=1;(r>=Number.MAX_SAFE_INTEGER||a<=Number.MIN_SAFE_INTEGER)&&(t=Math.abs(.05*r)),h(r+t),e||o(a-t)}this.min=a,this.max=r}getTickLimit(){let{maxTicksLimit:t,stepSize:e}=this.options.ticks,i;return e?1e3<(i=Math.ceil(this.max/e)-Math.floor(this.min/e)+1)&&(console.warn(`scales.${this.id}.ticks.stepSize: ${e} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3):(i=this.computeTickLimit(),t=t||11),i=t?Math.min(t,i):i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){var t=this.options,e=t.ticks,i=this.getTickLimit();const s=function(t,e){const i=[];var{bounds:s,step:a,min:r,max:n,precision:o,count:h,maxTicks:l,maxDigits:c,includeBounds:d}=t,u=a||1,g=l-1,{min:e,max:f}=e,p=!P(r),m=!P(n),v=!P(h),c=(f-e)/(c+1);let x=Ut((f-e)/g/u)*u,b,_,y,w;if(x<1e-14&&!p&&!m)return[{value:e},{value:f}];(w=Math.ceil(f/x)-Math.floor(e/x))>g&&(x=Ut(w*x/g/u)*u),P(o)||(b=Math.pow(10,o),x=Math.ceil(x*b)/b),y="ticks"===s?(_=Math.floor(e/x)*x,Math.ceil(f/x)*x):(_=e,f),p&&m&&a&&Gt((n-r)/a,x/1e3)?(w=Math.round(Math.min((n-r)/x,l)),x=(n-r)/w,_=r,y=n):v?(_=p?r:_,y=m?n:y,w=h-1,x=(y-_)/w):w=Kt(w=(y-_)/x,Math.round(w),x/1e3)?Math.round(w):Math.ceil(w),g=Math.max(Jt(x),Jt(_)),b=Math.pow(10,P(o)?g:o),_=Math.round(_*b)/b,y=Math.round(y*b)/b;let M=0;for(p&&(d&&_!==r?(i.push({value:r}),_<r&&M++,Kt(Math.round((_+M*x)*b)/b,r,Lr(r,c,t))&&M++):_<r&&M++);M<w;++M)i.push({value:Math.round((_+M*x)*b)/b});return m&&d&&y!==n?i.length&&Kt(i[i.length-1].value,n,Lr(n,c,t))?i[i.length-1].value=n:i.push({value:n}):m&&y!==n||i.push({value:y}),i}({maxTicks:Math.max(2,i),bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&Zt(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){var t=this.ticks;let e=this.min,i=this.max;super.configure(),this.options.offset&&t.length&&(t=(i-e)/Math.max(t.length-1,1)/2,e-=t,i+=t),this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Bi(t,this.chart.options.locale,this.options.ticks.format)}}class Er extends Rr{determineDataLimits(){var{min:t,max:e}=this.getMinMax(!0);this.min=p(t)?t:0,this.max=p(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){var t=this.isHorizontal(),e=t?this.width:this.height,i=z(this.options.ticks.minRotation),t=(t?Math.sin(i):Math.cos(i))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,i.lineHeight/t))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Ir(t){return 1==t/Math.pow(10,Math.floor(u(t)))}Er.id="linear",Er.defaults={ticks:{callback:As.formatters.numeric}};class zr extends Fs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){t=Rr.prototype.parse.apply(this,[t,e]);if(0!==t)return p(t)&&0<t?t:null;this._zero=!0}determineDataLimits(){var{min:t,max:e}=this.getMinMax(!0);this.min=p(t)?Math.max(0,t):null,this.max=p(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:i}=this.getUserBounds();let s=this.min,a=this.max;var t=t=>s=e?s:t,r=t=>a=i?a:t,n=(t,e)=>Math.pow(10,Math.floor(u(t))+e);s===a&&(s<=0?(t(1),r(10)):(t(n(s,-1)),r(n(a,1)))),s<=0&&t(n(a,-1)),a<=0&&r(n(s,1)),this._zero&&this.min!==this._suggestedMin&&s===n(this.min,0)&&t(n(s,-1)),this.min=s,this.max=a}buildTicks(){var t=this.options;const e=function(t,e){var i=Math.floor(u(e.max)),s=Math.ceil(e.max/Math.pow(10,i));const a=[];let r=l(t.min,Math.pow(10,Math.floor(u(e.min)))),n=Math.floor(u(r)),o=Math.floor(r/Math.pow(10,n)),h=n<0?Math.pow(10,Math.abs(n)):1;for(;a.push({value:r,major:Ir(r)}),10===++o&&(o=1,++n,h=0<=n?1:h),r=Math.round(o*Math.pow(10,n)*h)/h,n<i||n===i&&o<s;);return e=l(t.max,r),a.push({value:e,major:Ir(r)}),a}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&Zt(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Bi(t,this.chart.options.locale,this.options.ticks.format)}configure(){var t=this.min;super.configure(),this._startValue=u(t),this._valueRange=u(this.max)-u(t)}getPixelForValue(t){return null===(t=void 0!==t&&0!==t?t:this.min)||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(u(t)-this._startValue)/this._valueRange)}getValueForPixel(t){t=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+t*this._valueRange)}}function Fr(t){var e=t.ticks;return e.display&&t.display?(t=V(e.backdropPadding),B(e.font&&e.font.size,R.font.size)+t.height):0}function Br(t,e,i,s,a){return t===s||t===a?{start:e-i/2,end:e+i/2}:t<s||a<t?{start:e-i,end:e}:{start:e,end:e+i}}function Vr(e){const i={l:0,r:e.width,t:0,b:e.height-e.paddingTop},s={},a=[],r=[];var n=e.getLabels().length;for(let t=0;t<n;t++){var o=e.options.pointLabels.setContext(e.getPointLabelContext(t)),h=(r[t]=o.padding,e.getPointPosition(t,e.drawingArea+r[t])),o=E(o.font),l=(l=e.ctx,o=o,c=I(c=e._pointLabels[t])?c:[c],{w:oe(l,o.string,c),h:c.length*o.lineHeight}),c=(a[t]=l,e.getIndexAngle(t)),o=Qt(c),d=Br(o,h.x,l.w,0,180),o=Br(o,h.y,l.h,90,270);d.start<i.l&&(i.l=d.start,s.l=c),d.end>i.r&&(i.r=d.end,s.r=c),o.start<i.t&&(i.t=o.start,s.t=c),o.end>i.b&&(i.b=o.end,s.b=c)}e._setReductions(e.drawingArea,i,s),e._pointLabelItems=function(e,i,s){const a=[],r=e.getLabels().length,t=e.options,n=Fr(t),o=e.getDistanceFromCenterForValue(t.ticks.reverse?e.min:e.max);for(let t=0;t<r;t++){var h=0===t?n/2:0,h=e.getPointPosition(t,o+h+s[t]),l=Qt(e.getIndexAngle(t)),c=i[t],d=function(t,e,i){90===i||270===i?t-=e/2:(270<i||i<90)&&(t-=e);return t}(h.y,c.h,l),l=function(t){{if(0===t||180===t)return"center";if(t<180)return"left"}return"right"}(l),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(h.x,c.w,l);a.push({x:h.x,y:d,textAlign:l,left:u,top:d,right:u+c.w,bottom:d+c.h})}return a}(e,a,r)}function Wr(e,i,t,s){const a=e["ctx"];if(t)a.arc(e.xCenter,e.yCenter,i,0,m);else{var r=e.getPointPosition(0,i);a.moveTo(r.x,r.y);for(let t=1;t<s;t++)r=e.getPointPosition(t,i),a.lineTo(r.x,r.y)}}function Nr(t){return qt(t)?t:0}zr.id="logarithmic",zr.defaults={ticks:{callback:As.formatters.logarithmic,major:{enabled:!0}}};class Hr extends Rr{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){this.width=this.maxWidth,this.height=this.maxHeight,this.paddingTop=Fr(this.options)/2,this.xCenter=Math.floor(this.width/2),this.yCenter=Math.floor((this.height-this.paddingTop)/2),this.drawingArea=Math.min(this.height-this.paddingTop,this.width)/2}determineDataLimits(){var{min:t,max:e}=this.getMinMax(!1);this.min=p(t)&&!isNaN(t)?t:0,this.max=p(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Fr(this.options))}generateTickLabels(t){Rr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{t=c(this.options.pointLabels.callback,[t,e],this);return t||0===t?t:""})}fit(){var t=this.options;t.display&&t.pointLabels.display?Vr(this):this.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){var s=e.l/Math.sin(i.l),a=Math.max(e.r-this.width,0)/Math.sin(i.r),r=-e.t/Math.cos(i.t),e=-Math.max(e.b-(this.height-this.paddingTop),0)/Math.cos(i.b),s=Nr(s),a=Nr(a),r=Nr(r),e=Nr(e);this.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(s+a)/2),Math.floor(t-(r+e)/2))),this.setCenterPoint(s,a,r,e)}setCenterPoint(t,e,i,s){e=this.width-e-this.drawingArea,t+=this.drawingArea,i+=this.drawingArea,s=this.height-this.paddingTop-s-this.drawingArea;this.xCenter=Math.floor((t+e)/2+this.left),this.yCenter=Math.floor((i+s)/2+this.top+this.paddingTop)}getIndexAngle(t){return h(t*(m/this.getLabels().length)+z(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(P(t))return NaN;var e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(P(t))return NaN;t/=this.drawingArea/(this.max-this.min);return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(t){var e=this._pointLabels||[];if(0<=t&&t<e.length)return e=e[t],w(this.getContext(),{label:e,index:t,type:"pointLabel"})}getPointPosition(t,e){t=this.getIndexAngle(t)-y;return{x:Math.cos(t)*e+this.xCenter,y:Math.sin(t)*e+this.yCenter,angle:t}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){var{left:t,top:e,right:i,bottom:s}=this._pointLabelItems[t];return{left:t,top:e,right:i,bottom:s}}drawBackground(){var{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Wr(this,this.getDistanceFromCenterForValue(this._endValue),e,this.getLabels().length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx;var e=this.options;const{angleLines:i,grid:h}=e,l=this.getLabels().length;let s,c,a;if(e.pointLabels.display){var r=this;var n=l;const{ctx:k,options:{pointLabels:S}}=r;for(let t=n-1;0<=t;t--){var o,d=S.setContext(r.getPointLabelContext(t)),u=E(d.font),{x:g,y:f,textAlign:p,left:m,top:v,right:x,bottom:b}=r._pointLabelItems[t],_=d["backdropColor"];P(_)||(o=V(d.backdropPadding),k.fillStyle=_,k.fillRect(m-o.left,v-o.top,x-m+o.width,b-v+o.height)),me(k,r._pointLabels[t],g,f+u.lineHeight/2,u,{color:d.color,textAlign:p,textBaseline:"middle"})}}if(h.display&&this.ticks.forEach((t,e)=>{if(0!==e){c=this.getDistanceFromCenterForValue(t.value);t=h.setContext(this.getContext(e-1));{var e=this,i=c,s=l;const o=e.ctx;var a=t.circular,{color:r,lineWidth:n}=t;!a&&!s||!r||!n||i<0||(o.save(),o.strokeStyle=r,o.lineWidth=n,o.setLineDash(t.borderDash),o.lineDashOffset=t.borderDashOffset,o.beginPath(),Wr(e,i,a,s),o.closePath(),o.stroke(),o.restore())}}}),i.display){for(t.save(),s=this.getLabels().length-1;0<=s;s--){var y=i.setContext(this.getPointLabelContext(s)),{color:w,lineWidth:M}=y;M&&w&&(t.lineWidth=M,t.strokeStyle=w,t.setLineDash(y.borderDash),t.lineDashOffset=y.borderDashOffset,c=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(s,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const n=this.ctx,o=this.options,h=o.ticks;if(h.display){var t=this.getIndexAngle(0);let a,r;n.save(),n.translate(this.xCenter,this.yCenter),n.rotate(t),n.textAlign="center",n.textBaseline="middle",this.ticks.forEach((t,e)=>{var i,s;0===e&&!o.reverse||(s=E((i=h.setContext(this.getContext(e))).font),a=this.getDistanceFromCenterForValue(this.ticks[e].value),i.showLabelBackdrop&&(n.font=s.string,r=n.measureText(t.label).width,n.fillStyle=i.backdropColor,e=V(i.backdropPadding),n.fillRect(-r/2-e.left,-a-s.size/2-e.top,r+e.width,s.size+e.height)),me(n,t.label,0,-a,s,{color:i.color}))}),n.restore()}}drawTitle(){}}Hr.id="radialLinear",Hr.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:As.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5}},Hr.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};const jr={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:!(Hr.descriptors={angleLines:{_fallback:"grid"}}),size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},D=Object.keys(jr);function Yr(t,e){return t-e}function $r(t,e){if(P(e))return null;const i=t._adapter,{parser:s,round:a,isoWeekday:r}=t._parseOpts;let n=e;return"function"==typeof s&&(n=s(n)),null===(n=p(n)?n:"string"==typeof s?i.parse(n,s):i.parse(n))?null:+(n=a?"week"!==a||!qt(r)&&!0!==r?i.startOf(n,a):i.startOf(n,"isoWeek",r):n)}function Ur(e,i,s,a){var r=D.length;for(let t=D.indexOf(e);t<r-1;++t){var n=jr[D[t]],o=n.steps||Number.MAX_SAFE_INTEGER;if(n.common&&Math.ceil((s-i)/(o*n.size))<=a)return D[t]}return D[r-1]}function Xr(t,e,i){var s,a;i?i.length&&({lo:s,hi:a}=xe(i,e),t[i[s]>=e?i[s]:i[a]]=!0):t[e]=!0}function qr(i,t,s){const a=[],r={};var e=t.length;let n,o;for(n=0;n<e;++n)o=t[n],r[o]=n,a.push({value:o,major:!1});if(0!==e&&s){var h=a,l=r,c=s;const u=i._adapter;var i=+u.startOf(h[0].value,c),d=h[h.length-1].value;let t,e;for(t=i;t<=d;t=+u.add(t,1,c))0<=(e=l[t])&&(h[e].major=!0);return h}return a}class Kr extends Fs{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){var i=t.time||(t.time={});const s=this._adapter=new la._date(t.adapters.date);Ot(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:$r(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){var t=this.options;const e=this._adapter;var i=t.time.unit||"day";let{min:s,max:a,minDefined:r,maxDefined:n}=this.getUserBounds();function o(t){r||isNaN(t.min)||(s=Math.min(s,t.min)),n||isNaN(t.max)||(a=Math.max(a,t.max))}r&&n||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||o(this.getMinMax(!1))),s=p(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),a=p(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,a-1),this.max=Math.max(s+1,a)}_getLabelBounds(){var t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){var t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate(),a=("ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]),this.min);const r=_e(s,a,this.max);return this._unit=e.unit||(i.autoSkip?Ur(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):function(e,i,s,a,r){for(let t=D.length-1;t>=D.indexOf(s);t--){var n=D[t];if(jr[n].common&&e._adapter.diff(r,a,n)>=i-1)return n}return D[s?D.indexOf(s):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(i){for(let t=D.indexOf(i)+1,e=D.length;t<e;++t)if(jr[D[t]].common)return D[t]}(this._unit):void 0,this.initOffsets(s),t.reverse&&r.reverse(),qr(this,r,this._majorUnit)}initOffsets(t){let e=0,i=0;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),e=1===t.length?1-s:(this.getDecimalForValue(t[1])-s)/2,s=this.getDecimalForValue(t[t.length-1]),i=1===t.length?s:(s-this.getDecimalForValue(t[t.length-2]))/2);var s=t.length<3?.5:.25;e=f(e,0,s),i=f(i,0,s),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter;var e=this.min,i=this.max,s=this.options,a=s.time,r=a.unit||Ur(a.minUnit,e,i,this._getLabelCapacity(e)),n=B(a.stepSize,1),a="week"===r&&a.isoWeekday,o=qt(a)||!0===a,h={};let l=e,c,d;if(o&&(l=+t.startOf(l,"isoWeek",a)),l=+t.startOf(l,o?"day":r),t.diff(i,e,r)>1e5*n)throw new Error(e+" and "+i+" are too far apart with stepSize of "+n+" "+r);var u="data"===s.ticks.source&&this.getDataTimestamps();for(c=l,d=0;c<i;c=+t.add(c,n,r),d++)Xr(h,c,u);return c!==i&&"ticks"!==s.bounds&&1!==d||Xr(h,c,u),Object.keys(h).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter;var i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){var a=this.options,r=a.time.displayFormats,n=this._unit,o=this._majorUnit,n=n&&r[n],r=o&&r[o],h=i[e],o=o&&r&&h&&h.major,h=this._adapter.format(t,s||(o?r:n)),t=a.ticks.callback;return t?c(t,[h,e,i],this):h}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)(s=t[e]).label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){var e=this._offsets,t=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+t)*e.factor)}getValueForPixel(t){var e=this._offsets,t=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+t*(this.max-this.min)}_getLabelSize(t){var e=this.options.ticks,t=this.ctx.measureText(t).width,e=z(this.isHorizontal()?e.maxRotation:e.minRotation),i=Math.cos(e),e=Math.sin(e),s=this._resolveTickFontOptions(0).size;return{w:t*i+s*e,h:t*e+s*i}}_getLabelCapacity(t){var e=this.options.time,i=e.displayFormats,e=i[e.unit]||i.millisecond,i=this._tickFormatFunction(t,0,qr(this,[t],this._majorUnit),e),t=this._getLabelSize(i),e=Math.floor(this.isHorizontal()?this.width/t.w:this.height/t.h)-1;return 0<e?e:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;var s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push($r(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ke(t.sort(Yr))}}function Gr(t,e,i){let s=0,a=t.length-1,r,n,o,h;i?(e>=t[s].pos&&e<=t[a].pos&&({lo:s,hi:a}=x(t,"pos",e)),{pos:r,time:o}=t[s],{pos:n,time:h}=t[a]):(e>=t[s].time&&e<=t[a].time&&({lo:s,hi:a}=x(t,"time",e)),{time:r,pos:o}=t[s],{time:n,pos:h}=t[a]);i=n-r;return i?o+(h-o)*(e-r)/i:o}Kr.id="time",Kr.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Zr extends Kr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){var t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Gr(e,this.min),this._tableRange=Gr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){var{min:e,max:i}=this;const s=[],a=[];let r,n,o,h,l;for(r=0,n=t.length;r<n;++r)(h=t[r])>=e&&h<=i&&s.push(h);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,n=s.length;r<n;++r)l=s[r+1],o=s[r-1],h=s[r],Math.round((l+o)/2)!==h&&a.push({time:h,pos:r/(n-1)});return a}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps();var i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t}getDecimalForValue(t){return(Gr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){var e=this._offsets,t=this.getDecimalForPixel(t)/e.factor-e.end;return Gr(this._table,t*this._tableRange+this._minPos,!0)}}Zr.id="timeseries",Zr.defaults=Kr.defaults;ur=Object.freeze({__proto__:null,CategoryScale:Tr,LinearScale:Er,LogarithmicScale:zr,RadialLinearScale:Hr,TimeScale:Kr,TimeSeriesScale:Zr});return s.register(Sa,ur,Ga,Ja),s.helpers={...Ki},s._adapters=la,s.Animation=ms,s.Animations=xs,s.animator=n,s.controllers=b.controllers.items,s.DatasetController=e,s.Element=i,s.elements=Ga,s.Interaction=Ye,s.layouts=a,s.platforms=Fe,s.Scale=Fs,s.Ticks=As,Object.assign(s,Sa,ur,Ga,Ja,Fe),s.Chart=s,"undefined"!=typeof window&&(window.Chart=s),s});