*/constr={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},l="0123456789ABCDEF",c=t=>l[15&t],h=t=>l[(240&t)>>4]+l[15&t],d=t=>(240&t)>>4==(15&t);functionu(t){vare=function(t){returnd(t.r)&&d(t.g)&&d(t.b)&&d(t.a)}(t)?c:h;returnt?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}functionf(t){returnt+.5|0}constg=(t,e,i)=>Math.max(Math.min(t,i),e);functionp(t){returng(f(2.55*t),0,255)}functionm(t){returng(f(255*t),0,255)}functionx(t){returng(f(t/2.55)/100,0,1)}functionb(t){returng(f(100*t),0,100)}const_=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;consty=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;functionv(t,e,i){constn=e*Math.min(i,1-i),o=(e,o=(e+t/30)%12)=>i-n*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}functionw(t,e,i){constn=(n,o=(n+t/60)%6)=>i-i*e*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}functionM(t,e,i){constn=v(t,1,.5);leto;for(e+i>1&&(o=1/(e+i),e*=o,i*=o),o=0;o<3;o++)n[o]*=1-e-i,n[o]+=e;returnn}functionk(t){conste=t.r/255,i=t.g/255,n=t.b/255,o=Math.max(e,i,n),s=Math.min(e,i,n),a=(o+s)/2;letr,l,c;returno!==s&&(c=o-s,l=a>.5?c/(2-o-s):c/(o+s),r=o===e?(i-n)/c+(i<n?6:0):o===i?(n-e)/c+2:(e-i)/c+4,r=60*r+.5),[0|r,l||0,a]}functionS(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(m)}functionP(t,e,i){returnS(v,t,e,i)}functionD(t){return(t%360+360)%360}functionC(t){conste=y.exec(t);leti,n=255;if(!e)return;e[5]!==i&&(n=e[6]?p(+e[5]):m(+e[5]));consto=D(+e[2]),s=+e[3]/100,a=+e[4]/100;returni="hwb"===e[1]?function(t,e,i){returnS(M,t,e,i)}(o,s,a):"hsv"===e[1]?function(t,e,i){returnS(w,t,e,i)}(o,s,a):P(o,s,a),{r:i[0],g:i[1],b:i[2],a:n}}constO={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"},A={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"};letT;functionR(t){T||(T=function(){constt={},e=Object.keys(A),i=Object.keys(O);letn,o,s,a,r;for(n=0;n<e.length;n++){for(a=r=e[n],o=0;o<i.length;o++)s=i[o],r=r.replace(s,O[s]);s=parseInt(A[a],16),t[r]=[s>>16&255,s>>8&255,255&s]}returnt}(),T.transparent=[0,0,0,0]);conste=T[t.toLowerCase()];returne&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}functionL(t,e,i){if(t){letn=k(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=P(n),t.r=n[0],t.g=n[1],t.b=n[2]}}functionE(t,e){returnt?Object.assign(e||{},t):t}functionI(t){vare={r:0,g:0,b:0,a:255};returnArray.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=m(t[3]))):(e=E(t,{r:0,g:0,b:0,a:1})).a=m(e.a),e}functionz(t){return"r"===t.charAt(0)?function(t){conste=_.exec(t);leti,n,o,s=255;if(e){if(e[7]!==i){constt=+e[7];s=255&(e[8]?p(t):255*t)}returni=+e[1],n=+e[3],o=+e[5],i=255&(e[2]?p(i):i),n=255&(e[4]?p(n):n),o=255&(e[6]?p(o):o),{r:i,g:n,b:o,a:s}}}(t):C(t)}classF{constructor(t){if(tinstanceofF)returnt;conste=typeoft;leti;varn,o,s;"object"===e?i=I(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?o={r:255&17*r[n[1]],g:255&17*r[n[2]],b:255&17*r[n[3]],a:5===s?17*r[n[4]]:255}:7!==s&&9!==s||(o={r:r[n[1]]<<4|r[n[2]],g:r[n[3]]<<4|r[n[4]],b:r[n[5]]<<4|r[n[6]],a:9===s?r[n[7]]<<4|r[n[8]]:255})),i=o||R(t)||z(t)),this._rgb=i,this._valid=!!i}getvalid(){returnthis._valid}getrgb(){vart=E(this._rgb);returnt&&(t.a=x(t.a)),t}setrgb(t){this._rgb=I(t)}rgbString(){returnthis._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${x(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;vart}hexString(){returnthis._valid?u(this._rgb):this._rgb}hslString(){returnthis._valid?function(t){if(!t)return;conste=k(t),i=e[0],n=b(e[1]),o=b(e[2]);returnt.a<255?`hsla(${i}, ${n}%, ${o}%, ${x(t.a)})`:`hsl(${i}, ${n}%, ${o}%)`}(this._rgb):this._rgb}mix(t,e){consti=this;if(t){constn=i.rgb,o=t.rgb;lets;consta=e===s?.5:e,r=2*a-1,l=n.a-o.a,c=((r*l==-1?r:(r+l)/(1+r*l))+1)/2;s=1-c,n.r=255&c*n.r+s*o.r+.5,n.g=255&c*n.g+s*o.g+.5,n.b=255&c*n.b+s*o.b+.5,n.a=a*n.a+(1-a)*o.a,i.rgb=n}returni}clone(){returnnewF(this.rgb)}alpha(t){returnthis._rgb.a=m(t),this}clearer(t){returnthis._rgb.a*=1-t,this}greyscale(){constt=this._rgb,e=f(.3*t.r+.59*t.g+.11*t.b);returnt.r=t.g=t.b=e,this}opaquer(t){returnthis._rgb.a*=1+t,this}negate(){constt=this._rgb;returnt.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){returnL(this._rgb,2,t),this}darken(t){returnL(this._rgb,2,-t),this}saturate(t){returnL(this._rgb,1,t),this}desaturate(t){returnL(this._rgb,1,-t),this}rotate(t){returnfunction(t,e){vari=k(t);i[0]=D(i[0]+e),i=P(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}functionV(t){returnnewF(t)}constB=t=>tinstanceofCanvasGradient||tinstanceofCanvasPattern;functionW(t){returnB(t)?t:V(t)}functionH(t){returnB(t)?t:V(t).saturate(.5).darken(.1).hexString()}functionN(){}constj=function(){lett=0;returnfunction(){returnt++}}();function$(t){returnnull==t}functionY(t){if(Array.isArray&&Array.isArray(t))return!0;conste=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}functionU(t){returnnull!==t&&"[object Object]"===Object.prototype.toString.call(t)}constX=t=>("number"==typeoft||tinstanceofNumber)&&isFinite(+t);functionq(t,e){returnX(t)?t:e}functionK(t,e){returnvoid0===t?e:t}constG=(t,e)=>"string"==typeoft&&t.endsWith("%")?parseFloat(t)/100:t/e,Z=(t,e)=>"string"==typeoft&&t.endsWith("%")?parseFloat(t)/100*e:+t;functionQ(t,e,i){if(t&&"function"==typeoft.call)returnt.apply(i,e)}functionJ(t,e,i,n){leto,s,a;if(Y(t))if(s=t.length,n)for(o=s-1;o>=0;o--)e.call(i,t[o],o);elsefor(o=0;o<s;o++)e.call(i,t[o],o);elseif(U(t))for(a=Object.keys(t),s=a.length,o=0;o<s;o++)e.call(i,t[a[o]],a[o])}functiontt(t,e){leti,n,o,s;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(o=t[i],s=e[i],o.datasetIndex!==s.datasetIndex||o.index!==s.index)return!1;return!0}functionet(t){if(Y(t))returnt.map(et);if(U(t)){conste=Object.create(null),i=Object.keys(t),n=i.length;leto=0;for(;o<n;++o)e[i[o]]=et(t[i[o]]);returne}returnt}functionit(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}functionnt(t,e,i,n){if(!it(t))return;consto=e[t],s=i[t];U(o)&&U(s)?ot(o,s,n):e[t]=et(s)}functionot(t,e,i){constn=Y(e)?e:[e],o=n.length;if(!U(t))returnt;consts=(i=i||{}).merger||nt;for(leta=0;a<o;++a){if(!U(e=n[a]))continue;consto=Object.keys(e);for(letn=0,a=o.length;n<a;++n)s(o[n],t,e,i)}returnt}functionst(t,e){returnot(t,e,{merger:at})}functionat(t,e,i){if(!it(t))return;constn=e[t],o=i[t];U(n)&&U(o)?st(n,o):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=et(o))}functionrt(t,e){consti=t.indexOf(".",e);return-1===i?t.length:i}functionlt(t,e){if(""===e)returnt;leti=0,n=rt(e,i);for(;t&&n>i;)t=t[e.substr(i,n-i)],i=n+1,n=rt(e,i);returnt}functionct(t){returnt.charAt(0).toUpperCase()+t.slice(1)}constht=t=>void0!==t,dt=t=>"function"==typeoft,ut=(t,e)=>{if(t.size!==e.size)return!1;for(constioft)if(!e.has(i))return!1;return!0},ft=Object.create(null),gt=Object.create(null);functionpt(t,e){if(!e)returnt;consti=e.split(".");for(lete=0,n=i.length;e<n;++e){constn=i[e];t=t[n]||(t[n]=Object.create(null))}returnt}functionmt(t,e,i){return"string"==typeofe?ot(pt(t,e),i):ot(pt(t,""),e)}varxt=newclass{constructor(t){this.animation=void0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>H(e.backgroundColor),this.hoverBorderColor=(t,e)=>H(e.borderColor),this.hoverColor=(t,e)=>H(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void0,this.scales={},this.showLine=!0,this.describe(t)}set(t,e){returnmt(this,t,e)}get(t){returnpt(this,t)}describe(t,e){returnmt(gt,t,e)}override(t,e){returnmt(ft,t,e)}route(t,e,i,n){consto=pt(this,t),s=pt(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){constt=this[a],e=s[n];returnU(t)?Object.assign({},e,t):K(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});constbt=Math.PI,_t=2*bt,yt=_t+bt,vt=Number.POSITIVE_INFINITY,wt=bt/180,Mt=bt/2,kt=bt/4,St=2*bt/3,Pt=Math.log10,Dt=Math.sign;functionCt(t){conste=Math.pow(10,Math.floor(Pt(t))),i=t/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}functionOt(t){conste=[],i=Math.sqrt(t);letn;for(n=1;n<i;n++)t%n==0&&(e.push(n),e.push(t/n));returni===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}functionAt(t){return!isNaN(parseFloat(t))&&isFinite(t)}functionTt(t,e,i){returnMath.abs(t-e)<i}functionRt(t,e){consti=Math.round(t);returni-e<=t&&i+e>=t}functionLt(t,e,i){letn,o,s;for(n=0,o=t.length;n<o;n++)s=t[n][i],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}functionEt(t){returnt*(bt/180)}functionIt(t){returnt*(180/bt)}functionzt(t){if(!X(t))return;lete=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;returni}functionFt(t,e){consti=e.x-t.x,n=e.y-t.y,o=Math.sqrt(i*i+n*n);lets=Math.atan2(n,i);returns<-.5*bt&&(s+=_t),{angle:s,distance:o}}functionVt(t,e){returnMath.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}functionBt(t,e){return(t-e+yt)%_t-bt}functionWt(t){return(t%_t+_t)%_t}functionHt(t,e,i){constn=Wt(t),o=Wt(e),s=Wt(i),a=Wt(o-n),r=Wt(s-n),l=Wt(n-o),c=Wt(n-s);returnn===o||n===s||a>r&&l<c}functionNt(t,e,i){returnMath.max(e,Math.min(i,t))}functionjt(t){returnNt(t,-32768,32767)}function$t(t){return!t||$(t.size)||$(t.family)?null:(t.style?t.style+"":"")+(t.weight?t.weight+"":"")+t.size+"px "+t.family}functionYt(t,e,i,n,o){lets=e[o];returns||(s=e[o]=t.measureText(o).width,i.push(o)),s>n&&(n=s),n}functionUt(t,e,i,n){leto=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(o=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;leta=0;constr=i.length;letl,c,h,d,u;for(l=0;l<r;l++)if(d=i[l],null!=d&&!0!==Y(d))a=Yt(t,o,s,a,d);elseif(Y(d))for(c=0,h=d.length;c<h;c++)u=d[c],null==u||Y(u)||(a=Yt(t,o,s,a,u));t.restore();constf=s.length/2;if(f>i.length){for(l=0;l<f;l++)deleteo[s[l]];s.splice(0,f)}returna}functionXt(t,e,i){constn=t.currentDevicePixelRatio,o=0!==i?Math.max(i/2,.5):0;returnMath.round((e-o)*n)/n+o}functionqt(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}functionKt(t,e,i,n){leto,s,a,r,l;constc=e.pointStyle,h=e.rotation,d=e.radius;letu=(h||0)*wt;if(c&&"object"==typeofc&&(o=c.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))returnt.save(),t.translate(i,n),t.rotate(u),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),voidt.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),c){default:t.arc(i,n,d,0,_t),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(u)*d,n-Math.cos(u)*d),u+=St,t.lineTo(i+Math.sin(u)*d,n-Math.cos(u)*d),u+=St,t.lineTo(i+Math.sin(u)*d,n-Math.cos(u)*d),t.closePath();break;case"rectRounded":l=.516*d,r=d-l,s=Math.cos(u+kt)*r,a=Math.sin(u+kt)*r,t.arc(i-s,n-a,l,u-bt,u-Mt),t.arc(i+a,n-s,l,u-Mt,u),t.arc(i+s,n+a,l,u,u+Mt),t.arc(i-a,n+s,l,u+Mt,u+bt),t.closePath();break;case"rect":if(!h){r=Math.SQRT1_2*d,t.rect(i-r,n-r,2*r,2*r);break}u+=kt;case"rectRot":s=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-s,n-a),t.lineTo(i+a,n-s),t.lineTo(i+s,n+a),t.lineTo(i-a,n+s),t.closePath();break;case"crossRot":u+=kt;case"cross":s=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-s,n-a),t.lineTo(i+s,n+a),t.moveTo(i+a,n-s),t.lineTo(i-a,n+s);break;case"star":s=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-s,n-a),t.lineTo(i+s,n+a),t.moveTo(i+a,n-s),t.lineTo(i-a,n+s),u+=kt,s=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-s,n-a),t.lineTo(i+s,n+a),t.moveTo(i+a,n-s),t.lineTo(i-a,n+s);break;case"line":s=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-s,n-a),t.lineTo(i+s,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(u)*d,n+Math.sin(u)*d)}t.fill(),e.borderWidth>0&&t.stroke()}}functionGt(t,e,i){returni=i||.5,t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}functionZt(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}functionQt(t){t.restore()}functionJt(t,e,i,n,o){if(!e)returnt.lineTo(i.x,i.y);if("middle"===o){constn=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===o!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}functionte(t,e,i,n){if(!e)returnt.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}functionee(t,e,i,n,o,s={}){consta=Y(e)?e:[e],r=s.strokeWidth>0&&""!==s.strokeColor;letl,c;for(t.save(),s.translation&&t.translate(s.translation[0],s.translation[1]),$(s.rotation)||t.rotate(s.rotation),t.font=o.string,s.color&&(t.fillStyle=s.color),s.textAlign&&(t.textAlign=s.textAlign),s.textBaseline&&(t.textBaseline=s.textBaseline),l=0;l<a.length;++l){if(c=a[l],r&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),$(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(c,i,n,s.maxWidth)),t.fillText(c,i,n,s.maxWidth),s.strikethrough||s.underline){conste=t.measureText(c),o=i-e.actualBoundingBoxLeft,a=i+e.actualBoundingBoxRight,r=n-e.actualBoundingBoxAscent,l=n+e.actualBoundingBoxDescent,h=s.strikethrough?(r+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(o,h),t.lineTo(a,h),t.stroke()}n+=o.lineHeight}t.restore()}functionie(t,e){const{x:i,y:n,w:o,h:s,radius:a}=e;t.arc(i+a.topLeft,n+a.topLeft,a.topLeft,-Mt,bt,!0),t.lineTo(i,n+s-a.bottomLeft),t.arc(i+a.bottomLeft,n+s-a.bottomLeft,a.bottomLeft,bt,Mt,!0),t.lineTo(i+o-a.bottomRight,n+s),t.arc(i+o-a.bottomRight,n+s-a.bottomRight,a.bottomRight,Mt,0,!0),t.lineTo(i+o,n+a.topRight),t.arc(i+o-a.topRight,n+a.topRight,a.topRight,0,-Mt,!0),t.lineTo(i+a.topLeft,n)}functionne(t,e,i){i=i||(i=>t[i]<e);letn,o=t.length-1,s=0;for(;o-s>1;)n=s+o>>1,i(n)?s=n:o=n;return{lo:s,hi:o}}constoe=(t,e,i)=>ne(t,i,(n=>t[n][e]<i)),se=(t,e,i)=>ne(t,i,(n=>t[n][e]>=i));functionae(t,e,i){letn=0,o=t.length;for(;n<o&&t[n]<e;)n++;for(;o>n&&t[o-1]>i;)o--;returnn>0||o<t.length?t.slice(n,o):t}constre=["push","pop","shift","splice","unshift"];functionle(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),re.forEach((e=>{consti="_onData"+ct(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){consto=n.apply(this,e);returnt._chartjs.listeners.forEach((t=>{"function"==typeoft[i]&&t[i](...e)})),o}})})))}functionce(t,e){consti=t._chartjs;if(!i)return;constn=i.listeners,o=n.indexOf(e);-1!==o&&n.splice(o,1),n.length>0||(re.forEach((e=>{deletet[e]})),deletet._chartjs)}functionhe(t){conste=newSet;leti,n;for(i=0,n=t.length;i<n;++i)e.add(t[i]);if(e.size===n)returnt;consto=[];returne.forEach((t=>{o.push(t)})),o}functionde(t){lete=t.parentNode;returne&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}functionue(t,e,i){letn;return"string"==typeoft?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}constfe=t=>window.getComputedStyle(t,null);functionge(t,e){returnfe(t).getPropertyValue(e)}constpe=["top","right","bottom","left"];functionme(t,e,i){constn={};i=i?"-"+i:"";for(leto=0;o<4;o++){consts=pe[o];n[s]=parseFloat(t[e+"-"+s+i])||0}returnn.width=n.left+n.right,n.height=n.top+n.bottom,n}functionxe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,o=fe(i),s="border-box"===o.boxSizing,a=me(o,"padding"),r=me(o,"border","width"),{x:l,y:c,box:h}=function(t,e){consti=t.native||t,n=i.touches,o=n&&n.length?n[0]:i,{offsetX:s,offsetY:a}=o;letr,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,a,i.target))r=s,l=a;else{constt=e.getBoundingClientRect();r=o.clientX-t.left,l=o.clientY-t.top,c=!0}return{x:r,y:l,box:c}}(t,i),d=a.left+(h&&r.left),u=a.top+(h&&r.top);let{width:f,height:g}=e;returns&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/g*i.height/n)}}constbe=t=>Math.round(10*t)/10;function_e(t,e,i,n){consto=fe(t),s=me(o,"margin"),a=ue(o.maxWidth,t,"clientWidth")||vt,r=ue(o.maxHeight,t,"clientHeight")||vt,l=function(t,e,i){letn,o;if(void0===e||void0===i){consts=de(t);if(s){constt=s.getBoundingClientRect(),a=fe(s),r=me(a,"border","width"),l=me(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,n=ue(a.maxWidth,s,"clientWidth"),o=ue(a.maxHeight,s,"clientHeight")}elsee=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||vt,maxHeight:o||vt}}(t,e,i);let{width:c,height:h}=l;if("content-box"===o.boxSizing){constt=me(o,"border","width"),e=me(o,"padding");c-=e.width+t.width,h-=e.height+t.height}returnc=Math.max(0,c-s.width),h=Math.max(0,n?Math.floor(c/n):h-s.height),c=be(Math.min(c,a,l.maxWidth)),h=be(Math.min(h,r,l.maxHeight)),c&&!h&&(h=be(c/2)),{width:c,height:h}}functionye(t,e,i){constn=t.currentDevicePixelRatio=e||1,{canvas:o,width:s,height:a}=t;o.height=a*n,o.width=s*n,t.ctx.setTransform(n,0,0,n,0,0),o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=a+"px",o.style.width=s+"px")}constve=function(){lett=!1;try{conste={getpassive(){returnt=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}returnt}();functionwe(t,e){consti=ge(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);returnn?+n[1]:void0}functionMe(t,e){return"native"int?{x:t.x,y:t.y}:xe(t,e)}functionke(t,e,i,n){const{controller:o,data:s,_sorted:a}=t,r=o._cachedMeta.iScale;if(r&&e===r.axis&&a&&s.length){constt=r._reversePixels?se:oe;if(!n)returnt(s,e,i);if(o._sharedOptions){constn=s[0],o="function"==typeofn.getRange&&n.getRange(e);if(o){constn=t(s,e,i-o),a=t(s,e,i+o);return{lo:n.lo,hi:a.hi}}}}return{lo:0,hi:s.length-1}}functionSe(t,e,i,n,o){consts=t.getSortedVisibleDatasetMetas(),a=i[e];for(lett=0,i=s.length;t<i;++t){const{index:i,data:r}=s[t],{lo:l,hi:c}=ke(s[t],e,a,o);for(lett=l;t<=c;++t){conste=r[t];e.skip||n(e,i,t)}}}functionPe(t,e,i,n){consto=[];if(!Gt(e,t.chartArea,t._minPadding))returno;returnSe(t,i,e,(function(t,i,s){t.inRange(e.x,e.y,n)&&o.push({element:t,datasetIndex:i,index:s})}),!0),o}functionDe(t,e,i,n,o){consts=function(t){conste=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");returnfunction(t,n){consto=e?Math.abs(t.x-n.x):0,s=i?Math.abs(t.y-n.y):0;returnMath.sqrt(Math.pow(o,2)+Math.pow(s,2))}}(i);leta=Number.POSITIVE_INFINITY,r=[];if(!Gt(e,t.chartArea,t._minPadding))returnr;returnSe(t,i,e,(function(t,i,l){if(n&&!t.inRange(e.x,e.y,o))return;constc=t.getCenterPoint(o),h=s(e,c);h<a?(r=[{element:t,datasetIndex:i,index:l}],a=h):h===a&&r.push({element:t,datasetIndex:i,index:l})})),r}functionCe(t,e,i,n){consto=Me(e,t),s=[],a=i.axis,r="x"===a?"inXRange":"inYRange";letl=!1;returnfunction(t,e){consti=t.getSortedVisibleDatasetMetas();letn,o,s;for(lett=0,a=i.length;t<a;++t){({index:n,data:o}=i[t]);for(lett=0,i=o.length;t<i;++t)s=o[t],s.skip||e(s,n,t)}}(t,((t,e,i)=>{t[r](o[a],n)&&s.push({element:t,datasetIndex:e,index:i}),t.inRange(o.x,o.y,n)&&(l=!0)})),i.intersect&&!l?[]:s}varOe={modes:{index(t,e,i,n){consto=Me(e,t),s=i.axis||"x",a=i.intersect?Pe(t,o,s,n):De(t,o,s,!1,n),r=[];returna.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{conste=a[0].index,i=t.data[e];i&&!i.skip&&r.push({element:i,datasetIndex:t.index,index:e})})),r):[]},dataset(t,e,i,n){consto=Me(e,t),s=i.axis||"xy";leta=i.intersect?Pe(t,o,s,n):De(t,o,s,!1,n);if(a.length>0){conste=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(lett=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}returna},point:(t,e,i,n)=>Pe(t,Me(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>De(t,Me(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>(i.axis="x",Ce(t,e,i,n)),y:(t,e,i,n)=>(i.axis="y",Ce(t,e,i,n))}};constAe=newRegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Te=newRegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);functionRe(t,e){consti=(""+t).match(Ae);if(!i||"normal"===i[1])return1.2*e;switch(t=+i[2],i[3]){case"px":returnt;case"%":t/=100}returne*t}functionLe(t,e){consti={},n=U(e),o=n?Object.keys(e):e,s=U(t)?n?i=>K(t[i],t[e[i]]):e=>t[e]:()=>t;for(consttofo)i[t]=+s(t)||0;returni}functionEe(t){returnLe(t,{top:"y",right:"x",bottom:"y",left:"x"})}functionIe(t){returnLe(t,["topLeft","topRight","bottomLeft","bottomRight"])}functionze(t){conste=Ee(t);returne.width=e.left+e.right,e.height=e.top+e.bottom,e}functionFe(t,e){t=t||{},e=e||xt.font;leti=K(t.size,e.size);"string"==typeofi&&(i=parseInt(i,10));letn=K(t.style,e.style);n&&!(""+n).match(Te)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");consto={family:K(t.family,e.family),lineHeight:Re(K(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:K(t.weight,e.weight),string:""};returno.string=$t(o),o}functionVe(t,e,i,n){leto,s,a,r=!0;for(o=0,s=t.length;o<s;++o)if(a=t[o],void0!==a&&(void0!==e&&"function"==typeofa&&(a=a(e),r=!1),void0!==i&&Y(a)&&(a=a[i%a.length],r=!1),void0!==a))returnn&&!r&&(n.cacheable=!1),a}functionBe(t,e){const{min:i,max:n}=t;return{min:i-Math.abs(Z(e,i)),max:n+Z(e,n)}}constWe=["left","top","right","bottom"];functionHe(t,e){returnt.filter((t=>t.pos===e))}functionNe(t,e){returnt.filter((t=>-1===We.indexOf(t.pos)&&t.box.axis===e))}functionje(t,e){returnt.sort(((t,i)=>{constn=e?i:t,o=e?t:i;returnn.weight===o.weight?n.index-o.index:n.weight-o.weight}))}function$e(t,e,i,n){returnMath.max(t[i],e[i])+Math.max(t[n],e[n])}functionYe(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}functionUe(t,e,i){constn=i.box,o=t.maxPadding;U(i.pos)||(i.size&&(t[i.pos]-=i.size),i.size=i.horizontal?n.height:n.width,t[i.pos]+=i.size),n.getPadding&&Ye(o,n.getPadding());consts=Math.max(0,e.outerWidth-$e(o,t,"left","right")),a=Math.max(0,e.outerHeight-$e(o,t,"top","bottom")),r=s!==t.w,l=a!==t.h;returnt.w=s,t.h=a,i.horizontal?{same:r,other:l}:{same:l,other:r}}functionXe(t,e){consti=e.maxPadding;functionn(t){constn={left:0,top:0,right:0,bottom:0};returnt.forEach((t=>{n[t]=Math.max(e[t],i[t])})),n}returnn(t?["left","right"]:["top","bottom"])}functionqe(t,e,i){constn=[];leto,s,a,r,l,c;for(o=0,s=t.length,l=0;o<s;++o){a=t[o],r=a.box,r.update(a.width||e.w,a.height||e.h,Xe(a.horizontal,e));const{same:s,other:h}=Ue(e,i,a);l|=s&&n.length,c=c||h,r.fullSize||n.push(a)}returnl&&qe(n,e,i)||c}functionKe(t,e,i){constn=i.padding;leto,s,a,r,l=e.x,c=e.y;for(o=0,s=t.length;o<s;++o)a=t[o],r=a.box,a.horizontal?(r.left=r.fullSize?n.left:e.left,r.right=r.fullSize?i.outerWidth-n.right:e.left+e.w,r.top=c,r.bottom=c+r.height,r.width=r.right-r.left,c=r.bottom):(r.left=l,r.right=l+r.width,r.top=r.fullSize?n.top:e.top,r.bottom=r.fullSize?i.outerHeight-n.right:e.top+e.h,r.height=r.bottom-r.top,l=r.right);e.x=l,e.y=c}xt.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});varGe={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){consti=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;consto=ze(t.options.layout.padding),s=e-o.width,a=i-o.height,r=function(t){conste=function(t){conste=[];leti,n,o;for(i=0,n=(t||[]).length;i<n;++i)o=t[i],e.push({index:i,box:o,pos:o.position,horizontal:o.isHorizontal(),weight:o.weight});returne}(t),i=je(e.filter((t=>t.box.fullSize)),!0),n=je(He(e,"left"),!0),o=je(He(e,"right")),s=je(He(e,"top"),!0),a=je(He(e,"bottom")),r=Ne(e,"x"),l=Ne(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:o.concat(l).concat(a).concat(r),chartArea:He(e,"chartArea"),vertical:n.concat(o).concat(l),horizontal:s.concat(a).concat(r)}}(t.boxes),l=r.vertical,c=r.horizontal;J(t.boxes,(t=>{"function"==typeoft.beforeLayout&&t.beforeLayout()}));consth=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},o);Ye(u,ze(n));constf=Object.assign({maxPadding:u,w:s,h:a,x:o.left,y:o.top},o);!function(t,e){leti,n,o;for(i=0,n=t.length;i<n;++i)o=t[i],o.horizontal?(o.width=o.box.fullSize&&e.availableWidth,o.height=e.hBoxMaxHeight):(o.width=e.vBoxMaxWidth,o.height=o.box.fullSize&&e.availableHeight)}(l.concat(c),d),qe(r.fullSize,f,d),qe(l,f,d),qe(c,f,d)&&qe(l,f,d),function(t){conste=t.maxPadding;functioni(i){constn=Math.max(e[i]-t[i],0);returnt[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),Ke(r.leftAndTop,f,d),f.x+=f.w,f.y+=f.h,Ke(r.rightAndBottom,f,d),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},J(r.chartArea,(e=>{consti=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h)}))}};classZe{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return1}getMaximumSize(t,e,i,n){returne=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}}classQeextendsZe{acquireContext(t){returnt&&t.getContext&&t.getContext("2d")||null}}constJe={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ti=t=>null===t||""===t;constei=!!ve&&{passive:!0};functionii(t,e,i){t.canvas.removeEventListener(e,i,ei)}functionni(t,e,i){constn=t.canvas,o=n&&de(n)||n,s=newMutationObserver((t=>{conste=de(o);t.forEach((t=>{for(letn=0;n<t.addedNodes.length;n++){consts=t.addedNodes[n];s!==o&&s!==e||i(t.target)}}))}));returns.observe(document,{childList:!0,subtree:!0}),s}functionoi(t,e,i){constn=t.canvas,o=n&&de(n);if(!o)return;consts=newMutationObserver((t=>{t.forEach((t=>{for(lete=0;e<t.removedNodes.length;e++)if(t.removedNodes[e]===n){i();break}}))}));returns.observe(o,{childList:!0}),s}constsi=newMap;letai=0;functionri(){constt=window.devicePixelRatio;t!==ai&&(ai=t,si.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}functionli(t,i,n){consto=t.canvas,s=o&&de(o);if(!s)return;consta=e(((t,e)=>{consti=s.clientWidth;n(t,e),i<s.clientWidth&&n()}),window),r=newResizeObserver((t=>{conste=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||a(i,n)}));returnr.observe(s),function(t,e){si.size||window.addEventListener("resize",ri),si.set(t,e)}(t,a),r}functionci(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){si.delete(t),si.size||window.removeEventListener("resize",ri)}(t)}functionhi(t,i,n){consto=t.canvas,s=e((e=>{null!==t.ctx&&n(function(t,e){consti=Je[t.type]||t.type,{x:n,y:o}=xe(t,e);return{type:i,chart:e,native:t,x:void0!==n?n:null,y:void0!==o?o:null}}(e,t))}),t,(t=>{conste=t[0];return[e,e.offsetX,e.offsetY]}));returnfunction(t,e,i){t.addEventListener(e,i,ei)}(o,i,s),s}classdiextendsZe{acquireContext(t,e){consti=t&&t.getContext&&t.getContext("2d");returni&&i.canvas===t?(function(t,e){consti=t.style,n=t.getAttribute("height"),o=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",ti(o)){conste=we(t,"width");void0!==e&&(t.width=e)}if(ti(n))if(""===t.style.height)t.height=t.width/(e||2);else{conste=we(t,"height");void0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){conste=t.canvas;if(!e.$chartjs)return!1;consti=e.$chartjs.initial;["height","width"].forEach((t=>{constn=i[t];$(n)?e.removeAttribute(t):e.setAttribute(t,n)}));constn=i.style||{};returnObject.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,deletee.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);constn=t.$proxies||(t.$proxies={}),o={attach:ni,detach:oi,resize:li}[e]||hi;n[e]=o(t,e,i)}removeEventListener(t,e){consti=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:ci,detach:ci,resize:ci}[e]||ii)(t,e,n),i[e]=void0}getDevicePixelRatio(){returnwindow.devicePixelRatio}getMaximumSize(t,e,i,n){return_e(t,e,i,n)}isAttached(t){conste=de(t);return!(!e||!de(e))}}varui=Object.freeze({__proto__:null,BasePlatform:Ze,BasicPlatform:Qe,DomPlatform:di});constfi=t=>0===t||1===t,gi=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*_t/i),pi=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*_t/i)+1,mi={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Mt),easeOutSine:t=>Math.sin(t*Mt),easeInOutSine:t=>-.5*(Math.cos(bt*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>fi(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>fi(t)?t:gi(t,.075,.3),easeOutElastic:t=>fi(t)?t:pi(t,.075,.3),easeInOutElastic(t){conste=.1125;returnfi(t)?t:t<.5?.5*gi(2*t,e,.45):.5+.5*pi(2*t-1,e,.45)},easeInBack(t){conste=1.70158;returnt*t*((e+1)*t-e)},easeOutBack(t){conste=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){lete=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-mi.easeOutBounce(1-t),easeOutBounce(t){conste=7.5625,i=2.75;returnt<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*mi.easeInBounce(2*t):.5*mi.easeOutBounce(2*t-1)+.5},xi="transparent",bi={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){constn=W(t||xi),o=n.valid&&W(e||xi);returno&&o.valid?o.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class_i{constructor(t,e,i,n){consto=e[i];n=Ve([t.to,n,o,t.from]);consts=Ve([t.from,o,n]);this._active=!0,this._fn=t.fn||bi[t.type||typeofs],this._easing=mi[t.easing]||mi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=n,this._promises=void0}active(){returnthis._active}update(t,e,i){constn=this;if(n._active){n._notify(!1);consto=n._target[n._prop],s=i-n._start,a=n._duration-s;n._start=i,n._duration=Math.floor(Math.max(a,t.duration)),n._total+=s,n._loop=!!t.loop,n._to=Ve([t.to,e,o,t.from]),n._from=Ve([t.from,o,e])}}cancel(){constt=this;t._active&&(t.tick(Date.now()),t._active=!1,t._notify(!1))}tick(t){conste=this,i=t-e._start,n=e._duration,o=e._prop,s=e._from,a=e._loop,r=e._to;letl;if(e._active=s!==r&&(a||i<n),!e._active)returne._target[o]=r,voide._notify(!0);i<0?e._target[o]=s:(l=i/n%2,l=a&&l>1?2-l:l,l=e._easing(Math.min(1,Math.max(0,l))),e._target[o]=e._fn(s,r,l))}wait(){constt=this._promises||(this._promises=[]);returnnewPromise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){conste=t?"res":"rej",i=this._promises||[];for(lett=0;t<i.length;t++)i[t][e]()}}xt.set("animation",{delay:void0,duration:1e3,easing:"easeOutQuart",fn:void0,from:void0,loop:void0,to:void0,type:void0});constyi=Object.keys(xt.animation);xt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),xt.describe("animations",{_fallback:"animation"}),xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});classvi{constructor(t,e){this._chart=t,this._properties=newMap,this.configure(e)}configure(t){if(!U(t))return;conste=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{constn=t[i];if(!U(n))return;consto={};for(consttofyi)o[t]=n[t];(Y(n.properties)&&n.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,o)}))}))}_animateOptions(t,e){consti=e.options,n=function(t,e){if(!e)return;leti=t.options;if(!i)returnvoid(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));returni}(t,i);if(!n)return[];consto=this._createAnimations(n,i);returni.$shared&&function(t,e){consti=[],n=Object.keys(e);for(lete=0;e<n.length;e++){consto=t[n[e]];o&&o.active()&&i.push(o.wait())}returnPromise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),o}_createAnimations(t,e){consti=this._properties,n=[],o=t.$animations||(t.$animations={}),s=Object.keys(e),a=Date.now();letr;for(r=s.length-1;r>=0;--r){constl=s[r];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}constc=e[l];leth=o[l];constd=i.get(l);if(h){if(d&&h.active()){h.update(d,c,a);continue}h.cancel()}d&&d.duration?(o[l]=h=new_i(d,t,l,c),n.push(h)):t[l]=c}returnn}update(t,e){if(0===this._properties.size)returnvoidObject.assign(t,e);consti=this._createAnimations(t,e);returni.length?(a.add(this._chart,i),!0):void0}}functionwi(t,e){consti=t&&t.options||{},n=i.reverse,o=void0===i.min?e:0,s=void0===i.max?e:0;return{start:n?s:o,end:n?o:s}}functionMi(t,e){consti=[],n=t._getSortedDatasetMetas(e);leto,s;for(o=0,s=n.length;o<s;++o)i.push(n[o].index);returni}functionki(t,e,i,n){consto=t.keys,s="single"===n.mode;leta,r,l,c;if(null!==e){for(a=0,r=o.length;a<r;++a){if(l=+o[a],l===i){if(n.all)continue;break}c=t.values[l],X(c)&&(s||0===e||Dt(e)===Dt(c))&&(e+=c)}returne}}functionSi(t,e){consti=t&&t.options.stacked;returni||void0===i&&void0!==e.stack}functionPi(t,e,i){constn=t[e]||(t[e]={});returnn[i]||(n[i]={})}functionDi(t,e,i){for(constnofe.getMatchingVisibleMetas("bar").reverse()){conste=t[n.index];if(i&&e>0||!i&&e<0)returnn.index}returnnull}functionCi(t,e){const{chart:i,_cachedMeta:n}=t,o=i._stacks||(i._stacks={}),{iScale:s,vScale:a,index:r}=n,l=s.axis,c=a.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,a,n),d=e.length;letu;for(lett=0;t<d;++t){consti=e[t],{[l]:n,[c]:s}=i;u=(i._stacks||(i._stacks={}))[c]=Pi(o,h,n),u[r]=s,u._top=Di(u,a,!0),u._bottom=Di(u,a,!1)}}functionOi(t,e){consti=t.scales;returnObject.keys(i).filter((t=>i[t].axis===e)).shift()}functionAi(t,e){e=e||t._parsed;for(constiofe){conste=i._stacks;if(!e||void0===e[t.vScale.id]||void0===e[t.vScale.id][t.index])return;deletee[t.vScale.id][t.index]}}constTi=t=>"reset"===t||"none"===t,Ri=(t,e)=>e?t:Object.assign({},t);classLi{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void0,this._parsing=!1,this._data=void0,this._objectData=void0,this._sharedOptions=void0,this._drawStart=void0,this._drawCount=void0,this.enableOptionSharing=!1,this.$context=void0,this.initialize()}initialize(){constt=this,e=t._cachedMeta;t.configure(),t.linkScales(),e._stacked=Si(e.vScale,e),t.addElements()}updateIndex(t){this.index=t}linkScales(){constt=this,e=t.chart,i=t._cachedMeta,n=t.getDataset(),o=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=i.xAxisID=K(n.xAxisID,Oi(e,"x")),a=i.yAxisID=K(n.yAxisID,Oi(e,"y")),r=i.rAxisID=K(n.rAxisID,Oi(e,"r")),l=i.indexAxis,c=i.iAxisID=o(l,s,a,r),h=i.vAxisID=o(l,a,s,r);i.xScale=t.getScaleForId(s),i.yScale=t.getScaleForId(a),i.rScale=t.getScaleForId(r),i.iScale=t.getScaleForId(c),i.vScale=t.getScaleForId(h)}getDataset(){returnthis.chart.data.datasets[this.index]}getMeta(){returnthis.chart.getDatasetMeta(this.index)}getScaleForId(t){returnthis.chart.scales[t]}_getOtherScale(t){conste=this._cachedMeta;returnt===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){constt=this._cachedMeta;this._data&&ce(this._data,this),t._stacked&&Ai(t)}_dataCheck(){constt=this,e=t.getDataset(),i=e.data||(e.data=[]);U(i)?t._data=function(t){conste=Object.keys(t),i=newArray(e.length);letn,o,s;for(n=0,o=e.length;n<o;++n)s=e[n],i[n]={x:s,y:t[s]};returni}(i):t._data!==i&&(t._data&&(ce(t._data,t),Ai(t._cachedMeta)),i&&Object.isExtensible(i)&&le(i,t),t._data=i)}addElements(){constt=this,e=t._cachedMeta;t._dataCheck(),t.datasetElementType&&(e.dataset=newt.datasetElementType)}buildOrUpdateElements(t){conste=this,i=e._cachedMeta,n=e.getDataset();leto=!1;e._dataCheck(),i._stacked=Si(i.vScale,i),i.stack!==n.stack&&(o=!0,Ai(i),i.stack=n.stack),e._resyncElements(t),o&&Ci(e,i._parsed)}configure(){constt=this,e=t.chart.config,i=e.datasetScopeKeys(t._type),n=e.getOptionScopes(t.getDataset(),i,!0);t.options=e.createResolver(n,t.getContext()),t._parsing=t.options.parsing}parse(t,e){consti=this,{_cachedMeta:n,_data:o}=i,{iScale:s,_stacked:a}=n,r=s.axis;letl,c,h,d=0===t&&e===o.length||n._sorted,u=t>0&&n._parsed[t-1];if(!1===i._parsing)n._parsed=o,n._sorted=!0,h=o;else{h=Y(o[t])?i.parseArrayData(n,o,t,e):U(o[t])?i.parseObjectData(n,o,t,e):i.parsePrimitiveData(n,o,t,e);consts=()=>null===c[r]||u&&c[r]<u[r];for(l=0;l<e;++l)n._parsed[l+t]=c=h[l],d&&(s()&&(d=!1),u=c);n._sorted=d}a&&Ci(i,h)}parsePrimitiveData(t,e,i,n){const{iScale:o,vScale:s}=t,a=o.axis,r=s.axis,l=o.getLabels(),c=o===s,h=newArray(n);letd,u,f;for(d=0,u=n;d<u;++d)f=d+i,h[d]={[a]:c||o.parse(l[f],f),[r]:s.parse(e[f],f)};returnh}parseArrayData(t,e,i,n){const{xScale:o,yScale:s}=t,a=newArray(n);letr,l,c,h;for(r=0,l=n;r<l;++r)c=r+i,h=e[c],a[r]={x:o.parse(h[0],c),y:s.parse(h[1],c)};returna}parseObjectData(t,e,i,n){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=newArray(n);letc,h,d,u;for(c=0,h=n;c<h;++c)d=c+i,u=e[d],l[c]={x:o.parse(lt(u,a),d),y:s.parse(lt(u,r),d)};returnl}getParsed(t){returnthis._cachedMeta._parsed[t]}getDataElement(t){returnthis._cachedMeta.data[t]}applyStack(t,e,i){constn=this.chart,o=this._cachedMeta,s=e[t.axis];returnki({keys:Mi(n,!0),values:e._stacks[t.axis]},s,o.index,{mode:i})}updateRangeFromParsed(t,e,i,n){consto=i[e.axis];lets=null===o?NaN:o;consta=n&&i._stacks[e.axis];n&&a&&(n.values=a,t.min=Math.min(t.min,s),t.max=Math.max(t.max,s),s=ki(n,o,this._cachedMeta.index,{all:!0})),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){consti=this,n=i._cachedMeta,o=n._parsed,s=n._sorted&&t===n.iScale,a=o.length,r=i._getOtherScale(t),l=e&&n._stacked&&{keys:Mi(i.chart,!0),values:null},c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=function(t){const{min:e,max:i,minDefined:n,maxDefined:o}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:o?i:Number.POSITIVE_INFINITY}}(r);letu,f,g,p;functionm(){returng=o[u],f=g[t.axis],p=g[r.axis],!X(f)||h>p||d<p}for(u=0;u<a&&(m()||(i.updateRangeFromParsed(c,t,g,l),!s));++u);if(s)for(u=a-1;u>=0;--u)if(!m()){i.updateRangeFromParsed(c,t,g,l);break}returnc}getAllParsedValues(t){conste=this._cachedMeta._parsed,i=[];letn,o,s;for(n=0,o=e.length;n<o;++n)s=e[n][t.axis],X(s)&&i.push(s);returni}getMaxOverflow(){return!1}getLabelAndValue(t){conste=this._cachedMeta,i=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){conste=this,i=e._cachedMeta;e.configure(),e._cachedDataOpts={},e.update(t||"default"),i._clip=function(t){lete,i,n,o;returnU(t)?(e=t.top,i=t.right,n=t.bottom,o=t.left):e=i=n=o=t,{top:e,right:i,bottom:n,left:o}}(K(e.options.clip,function(t,e,i){if(!1===i)return!1;constn=wi(t,i),o=wi(e,i);return{top:o.end,right:n.end,bottom:o.start,left:n.start}}(i.xScale,i.yScale,e.getMaxOverflow())))}update(t){}draw(){constt=this,e=t._ctx,i=t.chart,n=t._cachedMeta,o=n.data||[],s=i.chartArea,a=[],r=t._drawStart||0,l=t._drawCount||o.length-r;letc;for(n.dataset&&n.dataset.draw(e,s,r,l),c=r;c<r+l;++c){constt=o[c];t.active?a.push(t):t.draw(e,s)}for(c=0;c<a.length;++c)a[c].draw(e,s)}getStyle(t,e){consti=e?"active":"default";returnvoid0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){constn=this,o=n.getDataset();lets;if(t>=0&&t<n._cachedMeta.data.length){conste=n._cachedMeta.data[t];s=e.$context||(e.$context=function(t,e,i){returnObject.assign(Object.create(t),{active:!1,dataIndex:e,parsed:void0,raw:void0,element:i,index:e,mode:"default",type:"data"})}(n.getContext(),t,e)),s.parsed=n.getParsed(t),s.raw=o.data[t]}elses=n.$context||(n.$context=function(t,e){returnObject.assign(Object.create(t),{active:!1,dataset:void0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(n.chart.getContext(),n.index)),s.dataset=o;returns.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){returnthis._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){returnthis._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){constn=this,o="active"===e,s=n._cachedDataOpts,a=t+"-"+e,r=s[a],l=n.enableOptionSharing&&ht(i);if(r)returnRi(r,l);constc=n.chart.config,h=c.datasetElementScopeKeys(n._type,t),d=o?[t+"Hover","hover",t,""]:[t,""],u=c.getOptionScopes(n.getDataset(),h),f=Object.keys(xt.elements[t]),g=c.resolveNamedOptions(u,f,(()=>n.getContext(i,o)),d);returng.$shared&&(g.$shared=l,s[a]=Object.freeze(Ri(g,l))),g}_resolveAnimations(t,e,i){constn=this,o=n.chart,s=n._cachedDataOpts,a="animation-"+e,r=s[a];if(r)returnr;letl;if(!1!==o.options.animation){consto=n.chart.config,s=o.datasetAnimationScopeKeys(n._type,e),a=o.getOptionScopes(n.getDataset(),s);l=o.createResolver(a,n.getContext(t,i,e))}constc=newvi(o,l&&l.animations);returnl&&l._cacheable&&(s[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)returnthis._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ti(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){Ti(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Ti(e)&&this._resolveAnimations(void0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;consto=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){constt=this._cachedMeta.dataset;t&&this._setStyle(t,void0,"active",!1)}_setDatasetHoverStyle(){constt=this._cachedMeta.dataset;t&&this._setStyle(t,void0,"active",!0)}_resyncElements(t){conste=this,i=e._cachedMeta.data.length,n=e._data.length;n>i?e._insertElements(i,n-i,t):n<i&&e._removeElements(n,i-n);consto=Math.min(n,i);o&&e.parse(0,o)}_insertElements(t,e,i=!0){constn=this,o=n._cachedMeta,s=o.data,a=t+e;letr;constl=t=>{for(t.length+=e,r=t.length-1;r>=a;r--)t[r]=t[r-e]};for(l(s),r=t;r<a;++r)s[r]=newn.dataElementType;n._parsing&&l(o._parsed),n.parse(t,e),i&&n.updateElements(s,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){consti=this._cachedMeta;if(this._parsing){constn=i._parsed.splice(t,e);i._stacked&&Ai(i,n)}i.data.splice(t,e)}_onDataPush(){constt=arguments.length;this._insertElements(this.getDataset().data.length-t,t)}_onDataPop(){this._removeElements(this._cachedMeta.data.length-1,1)}_onDataShift(){this._removeElements(0,1)}_onDataSplice(t,e){this._removeElements(t,e),this._insertElements(t,arguments.length-2)}_onDataUnshift(){this._insertElements(0,arguments.length)}}Li.defaults={},Li.prototype.datasetElementType=null,Li.prototype.dataElementType=null;classEi{constructor(){this.x=void0,this.y=void0,this.active=!1,this.options=void0,this.$animations=void0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){returnAt(this.x)&&At(this.y)}getProps(t,e){consti=this,n=this.$animations;if(!e||!n)returni;consto={};returnt.forEach((t=>{o[t]=n[t]&&n[t].active()?n[t]._to:i[t]})),o}}Ei.defaults={},Ei.defaultRoutes=void0;constIi=newMap;functionzi(t,e,i){returnfunction(t,e){e=e||{};consti=t+JSON.stringify(e);letn=Ii.get(i);returnn||(n=newIntl.NumberFormat(t,e),Ii.set(i,n)),n}(e,i).format(t)}constFi={values:t=>Y(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";constn=this.chart.options.locale;leto,s=t;if(i.length>1){conste=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),s=function(t,e){leti=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));returni}(t,i)}consta=Pt(Math.abs(s)),r=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:o,minimumFractionDigits:r,maximumFractionDigits:r};returnObject.assign(l,this.options.ticks.format),zi(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";constn=t/Math.pow(10,Math.floor(Pt(t)));return1===n||2===n||5===n?Fi.numeric.call(this,t,e,i):""}};varVi={formatters:Fi};functionBi(t,e){consti=t.options.ticks,n=i.maxTicksLimit||function(t){conste=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),o=t._maxLength/i;returnMath.floor(Math.min(n,o))}(t),o=i.major.enabled?function(t){conste=[];leti,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);returne}(e):[],s=o.length,a=o[0],r=o[s-1],l=[];if(s>n)returnfunction(t,e,i,n){leto,s=0,a=i[0];for(n=Math.ceil(n),o=0;o<t.length;o++)o===a&&(e.push(t[o]),s++,a=i[s*n])}(e,l,o,s/n),l;constc=function(t,e,i){constn=function(t){conste=t.length;leti,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;returnn}(t),o=e.length/i;if(!n)returnMath.max(o,1);consts=Ot(n);for(lett=0,e=s.length-1;t<e;t++){conste=s[t];if(e>o)returne}returnMath.max(o,1)}(o,e,n);if(s>0){lett,i;constn=s>1?Math.round((r-a)/(s-1)):null;for(Wi(e,l,c,$(n)?0:a-n,a),t=0,i=s-1;t<i;t++)Wi(e,l,c,o[t],o[t+1]);returnWi(e,l,c,r,$(n)?e.length:r+n),l}returnWi(e,l,c),l}functionWi(t,e,i,n,o){consts=K(n,0),a=Math.min(K(o,t.length),t.length);letr,l,c,h=0;for(i=Math.ceil(i),o&&(r=o-n,i=r/Math.floor(r/i)),c=s;c<0;)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);l<a;l++)l===c&&(e.push(t[l]),h++,c=Math.round(s+h*i))}xt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Vi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),xt.route("scale.ticks","color","","color"),xt.route("scale.grid","color","","borderColor"),xt.route("scale.grid","borderColor","","borderColor"),xt.route("scale.title","color","","color"),xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),xt.describe("scales",{_fallback:"scale"});constHi=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;functionNi(t,e){consti=[],n=t.length/e,o=t.length;lets=0;for(;s<o;s+=n)i.push(t[Math.floor(s)]);returni}functionji(t,e,i){constn=t.ticks.length,o=Math.min(e,n-1),s=t._startPixel,a=t._endPixel,r=1e-6;letl,c=t.getPixelForTick(o);if(!(i&&(l=1===n?Math.max(c-s,a-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(o-1))/2,c+=o<e?l:-l,c<s-r||c>a+r)))returnc}function$i(t){returnt.drawTicks?t.tickLength:0}functionYi(t,e){if(!t.display)return0;consti=Fe(t.font,e),n=ze(t.padding);return(Y(t.text)?t.text.length:1)*i.lineHeight+n.height}functionUi(t,e,i){leto=n(t);return(i&&"right"!==e||!i&&"right"===e)&&(o=(t=>"left"===t?"right":"right"===t?"left":t)(o)),o}classXiextendsEi{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void0,this.ctx=t.ctx,this.chart=t.chart,this.top=void0,this.bottom=void0,this.left=void0,this.right=void0,this.width=void0,this.height=void0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void0,this.maxHeight=void0,this.paddingTop=void0,this.paddingBottom=void0,this.paddingLeft=void0,this.paddingRight=void0,this.axis=void0,this.labelRotation=void0,this.min=void0,this.max=void0,this._range=void0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void0,this._endPixel=void0,this._reversePixels=!1,this._userMax=void0,this._userMin=void0,this._suggestedMax=void0,this._suggestedMin=void0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void0}init(t){conste=this;e.options=t.setContext(e.getContext()),e.axis=t.axis,e._userMin=e.parse(t.min),e._userMax=e.parse(t.max),e._suggestedMin=e.parse(t.suggestedMin),e._suggestedMax=e.parse(t.suggestedMax)}parse(t,e){returnt}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;returnt=q(t,Number.POSITIVE_INFINITY),e=q(e,Number.NEGATIVE_INFINITY),i=q(i,Number.POSITIVE_INFINITY),n=q(n,Number.NEGATIVE_INFINITY),{min:q(t,i),max:q(e,n),minDefined:X(t),maxDefined:X(e)}}getMinMax(t){conste=this;leti,{min:n,max:o,minDefined:s,maxDefined:a}=e.getUserBounds();if(s&&a)return{min:n,max:o};constr=e.getMatchingVisibleMetas();for(letl=0,c=r.length;l<c;++l)i=r[l].controller.getMinMax(e,t),s||(n=Math.min(n,i.min)),a||(o=Math.max(o,i.max));return{min:q(n,q(o,n)),max:q(o,q(n,o))}}getPadding(){constt=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}}getTicks(){returnthis.ticks}getLabels(){constt=this.chart.data;returnthis.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Q(this.options.beforeUpdate,[this])}update(t,e,i){constn=this,o=n.options.ticks,s=o.sampleSize;n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),n.ticks=null,n._labelSizes=null,n._gridLineItems=null,n._labelItems=null,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n._maxLength=n.isHorizontal()?n.width+i.left+i.right:n.height+i.top+i.bottom,n._dataLimitsCached||(n.beforeDataLimits(),n.determineDataLimits(),n.afterDataLimits(),n._range=Be(n,n.options.grace),n._dataLimitsCached=!0),n.beforeBuildTicks(),n.ticks=n.buildTicks()||[],n.afterBuildTicks();consta=s<n.ticks.length;n._convertTicksToLabels(a?Ni(n.ticks,s):n.ticks),n.configure(),n.beforeCalculateLabelRotation(),n.calculateLabelRotation(),n.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(n.ticks=Bi(n,n.ticks),n._labelSizes=null),a&&n._convertTicksToLabels(n.ticks),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate()}configure(){constt=this;lete,i,n=t.options.reverse;t.isHorizontal()?(e=t.left,i=t.right):(e=t.top,i=t.bottom,n=!n),t._startPixel=e,t._endPixel=i,t._reversePixels=n,t._length=i-e,t._alignToPixels=t.options.alignToPixels}afterUpdate(){Q(this.options.afterUpdate,[this])}beforeSetDimensions(){Q(this.options.beforeSetDimensions,[this])}setDimensions(){constt=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0}afterSetDimensions(){Q(this.options.afterSetDimensions,[this])}_callHooks(t){conste=this;e.chart.notifyPlugins(t,e.getContext()),Q(e.options[t],[e])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Q(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){conste=this,i=e.options.ticks;letn,o,s;for(n=0,o=t.length;n<o;n++)s=t[n],s.label=Q(i.callback,[s.value,n,t],e);for(n=0;n<o;n++)$(t[n].label)&&(t.splice(n,1),o--,n--)}afterTickToLabelConversion(){Q(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Q(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){constt=this,e=t.options,i=e.ticks,n=t.ticks.length,o=i.minRotation||0,s=i.maxRotation;leta,r,l,c=o;if(!t._isVisible()||!i.display||o>=s||n<=1||!t.isHorizontal())returnvoid(t.labelRotation=o);consth=t._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Nt(t.chart.width-d,0,t.maxWidth);a=e.offset?t.maxWidth/n:f/(n-1),d+6>a&&(a=f/(n-(e.offset?.5:1)),r=t.maxHeight-$i(e.grid)-i.padding-Yi(e.title,t.chart.options.font),l=Math.sqrt(d*d+u*u),c=It(Math.min(Math.asin(Math.min((h.highest.height+6)/a,1)),Math.asin(Math.min(r/l,1))-Math.asin(u/l))),c=Math.max(o,Math.min(s,c))),t.labelRotation=c}afterCalculateLabelRotation(){Q(this.options.afterCalculateLabelRotation,[this])}beforeFit(){Q(this.options.beforeFit,[this])}fit(){constt=this,e={width:0,height:0},{chart:i,options:{ticks:n,title:o,grid:s}}=t,a=t._isVisible(),r=t.isHorizontal();if(a){consta=Yi(o,i.options.font);if(r?(e.width=t.maxWidth,e.height=$i(s)+a):(e.height=t.maxHeight,e.width=$i(s)+a),n.display&&t.ticks.length){const{first:i,last:o,widest:s,highest:a}=t._getLabelSizes(),l=2*n.padding,c=Et(t.labelRotation),h=Math.cos(c),d=Math.sin(c);if(r){consti=n.mirror?0:d*s.width+h*a.height;e.height=Math.min(t.maxHeight,e.height+i+l)}else{consti=n.mirror?0:h*s.width+d*a.height;e.width=Math.min(t.maxWidth,e.width+i+l)}t._calculatePadding(i,o,d,h)}}t._handleMargins(),r?(t.width=t._length=i.width-t._margins.left-t._margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=i.height-t._margins.top-t._margins.bottom)}_calculatePadding(t,e,i,n){consto=this,{ticks:{align:s,padding:a},position:r}=o.options,l=0!==o.labelRotation,c="top"!==r&&"x"===o.axis;if(o.isHorizontal()){constr=o.getPixelForTick(0)-o.left,h=o.right-o.getPixelForTick(o.ticks.length-1);letd=0,u=0;l?c?(d=n*t.width,u=i*e.height):(d=i*t.height,u=n*e.width):"start"===s?u=e.width:"end"===s?d=t.width:(d=t.width/2,u=e.width/2),o.paddingLeft=Math.max((d-r+a)*o.width/(o.width-r),0),o.paddingRight=Math.max((u-h+a)*o.width/(o.width-h),0)}else{leti=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),o.paddingTop=i+a,o.paddingBottom=n+a}}_handleMargins(){constt=this;t._margins&&(t._margins.left=Math.max(t.paddingLeft,t._margins.left),t._margins.top=Math.max(t.paddingTop,t._margins.top),t._margins.right=Math.max(t.paddingRight,t._margins.right),t._margins.bottom=Math.max(t.paddingBottom,t._margins.bottom))}afterFit(){Q(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){returnthis.options.fullSize}_convertTicksToLabels(t){conste=this;e.beforeTickToLabelConversion(),e.generateTickLabels(t),e.afterTickToLabelConversion()}_getLabelSizes(){constt=this;lete=t._labelSizes;if(!e){consti=t.options.ticks.sampleSize;letn=t.ticks;i<n.length&&(n=Ni(n,i)),t._labelSizes=e=t._computeLabelSizes(n,n.length)}returne}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:n}=this,o=[],s=[];leta,r,l,c,h,d,u,f,g,p,m,x=0,b=0;for(a=0;a<e;++a){if(c=t[a].label,h=this._resolveTickFontOptions(a),i.font=d=h.string,u=n[d]=n[d]||{data:{},gc:[]},f=h.lineHeight,g=p=0,$(c)||Y(c)){if(Y(c))for(r=0,l=c.length;r<l;++r)m=c[r],$(m)||Y(m)||(g=Yt(i,u.data,u.gc,g,m),p+=f)}elseg=Yt(i,u.data,u.gc,g,c),p=f;o.push(g),s.push(p),x=Math.max(g,x),b=Math.max(p,b)}!function(t,e){J(t,(t=>{consti=t.gc,n=i.length/2;leto;if(n>e){for(o=0;o<n;++o)deletet.data[i[o]];i.splice(0,n)}}))}(n,e);const_=o.indexOf(x),y=s.indexOf(b),v=t=>({width:o[t]||0,height:s[t]||0});return{first:v(0),last:v(e-1),widest:v(_),highest:v(y),widths:o,heights:s}}getLabelForValue(t){returnt}getPixelForValue(t,e){returnNaN}getValueForPixel(t){}getPixelForTick(t){conste=this.ticks;returnt<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){conste=this;e._reversePixels&&(t=1-t);consti=e._startPixel+t*e._length;returnjt(e._alignToPixels?Xt(e.chart,i,0):i)}getDecimalForPixel(t){conste=(t-this._startPixel)/this._length;returnthis._reversePixels?1-e:e}getBasePixel(){returnthis.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;returnt<0&&e<0?e:t>0&&e>0?t:0}getContext(t){conste=this,i=e.ticks||[];if(t>=0&&t<i.length){constn=i[t];returnn.$context||(n.$context=function(t,e,i){returnObject.assign(Object.create(t),{tick:i,index:e,type:"tick"})}(e.getContext(),t,n))}returne.$context||(e.$context=(n=e.chart.getContext(),o=e,Object.assign(Object.create(n),{scale:o,type:"scale"})));varn,o}_tickSize(){constt=this,e=t.options.ticks,i=Et(t.labelRotation),n=Math.abs(Math.cos(i)),o=Math.abs(Math.sin(i)),s=t._getLabelSizes(),a=e.autoSkipPadding||0,r=s?s.widest.width+a:0,l=s?s.highest.height+a:0;returnt.isHorizontal()?l*n>r*o?r/n:l/o:l*o<r*n?l/n:r/o}_isVisible(){constt=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){conste=this,i=e.axis,n=e.chart,o=e.options,{grid:s,position:a}=o,r=s.offset,l=e.isHorizontal(),c=e.ticks.length+(r?1:0),h=$i(s),d=[],u=s.setContext(e.getContext()),f=u.drawBorder?u.borderWidth:0,g=f/2,p=function(t){returnXt(n,t,f)};letm,x,b,_,y,v,w,M,k,S,P,D;if("top"===a)m=p(e.bottom),v=e.bottom-h,M=m-g,S=p(t.top)+g,D=t.bottom;elseif("bottom"===a)m=p(e.top),S=t.top,D=p(t.bottom)-g,v=m+g,M=e.top+h;elseif("left"===a)m=p(e.right),y=e.right-h,w=m-g,k=p(t.left)+g,P=t.right;elseif("right"===a)m=p(e.left),k=t.left,P=p(t.right)-g,y=m+g,w=e.left+h;elseif("x"===i){if("center"===a)m=p((t.top+t.bottom)/2+.5);elseif(U(a)){constt=Object.keys(a)[0],i=a[t];m=p(e.chart.scales[t].getPixelForValue(i))}S=t.top,D=t.bottom,v=m+g,M=v+h}elseif("y"===i){if("center"===a)m=p((t.left+t.right)/2);elseif(U(a)){constt=Object.keys(a)[0],i=a[t];m=p(e.chart.scales[t].getPixelForValue(i))}y=m-g,w=y-h,k=t.left,P=t.right}for(x=0;x<c;++x){constt=s.setContext(e.getContext(x)),i=t.lineWidth,o=t.color,a=s.borderDash||[],c=t.borderDashOffset,h=t.tickWidth,u=t.tickColor,f=t.tickBorderDash||[],g=t.tickBorderDashOffset;b=ji(e,x,r),void0!==b&&(_=Xt(n,b,i),l?y=w=k=P=_:v=M=S=D=_,d.push({tx1:y,ty1:v,tx2:w,ty2:M,x1:k,y1:S,x2:P,y2:D,width:i,color:o,borderDash:a,borderDashOffset:c,tickWidth:h,tickColor:u,tickBorderDash:f,tickBorderDashOffset:g}))}returne._ticksLength=c,e._borderValue=m,d}_computeLabelItems(t){conste=this,i=e.axis,n=e.options,{position:o,ticks:s}=n,a=e.isHorizontal(),r=e.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=s,u=$i(n.grid),f=u+h,g=d?-h:f,p=-Et(e.labelRotation),m=[];letx,b,_,y,v,w,M,k,S,P,D,C,O="middle";if("top"===o)w=e.bottom-g,M=e._getXAxisLabelAlignment();elseif("bottom"===o)w=e.top+g,M=e._getXAxisLabelAlignment();elseif("left"===o){constt=e._getYAxisLabelAlignment(u);M=t.textAlign,v=t.x}elseif("right"===o){constt=e._getYAxisLabelAlignment(u);M=t.textAlign,v=t.x}elseif("x"===i){if("center"===o)w=(t.top+t.bottom)/2+f;elseif(U(o)){constt=Object.keys(o)[0],i=o[t];w=e.chart.scales[t].getPixelForValue(i)+f}M=e._getXAxisLabelAlignment()}elseif("y"===i){if("center"===o)v=(t.left+t.right)/2-f;elseif(U(o)){constt=Object.keys(o)[0],i=o[t];v=e.chart.scales[t].getPixelForValue(i)}M=e._getYAxisLabelAlignment(u).textAlign}"y"===i&&("start"===l?O="top":"end"===l&&(O="bottom"));constA=e._getLabelSizes();for(x=0,b=r.length;x<b;++x){_=r[x],y=_.label;constt=s.setContext(e.getContext(x));k=e.getPixelForTick(x)+s.labelOffset,S=e._resolveTickFontOptions(x),P=S.lineHeight,D=Y(y)?y.length:1;consti=D/2,n=t.color,l=t.textStrokeColor,h=t.textStrokeWidth;letu;if(a?(v=k,C="top"===o?"near"===c||0!==p?-D*P+P/2:"center"===c?-A.highest.height/2-i*P+P:-A.highest.height+P/2:"near"===c||0!==p?P/2:"center"===c?A.highest.height/2-i*P:A.highest.height-D*P,d&&(C*=-1)):(w=k,C=(1-D)*P/2),t.showLabelBackdrop){conste=ze(t.backdropPadding),i=A.heights[x],n=A.widths[x];leto=w+C-e.top,s=v-e.left;switch(O){case"middle":o-=i/2;break;case"bottom":o-=i}switch(M){case"center":s-=n/2;break;case"right":s-=n}u={left:s,top:o,width:n+e.width,height:i+e.height,color:t.backdropColor}}m.push({rotation:p,label:y,font:S,color:n,strokeColor:l,strokeWidth:h,textOffset:C,textAlign:M,textBaseline:O,translation:[v,w],backdrop:u})}returnm}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Et(this.labelRotation))return"top"===t?"left":"right";leti="center";return"start"===e.align?i="left":"end"===e.align&&(i="right"),i}_getYAxisLabelAlignment(t){conste=this,{position:i,ticks:{crossAlign:n,mirror:o,padding:s}}=e.options,a=t+s,r=e._getLabelSizes().widest.width;letl,c;return"left"===i?o?(l="left",c=e.right+s):(c=e.right-a,"near"===n?l="right":"center"===n?(l="center",c-=r/2):(l="left",c=e.left)):"right"===i?o?(l="right",c=e.left+s):(c=e.left+a,"near"===n?l="left":"center"===n?(l="center",c+=r/2):(l="right",c=e.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){constt=this;if(t.options.ticks.mirror)return;conste=t.chart,i=t.options.position;return"left"===i||"right"===i?{top:0,left:t.left,bottom:e.height,right:t.right}:"top"===i||"bottom"===i?{top:t.top,left:0,bottom:t.bottom,right:e.width}:void0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:o,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,s),t.restore())}getLineWidthForValue(t){conste=this,i=e.options.grid;if(!e._isVisible()||!i.display)return0;constn=e.ticks.findIndex((e=>e.value===t));if(n>=0){returni.setContext(e.getContext(n)).lineWidth}return0}drawGrid(t){conste=this,i=e.options.grid,n=e.ctx,o=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));lets,a;constr=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(i.display)for(s=0,a=o.length;s<a;++s){constt=o[s];i.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),i.drawTicks&&r({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){constt=this,{chart:e,ctx:i,options:{grid:n}}=t,o=n.setContext(t.getContext()),s=n.drawBorder?o.borderWidth:0;if(!s)return;consta=n.setContext(t.getContext(0)).lineWidth,r=t._borderValue;letl,c,h,d;t.isHorizontal()?(l=Xt(e,t.left,s)-s/2,c=Xt(e,t.right,a)+a/2,h=d=r):(h=Xt(e,t.top,s)-s/2,d=Xt(e,t.bottom,a)+a/2,l=c=r),i.save(),i.lineWidth=o.borderWidth,i.strokeStyle=o.borderColor,i.beginPath(),i.moveTo(l,h),i.lineTo(c,d),i.stroke(),i.restore()}drawLabels(t){conste=this;if(!e.options.ticks.display)return;consti=e.ctx,n=e._computeLabelArea();n&&Zt(i,n);consto=e._labelItems||(e._labelItems=e._computeLabelItems(t));lets,a;for(s=0,a=o.length;s<a;++s){constt=o[s],e=t.font,n=t.label;t.backdrop&&(i.fillStyle=t.backdrop.color,i.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),ee(i,n,0,t.textOffset,e,t)}n&&Qt(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;consts=Fe(i.font),a=ze(i.padding),r=i.align;letl=s.lineHeight/2;"bottom"===e?(l+=a.bottom,Y(i.text)&&(l+=s.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=function(t,e,i,n){const{top:s,left:a,bottom:r,right:l}=t;letc,h,d,u=0;returnt.isHorizontal()?(h=o(n,a,l),d=Hi(t,i,e),c=l-a):(h=Hi(t,i,e),d=o(n,r,s),u="left"===i?-Mt:Mt),{titleX:h,titleY:d,maxWidth:c,rotation:u}}(this,l,e,r);ee(t,i.text,0,0,s,{color:i.color,maxWidth:d,rotation:u,textAlign:Ui(r,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){conste=this;e._isVisible()&&(e.drawBackground(),e.drawGrid(t),e.drawBorder(),e.drawTitle(),e.drawLabels(t))}_layers(){constt=this,e=t.options,i=e.ticks&&e.ticks.z||0,n=e.grid&&e.grid.z||0;returnt._isVisible()&&t.draw===Xi.prototype.draw?[{z:n,draw(e){t.drawBackground(),t.drawGrid(e),t.drawTitle()}},{z:n+1,draw(){t.drawBorder()}},{z:i,draw(e){t.drawLabels(e)}}]:[{z:i,draw(e){t.draw(e)}}]}getMatchingVisibleMetas(t){conste=this,i=e.chart.getSortedVisibleDatasetMetas(),n=e.axis+"AxisID",o=[];lets,a;for(s=0,a=i.length;s<a;++s){consta=i[s];a[n]!==e.id||t&&a.type!==t||o.push(a)}returno}_resolveTickFontOptions(t){returnFe(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){constt=this,e=t._resolveTickFontOptions(0).lineHeight;returnt.isHorizontal()?t.width/e/.7:t.height/e}}functionqi(t,e=[""],i=t,n,o=(()=>t[0])){ht(n)||(n=an("_fallback",t));consts={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:o,override:o=>qi([o,...t],e,i,n)};returnnewProxy(s,{deleteProperty:(e,i)=>(deletee[i],deletee._keys,deletet[0][i],!0),get:(i,n)=>Ji(i,n,(()=>function(t,e,i,n){leto;for(constsofe)if(o=an(Zi(s,t),i),ht(o))returnQi(t,o)?on(i,n,t,o):o}(n,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>rn(t).includes(e),ownKeys:t=>rn(t),set:(t,e,i)=>((t._storage||(t._storage=o()))[e]=i,deletet[e],deletet._keys,!0)})}functionKi(t,e,i,n){consto={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:newSet,_descriptors:Gi(t,n),setContext:e=>Ki(t,e,i,n),override:o=>Ki(t.override(o),e,i,n)};returnnewProxy(o,{deleteProperty:(e,i)=>(deletee[i],deletet[i],!0),get:(t,e,i)=>Ji(t,e,(()=>function(t,e,i){const{_proxy:n,_context:o,_subProxy:s,_descriptors:a}=t;letr=n[e];dt(r)&&a.isScriptable(e)&&(r=function(t,e,i,n){const{_proxy:o,_context:s,_subProxy:a,_stack:r}=i;if(r.has(t))thrownewError("Recursion detected: "+[...r].join("->")+"->"+t);r.add(t),e=e(s,a||n),r.delete(t),U(e)&&(e=on(o._scopes,o,t,e));returne}(e,r,t,i));Y(r)&&r.length&&(r=function(t,e,i,n){const{_proxy:o,_context:s,_subProxy:a,_descriptors:r}=i;if(ht(s.index)&&n(t))e=e[s.index%e.length];elseif(U(e[0])){consti=e,n=o._scopes.filter((t=>t!==i));e=[];for(constlofi){consti=on(n,o,t,l);e.push(Ki(i,s,a&&a[t],r))}}returne}(e,r,t,a.isIndexable));Qi(e,r)&&(r=Ki(r,o,s&&s[e],a));returnr}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,deletee[i],!0)})}functionGi(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:i,indexable:n,isScriptable:dt(i)?i:()=>i,isIndexable:dt(n)?n:()=>n}}constZi=(t,e)=>t?t+ct(e):e,Qi=(t,e)=>U(e)&&"adapters"!==t;functionJi(t,e,i){letn=t[e];returnht(n)||(n=i(),ht(n)&&(t[e]=n)),n}functiontn(t,e,i){returndt(t)?t(e,i):t}consten=(t,e)=>!0===t?e:"string"==typeoft?lt(e,t):void0;functionnn(t,e,i,n){for(constoofe){conste=en(i,o);if(e){t.add(e);consto=tn(e._fallback,i,e);if(ht(o)&&o!==i&&o!==n)returno}elseif(!1===e&&ht(n)&&i!==n)returnnull}return!1}functionon(t,e,i,n){consto=e._rootScopes,s=tn(e._fallback,i,n),a=[...t,...o],r=newSet;r.add(n);letl=sn(r,a,i,s||i);returnnull!==l&&((!ht(s)||s===i||(l=sn(r,a,s,l),null!==l))&&qi([...r],[""],o,s,(()=>{constt=e._getTarget();returniint||(t[i]={}),t[i]})))}functionsn(t,e,i,n){for(;i;)i=nn(t,e,i,n);returni}functionan(t,e){for(constiofe){if(!i)continue;conste=i[t];if(ht(e))returne}}functionrn(t){lete=t._keys;returne||(e=t._keys=function(t){conste=newSet;for(constioft)for(consttofObject.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return[...e]}(t._scopes)),e}constln=Number.EPSILON||1e-14,cn=(t,e)=>e<t.length&&!t[e].skip&&t[e];functionhn(t,e,i,n){consto=t.skip?e:t,s=e,a=i.skip?e:i,r=Vt(s,o),l=Vt(a,s);letc=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;constd=n*c,u=n*h;return{previous:{x:s.x-d*(a.x-o.x),y:s.y-d*(a.y-o.y)},next:{x:s.x+u*(a.x-o.x),y:s.y+u*(a.y-o.y)}}}functiondn(t){conste=t.length,i=Array(e).fill(0),n=Array(e);leto,s,a,r=cn(t,0);for(o=0;o<e;++o)if(s=a,a=r,r=cn(t,o+1),a){if(r){constt=r.x-a.x;i[o]=0!==t?(r.y-a.y)/t:0}n[o]=s?r?Dt(i[o-1])!==Dt(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}!function(t,e,i){constn=t.length;leto,s,a,r,l,c=cn(t,0);for(leth=0;h<n-1;++h)l=c,c=cn(t,h+1),l&&c&&(Tt(e[h],0,ln)?i[h]=i[h+1]=0:(o=i[h]/e[h],s=i[h+1]/e[h],r=Math.pow(o,2)+Math.pow(s,2),r<=9||(a=3/Math.sqrt(r),i[h]=o*a*e[h],i[h+1]=s*a*e[h])))}(t,i,n),function(t,e){consti=t.length;letn,o,s,a=cn(t,0);for(letr=0;r<i;++r){if(o=s,s=a,a=cn(t,r+1),!s)continue;const{x:i,y:l}=s;o&&(n=(i-o.x)/3,s.cp1x=i-n,s.cp1y=l-n*e[r]),a&&(n=(a.x-i)/3,s.cp2x=i+n,s.cp2y=l+n*e[r])}}(t,n)}functionun(t,e,i){returnMath.max(Math.min(t,i),e)}functionfn(t,e,i,n){leto,s,a,r;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)dn(t);else{leti=n?t[t.length-1]:t[0];for(o=0,s=t.length;o<s;++o)a=t[o],r=hn(i,a,t[Math.min(o+1,s-(n?0:1))%s],e.tension),a.cp1x=r.previous.x,a.cp1y=r.previous.y,a.cp2x=r.next.x,a.cp2y=r.next.y,i=a}e.capBezierPoints&&function(t,e){leti,n,o,s,a,r=Gt(t[0],e);for(i=0,n=t.length;i<n;++i)a=s,s=r,r=i<n-1&&Gt(t[i+1],e),s&&(o=t[i],a&&(o.cp1x=un(o.cp1x,e.left,e.right),o.cp1y=un(o.cp1y,e.top,e.bottom)),r&&(o.cp2x=un(o.cp2x,e.left,e.right),o.cp2y=un(o.cp2y,e.top,e.bottom)))}(t,i)}functiongn(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}functionpn(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}functionmn(t,e,i,n){consto={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},a=gn(t,o,i),r=gn(o,s,i),l=gn(s,e,i),c=gn(a,r,i),h=gn(r,l,i);returngn(c,h,i)}functionxn(t,e,i){returnt?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}functionbn(t,e){leti,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function_n(t,e){void0!==e&&(deletet.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}functionyn(t){return"angle"===t?{between:Ht,compare:Bt,normalize:Wt}:{between:(t,e,i)=>t>=Math.min(e,i)&&t<=Math.max(i,e),compare:(t,e)=>t-e,normalize:t=>t}}functionvn({start:t,end:e,count:i,loop:n,style:o}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:o}}functionwn(t,e,i){if(!i)return[t];const{property:n,start:o,end:s}=i,a=e.length,{compare:r,between:l,normalize:c}=yn(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:o,end:s}=i,{between:a,normalize:r}=yn(n),l=e.length;letc,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;c<h&&a(r(e[d%l][n]),o,s);++c)d--,u--;d%=l,u%=l}returnu<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),g=[];letp,m,x,b=!1,_=null;consty=()=>b||l(o,x,p)&&0!==r(o,x),v=()=>!b||0===r(s,p)||l(s,x,p);for(lett=h,i=h;t<=d;++t)m=e[t%a],m.skip||(p=c(m[n]),b=l(p,o,s),null===_&&y()&&(_=0===r(p,o)?t:i),null!==_&&v()&&(g.push(vn({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,x=p);returnnull!==_&&g.push(vn({start:_,end:d,loop:u,count:a,style:f})),g}functionMn(t,e){consti=[],n=t.segments;for(leto=0;o<n.length;o++){consts=wn(n[o],t.points,e);s.length&&i.push(...s)}returni}functionkn(t,e){consti=t.points,n=t.options.spanGaps,o=i.length;if(!o)return[];consts=!!t._loop,{start:a,end:r}=function(t,e,i,n){leto=0,s=e-1;if(i&&!n)for(;o<e&&!t[o].skip;)o++;for(;o<e&&t[o].skip;)o++;for(o%=e,i&&(s+=o);s>o&&t[s%e].skip;)s--;returns%=e,{start:o,end:s}}(i,o,s,n);if(!0===n)returnSn([{start:a,end:r,loop:s}],i,e);returnSn(function(t,e,i,n){consto=t.length,s=[];leta,r=e,l=t[e];for(a=e+1;a<=i;++a){consti=t[a%o];i.skip||i.stop?l.skip||(n=!1,s.push({start:e%o,end:(a-1)%o,loop:n}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}returnnull!==r&&s.push({start:e%o,end:r%o,loop:n}),s}(i,a,r<a?r+o:r,!!t._fullLoop&&0===a&&r===o-1),i,e)}functionSn(t,e,i){returni&&i.setContext&&e?function(t,e,i){constn=e.length,o=[];lets=t[0].start,a=s;for(constroft){lett,l,c=e[s%n];for(a=s+1;a<=r.end;a++){consth=e[a%n];l=Pn(i.setContext({type:"segment",p0:c,p1:h})),Dn(l,t)&&(o.push({start:s,end:a-1,loop:r.loop,style:t}),t=l,s=a-1),c=h,t=l}s<a-1&&(o.push({start:s,end:a-1,loop:r.loop,style:l}),s=a-1)}returno}(t,e,i):t}functionPn(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}functionDn(t,e){returne&&JSON.stringify(t)!==JSON.stringify(e)}varCn=Object.freeze({__proto__:null,easingEffects:mi,color:W,getHoverColor:H,noop:N,uid:j,isNullOrUndef:$,isArray:Y,isObject:U,isFinite:X,finiteOrDefault:q,valueOrDefault:K,toPercentage:G,toDimension:Z,callback:Q,each:J,_elementsEqual:tt,clone:et,_merger:nt,merge:ot,mergeIf:st,_mergerIf:at,_deprecated:function(t,e,i,n){void0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+n+'" instead')},resolveObjectKey:lt,_capitalize:ct,defined:ht,isFunction:dt,setsEqual:ut,toFontString:$t,_measureText:Yt,_longestText:Ut,_alignPixel:Xt,clearCanvas:qt,drawPoint:Kt,_isPointInArea:Gt,clipArea:Zt,unclipArea:Qt,_steppedLineTo:Jt,_bezierCurveTo:te,renderText:ee,addRoundedRectPath:ie,_lookup:ne,_lookupByKey:oe,_rlookupByKey:se,_filterBetween:ae,listenArrayEvents:le,unlistenArrayEvents:ce,_arrayUnique:he,_createResolver:qi,_attachContext:Ki,_descriptors:Gi,splineCurve:hn,splineCurveMonotone:dn,_updateBezierControlPoints:fn,_getParentNode:de,getStyle:ge,getRelativePosition:xe,getMaximumSize:_e,retinaScale:ye,supportsEventListenerOptions:ve,readUsedSize:we,fontString:function(t,e,i){returne+""+t+"px "+i},requestAnimFrame:t,throttled:e,debounce:i,_toLeftRightCenter:n,_alignStartEnd:o,_textX:s,_pointInLine:gn,_steppedInterpolation:pn,_bezierInterpolation:mn,formatNumber:zi,toLineHeight:Re,_readValueToProps:Le,toTRBL:Ee,toTRBLCorners:Ie,toPadding:ze,toFont:Fe,resolve:Ve,_addGrace:Be,PI:bt,TAU:_t,PITAU:yt,INFINITY:vt,RAD_PER_DEG:wt,HALF_PI:Mt,QUARTER_PI:kt,TWO_THIRDS_PI:St,log10:Pt,sign:Dt,niceNum:Ct,_factorize:Ot,isNumber:At,almostEquals:Tt,almostWhole:Rt,_setMinAndMaxByKey:Lt,toRadians:Et,toDegrees:It,_decimalPlaces:zt,getAngleFromPoint:Ft,distanceBetweenPoints:Vt,_angleDiff:Bt,_normalizeAngle:Wt,_angleBetween:Ht,_limitValue:Nt,_int16Range:jt,getRtlAdapter:xn,overrideTextDirection:bn,restoreTextDirection:_n,_boundSegment:wn,_boundSegments:Mn,_computeSegments:kn});classOn{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){returnObject.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){conste=this,i=Object.getPrototypeOf(t);letn;(function(t){return"id"int&&"defaults"int})(i)&&(n=e.register(i));consto=e.items,s=t.id,a=e.scope+"."+s;if(!s)thrownewError("class does not have id: "+t);returnsino||(o[s]=t,function(t,e,i){constn=ot(Object.create(null),[i?xt.get(i):{},xt.get(e),t.defaults]);xt.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{constn=i.split("."),o=n.pop(),s=[t].concat(n).join("."),a=e[i].split("."),r=a.pop(),l=a.join(".");xt.route(s,o,l,r)}))}(e,t.defaultRoutes);t.descriptors&&xt.describe(e,t.descriptors)}(t,a,n),e.override&&xt.override(t.id,t.overrides)),a}get(t){returnthis.items[t]}unregister(t){conste=this.items,i=t.id,n=this.scope;iine&&deletee[i],n&&iinxt[n]&&(deletext[n][i],this.override&&deleteft[i])}}varAn=newclass{constructor(){this.controllers=newOn(Li,"datasets",!0),this.elements=newOn(Ei,"elements"),this.plugins=newOn(Object,"plugins"),this.scales=newOn(Xi,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){returnthis._get(t,this.controllers,"controller")}getElement(t){returnthis._get(t,this.elements,"element")}getPlugin(t){returnthis._get(t,this.plugins,"plugin")}getScale(t){returnthis._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){constn=this;[...e].forEach((e=>{consto=i||n._getRegistryForType(e);i||o.isForType(e)||o===n.plugins&&e.id?n._exec(t,o,e):J(e,(e=>{consto=i||n._getRegistryForType(e);n._exec(t,o,e)}))}))}_exec(t,e,i){constn=ct(t);Q(i["before"+n],[],i),e[t](i),Q(i["after"+n],[],i)}_getRegistryForType(t){for(lete=0;e<this._typedRegistries.length;e++){consti=this._typedRegistries[e];if(i.isForType(t))returni}returnthis.plugins}_get(t,e,i){constn=e.get(t);if(void0===n)thrownewError('"'+t+'" is not a registered '+i+".");returnn}};classTn{constructor(){this._init=[]}notify(t,e,i,n){consto=this;"beforeInit"===e&&(o._init=o._createDescriptors(t,!0),o._notify(o._init,t,"install"));consts=n?o._descriptors(t).filter(n):o._descriptors(t),a=o._notify(s,t,e,i);return"destroy"===e&&(o._notify(s,t,"stop"),o._notify(o._init,t,"uninstall")),a}_notify(t,e,i,n){n=n||{};for(constooft){constt=o.plugin;if(!1===Q(t[i],[e,n,o.options],t)&&n.cancelable)return!1}return!0}invalidate(){$(this._cache)||(this._oldCache=this._cache,this._cache=void0)}_descriptors(t){if(this._cache)returnthis._cache;conste=this._cache=this._createDescriptors(t);returnthis._notifyStateChanges(t),e}_createDescriptors(t,e){consti=t&&t.config,n=K(i.options&&i.options.plugins,{}),o=function(t){conste=[],i=Object.keys(An.plugins.items);for(lett=0;t<i.length;t++)e.push(An.getPlugin(i[t]));constn=t.plugins||[];for(lett=0;t<n.length;t++){consti=n[t];-1===e.indexOf(i)&&e.push(i)}returne}(i);return!1!==n||e?function(t,e,i,n){consto=[],s=t.getContext();for(leta=0;a<e.length;a++){constr=e[a],l=Rn(i[r.id],n);null!==l&&o.push({plugin:r,options:Ln(t.config,r,l,s)})}returno}(t,o,n,e):[]}_notifyStateChanges(t){conste=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}functionRn(t,e){returne||!1!==t?!0===t?{}:t:null}functionLn(t,e,i,n){consto=t.pluginScopeKeys(e),s=t.getOptionScopes(i,o);returnt.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}functionEn(t,e){consti=xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}functionIn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void0)||t.charAt(0).toLowerCase();vari}functionzn(t){conste=t.options||(t.options={});e.plugins=K(e.plugins,{}),e.scales=function(t,e){consti=ft[t.type]||{scales:{}},n=e.scales||{},o=En(t.type,e),s=Object.create(null),a=Object.create(null);returnObject.keys(n).forEach((t=>{conste=n[t],r=In(t,e),l=function(t,e){returnt===e?"_index_":"_value_"}(r,o),c=i.scales||{};s[r]=s[r]||t,a[t]=st(Object.create(null),[{axis:r},e,c[r],c[l]])})),t.data.datasets.forEach((i=>{consto=i.type||t.type,r=i.indexAxis||En(o,e),l=(ft[o]||{}).scales||{};Object.keys(l).forEach((t=>{conste=function(t,e){leti=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),o=i[e+"AxisID"]||s[e]||e;a[o]=a[o]||Object.create(null),st(a[o],[{axis:e},n[o],l[t]])}))})),Object.keys(a).forEach((t=>{conste=a[t];st(e,[xt.scales[e.type],xt.scale])})),a}(t,e)}functionFn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}constVn=newMap,Bn=newSet;functionWn(t,e){leti=Vn.get(t);returni||(i=e(),Vn.set(t,i),Bn.add(i)),i}constHn=(t,e,i)=>{constn=lt(e,i);void0!==n&&t.add(n)};classNn{constructor(t){this._config=function(t){return(t=t||{}).data=Fn(t.data),zn(t),t}(t),this._scopeCache=newMap,this._resolverCache=newMap}gettype(){returnthis._config.type}settype(t){this._config.type=t}getdata(){returnthis._config.data}setdata(t){this._config.data=Fn(t)}getoptions(){returnthis._config.options}setoptions(t){this._config.options=t}getplugins(){returnthis._config.plugins}update(){constt=this._config;this.clearCache(),zn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){returnWn(t,(()=>[["datasets."+t,""]]))}datasetAnimationScopeKeys(t,e){returnWn(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]]))}datasetElementScopeKeys(t,e){returnWn(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]]))}pluginScopeKeys(t){conste=t.id;returnWn(`${this.type}-plugin-${e}`,(()=>[["plugins."+e,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){consti=this._scopeCache;letn=i.get(t);returnn&&!e||(n=newMap,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,s=this._cachedScopes(t,i),a=s.get(e);if(a)returna;constr=newSet;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>Hn(r,t,e)))),e.forEach((t=>Hn(r,n,t))),e.forEach((t=>Hn(r,ft[o]||{},t))),e.forEach((t=>Hn(r,xt,t))),e.forEach((t=>Hn(r,gt,t)))}));constl=[...r];returnBn.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ft[e]||{},xt.datasets[e]||{},{type:e},xt,gt]}resolveNamedOptions(t,e,i,n=[""]){consto={$shared:!0},{resolver:s,subPrefixes:a}=jn(this._resolverCache,t,n);letr=s;if(function(t,e){const{isScriptable:i,isIndexable:n}=Gi(t);for(constoofe)if(i(o)&&dt(t[o])||n(o)&&Y(t[o]))return!0;return!1}(s,e)){o.$shared=!1;r=Ki(s,i=dt(i)?i():i,this.createResolver(t,i,a))}for(consttofe)o[t]=r[t];returno}createResolver(t,e,i=[""],n){const{resolver:o}=jn(this._resolverCache,t,i);returnU(e)?Ki(o,e,void0,n):o}}functionjn(t,e,i){letn=t.get(e);n||(n=newMap,t.set(e,n));consto=i.join();lets=n.get(o);if(!s){s={resolver:qi(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(o,s)}returns}const$n=["top","bottom","left","right","chartArea"];functionYn(t,e){return"top"===t||"bottom"===t||-1===$n.indexOf(t)&&"x"===e}functionUn(t,e){returnfunction(i,n){returni[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}functionXn(t){conste=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Q(i&&i.onComplete,[t],e)}functionqn(t){conste=t.chart,i=e.options.animation;Q(i&&i.onProgress,[t],e)}functionKn(){return"undefined"!=typeofwindow&&"undefined"!=typeofdocument}functionGn(t){returnKn()&&"string"==typeoft?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}constZn={},Qn=t=>{conste=Gn(t);returnObject.values(Zn).filter((t=>t.canvas===e)).pop()};classJn{constructor(t,e){constn=this;this.config=e=newNn(e);consto=Gn(t),s=Qn(o);if(s)thrownewError("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");constr=e.createResolver(e.chartOptionScopes(),n.getContext());this.platform=n._initializePlatform(o,e);constl=n.platform.acquireContext(o,r.aspectRatio),c=l&&l.canvas,h=c&&c.height,d=c&&c.width;this.id=j(),this.ctx=l,this.canvas=c,this.width=d,this.height=h,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void0,this.boxes=[],this.currentDevicePixelRatio=void0,this.chartArea=void0,this._active=[],this._lastEvent=void0,this._listeners={},this._sortedMetasets=[],this.scales={},this.scale=void0,this._plugins=newTn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void0,this.$context=void0,this._doResize=i((()=>this.update("resize")),r.resizeDelay||0),Zn[n.id]=n,l&&c?(a.listen(n,"complete",Xn),a.listen(n,"progress",qn),n._initialize(),n.attached&&n.update()):console.error("Failed to create chart: can't acquire context from the given item")}getaspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return$(t)?e&&o?o:n?i/n:null:t}getdata(){returnthis.config.data}setdata(t){this.config.data=t}getoptions(){returnthis._options}setoptions(t){this.config.options=t}_initialize(){constt=this;returnt.notifyPlugins("beforeInit"),t.options.responsive?t.resize():ye(t,t.options.devicePixelRatio),t.bindEvents(),t.notifyPlugins("afterInit"),t}_initializePlatform(t,e){returne.platform?newe.platform:!Kn()||"undefined"!=typeofOffscreenCanvas&&tinstanceofOffscreenCanvas?newQe:newdi}clear(){returnqt(this.canvas,this.ctx),this}stop(){returna.stop(this),this}resize(t,e){a.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){consti=this,n=i.options,o=i.canvas,s=n.maintainAspectRatio&&i.aspectRatio,a=i.platform.getMaximumSize(o,t,e,s),r=i.currentDevicePixelRatio,l=n.devicePixelRatio||i.platform.getDevicePixelRatio();i.width===a.width&&i.height===a.height&&r===l||(i.width=a.width,i.height=a.height,i._aspectRatio=i.aspectRatio,ye(i,l,!0),i.notifyPlugins("resize",{size:a}),Q(n.onResize,[i,a],i),i.attached&&i._doResize()&&i.render())}ensureScalesHaveIDs(){J(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){constt=this,e=t.options,i=e.scales,n=t.scales,o=Object.keys(n).reduce(((t,e)=>(t[e]=!1,t)),{});lets=[];i&&(s=s.concat(Object.keys(i).map((t=>{conste=i[t],n=In(t,e),o="r"===n,s="x"===n;return{options:e,dposition:o?"chartArea":s?"bottom":"left",dtype:o?"radialLinear":s?"category":"linear"}})))),J(s,(i=>{consts=i.options,a=s.id,r=In(a,s),l=K(s.type,i.dtype);void0!==s.position&&Yn(s.position,r)===Yn(i.dposition)||(s.position=i.dposition),o[a]=!0;letc=null;if(ainn&&n[a].type===l)c=n[a];else{c=new(An.getScale(l))({id:a,type:l,ctx:t.ctx,chart:t}),n[c.id]=c}c.init(s,e)})),J(o,((t,e)=>{t||deleten[e]})),J(n,(e=>{Ge.configure(t,e,e.options),Ge.addBox(t,e)}))}_updateMetasetIndex(t,e){consti=this._metasets,n=t.index;n!==e&&(i[n]=i[e],i[e]=t,t.index=e)}_updateMetasets(){constt=this,e=t._metasets,i=t.data.datasets.length,n=e.length;if(n>i){for(lete=i;e<n;++e)t._destroyDatasetMeta(e);e.splice(i,n-i)}t._sortedMetasets=e.slice(0).sort(Un("order","index"))}_removeUnreferencedMetasets(){constt=this,{_metasets:e,data:{datasets:i}}=t;e.length>i.length&&deletet._stacks,e.forEach(((e,n)=>{0===i.filter((t=>t===e._dataset)).length&&t._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){constt=this,e=[],i=t.data.datasets;letn,o;for(t._removeUnreferencedMetasets(),n=0,o=i.length;n<o;n++){consto=i[n];lets=t.getDatasetMeta(n);consta=o.type||t.config.type;if(s.type&&s.type!==a&&(t._destroyDatasetMeta(n),s=t.getDatasetMeta(n)),s.type=a,s.indexAxis=o.indexAxis||En(a,t.options),s.order=o.order||0,t._updateMetasetIndex(s,n),s.label=""+o.label,s.visible=t.isDatasetVisible(n),s.controller)s.controller.updateIndex(n),s.controller.linkScales();else{consti=An.getController(a),{datasetElementType:o,dataElementType:r}=xt.datasets[a];Object.assign(i.prototype,{dataElementType:An.getElement(r),datasetElementType:o&&An.getElement(o)}),s.controller=newi(t,n),e.push(s.controller)}}returnt._updateMetasets(),e}_resetElements(){constt=this;J(t.data.datasets,((e,i)=>{t.getDatasetMeta(i).controller.reset()}),t)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){conste=this,i=e.config;i.update(),e._options=i.createResolver(i.chartOptionScopes(),e.getContext()),J(e.scales,(t=>{Ge.removeBox(e,t)}));constn=e._animationsDisabled=!e.options.animation;e.ensureScalesHaveIDs(),e.buildOrUpdateScales();consto=newSet(Object.keys(e._listeners)),s=newSet(e.options.events);if(ut(o,s)||(e.unbindEvents(),e.bindEvents()),e._plugins.invalidate(),!1===e.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;consta=e.buildOrUpdateControllers();e.notifyPlugins("beforeElementsUpdate");letr=0;for(lett=0,i=e.data.datasets.length;t<i;t++){const{controller:i}=e.getDatasetMeta(t),o=!n&&-1===a.indexOf(i);i.buildOrUpdateElements(o),r=Math.max(+i.getMaxOverflow(),r)}e._minPadding=r,e._updateLayout(r),n||J(a,(t=>{t.reset()})),e._updateDatasets(t),e.notifyPlugins("afterUpdate",{mode:t}),e._layers.sort(Un("z","_idx")),e._lastEvent&&e._eventHandler(e._lastEvent,!0),e.render()}_updateLayout(t){conste=this;if(!1===e.notifyPlugins("beforeLayout",{cancelable:!0}))return;Ge.update(e,e.width,e.height,t);consti=e.chartArea,n=i.width<=0||i.height<=0;e._layers=[],J(e.boxes,(t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),e._layers.push(...t._layers()))}),e),e._layers.forEach(((t,e)=>{t._idx=e})),e.notifyPlugins("afterLayout")}_updateDatasets(t){conste=this,i="function"==typeoft;if(!1!==e.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(letn=0,o=e.data.datasets.length;n<o;++n)e._updateDataset(n,i?t({datasetIndex:n}):t);e.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){consti=this,n=i.getDatasetMeta(t),o={meta:n,index:t,mode:e,cancelable:!0};!1!==i.notifyPlugins("beforeDatasetUpdate",o)&&(n.controller._update(e),o.cancelable=!1,i.notifyPlugins("afterDatasetUpdate",o))}render(){constt=this;!1!==t.notifyPlugins("beforeRender",{cancelable:!0})&&(a.has(t)?t.attached&&!a.running(t)&&a.start(t):(t.draw(),Xn({chart:t})))}draw(){constt=this;lete;if(t._resizeBeforeDraw){const{width:e,height:i}=t._resizeBeforeDraw;t._resize(e,i),t._resizeBeforeDraw=null}if(t.clear(),t.width<=0||t.height<=0)return;if(!1===t.notifyPlugins("beforeDraw",{cancelable:!0}))return;consti=t._layers;for(e=0;e<i.length&&i[e].z<=0;++e)i[e].draw(t.chartArea);for(t._drawDatasets();e<i.length;++e)i[e].draw(t.chartArea);t.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){conste=this._sortedMetasets,i=[];letn,o;for(n=0,o=e.length;n<o;++n){consto=e[n];t&&!o.visible||i.push(o)}returni}getSortedVisibleDatasetMetas(){returnthis._getSortedDatasetMetas(!0)}_drawDatasets(){constt=this;if(!1===t.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;conste=t.getSortedVisibleDatasetMetas();for(leti=e.length-1;i>=0;--i)t._drawDataset(e[i]);t.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){conste=this,i=e.ctx,n=t._clip,o=e.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==e.notifyPlugins("beforeDatasetDraw",s)&&(Zt(i,{left:!1===n.left?0:o.left-n.left,right:!1===n.right?e.width:o.right+n.right,top:!1===n.top?0:o.top-n.top,bottom:!1===n.bottom?e.height:o.bottom+n.bottom}),t.controller.draw(),Qt(i),s.cancelable=!1,e.notifyPlugins("afterDatasetDraw",s))}getElementsAtEventForMode(t,e,i,n){consto=Oe.modes[e];return"function"==typeofo?o(this,t,i,n):[]}getDatasetMeta(t){conste=this.data.datasets[t],i=this._metasets;letn=i.filter((t=>t&&t._dataset===e)).pop();returnn||(n=i[t]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1}),n}getContext(){returnthis.$context||(this.$context={chart:this,type:"chart"})}getVisibleDatasetCount(){returnthis.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){conste=this.data.datasets[t];if(!e)return!1;consti=this.getDatasetMeta(t);return"boolean"==typeofi.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateDatasetVisibility(t,e){consti=this,n=e?"show":"hide",o=i.getDatasetMeta(t),s=o.controller._resolveAnimations(void0,n);i.setDatasetVisibility(t,e),s.update(o,{visible:e}),i.update((e=>e.datasetIndex===t?n:void0))}hide(t){this._updateDatasetVisibility(t,!1)}show(t){this._updateDatasetVisibility(t,!0)}_destroyDatasetMeta(t){conste=this,i=e._metasets&&e._metasets[t];i&&i.controller&&(i.controller._destroy(),deletee._metasets[t])}destroy(){constt=this,{canvas:e,ctx:i}=t;letn,o;for(t.stop(),a.remove(t),n=0,o=t.data.datasets.length;n<o;++n)t._destroyDatasetMeta(n);t.config.clearCache(),e&&(t.unbindEvents(),qt(e,i),t.platform.releaseContext(i),t.canvas=null,t.ctx=null),t.notifyPlugins("destroy"),deleteZn[t.id]}toBase64Image(...t){returnthis.canvas.toDataURL(...t)}bindEvents(){constt=this,e=t._listeners,i=t.platform,n=(n,o)=>{i.addEventListener(t,n,o),e[n]=o},o=(n,o)=>{e[n]&&(i.removeEventListener(t,n,o),deletee[n])};lets=function(e,i,n){e.offsetX=i,e.offsetY=n,t._eventHandler(e)};if(J(t.options.events,(t=>n(t,s))),t.options.responsive){lete;s=(e,i)=>{t.canvas&&t.resize(e,i)};consta=()=>{o("attach",a),t.attached=!0,t.resize(),n("resize",s),n("detach",e)};e=()=>{t.attached=!1,o("resize",s),n("attach",a)},i.isAttached(t.canvas)?a():e()}elset.attached=!0}unbindEvents(){constt=this,e=t._listeners;e&&(t._listeners={},J(e,((e,i)=>{t.platform.removeEventListener(t,i,e)})))}updateHoverStyle(t,e,i){constn=i?"set":"remove";leto,s,a,r;for("dataset"===e&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){s=t[a];conste=s&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[n+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){returnthis._active||[]}setActiveElements(t){conste=this,i=e._active||[],n=t.map((({datasetIndex:t,index:i})=>{constn=e.getDatasetMeta(t);if(!n)thrownewError("No dataset found at index "+t);return{datasetIndex:t,element:n.data[i],index:i}}));!tt(n,i)&&(e._active=n,e._updateHoverStyles(n,i))}notifyPlugins(t,e,i){returnthis._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){constn=this,o=n.options.hover,s=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),a=s(e,t),r=i?t:s(t,e);a.length&&n.updateHoverStyle(a,o.mode,!1),r.length&&o.mode&&n.updateHoverStyle(r,o.mode,!0)}_eventHandler(t,e){consti=this,n={event:t,replay:e,cancelable:!0},o=e=>(e.options.events||this.options.events).includes(t.type);if(!1===i.notifyPlugins("beforeEvent",n,o))return;consts=i._handleEvent(t,e);returnn.cancelable=!1,i.notifyPlugins("afterEvent",n,o),(s||n.changed)&&i.render(),i}_handleEvent(t,e){consti=this,{_active:n=[],options:o}=i,s=o.hover,a=e;letr=[],l=!1,c=null;return"mouseout"!==t.type&&(r=i.getElementsAtEventForMode(t,s.mode,s,a),c="click"===t.type?i._lastEvent:t),i._lastEvent=null,Gt(t,i.chartArea,i._minPadding)&&(Q(o.onHover,[t,r,i],i),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||Q(o.onClick,[t,r,i],i)),l=!tt(r,n),(l||e)&&(i._active=r,i._updateHoverStyles(r,n,e)),i._lastEvent=c,l}}constto=()=>J(Jn.instances,(t=>t._plugins.invalidate())),eo=!0;functionio(){thrownewError("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}Object.defineProperties(Jn,{defaults:{enumerable:eo,value:xt},instances:{enumerable:eo,value:Zn},overrides:{enumerable:eo,value:ft},registry:{enumerable:eo,value:An},version:{enumerable:eo,value:"3.2.1"},getChart:{enumerable:eo,value:Qn},register:{enumerable:eo,value:(...t)=>{An.add(...t),to()}},unregister:{enumerable:eo,value:(...t)=>{An.remove(...t),to()}}});classno{constructor(t){this.options=t||{}}formats(){returnio()}parse(t,e){returnio()}format(t,e){returnio()}add(t,e,i){returnio()}diff(t,e,i){returnio()}startOf(t,e,i){returnio()}endOf(t,e){returnio()}}no.override=function(t){Object.assign(no.prototype,t)};varoo={_date:no};functionso(t){conste=function(t){if(!t._cache.$bar){conste=t.getMatchingVisibleMetas("bar");leti=[];for(letn=0,o=e.length;n<o;n++)i=i.concat(e[n].controller.getAllParsedValues(t));t._cache.$bar=he(i.sort(((t,e)=>t-e)))}returnt._cache.$bar}(t);leti,n,o,s,a=t._length;constr=()=>{32767!==o&&-32768!==o&&(ht(s)&&(a=Math.min(a,Math.abs(o-s)||a)),s=o)};for(i=0,n=e.length;i<n;++i)o=t.getPixelForValue(e[i]),r();for(s=void0,i=0,n=t.ticks.length;i<n;++i)o=t.getPixelForTick(i),r();returna}functionao(t,e,i,n){returnY(t)?function(t,e,i,n){consto=i.parse(t[0],n),s=i.parse(t[1],n),a=Math.min(o,s),r=Math.max(o,s);letl=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:o,end:s,min:a,max:r}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}functionro(t,e,i,n){consto=t.iScale,s=t.vScale,a=o.getLabels(),r=o===s,l=[];letc,h,d,u;for(c=i,h=i+n;c<h;++c)u=e[c],d={},d[o.axis]=r||o.parse(a[c],c),l.push(ao(u,d,s,c));returnl}functionlo(t){returnt&&void0!==t.barStart&&void0!==t.barEnd}classcoextendsLi{parsePrimitiveData(t,e,i,n){returnro(t,e,i,n)}parseArrayData(t,e,i,n){returnro(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l="x"===o.axis?a:r,c="x"===s.axis?a:r,h=[];letd,u,f,g;for(d=i,u=i+n;d<u;++d)g=e[d],f={},f[o.axis]=o.parse(lt(g,l),d),h.push(ao(lt(g,c),f,s,d));returnh}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);consto=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getLabelAndValue(t){conste=this._cachedMeta,{iScale:i,vScale:n}=e,o=this.getParsed(t),s=o._custom,a=lo(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}initialize(){constt=this;t.enableOptionSharing=!0,super.initialize();t._cachedMeta.stack=t.getDataset().stack}update(t){conste=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){consto=this,s="reset"===n,a=o._cachedMeta.vScale,r=a.getBasePixel(),l=a.isHorizontal(),c=o._getRuler(),h=o.resolveDataElementOptions(e,n),d=o.getSharedOptions(h),u=o.includeOptions(n,d);o.updateSharedOptions(d,n,h);for(leth=e;h<e+i;h++){conste=o.getParsed(h),i=s||$(e[a.axis])?{base:r,head:r}:o._calculateBarValuePixels(h),f=o._calculateBarIndexPixels(h,c),g=(e._stacks||{})[a.axis],p={horizontal:l,base:i.base,enableBorderRadius:!g||lo(e._custom)||o.index===g._top||o.index===g._bottom,x:l?i.head:f.center,y:l?f.center:i.head,height:l?f.size:void0,width:l?void0:f.size};u&&(p.options=d||o.resolveDataElementOptions(h,n)),o.updateElement(t[h],h,p,n)}}_getStacks(t,e){consti=this._cachedMeta.iScale,n=i.getMatchingVisibleMetas(this._type),o=i.options.stacked,s=n.length,a=[];letr,l;for(r=0;r<s;++r){if(l=n[r],void0!==e){constt=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if($(t)||isNaN(t))continue}if((!1===o||-1===a.indexOf(l.stack)||void0===o&&void0===l.stack)&&a.push(l.stack),l.index===t)break}returna.length||a.push(void0),a}_getStackCount(t){returnthis._getStacks(void0,t).length}_getStackIndex(t,e,i){constn=this._getStacks(t,i),o=void0!==e?n.indexOf(e):-1;return-1===o?n.length-1:o}_getRuler(){constt=this,e=t.options,i=t._cachedMeta,n=i.iScale,o=[];lets,a;for(s=0,a=i.data.length;s<a;++s)o.push(n.getPixelForValue(t.getParsed(s)[n.axis],s));constr=e.barThickness;return{min:r||so(n),pixels:o,start:n._startPixel,end:n._endPixel,stackCount:t._getStackCount(),scale:n,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(t){conste=this,{vScale:i,_stacked:n}=e._cachedMeta,{base:o,minBarLength:s}=e.options,a=e.getParsed(t),r=a._custom,l=lo(r);letc,h,d=a[i.axis],u=0,f=n?e.applyStack(i,a,n):d;f!==d&&(u=f-d,f=d),l&&(d=r.barStart,f=r.barEnd-r.barStart,0!==d&&Dt(d)!==Dt(r.barEnd)&&(u=0),u+=d);constg=$(o)||l?u:o;letp=i.getPixelForValue(g);c=this.chart.getDataVisibility(t)?i.getPixelForValue(u+f):p,h=c-p,void0!==s&&Math.abs(h)<s&&(h=h<0?-s:s,0===d&&(p-=h/2),c=p+h);constm=o||0;if(p===i.getPixelForValue(m)){constt=i.getLineWidthForValue(m)/2;h>0?(p+=t,h-=t):h<0&&(p-=t,h+=t)}return{size:h,base:p,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){consti=this,n=e.scale,o=i.options,s=o.skipNull,a=K(o.maxBarThickness,1/0);letr,l;if(e.grouped){constn=s?i._getStackCount(t):e.stackCount,c="flex"===o.barThickness?function(t,e,i,n){consto=e.pixels,s=o[t];leta=t>0?o[t-1]:null,r=t<o.length-1?o[t+1]:null;constl=i.categoryPercentage;null===a&&(a=s-(null===r?e.end-e.start:r-s)),null===r&&(r=s+s-a);constc=s-(s-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/n,ratio:i.barPercentage,start:c}}(t,e,o,n):function(t,e,i,n){consto=i.barThickness;lets,a;return$(o)?(s=e.min*i.categoryPercentage,a=i.barPercentage):(s=o*n,a=1),{chunk:s/n,ratio:a,start:e.pixels[t]-s/2}}(t,e,o,n),h=i._getStackIndex(i.index,i._cachedMeta.stack,s?t:void0);r=c.start+c.chunk*h+c.chunk/2,l=Math.min(a,c.chunk*c.ratio)}elser=n.getPixelForValue(i.getParsed(t)[n.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){constt=this,e=t.chart,i=t._cachedMeta,n=i.vScale,o=i.data,s=o.length;leta=0;for(Zt(e.ctx,e.chartArea);a<s;++a)null!==t.getParsed(a)[n.axis]&&o[a].draw(t._ctx);Qt(e.ctx)}}co.id="bar",co.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},co.overrides={interaction:{mode:"index"},scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};classhoextendsLi{initialize(){this.enableOptionSharing=!0,super.initialize()}parseObjectData(t,e,i,n){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=[];letc,h,d;for(c=i,h=i+n;c<h;++c)d=e[c],l.push({x:o.parse(lt(d,a),c),y:s.parse(lt(d,r),c),_custom:d&&d.r&&+d.r});returnl}getMaxOverflow(){const{data:t,_parsed:e}=this._cachedMeta;leti=0;for(letn=t.length-1;n>=0;--n)i=Math.max(i,t[n].size()/2,e[n]._custom);returni>0&&i}getLabelAndValue(t){conste=this._cachedMeta,{xScale:i,yScale:n}=e,o=this.getParsed(t),s=i.getLabelForValue(o.x),a=n.getLabelForValue(o.y),r=o._custom;return{label:e.label,value:"("+s+", "+a+(r?", "+r:"")+")"}}update(t){conste=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){consto=this,s="reset"===n,{xScale:a,yScale:r}=o._cachedMeta,l=o.resolveDataElementOptions(e,n),c=o.getSharedOptions(l),h=o.includeOptions(n,c);for(letl=e;l<e+i;l++){conste=t[l],i=!s&&o.getParsed(l),c=s?a.getPixelForDecimal(.5):a.getPixelForValue(i.x),d=s?r.getBasePixel():r.getPixelForValue(i.y),u={x:c,y:d,skip:isNaN(c)||isNaN(d)};h&&(u.options=o.resolveDataElementOptions(l,n),s&&(u.options.radius=0)),o.updateElement(e,l,u,n)}o.updateSharedOptions(c,n,l)}resolveDataElementOptions(t,e){consti=this.getParsed(t);letn=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));consto=n.radius;return"active"!==e&&(n.radius=0),n.radius+=K(i&&i._custom,o),n}}ho.id="bubble",ho.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},ho.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};classuoextendsLi{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void0,this.outerRadius=void0,this.offsetX=void0,this.offsetY=void0}linkScales(){}parse(t,e){consti=this.getDataset().data,n=this._cachedMeta;leto,s;for(o=t,s=t+e;o<s;++o)n._parsed[o]=+i[o]}_getRotation(){returnEt(this.options.rotation-90)}_getCircumference(){returnEt(this.options.circumference)}_getRotationExtents(){lett=_t,e=-_t;consti=this;for(letn=0;n<i.chart.data.datasets.length;++n)if(i.chart.isDatasetVisible(n)){consto=i.chart.getDatasetMeta(n).controller,s=o._getRotation(),a=o._getCircumference();t=Math.min(t,s),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){conste=this,i=e.chart,{chartArea:n}=i,o=e._cachedMeta,s=o.data,a=e.getMaxBorderWidth()+e.getMaxOffset(s),r=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min(G(e.options.cutout,r),1),c=e._getRingWeight(e.index),{circumference:h,rotation:d}=e._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:g,offsetY:p}=function(t,e,i){letn=1,o=1,s=0,a=0;if(e<_t){constr=t,l=r+e,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(t,e,n)=>Ht(t,r,l)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>Ht(t,r,l)?-1:Math.min(e,e*i,n,n*i),p=f(0,c,d),m=f(Mt,h,u),x=g(bt,c,d),b=g(bt+Mt,h,u);n=(p-x)/2,o=(m-b)/2,s=-(p+x)/2,a=-(m+b)/2}return{ratioX:n,ratioY:o,offsetX:s,offsetY:a}}(d,h,l),m=(n.width-a)/u,x=(n.height-a)/f,b=Math.max(Math.min(m,x)/2,0),_=Z(e.options.radius,b),y=(_-Math.max(_*l,0))/e._getVisibleDatasetWeightTotal();e.offsetX=g*_,e.offsetY=p*_,o.total=e.calculateTotal(),e.outerRadius=_-y*e._getRingWeightOffset(e.index),e.innerRadius=Math.max(e.outerRadius-y*c,0),e.updateElements(s,0,s.length,t)}_circumference(t,e){consti=this,n=i.options,o=i._cachedMeta,s=i._getCircumference();returne&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===o._parsed[t]?0:i.calculateCircumference(o._parsed[t]*s/_t)}updateElements(t,e,i,n){consto=this,s="reset"===n,a=o.chart,r=a.chartArea,l=a.options.animation,c=(r.left+r.right)/2,h=(r.top+r.bottom)/2,d=s&&l.animateScale,u=d?0:o.innerRadius,f=d?0:o.outerRadius,g=o.resolveDataElementOptions(e,n),p=o.getSharedOptions(g),m=o.includeOptions(n,p);letx,b=o._getRotation();for(x=0;x<e;++x)b+=o._circumference(x,s);for(x=e;x<e+i;++x){conste=o._circumference(x,s),i=t[x],a={x:c+o.offsetX,y:h+o.offsetY,startAngle:b,endAngle:b+e,circumference:e,outerRadius:f,innerRadius:u};m&&(a.options=p||o.resolveDataElementOptions(x,n)),b+=e,o.updateElement(i,x,a,n)}o.updateSharedOptions(p,n,g)}calculateTotal(){constt=this._cachedMeta,e=t.data;leti,n=0;for(i=0;i<e.length;i++){conste=t._parsed[i];null!==e&&!isNaN(e)&&this.chart.getDataVisibility(i)&&(n+=Math.abs(e))}returnn}calculateCircumference(t){conste=this._cachedMeta.total;returne>0&&!isNaN(t)?_t*(Math.abs(t)/e):0}getLabelAndValue(t){conste=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=zi(e._parsed[t],i.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){conste=this;leti=0;constn=e.chart;leto,s,a,r,l;if(!t)for(o=0,s=n.data.datasets.length;o<s;++o)if(n.isDatasetVisible(o)){a=n.getDatasetMeta(o),t=a.data,r=a.controller,r!==e&&r.configure();break}if(!t)return0;for(o=0,s=t.length;o<s;++o)l=r.resolveDataElementOptions(o),"inner"!==l.borderAlign&&(i=Math.max(i,l.borderWidth||0,l.hoverBorderWidth||0));returni}getMaxOffset(t){lete=0;for(leti=0,n=t.length;i<n;++i){constt=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}returne}_getRingWeightOffset(t){lete=0;for(leti=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));returne}_getRingWeight(t){returnMath.max(K(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){returnthis._getRingWeightOffset(this.chart.data.datasets.length)||1}}uo.id="doughnut",uo.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",indexAxis:"r"},uo.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){conste=t.data;returne.labels.length&&e.datasets.length?e.labels.map(((e,i)=>{constn=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,hidden:!t.getDataVisibility(i),index:i}})):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){lete=t.label;consti=": "+t.formattedValue;returnY(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};classfoextendsLi{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){conste=this,i=e._cachedMeta,{dataset:n,data:o=[],_dataset:s}=i,a=e.chart._animationsDisabled;let{start:r,count:l}=function(t,e,i){constn=e.length;leto=0,s=n;if(t._sorted){const{iScale:a,_parsed:r}=t,l=a.axis,{min:c,max:h,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(o=Nt(Math.min(oe(r,a.axis,c).lo,i?n:oe(e,l,a.getPixelForValue(c)).lo),0,n-1)),s=u?Nt(Math.max(oe(r,a.axis,h).hi+1,i?0:oe(e,l,a.getPixelForValue(h)).hi+1),o,n)-o:n-o}return{start:o,count:s}}(i,o,a);e._drawStart=r,e._drawCount=l,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,o={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)returnt._scaleRanges=o,!0;consts=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;returnObject.assign(n,o),s}(i)&&(r=0,l=o.length),n._decimated=!!s._decimated,n.points=o;constc=e.resolveDatasetElementOptions(t);e.options.showLine||(c.borderWidth=0),c.segment=e.options.segment,e.updateElement(n,void0,{animated:!a,options:c},t),e.updateElements(o,r,l,t)}updateElements(t,e,i,n){consto=this,s="reset"===n,{xScale:a,yScale:r,_stacked:l}=o._cachedMeta,c=o.resolveDataElementOptions(e,n),h=o.getSharedOptions(c),d=o.includeOptions(n,h),u=o.options.spanGaps,f=At(u)?u:Number.POSITIVE_INFINITY,g=o.chart._animationsDisabled||s||"none"===n;letp=e>0&&o.getParsed(e-1);for(letc=e;c<e+i;++c){conste=t[c],i=o.getParsed(c),u=g?e:{},m=$(i.y),x=u.x=a.getPixelForValue(i.x,c),b=u.y=s||m?r.getBasePixel():r.getPixelForValue(l?o.applyStack(r,i,l):i.y,c);u.skip=isNaN(x)||isNaN(b)||m,u.stop=c>0&&i.x-p.x>f,u.parsed=i,d&&(u.options=h||o.resolveDataElementOptions(c,n)),g||o.updateElement(e,c,u,n),p=i}o.updateSharedOptions(h,n,c)}getMaxOverflow(){constt=this,e=t._cachedMeta,i=e.dataset,n=i.options&&i.options.borderWidth||0,o=e.data||[];if(!o.length)returnn;consts=o[0].size(t.resolveDataElementOptions(0)),a=o[o.length-1].size(t.resolveDataElementOptions(o.length-1));returnMath.max(n,s,a)/2}draw(){this._cachedMeta.dataset.updateControlPoints(this.chart.chartArea),super.draw()}}fo.id="line",fo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},fo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};classgoextendsLi{constructor(t,e){super(t,e),this.innerRadius=void0,this.outerRadius=void0}update(t){conste=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){constt=this,e=t.chart,i=e.chartArea,n=e.options,o=Math.min(i.right-i.left,i.bottom-i.top),s=Math.max(o/2,0),a=(s-Math.max(n.cutoutPercentage?s/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();t.outerRadius=s-a*t.index,t.innerRadius=t.outerRadius-a}updateElements(t,e,i,n){consto=this,s="reset"===n,a=o.chart,r=o.getDataset(),l=a.options.animation,c=o._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*bt;letf,g=u;constp=360/o.countVisibleElements();for(f=0;f<e;++f)g+=o._computeAngle(f,n,p);for(f=e;f<e+i;f++){conste=t[f];leti=g,m=g+o._computeAngle(f,n,p),x=a.getDataVisibility(f)?c.getDistanceFromCenterForValue(r.data[f]):0;g=m,s&&(l.animateScale&&(x=0),l.animateRotate&&(i=m=u));constb={x:h,y:d,innerRadius:0,outerRadius:x,startAngle:i,endAngle:m,options:o.resolveDataElementOptions(f,n)};o.updateElement(e,f,b,n)}}countVisibleElements(){constt=this.getDataset(),e=this._cachedMeta;leti=0;returne.data.forEach(((e,n)=>{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++})),i}_computeAngle(t,e,i){returnthis.chart.getDataVisibility(t)?Et(this.resolveDataElementOptions(t,e).angle||i):0}}go.id="polarArea",go.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},go.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){conste=t.data;returne.labels.length&&e.datasets.length?e.labels.map(((e,i)=>{constn=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,hidden:!t.getDataVisibility(i),index:i}})):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};classpoextendsuo{}po.id="pie",po.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};classmoextendsLi{getLabelAndValue(t){conste=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){conste=this,i=e._cachedMeta,n=i.dataset,o=i.data||[],s=i.iScale.getLabels();if(n.points=o,"resize"!==t){consti=e.resolveDatasetElementOptions(t);e.options.showLine||(i.borderWidth=0);consta={_loop:!0,_fullLoop:s.length===o.length,options:i};e.updateElement(n,void0,a,t)}e.updateElements(o,0,o.length,t)}updateElements(t,e,i,n){consto=this,s=o.getDataset(),a=o._cachedMeta.rScale,r="reset"===n;for(letl=e;l<e+i;l++){conste=t[l],i=o.resolveDataElementOptions(l,n),c=a.getPointPositionForValue(l,s.data[l]),h=r?a.xCenter:c.x,d=r?a.yCenter:c.y,u={x:h,y:d,angle:c.angle,skip:isNaN(h)||isNaN(d),options:i};o.updateElement(e,l,u,n)}}}mo.id="radar",mo.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},mo.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};classxoextendsfo{}xo.id="scatter",xo.defaults={showLine:!1,fill:!1},xo.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};varbo=Object.freeze({__proto__:null,BarController:co,BubbleController:ho,DoughnutController:uo,LineController:fo,PolarAreaController:go,PieController:po,RadarController:mo,ScatterController:xo});function_o(t,e){const{startAngle:i,endAngle:n,pixelMargin:o,x:s,y:a,outerRadius:r,innerRadius:l}=e;letc=o/r;t.beginPath(),t.arc(s,a,r,i-c,n+c),l>o?(c=o/l,t.arc(s,a,l,n+c,i-c,!0)):t.arc(s,a,o,n+Mt,i-Mt),t.closePath(),t.clip()}functionyo(t,e,i,n){consto=Le(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);consts=(i-e)/2,a=Math.min(s,n*e/2),r=t=>{conste=(i-Math.min(s,t))*n/2;returnNt(t,0,Math.min(s,e))};return{outerStart:r(o.outerStart),outerEnd:r(o.outerEnd),innerStart:Nt(o.innerStart,0,a),innerEnd:Nt(o.innerEnd,0,a)}}functionvo(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}functionwo(t,e){const{x:i,y:n,startAngle:o,endAngle:s,pixelMargin:a}=e,r=Math.max(e.outerRadius-a,0),l=e.innerRadius+a,{outerStart:c,outerEnd:h,innerStart:d,innerEnd:u}=yo(e,l,r,s-o),f=r-c,g=r-h,p=o+c/f,m=s-h/g,x=l+d,b=l+u,_=o+d/x,y=s-u/b;if(t.beginPath(),t.arc(i,n,r,p,m),h>0){conste=vo(g,m,i,n);t.arc(e.x,e.y,h,m,s+Mt)}constv=vo(b,s,i,n);if(t.lineTo(v.x,v.y),u>0){conste=vo(b,y,i,n);t.arc(e.x,e.y,u,s+Mt,y+Math.PI)}if(t.arc(i,n,l,s-u/l,o+d/l,!0),d>0){conste=vo(x,_,i,n);t.arc(e.x,e.y,d,_+Math.PI,o-Mt)}constw=vo(f,o,i,n);if(t.lineTo(w.x,w.y),c>0){conste=vo(f,p,i,n);t.arc(e.x,e.y,c,o-Mt,p)}t.closePath()}functionMo(t,e){const{options:i}=e,n="inner"===i.borderAlign;i.borderWidth&&(n?(t.lineWidth=2*i.borderWidth,t.lineJoin="round"):(t.lineWidth=i.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,i){const{x:n,y:o,startAngle:s,endAngle:a,pixelMargin:r}=e,l=Math.max(e.outerRadius-r,0),c=e.innerRadius+r;leth;for(i&&(e.endAngle=e.startAngle+_t,_o(t,e),e.endAngle=a,e.endAngle===e.startAngle&&(e.endAngle+=_t,e.fullCircles--)),t.beginPath(),t.arc(n,o,c,s+_t,s,!0),h=0;h<e.fullCircles;++h)t.stroke();for(t.beginPath(),t.arc(n,o,l,s,s+_t),h=0;h<e.fullCircles;++h)t.stroke()}(t,e,n),n&&_o(t,e),wo(t,e),t.stroke())}classkoextendsEi{constructor(t){super(),this.options=void0,this.circumference=void0,this.startAngle=void0,this.endAngle=void0,this.innerRadius=void0,this.outerRadius=void0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){constn=this.getProps(["x","y"],i),{angle:o,distance:s}=Ft(n,{x:t,y:e}),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i);return(h>=_t||Ht(o,a,r))&&(s>=l&&s<=c)}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:o,innerRadius:s,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),r=(n+o)/2,l=(s+a)/2;return{x:e+Math.cos(r)*l,y:i+Math.sin(r)*l}}tooltipPosition(t){returnthis.getCenterPoint(t)}draw(t){conste=this,i=e.options,n=i.offset||0;if(e.pixelMargin="inner"===i.borderAlign?.33:0,e.fullCircles=Math.floor(e.circumference/_t),!(0===e.circumference||e.innerRadius<0||e.outerRadius<0)){if(t.save(),n&&e.circumference<_t){consti=(e.startAngle+e.endAngle)/2;t.translate(Math.cos(i)*n,Math.sin(i)*n)}t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor,function(t,e){if(e.fullCircles){e.endAngle=e.startAngle+_t,wo(t,e);for(leti=0;i<e.fullCircles;++i)t.fill()}isNaN(e.circumference)||(e.endAngle=e.startAngle+e.circumference%_t),wo(t,e),t.fill()}(t,e),Mo(t,e),t.restore()}}}functionSo(t,e,i=e){t.lineCap=K(i.borderCapStyle,e.borderCapStyle),t.setLineDash(K(i.borderDash,e.borderDash)),t.lineDashOffset=K(i.borderDashOffset,e.borderDashOffset),t.lineJoin=K(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=K(i.borderWidth,e.borderWidth),t.strokeStyle=K(i.borderColor,e.borderColor)}functionPo(t,e,i){t.lineTo(i.x,i.y)}functionDo(t,e,i={}){constn=t.length,{start:o=0,end:s=n-1}=i,{start:a,end:r}=e,l=Math.max(o,a),c=Math.min(s,r),h=o<a&&s<a||o>r&&s>r;return{count:n,start:l,loop:e.loop,ilen:c<l&&!h?n+c-l:c-l}}functionCo(t,e,i,n){const{points:o,options:s}=e,{count:a,start:r,loop:l,ilen:c}=Do(o,i,n),h=function(t){returnt.stepped?Jt:t.tension||"monotone"===t.cubicInterpolationMode?te:Po}(s);letd,u,f,{move:g=!0,reverse:p}=n||{};for(d=0;d<=c;++d)u=o[(r+(p?c-d:d))%a],u.skip||(g?(t.moveTo(u.x,u.y),g=!1):h(t,f,u,p,s.stepped),f=u);returnl&&(u=o[(r+(p?c:0))%a],h(t,f,u,p,s.stepped)),!!l}functionOo(t,e,i,n){consto=e.points,{count:s,start:a,ilen:r}=Do(o,i,n),{move:l=!0,reverse:c}=n||{};leth,d,u,f,g,p,m=0,x=0;constb=t=>(a+(c?r-t:t))%s,_=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=o[b(0)],t.moveTo(d.x,d.y)),h=0;h<=r;++h){if(d=o[b(h)],d.skip)continue;conste=d.x,i=d.y,n=0|e;n===u?(i<f?f=i:i>g&&(g=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=n,x=0,f=g=i),p=i}_()}functionAo(t){conste=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Oo:Co}ko.id="arc",ko.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,angle:void0},ko.defaultRoutes={backgroundColor:"backgroundColor"};constTo="function"==typeofPath2D;functionRo(t,e,i,n){To&&1===e.segments.length?function(t,e,i,n){leto=e._path;o||(o=e._path=newPath2D,e.path(o,i,n)&&o.closePath()),So(t,e.options),t.stroke(o)}(t,e,i,n):function(t,e,i,n){const{segments:o,options:s}=e,a=Ao(e);for(constrofo)So(t,s,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}classLoextendsEi{constructor(t){super(),this.animated=!0,this.options=void0,this._loop=void0,this._fullLoop=void0,this._path=void0,this._points=void0,this._segments=void0,this._decimated=!1,this._pointsUpdated=!1,t&&Object.assign(this,t)}updateControlPoints(t){conste=this,i=e.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!e._pointsUpdated){constn=i.spanGaps?e._loop:e._fullLoop;fn(e._points,i,t,n),e._pointsUpdated=!0}}setpoints(t){conste=this;e._points=t,deletee._segments,deletee._path,e._pointsUpdated=!1}getpoints(){returnthis._points}getsegments(){returnthis._segments||(this._segments=kn(this,this.options.segment))}first(){constt=this.segments,e=this.points;returnt.length&&e[t[0].start]}last(){constt=this.segments,e=this.points,i=t.length;returni&&e[t[i-1].end]}interpolate(t,e){consti=this,n=i.options,o=t[e],s=i.points,a=Mn(i,{property:e,start:o,end:o});if(!a.length)return;constr=[],l=function(t){returnt.stepped?pn:t.tension||"monotone"===t.cubicInterpolationMode?mn:gn}(n);letc,h;for(c=0,h=a.length;c<h;++c){const{start:i,end:h}=a[c],d=s[i],u=s[h];if(d===u){r.push(d);continue}constf=l(d,u,Math.abs((o-d[e])/(u[e]-d[e])),n.stepped);f[e]=t[e],r.push(f)}return1===r.length?r[0]:r}pathSegment(t,e,i){returnAo(this)(t,this,e,i)}path(t,e,i){constn=this,o=n.segments,s=Ao(n);leta=n._loop;e=e||0,i=i||n.points.length-e;for(constrofo)a&=s(t,n,r,{start:e,end:e+i-1});return!!a}draw(t,e,i,n){consto=this,s=o.options||{};(o.points||[]).length&&s.borderWidth&&(t.save(),Ro(t,o,i,n),t.restore(),o.animated&&(o._pointsUpdated=!1,o._path=void0))}}functionEo(t,e,i,n){consto=t.options,{[i]:s}=t.getProps([i],n);returnMath.abs(e-s)<o.radius+o.hitRadius}Lo.id="line",Lo.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Lo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Lo.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};classIoextendsEi{constructor(t){super(),this.options=void0,this.parsed=void0,this.skip=void0,this.stop=void0,t&&Object.assign(this,t)}inRange(t,e,i){constn=this.options,{x:o,y:s}=this.getProps(["x","y"],i);returnMath.pow(t-o,2)+Math.pow(e-s,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){returnEo(this,t,"x",e)}inYRange(t,e){returnEo(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){lete=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return2*(e+(e&&t.borderWidth||0))}draw(t){conste=this,i=e.options;e.skip||i.radius<.1||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Kt(t,i,e.x,e.y))}getRange(){constt=this.options||{};returnt.radius+t.hitRadius}}functionzo(t,e){const{x:i,y:n,base:o,width:s,height:a}=t.getProps(["x","y","base","width","height"],e);letr,l,c,h,d;returnt.horizontal?(d=a/2,r=Math.min(i,o),l=Math.max(i,o),c=n-d,h=n+d):(d=s/2,r=i-d,l=i+d,c=Math.min(n,o),h=Math.max(n,o)),{left:r,top:c,right:l,bottom:h}}functionFo(t){lete=t.options.borderSkipped;consti={};returne?(e=t.horizontal?Vo(e,"left","right",t.base>t.x):Vo(e,"bottom","top",t.base<t.y),i[e]=!0,i):i}functionVo(t,e,i,n){varo,s,a;returnn?(a=i,t=Bo(t=(o=t)===(s=e)?a:o===a?s:o,i,e)):t=Bo(t,e,i),t}functionBo(t,e,i){return"start"===t?e:"end"===t?i:t}functionWo(t,e,i,n){returnt?0:Math.max(Math.min(e,n),i)}functionHo(t){conste=zo(t),i=e.right-e.left,n=e.bottom-e.top,o=function(t,e,i){constn=t.options.borderWidth,o=Fo(t),s=Ee(n);return{t:Wo(o.top,s.top,0,i),r:Wo(o.right,s.right,0,e),b:Wo(o.bottom,s.bottom,0,i),l:Wo(o.left,s.left,0,e)}}(t,i/2,n/2),s=function(t,e,i){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,s=Ie(o),a=Math.min(e,i),r=Fo(t),l=n||U(o);return{topLeft:Wo(!l||r.top||r.left,s.topLeft,0,a),topRight:Wo(!l||r.top||r.right,s.topRight,0,a),bottomLeft:Wo(!l||r.bottom||r.left,s.bottomLeft,0,a),bottomRight:Wo(!l||r.bottom||r.right,s.bottomRight,0,a)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:s},inner:{x:e.left+o.l,y:e.top+o.t,w:i-o.l-o.r,h:n-o.t-o.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,s.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(o.b,o.r))}}}}functionNo(t,e,i,n){consto=null===e,s=null===i,a=t&&!(o&&s)&&zo(t,n);returna&&(o||e>=a.left&&e<=a.right)&&(s||i>=a.top&&i<=a.bottom)}functionjo(t,e){t.rect(e.x,e.y,e.w,e.h)}Io.id="point",Io.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Io.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class$oextendsEi{constructor(t){super(),this.options=void0,this.horizontal=void0,this.base=void0,this.width=void0,this.height=void0,t&&Object.assign(this,t)}draw(t){conste=this.options,{inner:i,outer:n}=Ho(this),o=(s=n.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?ie:jo;vars;t.save(),n.w===i.w&&n.h===i.h||(t.beginPath(),o(t,n),t.clip(),o(t,i),t.fillStyle=e.borderColor,t.fill("evenodd")),t.beginPath(),o(t,i),t.fillStyle=e.backgroundColor,t.fill(),t.restore()}inRange(t,e,i){returnNo(this,t,e,i)}inXRange(t,e){returnNo(this,t,null,e)}inYRange(t,e){returnNo(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}$o.id="bar",$o.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void0},$o.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};varYo=Object.freeze({__proto__:null,ArcElement:ko,LineElement:Lo,PointElement:Io,BarElement:$o});functionUo(t){if(t._decimated){conste=t._data;deletet._decimated,deletet._data,Object.defineProperty(t,"data",{value:e})}}functionXo(t){t.data.datasets.forEach((t=>{Uo(t)}))}varqo={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)returnvoidXo(t);constn=t.width;t.data.datasets.forEach(((e,o)=>{const{_data:s,indexAxis:a}=e,r=t.getDatasetMeta(o),l=s||e.data;if("y"===Ve([a,t.options.indexAxis]))return;if("line"!==r.type)return;constc=t.scales[r.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;leth,{start:d,count:u}=function(t,e){consti=e.length;letn,o=0;const{iScale:s}=t,{min:a,max:r,minDefined:l,maxDefined:c}=s.getUserBounds();returnl&&(o=Nt(oe(e,s.axis,a).lo,0,i-1)),n=c?Nt(oe(e,s.axis,r).hi+1,o,i)-o:i-o,{start:o,count:n}}(r,l);if(u<=4*n)Uo(e);else{switch($(s)&&(e._data=l,deletee.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){returnthis._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":h=function(t,e,i,n,o){consts=o.samples||n;if(s>=i)returnt.slice(e,e+i);consta=[],r=(i-2)/(s-2);letl=0;constc=e+i-1;leth,d,u,f,g,p=e;for(a[l++]=t[p],h=0;h<s-2;h++){letn,o=0,s=0;constc=Math.floor((h+1)*r)+1+e,m=Math.min(Math.floor((h+2)*r)+1,i)+e,x=m-c;for(n=c;n<m;n++)o+=t[n].x,s+=t[n].y;o/=x,s/=x;constb=Math.floor(h*r)+1+e,_=Math.floor((h+1)*r)+1+e,{x:y,y:v}=t[p];for(u=f=-1,n=b;n<_;n++)f=.5*Math.abs((y-o)*(t[n].y-v)-(y-t[n].x)*(s-v)),f>u&&(u=f,d=t[n],g=n);a[l++]=d,p=g}returna[l++]=t[c],a}(l,d,u,n,i);break;case"min-max":h=function(t,e,i,n){leto,s,a,r,l,c,h,d,u,f,g=0,p=0;constm=[],x=e+i-1,b=t[e].x,_=t[x].x-b;for(o=e;o<e+i;++o){s=t[o],a=(s.x-b)/_*n,r=s.y;conste=0|a;if(e===l)r<u?(u=r,c=o):r>f&&(f=r,h=o),g=(p*g+s.x)/++p;else{consti=o-1;if(!$(c)&&!$(h)){conste=Math.min(c,h),n=Math.max(c,h);e!==d&&e!==i&&m.push({...t[e],x:g}),n!==d&&n!==i&&m.push({...t[n],x:g})}o>0&&i!==d&&m.push(t[i]),m.push(s),l=e,p=0,u=f=r,c=h=d=o}}returnm}(l,d,u,n);break;default:thrownewError(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=h}}))},destroy(t){Xo(t)}};functionKo(t,e,i){constn=function(t){conste=t.options,i=e.fill;letn=K(i&&i.target,i);returnvoid0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if(U(n))return!isNaN(n.value)&&n;leto=parseFloat(n);returnX(o)&&Math.floor(o)===o?("-"!==n[0]&&"+"!==n[0]||(o=e+o),!(o===e||o<0||o>=i)&&o):["origin","start","end","stack"].indexOf(n)>=0&&n}classGo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:s}=this;returne=e||{start:0,end:_t},t.arc(n,o,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:i+Math.sin(o)*n,angle:o}}}functionZo(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,n=e.options,o=e.getLabels().length,s=[],a=n.reverse?e.max:e.min,r=n.reverse?e.min:e.max;letl,c,h;if(h="start"===i?a:"end"===i?r:U(i)?i.value:e.getBaseValue(),n.grid.circular)returnc=e.getPointPositionForValue(0,a),newGo({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(h)});for(l=0;l<o;++l)s.push(e.getPointPositionForValue(l,h));returns}(t):function(t){const{scale:e={},fill:i}=t;letn,o=null;return"start"===i?o=e.bottom:"end"===i?o=e.top:U(i)?o=e.getPixelForValue(i.value):e.getBasePixel&&(o=e.getBasePixel()),X(o)?(n=e.isHorizontal(),{x:n?o:null,y:n?null:o}):null}(t)}functionQo(t){const{chart:e,scale:i,index:n,line:o}=t,s=[],a=o.segments,r=o.points,l=function(t,e){consti=[],n=t.getSortedVisibleDatasetMetas();for(lett=0;t<n.length;t++){consto=n[t];if(o.index===e)break;Jo(o)&&i.unshift(o.dataset)}returni}(e,n);l.push(is({x:null,y:i.bottom},o));for(lett=0;t<a.length;t++){conste=a[t];for(lett=e.start;t<=e.end;t++)ts(s,r[t],l)}returnnewLo({points:s,options:{}})}constJo=t=>"line"===t.type&&!t.hidden;functionts(t,e,i){constn=[];for(leto=0;o<i.length;o++){consts=i[o],{first:a,last:r,point:l}=es(s,e,"x");if(!(!l||a&&r))if(a)n.unshift(l);elseif(t.push(l),!r)break}t.push(...n)}functiones(t,e,i){constn=t.interpolate(e,i);if(!n)return{};consto=n[i],s=t.segments,a=t.points;letr=!1,l=!1;for(lett=0;t<s.length;t++){conste=s[t],n=a[e.start][i],c=a[e.end][i];if(o>=n&&o<=c){r=o===n,l=o===c;break}}return{first:r,last:l,point:n}}functionis(t,e){leti=[],n=!1;returnY(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},o=e.points,s=[];returne.segments.forEach((t=>{conste=o[t.start],a=o[t.end];null!==n?(s.push({x:e.x,y:n}),s.push({x:a.x,y:n})):null!==i&&(s.push({x:i,y:e.y}),s.push({x:i,y:a.y}))})),s}(t,e),i.length?newLo({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}functionns(t,e,i){letn=t[e].fill;consto=[e];lets;if(!i)returnn;for(;!1!==n&&-1===o.indexOf(n);){if(!X(n))returnn;if(s=t[n],!s)return!1;if(s.visible)returnn;o.push(n),n=s.fill}return!1}functionos(t,e,i){t.beginPath(),e.path(t),t.lineTo(e.last().x,i),t.lineTo(e.first().x,i),t.closePath(),t.clip()}functionss(t,e,i,n){if(n)return;leto=e[t],s=i[t];return"angle"===t&&(o=Wt(o),s=Wt(s)),{property:t,start:o,end:s}}functionas(t,e,i,n){returnt&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}functionrs(t,e,i){const{top:n,bottom:o}=e.chart.chartArea,{property:s,start:a,end:r}=i||{};"x"===s&&(t.beginPath(),t.rect(a,n,r-a,o-n),t.clip())}functionls(t,e,i,n){consto=e.interpolate(i,n);o&&t.lineTo(o.x,o.y)}functioncs(t,e){const{line:i,target:n,property:o,color:s,scale:a}=e,r=function(t,e,i){constn=t.segments,o=t.points,s=e.points,a=[];for(consttofn){constn=ss(i,o[t.start],o[t.end],t.loop);if(!e.segments){a.push({source:t,target:n,start:o[t.start],end:o[t.end]});continue}constr=Mn(e,n);for(consteofr){constr=ss(i,s[e.start],s[e.end],e.loop),l=wn(t,o,r);for(consttofl)a.push({source:t,target:e,start:{[i]:as(n,r,"start",Math.max)},end:{[i]:as(n,r,"end",Math.min)}})}}returna}(i,n,o);for(const{source:e,target:l,start:c,end:h}ofr){const{style:{backgroundColor:r=s}={}}=e;t.save(),t.fillStyle=r,rs(t,a,ss(o,c,h)),t.beginPath();constd=!!i.pathSegment(t,e);d?t.closePath():ls(t,n,h,o);constu=!!n.pathSegment(t,l,{move:d,reverse:!0}),f=d&&u;f||ls(t,n,c,o),t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}functionhs(t,e,i){constn=function(t){const{chart:e,fill:i,line:n}=t;if(X(i))returnfunction(t,e){consti=t.getDatasetMeta(e);returni&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)returnQo(t);consto=Zo(t);returnoinstanceofGo?o:is(o,n)}(e),{line:o,scale:s,axis:a}=e,r=o.options,l=r.fill,c=r.backgroundColor,{above:h=c,below:d=c}=l||{};n&&o.points.length&&(Zt(t,i),function(t,e){const{line:i,target:n,above:o,below:s,area:a,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==o&&(os(t,n,a.top),cs(t,{line:i,target:n,color:o,scale:r,property:l}),t.restore(),t.save(),os(t,n,a.bottom)),cs(t,{line:i,target:n,color:s,scale:r,property:l}),t.restore()}(t,{line:o,target:n,above:h,below:d,area:i,scale:s,axis:a}),Qt(t))}vards={id:"filler",afterDatasetsUpdate(t,e,i){constn=(t.data.datasets||[]).length,o=[];lets,a,r,l;for(a=0;a<n;++a)s=t.getDatasetMeta(a),r=s.dataset,l=null,r&&r.options&&rinstanceofLo&&(l={visible:t.isDatasetVisible(a),index:a,fill:Ko(r,a,n),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:r}),s.$filler=l,o.push(l);for(a=0;a<n;++a)l=o[a],l&&!1!==l.fill&&(l.fill=ns(o,a,i.propagate))},beforeDraw(t,e,i){constn="beforeDraw"===i.drawTime,o=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(lete=o.length-1;e>=0;--e){consti=o[e].$filler;i&&(i.line.updateControlPoints(s),n&&hs(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;constn=t.getSortedVisibleDatasetMetas();for(lete=n.length-1;e>=0;--e){consti=n[e].$filler;i&&hs(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){constn=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&hs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};constus=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;returnt.usePointStyle&&(i=Math.min(i,e),n=Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};classfsextendsEi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void0,this.columnSizes=void0,this.lineWidths=void0,this.maxHeight=void0,this.maxWidth=void0,this.top=void0,this.bottom=void0,this.left=void0,this.right=void0,this.height=void0,this.width=void0,this._margins=void0,this.position=void0,this.weight=void0,this.fullSize=void0}update(t,e,i){constn=this;n.maxWidth=t,n.maxHeight=e,n._margins=i,n.setDimensions(),n.buildLabels(),n.fit()}setDimensions(){constt=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height)}buildLabels(){constt=this,e=t.options.labels||{};leti=Q(e.generateLabels,[t.chart],t)||[];e.filter&&(i=i.filter((i=>e.filter(i,t.chart.data)))),e.sort&&(i=i.sort(((i,n)=>e.sort(i,n,t.chart.data)))),t.options.reverse&&i.reverse(),t.legendItems=i}fit(){constt=this,{options:e,ctx:i}=t;if(!e.display)returnvoid(t.width=t.height=0);constn=e.labels,o=Fe(n.font),s=o.size,a=t._computeTitleHeight(),{boxWidth:r,itemHeight:l}=us(n,s);letc,h;i.font=o.string,t.isHorizontal()?(c=t.maxWidth,h=t._fitRows(a,s,r,l)+10):(h=t.maxHeight,c=t._fitCols(a,s,r,l)+10),t.width=Math.min(c,e.maxWidth||t.maxWidth),t.height=Math.min(h,e.maxHeight||t.maxHeight)}_fitRows(t,e,i,n){consto=this,{ctx:s,maxWidth:a,options:{labels:{padding:r}}}=o,l=o.legendHitBoxes=[],c=o.lineWidths=[0],h=n+r;letd=t;s.textAlign="left",s.textBaseline="middle";letu=-1,f=-h;returno.legendItems.forEach(((t,o)=>{constg=i+e/2+s.measureText(t.text).width;(0===o||c[c.length-1]+g+2*r>a)&&(d+=h,c[c.length-(o>0?0:1)]=0,f+=h,u++),l[o]={left:0,top:f,row:u,width:g,height:n},c[c.length-1]+=g+r})),d}_fitCols(t,e,i,n){consto=this,{ctx:s,maxHeight:a,options:{labels:{padding:r}}}=o,l=o.legendHitBoxes=[],c=o.columnSizes=[],h=a-t;letd=r,u=0,f=0,g=0,p=0,m=0;returno.legendItems.forEach(((t,o)=>{consta=i+e/2+s.measureText(t.text).width;o>0&&f+e+2*r>h&&(d+=u+r,c.push({width:u,height:f}),g+=u+r,m++,p=0,u=f=0),u=Math.max(u,a),f+=e+r,l[o]={left:g,top:p,col:m,width:a,height:n},p+=n+r})),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){constt=this;if(!t.options.display)return;conste=t._computeTitleHeight(),{legendHitBoxes:i,options:{align:n,labels:{padding:s}}}=t;if(this.isHorizontal()){leta=0,r=o(n,t.left+s,t.right-t.lineWidths[a]);for(constlofi)a!==l.row&&(a=l.row,r=o(n,t.left+s,t.right-t.lineWidths[a])),l.top+=t.top+e+s,l.left=r,r+=l.width+s}else{leta=0,r=o(n,t.top+e+s,t.bottom-t.columnSizes[a].height);for(constlofi)l.col!==a&&(a=l.col,r=o(n,t.top+e+s,t.bottom-t.columnSizes[a].height)),l.top=r,l.left+=t.left+s,r+=l.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){constt=this;if(t.options.display){conste=t.ctx;Zt(e,t),t._draw(),Qt(e)}}_draw(){constt=this,{options:e,columnSizes:i,lineWidths:n,ctx:a}=t,{align:r,labels:l}=e,c=xt.color,h=xn(e.rtl,t.left,t.width),d=Fe(l.font),{color:u,padding:f}=l,g=d.size,p=g/2;letm;t.drawTitle(),a.textAlign=h.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:x,boxHeight:b,itemHeight:_}=us(l,g),y=t.isHorizontal(),v=this._computeTitleHeight();m=y?{x:o(r,t.left+f,t.right-n[0]),y:t.top+f+v,line:0}:{x:t.left+f,y:o(r,t.top+v+f,t.bottom-i[0].height),line:0},bn(t.ctx,e.textDirection);constw=_+f;t.legendItems.forEach(((e,M)=>{a.strokeStyle=e.fontColor||u,a.fillStyle=e.fontColor||u;constk=a.measureText(e.text).width,S=h.textAlign(e.textAlign||(e.textAlign=l.textAlign)),P=x+g/2+k;letD=m.x,C=m.y;h.setWidth(t.width),y?M>0&&D+P+f>t.right&&(C=m.y+=w,m.line++,D=m.x=o(r,t.left+f,t.right-n[m.line])):M>0&&C+w>t.bottom&&(D=m.x=D+i[m.line].width+f,m.line++,C=m.y=o(r,t.top+v+f,t.bottom-i[m.line].height));!function(t,e,i){if(isNaN(x)||x<=0||isNaN(b)||b<0)return;a.save();constn=K(i.lineWidth,1);if(a.fillStyle=K(i.fillStyle,c),a.lineCap=K(i.lineCap,"butt"),a.lineDashOffset=K(i.lineDashOffset,0),a.lineJoin=K(i.lineJoin,"miter"),a.lineWidth=n,a.strokeStyle=K(i.strokeStyle,c),a.setLineDash(K(i.lineDash,[])),l.usePointStyle){consto={radius:x*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},s=h.xPlus(t,x/2);Kt(a,o,s,e+p)}else{consto=e+Math.max((g-b)/2,0),s=h.leftForLtr(t,x),r=Ie(i.borderRadius);a.beginPath(),Object.values(r).some((t=>0!==t))?ie(a,{x:s,y:o,w:x,h:b,radius:r}):a.rect(s,o,x,b),a.fill(),0!==n&&a.stroke()}a.restore()}(h.x(D),C,e),D=s(S,D+x+p,t.right),function(t,e,i){ee(a,i.text,t,e+_/2,d,{strikethrough:i.hidden,textAlign:i.textAlign})}(h.x(D),C,e),y?m.x+=P+f:m.y+=w})),_n(t.ctx,e.textDirection)}drawTitle(){constt=this,e=t.options,i=e.title,s=Fe(i.font),a=ze(i.padding);if(!i.display)return;constr=xn(e.rtl,t.left,t.width),l=t.ctx,c=i.position,h=s.size/2,d=a.top+h;letu,f=t.left,g=t.width;if(this.isHorizontal())g=Math.max(...t.lineWidths),u=t.top+d,f=o(e.align,f,t.right-g);else{consti=t.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);u=d+o(e.align,t.top,t.bottom-i-e.labels.padding-t._computeTitleHeight())}constp=o(c,f,f+g);l.textAlign=r.textAlign(n(c)),l.textBaseline="middle",l.strokeStyle=i.color,l.fillStyle=i.color,l.font=s.string,ee(l,i.text,p,u,s)}_computeTitleHeight(){constt=this.options.title,e=Fe(t.font),i=ze(t.padding);returnt.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){consti=this;letn,o,s;if(t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom)for(s=i.legendHitBoxes,n=0;n<s.length;++n)if(o=s[n],t>=o.left&&t<=o.left+o.width&&e>=o.top&&e<=o.top+o.height)returni.legendItems[n];returnnull}handleEvent(t){conste=this,i=e.options;if(!function(t,e){if("mousemove"===t&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,i))return;constn=e._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){consta=e._hoveredItem,r=(s=n,null!==(o=a)&&null!==s&&o.datasetIndex===s.datasetIndex&&o.index===s.index);a&&!r&&Q(i.onLeave,[t,a,e],e),e._hoveredItem=n,n&&!r&&Q(i.onHover,[t,n,e],e)}elsen&&Q(i.onClick,[t,n,e],e);varo,s}}vargs={id:"legend",_element:fs,start(t,e,i){constn=t.legend=newfs({ctx:t.ctx,options:i,chart:t});Ge.configure(t,n,i),Ge.addBox(t,n)},stop(t){Ge.removeBox(t,t.legend),deletet.legend},beforeUpdate(t,e,i){constn=t.legend;Ge.configure(t,n,i),n.options=i},afterUpdate(t){conste=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){constn=e.datasetIndex,o=i.chart;o.isDatasetVisible(n)?(o.hide(n),e.hidden=!0):(o.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){conste=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:o,color:s}}=t.legend.options;returnt._getSortedDatasetMetas().map((t=>{consta=t.controller.getStyle(i?0:void0),r=ze(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(r.width+r.height)/4,strokeStyle:a.borderColor,pointStyle:n||a.pointStyle,rotation:a.rotation,textAlign:o||a.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};classpsextendsEi{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void0,this.top=void0,this.bottom=void0,this.left=void0,this.right=void0,this.width=void0,this.height=void0,this.position=void0,this.weight=void0,this.fullSize=void0}update(t,e){consti=this,n=i.options;if(i.left=0,i.top=0,!n.display)returnvoid(i.width=i.height=i.right=i.bottom=0);i.width=i.right=t,i.height=i.bottom=e;consto=Y(n.text)?n.text.length:1;i._padding=ze(n.padding);consts=o*Fe(n.font).lineHeight+i._padding.height;i.isHorizontal()?i.height=s:i.width=s}isHorizontal(){constt=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:s,options:a}=this,r=a.align;letl,c,h,d=0;returnthis.isHorizontal()?(c=o(r,i,s),h=e+t,l=s-i):("left"===a.position?(c=i+t,h=o(r,n,e),d=-.5*bt):(c=s-t,h=o(r,e,n),d=.5*bt),l=n-e),{titleX:c,titleY:h,maxWidth:l,rotation:d}}draw(){constt=this,e=t.ctx,i=t.options;if(!i.display)return;consto=Fe(i.font),s=o.lineHeight/2+t._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=t._drawArgs(s);ee(e,i.text,0,0,o,{color:i.color,maxWidth:l,rotation:c,textAlign:n(i.align),textBaseline:"middle",translation:[a,r]})}}varms={id:"title",_element:ps,start(t,e,i){!function(t,e){consti=newps({ctx:t.ctx,options:e,chart:t});Ge.configure(t,i,e),Ge.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){conste=t.titleBlock;Ge.removeBox(t,e),deletet.titleBlock},beforeUpdate(t,e,i){constn=t.titleBlock;Ge.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};constxs={average(t){if(!t.length)return!1;lete,i,n=0,o=0,s=0;for(e=0,i=t.length;e<i;++e){consti=t[e].element;if(i&&i.hasValue()){constt=i.tooltipPosition();n+=t.x,o+=t.y,++s}}return{x:n/s,y:o/s}},nearest(t,e){if(!t.length)return!1;leti,n,o,s=e.x,a=e.y,r=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){constn=t[i].element;if(n&&n.hasValue()){constt=Vt(e,n.getCenterPoint());t<r&&(r=t,o=n)}}if(o){constt=o.tooltipPosition();s=t.x,a=t.y}return{x:s,y:a}}};functionbs(t,e){returne&&(Y(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function_s(t){return("string"==typeoft||tinstanceofString)&&t.indexOf("\n")>-1?t.split("\n"):t}functionys(t,e){const{element:i,datasetIndex:n,index:o}=e,s=t.getDatasetMeta(n).controller,{label:a,value:r}=s.getLabelAndValue(o);return{chart:t,label:a,parsed:s.getParsed(o),raw:t.data.datasets[n].data[o],formattedValue:r,dataset:s.getDataset(),dataIndex:o,datasetIndex:n,element:i}}functionvs(t,e){consti=t._chart.ctx,{body:n,footer:o,title:s}=t,{boxWidth:a,boxHeight:r}=e,l=Fe(e.bodyFont),c=Fe(e.titleFont),h=Fe(e.footerFont),d=s.length,u=o.length,f=n.length,g=ze(e.padding);letp=g.height,m=0,x=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(x+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x){p+=f*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(x-f)*l.lineHeight+(x-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);letb=0;const_=function(t){m=Math.max(m,i.measureText(t).width+b)};returni.save(),i.font=c.string,J(t.title,_),i.font=l.string,J(t.beforeBody.concat(t.afterBody),_),b=e.displayColors?a+2:0,J(n,(t=>{J(t.before,_),J(t.lines,_),J(t.after,_)})),b=0,i.font=h.string,J(t.footer,_),i.restore(),m+=g.width,{width:m,height:p}}functionws(t,e,i,n){const{x:o,width:s}=i,{width:a,chartArea:{left:r,right:l}}=t;letc="center";return"center"===n?c=o<=(r+l)/2?"left":"right":o<=s/2?c="left":o>=a-s/2&&(c="right"),function(t,e,i,n){const{x:o,width:s}=n,a=i.caretSize+i.caretPadding;return"left"===t&&o+s+a>e.width||"right"===t&&o-s-a<0||void0}(c,t,e,i)&&(c="center"),c}functionMs(t,e,i){constn=e.yAlign||function(t,e){const{y:i,height:n}=e;returni<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:e.xAlign||ws(t,e,i,n),yAlign:n}}functionks(t,e,i,n){const{caretSize:o,caretPadding:s,cornerRadius:a}=t,{xAlign:r,yAlign:l}=i,c=o+s,h=a+s;letd=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,r);constu=function(t,e,i){let{y:n,height:o}=t;return"top"===e?n+=i:n-="bottom"===e?o+i:o/2,n}(e,l,c);return"center"===l?"left"===r?d+=c:"right"===r&&(d-=c):"left"===r?d-=h:"right"===r&&(d+=h),{x:Nt(d,0,n.width-e.width),y:Nt(u,0,n.height-e.height)}}functionSs(t,e,i){constn=ze(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}functionPs(t){returnbs([],_s(t))}functionDs(t,e){consti=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;returni?t.override(i):t}classCsextendsEi{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void0,this._size=void0,this._cachedAnimations=void0,this._tooltipItems=[],this.$animations=void0,this.$context=void0,this.options=t.options,this.dataPoints=void0,this.title=void0,this.beforeBody=void0,this.body=void0,this.afterBody=void0,this.footer=void0,this.xAlign=void0,this.yAlign=void0,this.x=void0,this.y=void0,this.height=void0,this.width=void0,this.caretX=void0,this.caretY=void0,this.labelColors=void0,this.labelPointStyles=void0,this.labelTextColors=void0}initialize(t){this.options=t,this._cachedAnimations=void0,this.$context=void0}_resolveAnimations(){constt=this,e=t._cachedAnimations;if(e)returne;consti=t._chart,n=t.options.setContext(t.getContext()),o=n.enabled&&i.options.animation&&n.animations,s=newvi(t._chart,o);returno._cacheable&&(t._cachedAnimations=Object.freeze(s)),s}getContext(){constt=this;returnt.$context||(t.$context=(e=t._chart.getContext(),i=t,n=t._tooltipItems,Object.assign(Object.create(e),{tooltip:i,tooltipItems:n,type:"tooltip"})));vare,i,n}getTitle(t,e){consti=this,{callbacks:n}=e,o=n.beforeTitle.apply(i,[t]),s=n.title.apply(i,[t]),a=n.afterTitle.apply(i,[t]);letr=[];returnr=bs(r,_s(o)),r=bs(r,_s(s)),r=bs(r,_s(a)),r}getBeforeBody(t,e){returnPs(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){consti=this,{callbacks:n}=e,o=[];returnJ(t,(t=>{conste={before:[],lines:[],after:[]},s=Ds(n,t);bs(e.before,_s(s.beforeLabel.call(i,t))),bs(e.lines,s.label.call(i,t)),bs(e.after,_s(s.afterLabel.call(i,t))),o.push(e)})),o}getAfterBody(t,e){returnPs(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){consti=this,{callbacks:n}=e,o=n.beforeFooter.apply(i,[t]),s=n.footer.apply(i,[t]),a=n.afterFooter.apply(i,[t]);letr=[];returnr=bs(r,_s(o)),r=bs(r,_s(s)),r=bs(r,_s(a)),r}_createItems(t){conste=this,i=e._active,n=e._chart.data,o=[],s=[],a=[];letr,l,c=[];for(r=0,l=i.length;r<l;++r)c.push(ys(e._chart,i[r]));returnt.filter&&(c=c.filter(((e,i,o)=>t.filter(e,i,o,n)))),t.itemSort&&(c=c.sort(((e,i)=>t.itemSort(e,i,n)))),J(c,(i=>{constn=Ds(t.callbacks,i);o.push(n.labelColor.call(e,i)),s.push(n.labelPointStyle.call(e,i)),a.push(n.labelTextColor.call(e,i))})),e.labelColors=o,e.labelPointStyles=s,e.labelTextColors=a,e.dataPoints=c,c}update(t,e){consti=this,n=i.options.setContext(i.getContext()),o=i._active;lets,a=[];if(o.length){constt=xs[n.position].call(i,o,i._eventPosition);a=i._createItems(n),i.title=i.getTitle(a,n),i.beforeBody=i.getBeforeBody(a,n),i.body=i.getBody(a,n),i.afterBody=i.getAfterBody(a,n),i.footer=i.getFooter(a,n);conste=i._size=vs(i,n),r=Object.assign({},t,e),l=Ms(i._chart,n,r),c=ks(n,r,l,i._chart);i.xAlign=l.xAlign,i.yAlign=l.yAlign,s={opacity:1,x:c.x,y:c.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else0!==i.opacity&&(s={opacity:0});i._tooltipItems=a,i.$context=void0,s&&i._resolveAnimations().update(i,s),t&&n.external&&n.external.call(i,{chart:i._chart,tooltip:i,replay:e})}drawCaret(t,e,i,n){consto=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{cornerRadius:s,caretSize:a}=i,{x:r,y:l}=t,{width:c,height:h}=e;letd,u,f,g,p,m;return"center"===o?(p=l+h/2,"left"===n?(d=r,u=d-a,g=p+a,m=p-a):(d=r+c,u=d+a,g=p-a,m=p+a),f=d):(u="left"===n?r+s+a:"right"===n?r+c-s-a:this.caretX,"top"===o?(g=l,p=g-a,d=u-a,f=u+a):(g=l+h,p=g+a,d=u+a,f=u-a),m=g),{x1:d,x2:u,x3:f,y1:g,y2:p,y3:m}}drawTitle(t,e,i){constn=this,o=n.title,s=o.length;leta,r,l;if(s){constc=xn(i.rtl,n.x,n.width);for(t.x=Ss(n,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=Fe(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<s;++l)e.fillText(o[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===s&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,n,o){consts=this,a=s.labelColors[i],r=s.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,h=Fe(o.bodyFont),d=Ss(s,"left",o),u=n.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,g=e.y+f;if(o.usePointStyle){conste={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=n.leftForLtr(u,c)+c/2,s=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Kt(t,e,i,s),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Kt(t,e,i,s)}else{t.lineWidth=a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;conste=n.leftForLtr(u,c),i=n.leftForLtr(n.xPlus(u,1),c-2),s=Ie(a.borderRadius);Object.values(s).some((t=>0!==t))?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ie(t,{x:e,y:g,w:c,h:l,radius:s}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ie(t,{x:i,y:g+1,w:c-2,h:l-2,radius:s}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,g,c,l),t.strokeRect(e,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(i,g+1,c-2,l-2))}t.fillStyle=s.labelTextColors[i]}drawBody(t,e,i){constn=this,{body:o}=n,{bodySpacing:s,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c}=i,h=Fe(i.bodyFont);letd=h.lineHeight,u=0;constf=xn(i.rtl,n.x,n.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},p=f.textAlign(a);letm,x,b,_,y,v,w;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Ss(n,p,i),e.fillStyle=i.bodyColor,J(n.beforeBody,g),u=r&&"right"!==p?"center"===a?c/2+1:c+2:0,_=0,v=o.length;_<v;++_){for(m=o[_],x=n.labelTextColors[_],e.fillStyle=x,J(m.before,g),b=m.lines,r&&b.length&&(n._drawColorBox(e,t,_,f,i),d=Math.max(h.lineHeight,l)),y=0,w=b.length;y<w;++y)g(b[y]),d=h.lineHeight;J(m.after,g)}u=0,d=h.lineHeight,J(n.afterBody,g),t.y-=s}drawFooter(t,e,i){constn=this,o=n.footer,s=o.length;leta,r;if(s){constl=xn(i.rtl,n.x,n.width);for(t.x=Ss(n,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=Fe(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<s;++r)e.fillText(o[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:s}=this,{x:a,y:r}=t,{width:l,height:c}=i,h=n.cornerRadius;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+h,r),"top"===s&&this.drawCaret(t,e,i,n),e.lineTo(a+l-h,r),e.quadraticCurveTo(a+l,r,a+l,r+h),"center"===s&&"right"===o&&this.drawCaret(t,e,i,n),e.lineTo(a+l,r+c-h),e.quadraticCurveTo(a+l,r+c,a+l-h,r+c),"bottom"===s&&this.drawCaret(t,e,i,n),e.lineTo(a+h,r+c),e.quadraticCurveTo(a,r+c,a,r+c-h),"center"===s&&"left"===o&&this.drawCaret(t,e,i,n),e.lineTo(a,r+h),e.quadraticCurveTo(a,r,a+h,r),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){conste=this,i=e._chart,n=e.$animations,o=n&&n.x,s=n&&n.y;if(o||s){constn=xs[t.position].call(e,e._active,e._eventPosition);if(!n)return;consta=e._size=vs(e,t),r=Object.assign({},n,e._size),l=Ms(i,t,r),c=ks(t,r,l,i);o._to===c.x&&s._to===c.y||(e.xAlign=l.xAlign,e.yAlign=l.yAlign,e.width=a.width,e.height=a.height,e.caretX=n.x,e.caretY=n.y,e._resolveAnimations().update(e,c))}}draw(t){conste=this,i=e.options.setContext(e.getContext());letn=e.opacity;if(!n)return;e._updateAnimationTarget(i);consto={width:e.width,height:e.height},s={x:e.x,y:e.y};n=Math.abs(n)<.001?0:n;consta=ze(i.padding),r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;i.enabled&&r&&(t.save(),t.globalAlpha=n,e.drawBackground(s,t,o,i),bn(t,i.textDirection),s.y+=a.top,e.drawTitle(s,t,i),e.drawBody(s,t,i),e.drawFooter(s,t,i),_n(t,i.textDirection),t.restore())}getActiveElements(){returnthis._active||[]}setActiveElements(t,e){consti=this,n=i._active,o=t.map((({datasetIndex:t,index:e})=>{constn=i._chart.getDatasetMeta(t);if(!n)thrownewError("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}})),s=!tt(n,o),a=i._positionChanged(o,e);(s||a)&&(i._active=o,i._eventPosition=e,i.update(!0))}handleEvent(t,e){consti=this,n=i.options,o=i._active||[];lets=!1,a=[];"mouseout"!==t.type&&(a=i._chart.getElementsAtEventForMode(t,n.mode,n,e),n.reverse&&a.reverse());constr=i._positionChanged(a,t);returns=e||!tt(a,o)||r,s&&(i._active=a,(n.enabled||n.external)&&(i._eventPosition={x:t.x,y:t.y},i.update(!0,e))),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,s=xs[o.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}Cs.positioners=xs;varOs={id:"tooltip",_element:Cs,positioners:xs,afterInit(t,e,i){i&&(t.tooltip=newCs({_chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){conste=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){consti=e.replay;t.tooltip.handleEvent(e.event,i)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:N,title(t){if(t.length>0){conste=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)returne.dataset.label||"";if(e.label)returne.label;if(n>0&&e.dataIndex<n)returni[e.dataIndex]}return""},afterTitle:N,beforeBody:N,beforeLabel:N,label(t){if(this&&this.options&&"dataset"===this.options.mode)returnt.label+": "+t.formattedValue||t.formattedValue;lete=t.dataset.label||"";e&&(e+=": ");consti=t.formattedValue;return$(i)||(e+=i),e},labelColor(t){conste=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){returnthis.options.bodyColor},labelPointStyle(t){conste=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:N,afterBody:N,beforeFooter:N,footer:N,afterFooter:N}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},As=Object.freeze({__proto__:null,Decimation:qo,Filler:ds,Legend:gs,Title:ms,Tooltip:Os});functionTs(t,e,i){constn=t.indexOf(e);if(-1===n)return((t,e,i)=>"string"==typeofe?t.push(e)-1:isNaN(e)?null:i)(t,e,i);returnn!==t.lastIndexOf(e)?i:n}classRsextendsXi{constructor(t){super(t),this._startValue=void0,this._valueRange=0}parse(t,e){if($(t))returnnull;consti=this.getLabels();return((t,e)=>null===t?null:Nt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Ts(i,t,K(e,t)),i.length-1)}determineDataLimits(){constt=this,{minDefined:e,maxDefined:i}=t.getUserBounds();let{min:n,max:o}=t.getMinMax(!0);"ticks"===t.options.bounds&&(e||(n=0),i||(o=t.getLabels().length-1)),t.min=n,t.max=o}buildTicks(){constt=this,e=t.min,i=t.max,n=t.options.offset,o=[];lets=t.getLabels();s=0===e&&i===s.length-1?s:s.slice(e,i+1),t._valueRange=Math.max(s.length-(n?0:1),1),t._startValue=t.min-(n?.5:0);for(lett=e;t<=i;t++)o.push({value:t});returno}getLabelForValue(t){conste=this.getLabels();returnt>=0&&t<e.length?e[t]:t}configure(){constt=this;super.configure(),t.isHorizontal()||(t._reversePixels=!t._reversePixels)}getPixelForValue(t){conste=this;return"number"!=typeoft&&(t=e.parse(t)),null===t?NaN:e.getPixelForDecimal((t-e._startValue)/e._valueRange)}getPixelForTick(t){conste=this.ticks;returnt<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){conste=this;returnMath.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange)}getBasePixel(){returnthis.bottom}}Rs.id="category",Rs.defaults={ticks:{callback:Rs.prototype.getLabelForValue}};classLsextendsXi{constructor(t){super(t),this.start=void0,this.end=void0,this._startValue=void0,this._endValue=void0,this._valueRange=0}parse(t,e){return$(t)||("number"==typeoft||tinstanceofNumber)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){constt=this,{beginAtZero:e,stacked:i}=t.options,{minDefined:n,maxDefined:o}=t.getUserBounds();let{min:s,max:a}=t;constr=t=>s=n?s:t,l=t=>a=o?a:t;if(e||i){constt=Dt(s),e=Dt(a);t<0&&e<0?l(0):t>0&&e>0&&r(0)}s===a&&(l(a+1),e||r(s-1)),t.min=s,t.max=a}getTickLimit(){constt=this,e=t.options.ticks;leti,{maxTicksLimit:n,stepSize:o}=e;returno?i=Math.ceil(t.max/o)-Math.floor(t.min/o)+1:(i=t.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){returnNumber.POSITIVE_INFINITY}buildTicks(){constt=this,e=t.options,i=e.ticks;letn=t.getTickLimit();n=Math.max(2,n);consto=function(t,e){consti=[],{step:n,min:o,max:s,precision:a,count:r,maxTicks:l,maxDigits:c,horizontal:h}=t,d=n||1,u=l-1,{min:f,max:g}=e,p=!$(o),m=!$(s),x=!$(r),b=(g-f)/c;let_,y,v,w,M=Ct((g-f)/u/d)*d;if(M<1e-14&&!p&&!m)return[{value:f},{value:g}];w=Math.ceil(g/M)-Math.floor(f/M),w>u&&(M=Ct(w*M/u/d)*d),$(a)||(_=Math.pow(10,a),M=Math.ceil(M*_)/_),y=Math.floor(f/M)*M,v=Math.ceil(g/M)*M,p&&m&&n&&Rt((s-o)/n,M/1e3)?(w=Math.min((s-o)/M,l),M=(s-o)/w,y=o,v=s):x?(y=p?o:y,v=m?s:v,w=r-1,M=(v-y)/w):(w=(v-y)/M,w=Tt(w,Math.round(w),M/1e3)?Math.round(w):Math.ceil(w)),_=Math.pow(10,$(a)?zt(M):a),y=Math.round(y*_)/_,v=Math.round(v*_)/_;letk=0;for(p&&(i.push({value:o}),y<=o&&k++,Tt(Math.round((y+k*M)*_)/_,o,b*(h?(""+o).length:1))&&k++);k<w;++k)i.push({value:Math.round((y+k*M)*_)/_});returnm?Tt(i[i.length-1].value,s,b*(h?(""+s).length:1))?i[i.length-1].value=s:i.push({value:s}):i.push({value:v}),i}({maxTicks:n,min:e.min,max:e.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:t._maxDigits(),horizontal:t.isHorizontal()},t._range||t);return"ticks"===e.bounds&&Lt(o,t,"value"),e.reverse?(o.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),o}configure(){constt=this,e=t.ticks;leti=t.min,n=t.max;if(super.configure(),t.options.offset&&e.length){constt=(n-i)/Math.max(e.length-1,1)/2;i-=t,n+=t}t._startValue=i,t._endValue=n,t._valueRange=n-i}getLabelForValue(t){returnzi(t,this.chart.options.locale)}}classEsextendsLs{determineDataLimits(){constt=this,{min:e,max:i}=t.getMinMax(!0);t.min=X(e)?e:0,t.max=X(i)?i:1,t.handleTickRangeOptions()}computeTickLimit(){constt=this;if(t.isHorizontal())returnMath.ceil(t.width/40);conste=t._resolveTickFontOptions(0);returnMath.ceil(t.height/e.lineHeight)}getPixelForValue(t){returnnull===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){returnthis._startValue+this.getDecimalForPixel(t)*this._valueRange}}functionIs(t){return1===t/Math.pow(10,Math.floor(Pt(t)))}Es.id="linear",Es.defaults={ticks:{callback:Vi.formatters.numeric}};classzsextendsXi{constructor(t){super(t),this.start=void0,this.end=void0,this._startValue=void0,this._valueRange=0}parse(t,e){consti=Ls.prototype.parse.apply(this,[t,e]);if(0!==i)returnX(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){constt=this,{min:e,max:i}=t.getMinMax(!0);t.min=X(e)?Math.max(0,e):null,t.max=X(i)?Math.max(0,i):null,t.options.beginAtZero&&(t._zero=!0),t.handleTickRangeOptions()}handleTickRangeOptions(){constt=this,{minDefined:e,maxDefined:i}=t.getUserBounds();letn=t.min,o=t.max;consts=t=>n=e?n:t,a=t=>o=i?o:t,r=(t,e)=>Math.pow(10,Math.floor(Pt(t))+e);n===o&&(n<=0?(s(1),a(10)):(s(r(n,-1)),a(r(o,1)))),n<=0&&s(r(o,-1)),o<=0&&a(r(n,1)),t._zero&&t.min!==t._suggestedMin&&n===r(t.min,0)&&s(r(n,-1)),t.min=n,t.max=o}buildTicks(){constt=this,e=t.options,i=function(t,e){consti=Math.floor(Pt(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),o=[];lets=q(t.min,Math.pow(10,Math.floor(Pt(e.min)))),a=Math.floor(Pt(s)),r=Math.floor(s/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{o.push({value:s,major:Is(s)}),++r,10===r&&(r=1,++a,l=a>=0?1:l),s=Math.round(r*Math.pow(10,a)*l)/l}while(a<i||a===i&&r<n);constc=q(t.max,s);returno.push({value:c,major:Is(s)}),o}({min:t._userMin,max:t._userMax},t);return"ticks"===e.bounds&&Lt(i,t,"value"),e.reverse?(i.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),i}getLabelForValue(t){returnvoid0===t?"0":zi(t,this.chart.options.locale)}configure(){constt=this,e=t.min;super.configure(),t._startValue=Pt(e),t._valueRange=Pt(t.max)-Pt(e)}getPixelForValue(t){conste=this;returnvoid0!==t&&0!==t||(t=e.min),null===t||isNaN(t)?NaN:e.getPixelForDecimal(t===e.min?0:(Pt(t)-e._startValue)/e._valueRange)}getValueForPixel(t){conste=this,i=e.getDecimalForPixel(t);returnMath.pow(10,e._startValue+i*e._valueRange)}}functionFs(t){conste=t.ticks;if(e.display&&t.display){constt=ze(e.backdropPadding);returnK(e.font&&e.font.size,xt.font.size)+t.height}return0}functionVs(t,e,i,n,o){returnt===n||t===o?{start:e-i/2,end:e+i/2}:t<n||t>o?{start:e-i,end:e}:{start:e,end:e+i}}functionBs(t){return0===t||180===t?"center":t<180?"left":"right"}functionWs(t,e,i){90===t||270===t?i.y-=e.h/2:(t>270||t<90)&&(i.y-=e.h)}functionHs(t,e,i,n){const{ctx:o}=t;if(i)o.arc(t.xCenter,t.yCenter,e,0,_t);else{leti=t.getPointPosition(0,e);o.moveTo(i.x,i.y);for(lets=1;s<n;s++)i=t.getPointPosition(s,e),o.lineTo(i.x,i.y)}}functionNs(t){returnAt(t)?t:0}zs.id="logarithmic",zs.defaults={ticks:{callback:Vi.formatters.logarithmic,major:{enabled:!0}}};classjsextendsLs{constructor(t){super(t),this.xCenter=void0,this.yCenter=void0,this.drawingArea=void0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){constt=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Fs(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2}determineDataLimits(){constt=this,{min:e,max:i}=t.getMinMax(!1);t.min=X(e)&&!isNaN(e)?e:0,t.max=X(i)&&!isNaN(i)?i:0,t.handleTickRangeOptions()}computeTickLimit(){returnMath.ceil(this.drawingArea/Fs(this.options))}generateTickLabels(t){conste=this;Ls.prototype.generateTickLabels.call(e,t),e._pointLabels=e.getLabels().map(((t,i)=>{constn=Q(e.options.pointLabels.callback,[t,i],e);returnn||0===n?n:""}))}fit(){constt=this,e=t.options;e.display&&e.pointLabels.display?function(t){conste={l:0,r:t.width,t:0,b:t.height-t.paddingTop},i={};letn,o,s;consta=[],r=[],l=t.getLabels().length;for(n=0;n<l;n++){constl=t.options.pointLabels.setContext(t.getContext(n));r[n]=l.padding,s=t.getPointPosition(n,t.drawingArea+r[n]);constu=Fe(l.font);t.ctx.font=u.string,c=t.ctx,h=u.lineHeight,o=Y(d=t._pointLabels[n])?{w:Ut(c,c.font,d),h:d.length*h}:{w:c.measureText(d).width,h:h},a[n]=o;constf=t.getIndexAngle(n),g=It(f),p=Vs(g,s.x,o.w,0,180),m=Vs(g,s.y,o.h,90,270);p.start<e.l&&(e.l=p.start,i.l=f),p.end>e.r&&(e.r=p.end,i.r=f),m.start<e.t&&(e.t=m.start,i.t=f),m.end>e.b&&(e.b=m.end,i.b=f)}varc,h,d;t._setReductions(t.drawingArea,e,i),t._pointLabelItems=[];constu=t.options,f=Fs(u),g=t.getDistanceFromCenterForValue(u.ticks.reverse?t.min:t.max);for(n=0;n<l;n++){conste=0===n?f/2:0,i=t.getPointPosition(n,g+e+r[n]),o=It(t.getIndexAngle(n)),s=a[n];Ws(o,s,i);constl=Bs(o);letc;c="left"===l?i.x:"center"===l?i.x-s.w/2:i.x-s.w;consth=c+s.w;t._pointLabelItems[n]={x:i.x,y:i.y,textAlign:l,left:c,top:i.y,right:h,bottom:i.y+s.h}}}(t):t.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){constn=this;leto=e.l/Math.sin(i.l),s=Math.max(e.r-n.width,0)/Math.sin(i.r),a=-e.t/Math.cos(i.t),r=-Math.max(e.b-(n.height-n.paddingTop),0)/Math.cos(i.b);o=Ns(o),s=Ns(s),a=Ns(a),r=Ns(r),n.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(o+s)/2),Math.floor(t-(a+r)/2))),n.setCenterPoint(o,s,a,r)}setCenterPoint(t,e,i,n){consto=this,s=o.width-e-o.drawingArea,a=t+o.drawingArea,r=i+o.drawingArea,l=o.height-o.paddingTop-n-o.drawingArea;o.xCenter=Math.floor((a+s)/2+o.left),o.yCenter=Math.floor((r+l)/2+o.top+o.paddingTop)}getIndexAngle(t){returnWt(t*(_t/this.getLabels().length)+Et(this.options.startAngle||0))}getDistanceFromCenterForValue(t){conste=this;if($(t))returnNaN;consti=e.drawingArea/(e.max-e.min);returne.options.reverse?(e.max-t)*i:(t-e.min)*i}getValueForDistanceFromCenter(t){if($(t))returnNaN;conste=this,i=t/(e.drawingArea/(e.max-e.min));returne.options.reverse?e.max-i:e.min+i}getPointPosition(t,e){consti=this,n=i.getIndexAngle(t)-Mt;return{x:Math.cos(n)*e+i.xCenter,y:Math.sin(n)*e+i.yCenter,angle:n}}getPointPositionForValue(t,e){returnthis.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){returnthis.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:o}}drawBackground(){constt=this,{backgroundColor:e,grid:{circular:i}}=t.options;if(e){constn=t.ctx;n.save(),n.beginPath(),Hs(t,t.getDistanceFromCenterForValue(t._endValue),i,t.getLabels().length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){constt=this,e=t.ctx,i=t.options,{angleLines:n,grid:o}=i,s=t.getLabels().length;leta,r,l;if(i.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:n}}=t;for(leto=e-1;o>=0;o--){conste=n.setContext(t.getContext(o)),s=Fe(e.font),{x:a,y:r,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[o],{backdropColor:f}=e;if(!$(f)){constt=ze(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}ee(i,t._pointLabels[o],a,r+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(t,s),o.display&&t.ticks.forEach(((e,i)=>{if(0!==i){r=t.getDistanceFromCenterForValue(e.value);constn=o.setContext(t.getContext(i-1));!function(t,e,i,n){consto=t.ctx,s=e.circular,{color:a,lineWidth:r}=e;!s&&!n||!a||!r||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=r,o.setLineDash(e.borderDash),o.lineDashOffset=e.borderDashOffset,o.beginPath(),Hs(t,i,s,n),o.closePath(),o.stroke(),o.restore())}(t,n,r,s)}})),n.display){for(e.save(),a=t.getLabels().length-1;a>=0;a--){consto=n.setContext(t.getContext(a)),{color:s,lineWidth:c}=o;c&&s&&(e.lineWidth=c,e.strokeStyle=s,e.setLineDash(o.borderDash),e.lineDashOffset=o.borderDashOffset,r=t.getDistanceFromCenterForValue(i.ticks.reverse?t.min:t.max),l=t.getPointPosition(a,r),e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){constt=this,e=t.ctx,i=t.options,n=i.ticks;if(!n.display)return;consto=t.getIndexAngle(0);lets,a;e.save(),e.translate(t.xCenter,t.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",t.ticks.forEach(((o,r)=>{if(0===r&&!i.reverse)return;constl=n.setContext(t.getContext(r)),c=Fe(l.font);if(s=t.getDistanceFromCenterForValue(t.ticks[r].value),l.showLabelBackdrop){a=e.measureText(o.label).width,e.fillStyle=l.backdropColor;constt=ze(l.backdropPadding);e.fillRect(-a/2-t.left,-s-c.size/2-t.top,a+t.width,c.size+t.height)}ee(e,o.label,0,-s,c,{color:l.color})})),e.restore()}drawTitle(){}}js.id="radialLinear",js.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Vi.formatters.numeric},pointLabels:{backdropColor:void0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},js.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},js.descriptors={angleLines:{_fallback:"grid"}};const$s={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}},Ys=Object.keys($s);functionUs(t,e){returnt-e}functionXs(t,e){if($(e))returnnull;consti=t._adapter,{parser:n,round:o,isoWeekday:s}=t._parseOpts;leta=e;return"function"==typeofn&&(a=n(a)),X(a)||(a="string"==typeofn?i.parse(a,n):i.parse(a)),null===a?null:(o&&(a="week"!==o||!At(s)&&!0!==s?i.startOf(a,o):i.startOf(a,"isoWeek",s)),+a)}functionqs(t,e,i,n){consto=Ys.length;for(lets=Ys.indexOf(t);s<o-1;++s){constt=$s[Ys[s]],o=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(o*t.size))<=n)returnYs[s]}returnYs[o-1]}functionKs(t,e,i){if(i){if(i.length){const{lo:n,hi:o}=ne(i,e);t[i[n]>=e?i[n]:i[o]]=!0}}elset[e]=!0}functionGs(t,e,i){constn=[],o={},s=e.length;leta,r;for(a=0;a<s;++a)r=e[a],o[r]=a,n.push({value:r,major:!1});return0!==s&&i?function(t,e,i,n){consto=t._adapter,s=+o.startOf(e[0].value,n),a=e[e.length-1].value;letr,l;for(r=s;r<=a;r=+o.add(r,1,n))l=i[r],l>=0&&(e[l].major=!0);returne}(t,n,o,i):n}classZsextendsXi{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void0,this._offsets={},this._normalized=!1,this._parseOpts=void0}init(t,e){consti=t.time||(t.time={}),n=this._adapter=newoo._date(t.adapters.date);st(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){returnvoid0===t?null:Xs(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){constt=this,e=t.options,i=t._adapter,n=e.time.unit||"day";let{min:o,max:s,minDefined:a,maxDefined:r}=t.getUserBounds();functionl(t){a||isNaN(t.min)||(o=Math.min(o,t.min)),r||isNaN(t.max)||(s=Math.max(s,t.max))}a&&r||(l(t._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||l(t.getMinMax(!1))),o=X(o)&&!isNaN(o)?o:+i.startOf(Date.now(),n),s=X(s)&&!isNaN(s)?s:+i.endOf(Date.now(),n)+1,t.min=Math.min(o,s-1),t.max=Math.max(o+1,s)}_getLabelBounds(){constt=this.getLabelTimestamps();lete=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;returnt.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){constt=this,e=t.options,i=e.time,n=e.ticks,o="labels"===n.source?t.getLabelTimestamps():t._generate();"ticks"===e.bounds&&o.length&&(t.min=t._userMin||o[0],t.max=t._userMax||o[o.length-1]);consts=t.min,a=ae(o,s,t.max);returnt._unit=i.unit||(n.autoSkip?qs(i.minUnit,t.min,t.max,t._getLabelCapacity(s)):function(t,e,i,n,o){for(lets=Ys.length-1;s>=Ys.indexOf(i);s--){consti=Ys[s];if($s[i].common&&t._adapter.diff(o,n,i)>=e-1)returni}returnYs[i?Ys.indexOf(i):0]}(t,a.length,i.minUnit,t.min,t.max)),t._majorUnit=n.major.enabled&&"year"!==t._unit?function(t){for(lete=Ys.indexOf(t)+1,i=Ys.length;e<i;++e)if($s[Ys[e]].common)returnYs[e]}(t._unit):void0,t.initOffsets(o),e.reverse&&a.reverse(),Gs(t,a,t._majorUnit)}initOffsets(t){conste=this;leti,n,o=0,s=0;e.options.offset&&t.length&&(i=e.getDecimalForValue(t[0]),o=1===t.length?1-i:(e.getDecimalForValue(t[1])-i)/2,n=e.getDecimalForValue(t[t.length-1]),s=1===t.length?n:(n-e.getDecimalForValue(t[t.length-2]))/2);consta=t.length<3?.5:.25;o=Nt(o,0,a),s=Nt(s,0,a),e._offsets={start:o,end:s,factor:1/(o+1+s)}}_generate(){constt=this,e=t._adapter,i=t.min,n=t.max,o=t.options,s=o.time,a=s.unit||qs(s.minUnit,i,n,t._getLabelCapacity(i)),r=K(s.stepSize,1),l="week"===a&&s.isoWeekday,c=At(l)||!0===l,h={};letd,u,f=i;if(c&&(f=+e.startOf(f,"isoWeek",l)),f=+e.startOf(f,c?"day":a),e.diff(n,i,a)>1e5*r)thrownewError(i+" and "+n+" are too far apart with stepSize of "+r+""+a);constg="data"===o.ticks.source&&t.getDataTimestamps();for(d=f,u=0;d<n;d=+e.add(d,r,a),u++)Ks(h,d,g);returnd!==n&&"ticks"!==o.bounds&&1!==u||Ks(h,d,g),Object.keys(h).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){conste=this._adapter,i=this.options.time;returni.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){consto=this,s=o.options,a=s.time.displayFormats,r=o._unit,l=o._majorUnit,c=r&&a[r],h=l&&a[l],d=i[e],u=l&&h&&d&&d.major,f=o._adapter.format(t,n||(u?h:c)),g=s.ticks.callback;returng?Q(g,[f,e,i],o):f}generateTickLabels(t){lete,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){conste=this;returnnull===t?NaN:(t-e.min)/(e.max-e.min)}getPixelForValue(t){conste=this,i=e._offsets,n=e.getDecimalForValue(t);returne.getPixelForDecimal((i.start+n)*i.factor)}getValueForPixel(t){conste=this,i=e._offsets,n=e.getDecimalForPixel(t)/i.factor-i.end;returne.min+n*(e.max-e.min)}_getLabelSize(t){conste=this,i=e.options.ticks,n=e.ctx.measureText(t).width,o=Et(e.isHorizontal()?i.maxRotation:i.minRotation),s=Math.cos(o),a=Math.sin(o),r=e._resolveTickFontOptions(0).size;return{w:n*s+r*a,h:n*a+r*s}}_getLabelCapacity(t){conste=this,i=e.options.time,n=i.displayFormats,o=n[i.unit]||n.millisecond,s=e._tickFormatFunction(t,0,Gs(e,[t],e._majorUnit),o),a=e._getLabelSize(s),r=Math.floor(e.isHorizontal()?e.width/a.w:e.height/a.h)-1;returnr>0?r:1}getDataTimestamps(){constt=this;lete,i,n=t._cache.data||[];if(n.length)returnn;consto=t.getMatchingVisibleMetas();if(t._normalized&&o.length)returnt._cache.data=o[0].controller.getAllParsedValues(t);for(e=0,i=o.length;e<i;++e)n=n.concat(o[e].controller.getAllParsedValues(t));returnt._cache.data=t.normalize(n)}getLabelTimestamps(){constt=this,e=t._cache.labels||[];leti,n;if(e.length)returne;consto=t.getLabels();for(i=0,n=o.length;i<n;++i)e.push(Xs(t,o[i]));returnt._cache.labels=t._normalized?e:t.normalize(e)}normalize(t){returnhe(t.sort(Us))}}functionQs(t,e,i){letn,o,s,a;if(i)n=Math.floor(e),o=Math.ceil(e),s=t[n],a=t[o];else{consti=ne(t,e);s=i.lo,a=i.hi,n=t[s],o=t[a]}constr=o-n;returnr?s+(a-s)*(e-n)/r:s}Zs.id="time",Zs.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};classJsextendsZs{constructor(t){super(t),this._table=[],this._maxIndex=void0}initOffsets(){constt=this,e=t._getTimestampsForTable();t._table=t.buildLookupTable(e),t._maxIndex=t._table.length-1,super.initOffsets(e)}buildLookupTable(t){const{min:e,max:i}=this;if(!t.length)return[{time:e,pos:0},{time:i,pos:1}];constn=[e];leto,s,a;for(o=0,s=t.length;o<s;++o)a=t[o],a>e&&a<i&&n.push(a);returnn.push(i),n}_getTimestampsForTable(){constt=this;lete=t._cache.all||[];if(e.length)returne;consti=t.getDataTimestamps(),n=t.getLabelTimestamps();returne=i.length&&n.length?t.normalize(i.concat(n)):i.length?i:n,e=t._cache.all=e,e}getPixelForValue(t,e){consti=this,n=i._offsets,o=i._normalized&&i._maxIndex>0&&!$(e)?e/i._maxIndex:i.getDecimalForValue(t);returni.getPixelForDecimal((n.start+o)*n.factor)}getDecimalForValue(t){returnQs(this._table,t)/this._maxIndex}getValueForPixel(t){conste=this,i=e._offsets,n=e.getDecimalForPixel(t)/i.factor-i.end;returnQs(e._table,n*this._maxIndex,!0)}}Js.id="timeseries",Js.defaults=Zs.defaults;varta=Object.freeze({__proto__:null,CategoryScale:Rs,LinearScale:Es,LogarithmicScale:zs,RadialLinearScale:js,TimeScale:Zs,TimeSeriesScale:Js});returnJn.register(bo,ta,Yo,As),Jn.helpers={...Cn},Jn._adapters=oo,Jn.Animation=_i,Jn.Animations=vi,Jn.animator=a,Jn.controllers=An.controllers.items,Jn.DatasetController=Li,Jn.Element=Ei,Jn.elements=Yo,Jn.Interaction=Oe,Jn.layouts=Ge,Jn.platforms=ui,Jn.Scale=Xi,Jn.Ticks=Vi,Object.assign(Jn,bo,ta,Yo,As,ui),Jn.Chart=Jn,"undefined"!=typeofwindow&&(window.Chart=Jn),Jn}));