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