import{aR as Zi,am as Ji,i as Qi,k as eo,ac as to,M as ro,j as ea,o as ao,c as no,t as io}from"./vendor.e9042f2c.js";import{c as oo}from"./main.109918ee.js";var ta={exports:{}};/*! * Chart.js v2.9.4 * https://www.chartjs.org * (c) 2020 Chart.js Contributors * Released under the MIT License */(function(lt,$){(function(O,j){lt.exports=j(function(){try{return require("moment")}catch{}}())})(Zi,function(O){O=O&&O.hasOwnProperty("default")?O.default:O;function j(e,t){return t={exports:{}},e(t,t.exports),t.exports}function Ie(e){return e&&e.default||e}var ae={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},F=j(function(e){var t={};for(var r in ae)ae.hasOwnProperty(r)&&(t[ae[r]]=r);var a=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var n in a)if(a.hasOwnProperty(n)){if(!("channels"in a[n]))throw new Error("missing channels property: "+n);if(!("labels"in a[n]))throw new Error("missing channel labels property: "+n);if(a[n].labels.length!==a[n].channels)throw new Error("channel and label counts mismatch: "+n);var i=a[n].channels,o=a[n].labels;delete a[n].channels,delete a[n].labels,Object.defineProperty(a[n],"channels",{value:i}),Object.defineProperty(a[n],"labels",{value:o})}a.rgb.hsl=function(s){var u=s[0]/255,d=s[1]/255,f=s[2]/255,c=Math.min(u,d,f),v=Math.max(u,d,f),g=v-c,p,m,b;return v===c?p=0:u===v?p=(d-f)/g:d===v?p=2+(f-u)/g:f===v&&(p=4+(u-d)/g),p=Math.min(p*60,360),p<0&&(p+=360),b=(c+v)/2,v===c?m=0:b<=.5?m=g/(v+c):m=g/(2-v-c),[p,m*100,b*100]},a.rgb.hsv=function(s){var u,d,f,c,v,g=s[0]/255,p=s[1]/255,m=s[2]/255,b=Math.max(g,p,m),x=b-Math.min(g,p,m),y=function(w){return(b-w)/6/x+1/2};return x===0?c=v=0:(v=x/b,u=y(g),d=y(p),f=y(m),g===b?c=f-d:p===b?c=1/3+u-f:m===b&&(c=2/3+d-u),c<0?c+=1:c>1&&(c-=1)),[c*360,v*100,b*100]},a.rgb.hwb=function(s){var u=s[0],d=s[1],f=s[2],c=a.rgb.hsl(s)[0],v=1/255*Math.min(u,Math.min(d,f));return f=1-1/255*Math.max(u,Math.max(d,f)),[c,v*100,f*100]},a.rgb.cmyk=function(s){var u=s[0]/255,d=s[1]/255,f=s[2]/255,c,v,g,p;return p=Math.min(1-u,1-d,1-f),c=(1-u-p)/(1-p)||0,v=(1-d-p)/(1-p)||0,g=(1-f-p)/(1-p)||0,[c*100,v*100,g*100,p*100]};function l(s,u){return Math.pow(s[0]-u[0],2)+Math.pow(s[1]-u[1],2)+Math.pow(s[2]-u[2],2)}a.rgb.keyword=function(s){var u=t[s];if(u)return u;var d=1/0,f;for(var c in ae)if(ae.hasOwnProperty(c)){var v=ae[c],g=l(s,v);g.04045?Math.pow((u+.055)/1.055,2.4):u/12.92,d=d>.04045?Math.pow((d+.055)/1.055,2.4):d/12.92,f=f>.04045?Math.pow((f+.055)/1.055,2.4):f/12.92;var c=u*.4124+d*.3576+f*.1805,v=u*.2126+d*.7152+f*.0722,g=u*.0193+d*.1192+f*.9505;return[c*100,v*100,g*100]},a.rgb.lab=function(s){var u=a.rgb.xyz(s),d=u[0],f=u[1],c=u[2],v,g,p;return d/=95.047,f/=100,c/=108.883,d=d>.008856?Math.pow(d,1/3):7.787*d+16/116,f=f>.008856?Math.pow(f,1/3):7.787*f+16/116,c=c>.008856?Math.pow(c,1/3):7.787*c+16/116,v=116*f-16,g=500*(d-f),p=200*(f-c),[v,g,p]},a.hsl.rgb=function(s){var u=s[0]/360,d=s[1]/100,f=s[2]/100,c,v,g,p,m;if(d===0)return m=f*255,[m,m,m];f<.5?v=f*(1+d):v=f+d-f*d,c=2*f-v,p=[0,0,0];for(var b=0;b<3;b++)g=u+1/3*-(b-1),g<0&&g++,g>1&&g--,6*g<1?m=c+(v-c)*6*g:2*g<1?m=v:3*g<2?m=c+(v-c)*(2/3-g)*6:m=c,p[b]=m*255;return p},a.hsl.hsv=function(s){var u=s[0],d=s[1]/100,f=s[2]/100,c=d,v=Math.max(f,.01),g,p;return f*=2,d*=f<=1?f:2-f,c*=v<=1?v:2-v,p=(f+d)/2,g=f===0?2*c/(v+c):2*d/(f+d),[u,g*100,p*100]},a.hsv.rgb=function(s){var u=s[0]/60,d=s[1]/100,f=s[2]/100,c=Math.floor(u)%6,v=u-Math.floor(u),g=255*f*(1-d),p=255*f*(1-d*v),m=255*f*(1-d*(1-v));switch(f*=255,c){case 0:return[f,m,g];case 1:return[p,f,g];case 2:return[g,f,m];case 3:return[g,p,f];case 4:return[m,g,f];case 5:return[f,g,p]}},a.hsv.hsl=function(s){var u=s[0],d=s[1]/100,f=s[2]/100,c=Math.max(f,.01),v,g,p;return p=(2-d)*f,v=(2-d)*c,g=d*c,g/=v<=1?v:2-v,g=g||0,p/=2,[u,g*100,p*100]},a.hwb.rgb=function(s){var u=s[0]/360,d=s[1]/100,f=s[2]/100,c=d+f,v,g,p,m;c>1&&(d/=c,f/=c),v=Math.floor(6*u),g=1-f,p=6*u-v,(v&1)!=0&&(p=1-p),m=d+p*(g-d);var b,x,y;switch(v){default:case 6:case 0:b=g,x=m,y=d;break;case 1:b=m,x=g,y=d;break;case 2:b=d,x=g,y=m;break;case 3:b=d,x=m,y=g;break;case 4:b=m,x=d,y=g;break;case 5:b=g,x=d,y=m;break}return[b*255,x*255,y*255]},a.cmyk.rgb=function(s){var u=s[0]/100,d=s[1]/100,f=s[2]/100,c=s[3]/100,v,g,p;return v=1-Math.min(1,u*(1-c)+c),g=1-Math.min(1,d*(1-c)+c),p=1-Math.min(1,f*(1-c)+c),[v*255,g*255,p*255]},a.xyz.rgb=function(s){var u=s[0]/100,d=s[1]/100,f=s[2]/100,c,v,g;return c=u*3.2406+d*-1.5372+f*-.4986,v=u*-.9689+d*1.8758+f*.0415,g=u*.0557+d*-.204+f*1.057,c=c>.0031308?1.055*Math.pow(c,1/2.4)-.055:c*12.92,v=v>.0031308?1.055*Math.pow(v,1/2.4)-.055:v*12.92,g=g>.0031308?1.055*Math.pow(g,1/2.4)-.055:g*12.92,c=Math.min(Math.max(0,c),1),v=Math.min(Math.max(0,v),1),g=Math.min(Math.max(0,g),1),[c*255,v*255,g*255]},a.xyz.lab=function(s){var u=s[0],d=s[1],f=s[2],c,v,g;return u/=95.047,d/=100,f/=108.883,u=u>.008856?Math.pow(u,1/3):7.787*u+16/116,d=d>.008856?Math.pow(d,1/3):7.787*d+16/116,f=f>.008856?Math.pow(f,1/3):7.787*f+16/116,c=116*d-16,v=500*(u-d),g=200*(d-f),[c,v,g]},a.lab.xyz=function(s){var u=s[0],d=s[1],f=s[2],c,v,g;v=(u+16)/116,c=d/500+v,g=v-f/200;var p=Math.pow(v,3),m=Math.pow(c,3),b=Math.pow(g,3);return v=p>.008856?p:(v-16/116)/7.787,c=m>.008856?m:(c-16/116)/7.787,g=b>.008856?b:(g-16/116)/7.787,c*=95.047,v*=100,g*=108.883,[c,v,g]},a.lab.lch=function(s){var u=s[0],d=s[1],f=s[2],c,v,g;return c=Math.atan2(f,d),v=c*360/2/Math.PI,v<0&&(v+=360),g=Math.sqrt(d*d+f*f),[u,g,v]},a.lch.lab=function(s){var u=s[0],d=s[1],f=s[2],c,v,g;return g=f/360*2*Math.PI,c=d*Math.cos(g),v=d*Math.sin(g),[u,c,v]},a.rgb.ansi16=function(s){var u=s[0],d=s[1],f=s[2],c=1 in arguments?arguments[1]:a.rgb.hsv(s)[2];if(c=Math.round(c/50),c===0)return 30;var v=30+(Math.round(f/255)<<2|Math.round(d/255)<<1|Math.round(u/255));return c===2&&(v+=60),v},a.hsv.ansi16=function(s){return a.rgb.ansi16(a.hsv.rgb(s),s[2])},a.rgb.ansi256=function(s){var u=s[0],d=s[1],f=s[2];if(u===d&&d===f)return u<8?16:u>248?231:Math.round((u-8)/247*24)+232;var c=16+36*Math.round(u/255*5)+6*Math.round(d/255*5)+Math.round(f/255*5);return c},a.ansi16.rgb=function(s){var u=s%10;if(u===0||u===7)return s>50&&(u+=3.5),u=u/10.5*255,[u,u,u];var d=(~~(s>50)+1)*.5,f=(u&1)*d*255,c=(u>>1&1)*d*255,v=(u>>2&1)*d*255;return[f,c,v]},a.ansi256.rgb=function(s){if(s>=232){var u=(s-232)*10+8;return[u,u,u]}s-=16;var d,f=Math.floor(s/36)/5*255,c=Math.floor((d=s%36)/6)/5*255,v=d%6/5*255;return[f,c,v]},a.rgb.hex=function(s){var u=((Math.round(s[0])&255)<<16)+((Math.round(s[1])&255)<<8)+(Math.round(s[2])&255),d=u.toString(16).toUpperCase();return"000000".substring(d.length)+d},a.hex.rgb=function(s){var u=s.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!u)return[0,0,0];var d=u[0];u[0].length===3&&(d=d.split("").map(function(p){return p+p}).join(""));var f=parseInt(d,16),c=f>>16&255,v=f>>8&255,g=f&255;return[c,v,g]},a.rgb.hcg=function(s){var u=s[0]/255,d=s[1]/255,f=s[2]/255,c=Math.max(Math.max(u,d),f),v=Math.min(Math.min(u,d),f),g=c-v,p,m;return g<1?p=v/(1-g):p=0,g<=0?m=0:c===u?m=(d-f)/g%6:c===d?m=2+(f-u)/g:m=4+(u-d)/g+4,m/=6,m%=1,[m*360,g*100,p*100]},a.hsl.hcg=function(s){var u=s[1]/100,d=s[2]/100,f=1,c=0;return d<.5?f=2*u*d:f=2*u*(1-d),f<1&&(c=(d-.5*f)/(1-f)),[s[0],f*100,c*100]},a.hsv.hcg=function(s){var u=s[1]/100,d=s[2]/100,f=u*d,c=0;return f<1&&(c=(d-f)/(1-f)),[s[0],f*100,c*100]},a.hcg.rgb=function(s){var u=s[0]/360,d=s[1]/100,f=s[2]/100;if(d===0)return[f*255,f*255,f*255];var c=[0,0,0],v=u%1*6,g=v%1,p=1-g,m=0;switch(Math.floor(v)){case 0:c[0]=1,c[1]=g,c[2]=0;break;case 1:c[0]=p,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=g;break;case 3:c[0]=0,c[1]=p,c[2]=1;break;case 4:c[0]=g,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=p}return m=(1-d)*f,[(d*c[0]+m)*255,(d*c[1]+m)*255,(d*c[2]+m)*255]},a.hcg.hsv=function(s){var u=s[1]/100,d=s[2]/100,f=u+d*(1-u),c=0;return f>0&&(c=u/f),[s[0],c*100,f*100]},a.hcg.hsl=function(s){var u=s[1]/100,d=s[2]/100,f=d*(1-u)+.5*u,c=0;return f>0&&f<.5?c=u/(2*f):f>=.5&&f<1&&(c=u/(2*(1-f))),[s[0],c*100,f*100]},a.hcg.hwb=function(s){var u=s[1]/100,d=s[2]/100,f=u+d*(1-u);return[s[0],(f-u)*100,(1-f)*100]},a.hwb.hcg=function(s){var u=s[1]/100,d=s[2]/100,f=1-d,c=f-u,v=0;return c<1&&(v=(f-c)/(1-c)),[s[0],c*100,v*100]},a.apple.rgb=function(s){return[s[0]/65535*255,s[1]/65535*255,s[2]/65535*255]},a.rgb.apple=function(s){return[s[0]/255*65535,s[1]/255*65535,s[2]/255*65535]},a.gray.rgb=function(s){return[s[0]/100*255,s[0]/100*255,s[0]/100*255]},a.gray.hsl=a.gray.hsv=function(s){return[0,0,s[0]]},a.gray.hwb=function(s){return[0,100,s[0]]},a.gray.cmyk=function(s){return[0,0,0,s[0]]},a.gray.lab=function(s){return[s[0],0,0]},a.gray.hex=function(s){var u=Math.round(s[0]/100*255)&255,d=(u<<16)+(u<<8)+u,f=d.toString(16).toUpperCase();return"000000".substring(f.length)+f},a.rgb.gray=function(s){var u=(s[0]+s[1]+s[2])/3;return[u/255*100]}});F.rgb,F.hsl,F.hsv,F.hwb,F.cmyk,F.xyz,F.lab,F.lch,F.hex,F.keyword,F.ansi16,F.ansi256,F.hcg,F.apple,F.gray;function ut(){for(var e={},t=Object.keys(F),r=t.length,a=0;a1&&(r=Array.prototype.slice.call(arguments)),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function na(e){var t=function(r){if(r==null)return r;arguments.length>1&&(r=Array.prototype.slice.call(arguments));var a=e(r);if(typeof a=="object")for(var n=a.length,i=0;i=0&&t<1?$e(Math.round(t*255)):"")}function da(e,t){return t<1||e[3]&&e[3]<1?Gt(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"}function Gt(e,t){return t===void 0&&(t=e[3]!==void 0?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function fa(e,t){if(t<1||e[3]&&e[3]<1)return Xt(e,t);var r=Math.round(e[0]/255*100),a=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return"rgb("+r+"%, "+a+"%, "+n+"%)"}function Xt(e,t){var r=Math.round(e[0]/255*100),a=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return"rgba("+r+"%, "+a+"%, "+n+"%, "+(t||e[3]||1)+")"}function ha(e,t){return t<1||e[3]&&e[3]<1?Kt(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"}function Kt(e,t){return t===void 0&&(t=e[3]!==void 0?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function ca(e,t){return t===void 0&&(t=e[3]!==void 0?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(t!==void 0&&t!==1?", "+t:"")+")"}function va(e){return Zt[e.slice(0,3)]}function Q(e,t,r){return Math.min(Math.max(t,e),r)}function $e(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var Zt={};for(var Jt in dt)Zt[dt[Jt]]=Jt;var U=function(e){if(e instanceof U)return e;if(!(this instanceof U))return new U(e);this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var t;typeof e=="string"?(t=J.getRgba(e),t?this.setValues("rgb",t):(t=J.getHsla(e))?this.setValues("hsl",t):(t=J.getHwb(e))&&this.setValues("hwb",t)):typeof e=="object"&&(t=e,t.r!==void 0||t.red!==void 0?this.setValues("rgb",t):t.l!==void 0||t.lightness!==void 0?this.setValues("hsl",t):t.v!==void 0||t.value!==void 0?this.setValues("hsv",t):t.w!==void 0||t.whiteness!==void 0?this.setValues("hwb",t):(t.c!==void 0||t.cyan!==void 0)&&this.setValues("cmyk",t))};U.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var e=this.values;return e.alpha!==1?e.hwb.concat([e.alpha]):e.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values;return e.rgb.concat([e.alpha])},hslaArray:function(){var e=this.values;return e.hsl.concat([e.alpha])},alpha:function(e){return e===void 0?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return e&&(e%=360,e=e<0?360+e:e),this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return J.hexString(this.values.rgb)},rgbString:function(){return J.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return J.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return J.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return J.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return J.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return J.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return J.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var e=this.values.rgb;return e[0]<<16|e[1]<<8|e[2]},luminosity:function(){for(var e=this.values.rgb,t=[],r=0;rr?(t+.05)/(r+.05):(r+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb,t=(e[0]*299+e[1]*587+e[2]*114)/1e3;return t<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=e[0]*.3+e[1]*.59+e[2]*.11;return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,r=(t[0]+e)%360;return t[0]=r<0?360+r:r,this.setValues("hsl",t),this},mix:function(e,t){var r=this,a=e,n=t===void 0?.5:t,i=2*n-1,o=r.alpha()-a.alpha(),l=((i*o==-1?i:(i+o)/(1+i*o))+1)/2,s=1-l;return this.rgb(l*r.red()+s*a.red(),l*r.green()+s*a.green(),l*r.blue()+s*a.blue()).alpha(r.alpha()*n+a.alpha()*(1-n))},toJSON:function(){return this.rgb()},clone:function(){var e=new U,t=this.values,r=e.values,a,n;for(var i in t)t.hasOwnProperty(i)&&(a=t[i],n={}.toString.call(a),n==="[object Array]"?r[i]=a.slice(0):n==="[object Number]"?r[i]=a:console.error("unexpected color value:",a));return e}},U.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},U.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},U.prototype.getValues=function(e){for(var t=this.values,r={},a=0;a=0;n--)t.call(r,e[n],n);else for(n=0;n=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e=e-1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,r=0,a=1;return e===0?0:e===1?1:(r||(r=.3),t=r/(2*Math.PI)*Math.asin(1/a),-(a*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)))},easeOutElastic:function(e){var t=1.70158,r=0,a=1;return e===0?0:e===1?1:(r||(r=.3),t=r/(2*Math.PI)*Math.asin(1/a),a*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},easeInOutElastic:function(e){var t=1.70158,r=0,a=1;return e===0?0:(e/=.5)==2?1:(r||(r=.45),t=r/(2*Math.PI)*Math.asin(1/a),e<1?-.5*(a*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)):a*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e=e-1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:function(e){return 1-Oe.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?Oe.easeInBounce(e*2)*.5:Oe.easeOutBounce(e*2-1)*.5+.5}},ga={effects:Oe};G.easingEffects=Oe;var z=Math.PI,pa=z/180,ma=z*2,X=z/2,Le=z/4,er=z*2/3,Ge={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,r,a,n,i){if(i){var o=Math.min(i,n/2,a/2),l=t+o,s=r+o,u=t+a-o,d=r+n-o;e.moveTo(t,s),lt.left-r&&e.xt.top-r&&e.y0&&e.requestAnimationFrame()},advance:function(){for(var e=this.animations,t,r,a,n,i=0;i=a?(h.callback(t.onAnimationComplete,[t],r),r.animating=!1,e.splice(i,1)):++i}},Me=h.options.resolve,ar=["push","pop","shift","splice","unshift"];function La(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ar.forEach(function(r){var a="onData"+r.charAt(0).toUpperCase()+r.slice(1),n=e[r];Object.defineProperty(e,r,{configurable:!0,enumerable:!1,value:function(){var i=Array.prototype.slice.call(arguments),o=n.apply(this,i);return h.each(e._chartjs.listeners,function(l){typeof l[a]=="function"&&l[a].apply(l,i)}),o}})})}function nr(e,t){var r=e._chartjs;if(!!r){var a=r.listeners,n=a.indexOf(t);n!==-1&&a.splice(n,1),!(a.length>0)&&(ar.forEach(function(i){delete e[i]}),delete e._chartjs)}}var mt=function(e,t){this.initialize(e,t)};h.extend(mt.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var r=this;r.chart=e,r.index=t,r.linkScales(),r.addElements(),r._type=r.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),r=e.chart,a=r.scales,n=e.getDataset(),i=r.options.scales;(t.xAxisID===null||!(t.xAxisID in a)||n.xAxisID)&&(t.xAxisID=n.xAxisID||i.xAxes[0].id),(t.yAxisID===null||!(t.yAxisID in a)||n.yAxisID)&&(t.yAxisID=n.yAxisID||i.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&nr(this._data,this)},createMetaDataset:function(){var e=this,t=e.datasetElementType;return t&&new t({_chart:e.chart,_datasetIndex:e.index})},createMetaData:function(e){var t=this,r=t.dataElementType;return r&&new r({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e=this,t=e.getMeta(),r=e.getDataset().data||[],a=t.data,n,i;for(n=0,i=r.length;na&&e.insertElements(a,n-a)},insertElements:function(e,t){for(var r=0;rn?(i=n/t.innerRadius,e.arc(o,l,t.innerRadius-n,a+i,r-i,!0)):e.arc(o,l,n,a+Math.PI/2,r-Math.PI/2),e.closePath(),e.clip()}function Ra(e,t,r,a){var n=r.endAngle,i;for(a&&(r.endAngle=r.startAngle+te,ir(e,r),r.endAngle=n,r.endAngle===r.startAngle&&r.fullCircles&&(r.endAngle+=te,r.fullCircles--)),e.beginPath(),e.arc(r.x,r.y,r.innerRadius,r.startAngle+te,r.startAngle,!0),i=0;il;)n-=te;for(;n=o&&n<=l,u=i>=r.innerRadius&&i<=r.outerRadius;return s&&u}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,r=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*r,y:e.y+Math.sin(t)*r}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,r=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*r,y:e.y+Math.sin(t)*r}},draw:function(){var e=this._chart.ctx,t=this._view,r=t.borderAlign==="inner"?.33:0,a={x:t.x,y:t.y,innerRadius:t.innerRadius,outerRadius:Math.max(t.outerRadius-r,0),pixelMargin:r,startAngle:t.startAngle,endAngle:t.endAngle,fullCircles:Math.floor(t.circumference/te)},n;if(e.save(),e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+te,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),n=0;ne.x&&(t=hr(t,"left","right")):e.baser?r:i,r:n.right||o<0?0:o>t?t:o,b:n.bottom||l<0?0:l>r?r:l,l:n.left||s<0?0:s>t?t:s}}function qa(e){var t=fr(e),r=t.right-t.left,a=t.bottom-t.top,n=ja(e,r/2,a/2);return{outer:{x:t.left,y:t.top,w:r,h:a},inner:{x:t.left+n.l,y:t.top+n.t,w:r-n.l-n.r,h:a-n.t-n.b}}}function Re(e,t,r){var a=t===null,n=r===null,i=!e||a&&n?!1:fr(e);return i&&(a||t>=i.left&&t<=i.right)&&(n||r>=i.top&&r<=i.bottom)}var Ua=ee.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,r=qa(t),a=r.outer,n=r.inner;e.fillStyle=t.backgroundColor,e.fillRect(a.x,a.y,a.w,a.h),!(a.w===n.w&&a.h===n.h)&&(e.save(),e.beginPath(),e.rect(a.x,a.y,a.w,a.h),e.clip(),e.fillStyle=t.borderColor,e.rect(n.x,n.y,n.w,n.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return Re(this._view,e,t)},inLabelRange:function(e,t){var r=this._view;return Ke(r)?Re(r,e,null):Re(r,null,t)},inXRange:function(e){return Re(this._view,e,null)},inYRange:function(e){return Re(this._view,null,e)},getCenterPoint:function(){var e=this._view,t,r;return Ke(e)?(t=e.x,r=(e.y+e.base)/2):(t=(e.x+e.base)/2,r=e.y),{x:t,y:r}},getArea:function(){var e=this._view;return Ke(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y}}}),E={},$a=Na,Ya=za,Ga=Ha,Xa=Ua;E.Arc=$a,E.Line=Ya,E.Point=Ga,E.Rectangle=Xa;var Be=h._deprecated,Se=h.valueOrDefault;_._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),_._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});function Ka(e,t){var r=e._length,a,n,i,o;for(i=1,o=t.length;i0?Math.min(r,Math.abs(n-a)):r,a=n;return r}function Za(e,t,r){var a=r.barThickness,n=t.stackCount,i=t.pixels[e],o=h.isNullOrUndef(a)?Ka(t.scale,t.pixels):-1,l,s;return h.isNullOrUndef(a)?(l=o*r.categoryPercentage,s=r.barPercentage):(l=a*n,s=1),{chunk:l/n,ratio:s,start:i-l/2}}function Ja(e,t,r){var a=t.pixels,n=a[e],i=e>0?a[e-1]:null,o=e=0&&u.min>=0?u.min:u.max,g=u.start===void 0?u.end:u.max>=0&&u.min>=0?u.max-u.min:u.min-u.max,p=s.length,m,b,x,y,w,k,D;if(f||f===void 0&&c!==void 0)for(m=0;m=0&&D.max>=0?D.max:D.min,(u.min<0&&x<0||u.max>=0&&x>0)&&(v+=x));return y=i.getPixelForValue(v),w=i.getPixelForValue(v+g),k=w-y,d!==void 0&&Math.abs(k)=0&&!o||g<0&&o?w=y-d:w=y+d),{size:k,base:y,head:w,center:w+k/2}},calculateBarIndexPixels:function(e,t,r,a){var n=this,i=a.barThickness==="flex"?Ja(t,r,a):Za(t,r,a),o=n.getStackIndex(e,n.getMeta().stack),l=i.start+i.chunk*o+i.chunk/2,s=Math.min(Se(a.maxBarThickness,1/0),i.chunk*i.ratio);return{base:l-s/2,head:l+s/2,center:l,size:s}},draw:function(){var e=this,t=e.chart,r=e._getValueScale(),a=e.getMeta().data,n=e.getDataset(),i=a.length,o=0;for(h.canvas.clipArea(t.ctx,t.chartArea);o=ve?-ne:x<-ve?ne:0;var y=x+c,w=Math.cos(x),k=Math.sin(x),D=Math.cos(y),C=Math.sin(y),P=x<=0&&y>=0||y>=ne,T=x<=ge&&y>=ge||y>=ne+ge,R=x===-ve||y>=ve,L=x<=-ge&&y>=-ge||y>=ve+ge,I=R?-1:Math.min(w,w*f,D,D*f),B=L?-1:Math.min(k,k*f,C,C*f),Te=P?1:Math.max(w,w*f,D,D*f),Fe=T?1:Math.max(k,k*f,C,C*f);i=(Te-I)/2,o=(Fe-B)/2,l=-(Te+I)/2,s=-(Fe+B)/2}for(m=0,b=d.length;m0&&!isNaN(e)?ne*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t=this,r=0,a=t.chart,n,i,o,l,s,u,d,f;if(!e){for(n=0,i=a.data.datasets.length;nr?d:r,r=f>r?f:r);return r},setHoverStyle:function(e){var t=e._model,r=e._options,a=h.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=Ze(r.hoverBackgroundColor,a(r.backgroundColor)),t.borderColor=Ze(r.hoverBorderColor,a(r.borderColor)),t.borderWidth=Ze(r.hoverBorderWidth,r.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,r=0;r0&&xt(i[o-1]._model,n)&&(s.controlPointPreviousX=d(s.controlPointPreviousX,n.left,n.right),s.controlPointPreviousY=d(s.controlPointPreviousY,n.top,n.bottom)),o0&&(i=e.getDatasetMeta(i[0]._datasetIndex).data),i},"x-axis":function(e,t){return wt(e,t,{intersect:!1})},point:function(e,t){var r=me(t,e);return yt(e,r)},nearest:function(e,t,r){var a=me(t,e);r.axis=r.axis||"xy";var n=kt(r.axis);return _t(e,a,r.intersect,n)},x:function(e,t,r){var a=me(t,e),n=[],i=!1;return Ne(e,function(o){o.inXRange(a.x)&&n.push(o),o.inRange(a.x,a.y)&&(i=!0)}),r.intersect&&!i&&(n=[]),n},y:function(e,t,r){var a=me(t,e),n=[],i=!1;return Ne(e,function(o){o.inYRange(a.y)&&n.push(o),o.inRange(a.x,a.y)&&(i=!0)}),r.intersect&&!i&&(n=[]),n}}},Mt=h.extend;function ze(e,t){return h.where(e,function(r){return r.pos===t})}function Je(e,t){return e.sort(function(r,a){var n=t?a:r,i=t?r:a;return n.weight===i.weight?n.index-i.index:n.weight-i.weight})}function fn(e){var t=[],r,a,n;for(r=0,a=(e||[]).length;r div {\r position: absolute;\r width: 1000000px;\r height: 1000000px;\r left: 0;\r top: 0;\r }\r \r .chartjs-size-monitor-shrink > div {\r position: absolute;\r width: 200%;\r height: 200%;\r left: 0;\r top: 0;\r }\r `,xn=Object.freeze({__proto__:null,default:bn}),yn=Ie(xn),N="$chartjs",St="chartjs-",Ct=St+"size-monitor",yr=St+"render-monitor",_n=St+"render-animation",_r=["animationstart","webkitAnimationStart"],kn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function kr(e,t){var r=h.getStyle(e,t),a=r&&r.match(/^(\d+)(\.\d+)?px$/);return a?Number(a[1]):void 0}function wn(e,t){var r=e.style,a=e.getAttribute("height"),n=e.getAttribute("width");if(e[N]={initial:{height:a,width:n,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",n===null||n===""){var i=kr(e,"width");i!==void 0&&(e.width=i)}if(a===null||a==="")if(e.style.height==="")e.height=e.width/(t.options.aspectRatio||2);else{var o=kr(e,"height");i!==void 0&&(e.height=o)}return e}var Mn=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("e",null,t)}catch{}return e}(),wr=Mn?{passive:!0}:!1;function Ee(e,t,r){e.addEventListener(t,r,wr)}function Dt(e,t,r){e.removeEventListener(t,r,wr)}function Pt(e,t,r,a,n){return{type:e,chart:t,native:n||null,x:r!==void 0?r:null,y:a!==void 0?a:null}}function Sn(e,t){var r=kn[e.type]||e.type,a=h.getRelativePosition(e,t);return Pt(r,t,a.x,a.y,e)}function Cn(e,t){var r=!1,a=[];return function(){a=Array.prototype.slice.call(arguments),t=t||this,r||(r=!0,h.requestAnimFrame.call(window,function(){r=!1,e.apply(t,a)}))}}function We(e){var t=document.createElement("div");return t.className=e||"",t}function Dn(e){var t=1e6,r=We(Ct),a=We(Ct+"-expand"),n=We(Ct+"-shrink");a.appendChild(We()),n.appendChild(We()),r.appendChild(a),r.appendChild(n),r._reset=function(){a.scrollLeft=t,a.scrollTop=t,n.scrollLeft=t,n.scrollTop=t};var i=function(){r._reset(),e()};return Ee(a,"scroll",i.bind(a,"expand")),Ee(n,"scroll",i.bind(n,"shrink")),r}function Pn(e,t){var r=e[N]||(e[N]={}),a=r.renderProxy=function(n){n.animationName===_n&&t()};h.each(_r,function(n){Ee(e,n,a)}),r.reflow=!!e.offsetParent,e.classList.add(yr)}function An(e){var t=e[N]||{},r=t.renderProxy;r&&(h.each(_r,function(a){Dt(e,a,r)}),delete t.renderProxy),e.classList.remove(yr)}function Tn(e,t,r){var a=e[N]||(e[N]={}),n=a.resizer=Dn(Cn(function(){if(a.resizer){var i=r.options.maintainAspectRatio&&e.parentNode,o=i?i.clientWidth:0;t(Pt("resize",r)),i&&i.clientWidth0){var i=e[0];i.label?r=i.label:i.xLabel?r=i.xLabel:n>0&&i.index-1?e.split(` `):e}function Ln(e){var t=e._xScale,r=e._yScale||e._scale,a=e._index,n=e._datasetIndex,i=e._chart.getDatasetMeta(n).controller,o=i._getIndexScale(),l=i._getValueScale();return{xLabel:t?t.getLabelForIndex(a,n):"",yLabel:r?r.getLabelForIndex(a,n):"",label:o?""+o.getLabelForIndex(a,n):"",value:l?""+l.getLabelForIndex(a,n):"",index:a,datasetIndex:n,x:e._model.x,y:e._model.y}}function Cr(e){var t=_.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:oe(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:oe(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:oe(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:oe(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:oe(e.titleFontStyle,t.defaultFontStyle),titleFontSize:oe(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:oe(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:oe(e.footerFontStyle,t.defaultFontStyle),footerFontSize:oe(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function Rn(e,t){var r=e._chart.ctx,a=t.yPadding*2,n=0,i=t.body,o=i.reduce(function(g,p){return g+p.before.length+p.lines.length+p.after.length},0);o+=t.beforeBody.length+t.afterBody.length;var l=t.title.length,s=t.footer.length,u=t.titleFontSize,d=t.bodyFontSize,f=t.footerFontSize;a+=l*u,a+=l?(l-1)*t.titleSpacing:0,a+=l?t.titleMarginBottom:0,a+=o*d,a+=o?(o-1)*t.bodySpacing:0,a+=s?t.footerMarginTop:0,a+=s*f,a+=s?(s-1)*t.footerSpacing:0;var c=0,v=function(g){n=Math.max(n,r.measureText(g).width+c)};return r.font=h.fontString(u,t._titleFontStyle,t._titleFontFamily),h.each(t.title,v),r.font=h.fontString(d,t._bodyFontStyle,t._bodyFontFamily),h.each(t.beforeBody.concat(t.afterBody),v),c=t.displayColors?d+2:0,h.each(i,function(g){h.each(g.before,v),h.each(g.lines,v),h.each(g.after,v)}),c=0,r.font=h.fontString(f,t._footerFontStyle,t._footerFontFamily),h.each(t.footer,v),n+=2*t.xPadding,{width:n,height:a}}function Bn(e,t){var r=e._model,a=e._chart,n=e._chart.chartArea,i="center",o="center";r.ya.height-t.height&&(o="bottom");var l,s,u,d,f,c=(n.left+n.right)/2,v=(n.top+n.bottom)/2;o==="center"?(l=function(p){return p<=c},s=function(p){return p>c}):(l=function(p){return p<=t.width/2},s=function(p){return p>=a.width-t.width/2}),u=function(p){return p+t.width+r.caretSize+r.caretPadding>a.width},d=function(p){return p-t.width-r.caretSize-r.caretPadding<0},f=function(p){return p<=v?"top":"bottom"},l(r.x)?(i="left",u(r.x)&&(i="center",o=f(r.y))):s(r.x)&&(i="right",d(r.x)&&(i="center",o=f(r.y)));var g=e._options;return{xAlign:g.xAlign?g.xAlign:i,yAlign:g.yAlign?g.yAlign:o}}function Nn(e,t,r,a){var n=e.x,i=e.y,o=e.caretSize,l=e.caretPadding,s=e.cornerRadius,u=r.xAlign,d=r.yAlign,f=o+l,c=s+l;return u==="right"?n-=t.width:u==="center"&&(n-=t.width/2,n+t.width>a.width&&(n=a.width-t.width),n<0&&(n=0)),d==="top"?i+=f:d==="bottom"?i-=t.height+f:i-=t.height/2,d==="center"?u==="left"?n+=f:u==="right"&&(n-=f):u==="left"?n-=c:u==="right"&&(n+=c),{x:n,y:i}}function et(e,t){return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-e.xPadding:e.x+e.xPadding}function Dr(e){return re([],se(e))}var zn=ee.extend({initialize:function(){this._model=Cr(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options,r=t.callbacks,a=r.beforeTitle.apply(e,arguments),n=r.title.apply(e,arguments),i=r.afterTitle.apply(e,arguments),o=[];return o=re(o,se(a)),o=re(o,se(n)),o=re(o,se(i)),o},getBeforeBody:function(){return Dr(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var r=this,a=r._options.callbacks,n=[];return h.each(e,function(i){var o={before:[],lines:[],after:[]};re(o.before,se(a.beforeLabel.call(r,i,t))),re(o.lines,a.label.call(r,i,t)),re(o.after,se(a.afterLabel.call(r,i,t))),n.push(o)}),n},getAfterBody:function(){return Dr(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,r=t.beforeFooter.apply(e,arguments),a=t.footer.apply(e,arguments),n=t.afterFooter.apply(e,arguments),i=[];return i=re(i,se(r)),i=re(i,se(a)),i=re(i,se(n)),i},update:function(e){var t=this,r=t._options,a=t._model,n=t._model=Cr(r),i=t._active,o=t._data,l={xAlign:a.xAlign,yAlign:a.yAlign},s={x:a.x,y:a.y},u={width:a.width,height:a.height},d={x:a.caretX,y:a.caretY},f,c;if(i.length){n.opacity=1;var v=[],g=[];d=Sr[r.position].call(t,i,t._eventPosition);var p=[];for(f=0,c=i.length;f0&&r.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(t.opacity!==0){var r={width:t.width,height:t.height},a={x:t.x,y:t.y},n=Math.abs(t.opacity<.001)?0:t.opacity,i=t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length;this._options.enabled&&i&&(e.save(),e.globalAlpha=n,this.drawBackground(a,t,e,r),a.y+=t.yPadding,h.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),h.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t=this,r=t._options,a=!1;return t._lastActive=t._lastActive||[],e.type==="mouseout"?t._active=[]:(t._active=t._chart.getElementsAtEventForMode(e,r.mode,r),r.reverse&&t._active.reverse()),a=!h.arrayEquals(t._active,t._lastActive),a&&(t._lastActive=t._active,(r.enabled||r.custom)&&(t._eventPosition={x:e.x,y:e.y},t.update(!0),t.pivot())),a}}),En=Sr,Tt=zn;Tt.positioners=En;var Ft=h.valueOrDefault;_._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});function Pr(){return h.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,r,a){if(e==="xAxes"||e==="yAxes"){var n=r[e].length,i,o,l;for(t[e]||(t[e]=[]),i=0;i=t[e].length&&t[e].push({}),!t[e][i].type||l.type&&l.type!==t[e][i].type?h.merge(t[e][i],[He.getScaleDefaults(o),l]):h.merge(t[e][i],l)}else h._merger(e,t,r,a)}})}function It(){return h.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,r,a){var n=t[e]||Object.create(null),i=r[e];e==="scales"?t[e]=Pr(n,i):e==="scale"?t[e]=h.merge(n,[He.getScaleDefaults(i.type),i]):h._merger(e,t,r,a)}})}function Wn(e){e=e||Object.create(null);var t=e.data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=It(_.global,_[e.type],e.options||{}),e}function Hn(e){var t=e.options;h.each(e.scales,function(r){Z.removeBox(e,r)}),t=It(_.global,_[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function Ar(e,t,r){var a,n=function(i){return i.id===a};do a=t+r++;while(h.findIndex(e,n)>=0);return a}function Tr(e){return e==="top"||e==="bottom"}function Fr(e,t){return function(r,a){return r[e]===a[e]?r[t]-a[t]:r[e]-a[e]}}var ue=function(e,t){return this.construct(e,t),this};h.extend(ue.prototype,{construct:function(e,t){var r=this;t=Wn(t);var a=De.acquireContext(e,t),n=a&&a.canvas,i=n&&n.height,o=n&&n.width;if(r.id=h.uid(),r.ctx=a,r.canvas=n,r.config=t,r.width=o,r.height=i,r.aspectRatio=i?o/i:null,r.options=t.options,r._bufferedRender=!1,r._layers=[],r.chart=r,r.controller=r,ue.instances[r.id]=r,Object.defineProperty(r,"data",{get:function(){return r.config.data},set:function(l){r.config.data=l}}),!a||!n){console.error("Failed to create chart: can't acquire context from the given item");return}r.initialize(),r.update()},initialize:function(){var e=this;return A.notify(e,"beforeInit"),h.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),A.notify(e,"afterInit"),e},clear:function(){return h.canvas.clear(this),this},stop:function(){return pt.cancelAnimation(this),this},resize:function(e){var t=this,r=t.options,a=t.canvas,n=r.maintainAspectRatio&&t.aspectRatio||null,i=Math.max(0,Math.floor(h.getMaximumWidth(a))),o=Math.max(0,Math.floor(n?i/n:h.getMaximumHeight(a)));if(!(t.width===i&&t.height===o)&&(a.width=t.width=i,a.height=t.height=o,a.style.width=i+"px",a.style.height=o+"px",h.retinaScale(t,r.devicePixelRatio),!e)){var l={width:i,height:o};A.notify(t,"resize",[l]),r.onResize&&r.onResize(t,l),t.stop(),t.update({duration:r.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},r=e.scale;h.each(t.xAxes,function(a,n){a.id||(a.id=Ar(t.xAxes,"x-axis-",n))}),h.each(t.yAxes,function(a,n){a.id||(a.id=Ar(t.yAxes,"y-axis-",n))}),r&&(r.id=r.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,r=e.scales||{},a=[],n=Object.keys(r).reduce(function(i,o){return i[o]=!1,i},{});t.scales&&(a=a.concat((t.scales.xAxes||[]).map(function(i){return{options:i,dtype:"category",dposition:"bottom"}}),(t.scales.yAxes||[]).map(function(i){return{options:i,dtype:"linear",dposition:"left"}}))),t.scale&&a.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),h.each(a,function(i){var o=i.options,l=o.id,s=Ft(o.type,i.dtype);Tr(o.position)!==Tr(i.dposition)&&(o.position=i.dposition),n[l]=!0;var u=null;if(l in r&&r[l].type===s)u=r[l],u.options=o,u.ctx=e.ctx,u.chart=e;else{var d=He.getScaleConstructor(s);if(!d)return;u=new d({id:l,type:s,options:o,ctx:e.ctx,chart:e}),r[u.id]=u}u.mergeTicksOptions(),i.isDefault&&(e.scale=u)}),h.each(n,function(i,o){i||delete r[o]}),e.scales=r,He.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,t=[],r=e.data.datasets,a,n;for(a=0,n=r.length;a=0;--a)t.drawDataset(r[a],e);A.notify(t,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var r=this,a={meta:e,index:e.index,easingValue:t};A.notify(r,"beforeDatasetDraw",[a])!==!1&&(e.controller.draw(t),A.notify(r,"afterDatasetDraw",[a]))},_drawTooltip:function(e){var t=this,r=t.tooltip,a={tooltip:r,easingValue:e};A.notify(t,"beforeTooltipDraw",[a])!==!1&&(r.draw(),A.notify(t,"afterTooltipDraw",[a]))},getElementAtEvent:function(e){return Ce.modes.single(this,e)},getElementsAtEvent:function(e){return Ce.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return Ce.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,r){var a=Ce.modes[t];return typeof a=="function"?a(this,e,r):[]},getDatasetAtEvent:function(e){return Ce.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,r=t.data.datasets[e];r._meta||(r._meta={});var a=r._meta[t.id];return a||(a=r._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r.order||0,index:e}),a},getVisibleDatasetCount:function(){for(var e=0,t=0,r=this.data.datasets.length;t=0;o--){var l=a[o];if(n(l))return l}},h.isNumber=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},h.almostEquals=function(a,n,i){return Math.abs(a-n)=a},h.max=function(a){return a.reduce(function(n,i){return isNaN(i)?n:Math.max(n,i)},Number.NEGATIVE_INFINITY)},h.min=function(a){return a.reduce(function(n,i){return isNaN(i)?n:Math.min(n,i)},Number.POSITIVE_INFINITY)},h.sign=Math.sign?function(a){return Math.sign(a)}:function(a){return a=+a,a===0||isNaN(a)?a:a>0?1:-1},h.toRadians=function(a){return a*(Math.PI/180)},h.toDegrees=function(a){return a*(180/Math.PI)},h._decimalPlaces=function(a){if(!!h.isFinite(a)){for(var n=1,i=0;Math.round(a*n)/n!==a;)n*=10,i++;return i}},h.getAngleFromPoint=function(a,n){var i=n.x-a.x,o=n.y-a.y,l=Math.sqrt(i*i+o*o),s=Math.atan2(o,i);return s<-.5*Math.PI&&(s+=2*Math.PI),{angle:s,distance:l}},h.distanceBetweenPoints=function(a,n){return Math.sqrt(Math.pow(n.x-a.x,2)+Math.pow(n.y-a.y,2))},h.aliasPixel=function(a){return a%2==0?0:.5},h._alignPixel=function(a,n,i){var o=a.currentDevicePixelRatio,l=i/2;return Math.round((n-l)*o)/o+l},h.splineCurve=function(a,n,i,o){var l=a.skip?n:a,s=n,u=i.skip?n:i,d=Math.sqrt(Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2)),f=Math.sqrt(Math.pow(u.x-s.x,2)+Math.pow(u.y-s.y,2)),c=d/(d+f),v=f/(d+f);c=isNaN(c)?0:c,v=isNaN(v)?0:v;var g=o*c,p=o*v;return{previous:{x:s.x-g*(u.x-l.x),y:s.y-g*(u.y-l.y)},next:{x:s.x+p*(u.x-l.x),y:s.y+p*(u.y-l.y)}}},h.EPSILON=Number.EPSILON||1e-14,h.splineCurveMonotone=function(a){var n=(a||[]).map(function(m){return{model:m._model,deltaK:0,mK:0}}),i=n.length,o,l,s,u;for(o=0;o0?n[o-1]:null,u=o0?n[o-1]:null,u=o=a.length-1?a[0]:a[n+1]:n>=a.length-1?a[a.length-1]:a[n+1]},h.previousItem=function(a,n,i){return i?n<=0?a[a.length-1]:a[n-1]:n<=0?a[0]:a[n-1]},h.niceNum=function(a,n){var i=Math.floor(h.log10(a)),o=a/Math.pow(10,i),l;return n?o<1.5?l=1:o<3?l=2:o<7?l=5:l=10:o<=1?l=1:o<=2?l=2:o<=5?l=5:l=10,l*Math.pow(10,i)},h.requestAnimFrame=function(){return typeof window=="undefined"?function(a){a()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,1e3/60)}}(),h.getRelativePosition=function(a,n){var i,o,l=a.originalEvent||a,s=a.target||a.srcElement,u=s.getBoundingClientRect(),d=l.touches;d&&d.length>0?(i=d[0].clientX,o=d[0].clientY):(i=l.clientX,o=l.clientY);var f=parseFloat(h.getStyle(s,"padding-left")),c=parseFloat(h.getStyle(s,"padding-top")),v=parseFloat(h.getStyle(s,"padding-right")),g=parseFloat(h.getStyle(s,"padding-bottom")),p=u.right-u.left-f-v,m=u.bottom-u.top-c-g;return i=Math.round((i-u.left-f)/p*s.width/n.currentDevicePixelRatio),o=Math.round((o-u.top-c)/m*s.height/n.currentDevicePixelRatio),{x:i,y:o}};function e(a,n,i){var o;return typeof a=="string"?(o=parseInt(a,10),a.indexOf("%")!==-1&&(o=o/100*n.parentNode[i])):o=a,o}function t(a){return a!=null&&a!=="none"}function r(a,n,i){var o=document.defaultView,l=h._getParentNode(a),s=o.getComputedStyle(a)[n],u=o.getComputedStyle(l)[n],d=t(s),f=t(u),c=Number.POSITIVE_INFINITY;return d||f?Math.min(d?e(s,a,i):c,f?e(u,l,i):c):"none"}h.getConstraintWidth=function(a){return r(a,"max-width","clientWidth")},h.getConstraintHeight=function(a){return r(a,"max-height","clientHeight")},h._calculatePadding=function(a,n,i){return n=h.getStyle(a,n),n.indexOf("%")>-1?i*parseInt(n,10)/100:parseInt(n,10)},h._getParentNode=function(a){var n=a.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n},h.getMaximumWidth=function(a){var n=h._getParentNode(a);if(!n)return a.clientWidth;var i=n.clientWidth,o=h._calculatePadding(n,"padding-left",i),l=h._calculatePadding(n,"padding-right",i),s=i-o-l,u=h.getConstraintWidth(a);return isNaN(u)?s:Math.min(s,u)},h.getMaximumHeight=function(a){var n=h._getParentNode(a);if(!n)return a.clientHeight;var i=n.clientHeight,o=h._calculatePadding(n,"padding-top",i),l=h._calculatePadding(n,"padding-bottom",i),s=i-o-l,u=h.getConstraintHeight(a);return isNaN(u)?s:Math.min(s,u)},h.getStyle=function(a,n){return a.currentStyle?a.currentStyle[n]:document.defaultView.getComputedStyle(a,null).getPropertyValue(n)},h.retinaScale=function(a,n){var i=a.currentDevicePixelRatio=n||typeof window!="undefined"&&window.devicePixelRatio||1;if(i!==1){var o=a.canvas,l=a.height,s=a.width;o.height=l*i,o.width=s*i,a.ctx.scale(i,i),!o.style.height&&!o.style.width&&(o.style.height=l+"px",o.style.width=s+"px")}},h.fontString=function(a,n,i){return n+" "+a+"px "+i},h.longestText=function(a,n,i,o){o=o||{};var l=o.data=o.data||{},s=o.garbageCollect=o.garbageCollect||[];o.font!==n&&(l=o.data={},s=o.garbageCollect=[],o.font=n),a.font=n;var u=0,d=i.length,f,c,v,g,p;for(f=0;fi.length){for(f=0;fo&&(o=s),o},h.numberOfLabelLines=function(a){var n=1;return h.each(a,function(i){h.isArray(i)&&i.length>n&&(n=i.length)}),n},h.color=Ye?function(a){return a instanceof CanvasGradient&&(a=_.global.defaultColor),Ye(a)}:function(a){return console.error("Color.js not found!"),a},h.getHoverColor=function(a){return a instanceof CanvasPattern||a instanceof CanvasGradient?a:h.color(a).saturate(.5).darken(.1).rgbString()}};function be(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function tt(e){this.options=e||{}}h.extend(tt.prototype,{formats:be,parse:be,format:be,add:be,diff:be,startOf:be,endOf:be,_create:function(e){return e}}),tt.override=function(e){h.extend(tt.prototype,e)};var jn=tt,Ot={_date:jn},Ve={formatters:{values:function(e){return h.isArray(e)?e:""+e},linear:function(e,t,r){var a=r.length>3?r[2]-r[1]:r[1]-r[0];Math.abs(a)>1&&e!==Math.floor(e)&&(a=e-Math.floor(e));var n=h.log10(Math.abs(a)),i="";if(e!==0){var o=Math.max(Math.abs(r[0]),Math.abs(r[r.length-1]));if(o<1e-4){var l=h.log10(Math.abs(e)),s=Math.floor(l)-Math.floor(n);s=Math.max(Math.min(s,20),0),i=e.toExponential(s)}else{var u=-1*Math.floor(n);u=Math.max(Math.min(u,20),0),i=e.toFixed(u)}}else i="0";return i},logarithmic:function(e,t,r){var a=e/Math.pow(10,Math.floor(h.log10(e)));return e===0?"0":a===1||a===2||a===5||t===0||t===r.length-1?e.toExponential():""}}},xe=h.isArray,je=h.isNullOrUndef,ye=h.valueOrDefault,Pe=h.valueAtIndexOrDefault;_._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:Ve.formatters.values,minor:{},major:{}}});function qn(e,t){for(var r=[],a=e.length/t,n=0,i=e.length;nl+s)))return i}function $n(e,t){h.each(e,function(r){var a=r.gc,n=a.length/2,i;if(n>t){for(i=0;ii)return l;return Math.max(i,1)}function Kn(e){var t=[],r,a;for(r=0,a=e.length;r=i||a<=1||!e.isHorizontal()){e.labelRotation=n;return}l=e._getLabelSizes(),s=l.widest.width,u=l.highest.height-l.highest.offset,d=Math.min(e.maxWidth,e.chart.width-s),f=t.offset?e.maxWidth/a:d/(a-1),s+6>f&&(f=d/(a-(t.offset?.5:1)),c=e.maxHeight-qe(t.gridLines)-r.padding-Lt(t.scaleLabel),v=Math.sqrt(s*s+u*u),o=h.toDegrees(Math.min(Math.asin(Math.min((l.highest.height+6)/f,1)),Math.asin(Math.min(c/v,1))-Math.asin(u/v))),o=Math.max(n,Math.min(i,o))),e.labelRotation=o},afterCalculateTickRotation:function(){h.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){h.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},r=e.chart,a=e.options,n=a.ticks,i=a.scaleLabel,o=a.gridLines,l=e._isVisible(),s=a.position==="bottom",u=e.isHorizontal();if(u?t.width=e.maxWidth:l&&(t.width=qe(o)+Lt(i)),u?l&&(t.height=qe(o)+Lt(i)):t.height=e.maxHeight,n.display&&l){var d=Rt(n),f=e._getLabelSizes(),c=f.first,v=f.last,g=f.widest,p=f.highest,m=d.minor.lineHeight*.4,b=n.padding;if(u){var x=e.labelRotation!==0,y=h.toRadians(e.labelRotation),w=Math.cos(y),k=Math.sin(y),D=k*g.width+w*(p.height-(x?p.offset:0))+(x?0:m);t.height=Math.min(e.maxHeight,t.height+D+b);var C=e.getPixelForTick(0)-e.left,P=e.right-e.getPixelForTick(e.getTicks().length-1),T,R;x?(T=s?w*c.width+k*c.offset:k*(c.height-c.offset),R=s?k*(v.height-v.offset):w*v.width+k*v.offset):(T=c.width/2,R=v.width/2),e.paddingLeft=Math.max((T-C)*e.width/(e.width-C),0)+3,e.paddingRight=Math.max((R-P)*e.width/(e.width-P),0)+3}else{var L=n.mirror?0:g.width+b+m;t.width=Math.min(e.maxWidth,t.width+L),e.paddingTop=c.height/2,e.paddingBottom=v.height/2}}e.handleMargins(),u?(e.width=e._length=r.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=r.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){h.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position;return e==="top"||e==="bottom"},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if(je(e))return NaN;if((typeof e=="number"||e instanceof Number)&&!isFinite(e))return NaN;if(e){if(this.isHorizontal()){if(e.x!==void 0)return this.getRightValue(e.x)}else if(e.y!==void 0)return this.getRightValue(e.y)}return e},_convertTicksToLabels:function(e){var t=this,r,a,n;for(t.ticks=e.map(function(i){return i.value}),t.beforeTickToLabelConversion(),r=t.convertTicksToLabels(e)||t.ticks,t.afterTickToLabelConversion(),a=0,n=e.length;aa-1?null:t.getPixelForDecimal(e*n+(r?n/2:0))},getPixelForDecimal:function(e){var t=this;return t._reversePixels&&(e=1-e),t._startPixel+e*t._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this,t=e.min,r=e.max;return e.beginAtZero?0:t<0&&r<0?r:t>0&&r>0?t:0},_autoSkip:function(e){var t=this,r=t.options.ticks,a=t._length,n=r.maxTicksLimit||a/t._tickSize()+1,i=r.major.enabled?Kn(e):[],o=i.length,l=i[0],s=i[o-1],u,d,f,c;if(o>n)return Zn(e,i,o/n),Bt(e);if(f=Xn(i,e,a,n),o>0){for(u=0,d=o-1;u1?(s-l)/(o-1):null,rt(e,f,h.isNullOrUndef(c)?0:l-c,l),rt(e,f,s,h.isNullOrUndef(c)?e.length:s+c),Bt(e)}return rt(e,f),Bt(e)},_tickSize:function(){var e=this,t=e.options.ticks,r=h.toRadians(e.labelRotation),a=Math.abs(Math.cos(r)),n=Math.abs(Math.sin(r)),i=e._getLabelSizes(),o=t.autoSkipPadding||0,l=i?i.widest.width+o:0,s=i?i.highest.height+o:0;return e.isHorizontal()?s*a>l*n?l/a:s/n:s*n=0&&(i=l)),n!==void 0&&(l=t.indexOf(n),l>=0&&(o=l)),e.minIndex=i,e.maxIndex=o,e.min=t[i],e.max=t[o]},buildTicks:function(){var e=this,t=e._getLabels(),r=e.minIndex,a=e.maxIndex;e.ticks=r===0&&a===t.length-1?t:t.slice(r,a+1)},getLabelForIndex:function(e,t){var r=this,a=r.chart;return a.getDatasetMeta(t).controller._getValueScaleId()===r.id?r.getRightValue(a.data.datasets[t].data[e]):r._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,r=e.ticks;W.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),!!r&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(r.length-(t?0:1),1))},getPixelForValue:function(e,t,r){var a=this,n,i,o;return!zt(t)&&!zt(r)&&(e=a.chart.data.datasets[r].data[t]),zt(e)||(n=a.isHorizontal()?e.x:e.y),(n!==void 0||e!==void 0&&isNaN(t))&&(i=a._getLabels(),e=h.valueOrDefault(n,e),o=i.indexOf(e),t=o!==-1?o:t,isNaN(t)&&(t=e)),a.getPixelForDecimal((t-a._startValue)/a._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=this,r=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(r,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}}),Qn=Jn;Or._defaults=Qn;var ei=h.noop,_e=h.isNullOrUndef;function ti(e,t){var r=[],a=1e-14,n=e.stepSize,i=n||1,o=e.maxTicks-1,l=e.min,s=e.max,u=e.precision,d=t.min,f=t.max,c=h.niceNum((f-d)/o/i)*i,v,g,p,m;if(co&&(c=h.niceNum(m*c/o/i)*i),n||_e(u)?v=Math.pow(10,h._decimalPlaces(c)):(v=Math.pow(10,u),c=Math.ceil(c*v)/v),g=Math.floor(d/c)*c,p=Math.ceil(f/c)*c,n&&(!_e(l)&&h.almostWhole(l/c,c/1e3)&&(g=l),!_e(s)&&h.almostWhole(s/c,c/1e3)&&(p=s)),m=(p-g)/c,h.almostEquals(m,Math.round(m),c/1e3)?m=Math.round(m):m=Math.ceil(m),g=Math.round(g*v)/v,p=Math.round(p*v)/v,r.push(_e(l)?g:l);for(var b=1;b0&&n>0&&(e.min=0)}var i=r.min!==void 0||r.suggestedMin!==void 0,o=r.max!==void 0||r.suggestedMax!==void 0;r.min!==void 0?e.min=r.min:r.suggestedMin!==void 0&&(e.min===null?e.min=r.suggestedMin:e.min=Math.min(e.min,r.suggestedMin)),r.max!==void 0?e.max=r.max:r.suggestedMax!==void 0&&(e.max===null?e.max=r.suggestedMax:e.max=Math.max(e.max,r.suggestedMax)),i!==o&&e.min>=e.max&&(i?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,r.beginAtZero||e.min--)},getTickLimit:function(){var e=this,t=e.options.ticks,r=t.stepSize,a=t.maxTicksLimit,n;return r?n=Math.ceil(e.max/r)-Math.floor(e.min/r)+1:(n=e._computeTickLimit(),a=a||11),a&&(n=Math.min(a,n)),n},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:ei,buildTicks:function(){var e=this,t=e.options,r=t.ticks,a=e.getTickLimit();a=Math.max(2,a);var n={maxTicks:a,min:r.min,max:r.max,precision:r.precision,stepSize:h.valueOrDefault(r.fixedStepSize,r.stepSize)},i=e.ticks=ti(n,e);e.handleDirectionalChanges(),e.max=h.max(i),e.min=h.min(i),r.reverse?(i.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),W.prototype.convertTicksToLabels.call(e)},_configure:function(){var e=this,t=e.getTicks(),r=e.min,a=e.max,n;W.prototype._configure.call(e),e.options.offset&&t.length&&(n=(a-r)/Math.max(t.length-1,1)/2,r-=n,a+=n),e._startValue=r,e._endValue=a,e._valueRange=a-r}}),ri={position:"left",ticks:{callback:Ve.formatters.linear}},ai=0,ni=1;function ii(e,t,r){var a=[r.type,t===void 0&&r.stack===void 0?r.index:"",r.stack].join(".");return e[a]===void 0&&(e[a]={pos:[],neg:[]}),e[a]}function oi(e,t,r,a){var n=e.options,i=n.stacked,o=ii(t,i,r),l=o.pos,s=o.neg,u=a.length,d,f;for(d=0;dt.length-1?null:this.getPixelForValue(t[e])}}),li=ri;Lr._defaults=li;var Et=h.valueOrDefault,H=h.math.log10;function ui(e,t){var r=[],a=Et(e.min,Math.pow(10,Math.floor(H(t.min)))),n=Math.floor(H(t.max)),i=Math.ceil(t.max/Math.pow(10,n)),o,l;a===0?(o=Math.floor(H(t.minNotZero)),l=Math.floor(t.minNotZero/Math.pow(10,o)),r.push(a),a=l*Math.pow(10,o)):(o=Math.floor(H(a)),l=Math.floor(a/Math.pow(10,o)));var s=o<0?Math.pow(10,Math.abs(o)):1;do r.push(a),++l,l===10&&(l=1,++o,s=o>=0?1:s),a=Math.round(l*Math.pow(10,o)*s)/s;while(o=0?e:t}var Rr=W.extend({determineDataLimits:function(){var e=this,t=e.options,r=e.chart,a=r.data.datasets,n=e.isHorizontal();function i(m){return n?m.xAxisID===e.id:m.yAxisID===e.id}var o,l,s,u,d,f;e.min=Number.POSITIVE_INFINITY,e.max=Number.NEGATIVE_INFINITY,e.minNotZero=Number.POSITIVE_INFINITY;var c=t.stacked;if(c===void 0){for(o=0;o0){var b=h.min(m),x=h.max(m);e.min=Math.min(e.min,b),e.max=Math.max(e.max,x)}})}else for(o=0;o0?e.minNotZero=e.min:e.max<1?e.minNotZero=Math.pow(10,Math.floor(H(e.max))):e.minNotZero=r)},buildTicks:function(){var e=this,t=e.options.ticks,r=!e.isHorizontal(),a={min:nt(t.min),max:nt(t.max)},n=e.ticks=ui(a,e);e.max=h.max(n),e.min=h.min(n),t.reverse?(r=!r,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),r&&n.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),W.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForTick:function(e){var t=this.tickValues;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(H(e)),r=Math.floor(e/Math.pow(10,t));return r*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,r=0;W.prototype._configure.call(e),t===0&&(t=e._getFirstTickValue(e.minNotZero),r=Et(e.options.ticks.fontSize,_.global.defaultFontSize)/e._length),e._startValue=H(t),e._valueOffset=r,e._valueRange=(H(e.max)-H(t))/(1-r)},getPixelForValue:function(e){var t=this,r=0;return e=+t.getRightValue(e),e>t.min&&e>0&&(r=(H(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(r)},getValueForPixel:function(e){var t=this,r=t.getDecimalForPixel(e);return r===0&&t.min===0?0:Math.pow(10,t._startValue+(r-t._valueOffset)*t._valueRange)}}),fi=di;Rr._defaults=fi;var it=h.valueOrDefault,Wt=h.valueAtIndexOrDefault,Br=h.options.resolve,hi={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Ve.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function Ht(e){var t=e.ticks;return t.display&&e.display?it(t.fontSize,_.global.defaultFontSize)+t.backdropPaddingY*2:0}function ci(e,t,r){return h.isArray(r)?{w:h.longestText(e,e.font,r),h:r.length*t}:{w:e.measureText(r).width,h:t}}function Nr(e,t,r,a,n){return e===a||e===n?{start:t-r/2,end:t+r/2}:en?{start:t-r,end:t}:{start:t,end:t+r}}function vi(e){var t=h.options._parseFont(e.options.pointLabels),r={l:0,r:e.width,t:0,b:e.height-e.paddingTop},a={},n,i,o;e.ctx.font=t.string,e._pointLabelSizes=[];var l=e.chart.data.labels.length;for(n=0;nr.r&&(r.r=d.end,a.r=s),f.startr.b&&(r.b=f.end,a.b=s)}e.setReductions(e.drawingArea,r,a)}function gi(e){return e===0||e===180?"center":e<180?"left":"right"}function pi(e,t,r,a){var n=r.y+a/2,i,o;if(h.isArray(t))for(i=0,o=t.length;i270||e<90)&&(r.y-=t.h)}function bi(e){var t=e.ctx,r=e.options,a=r.pointLabels,n=Ht(r),i=e.getDistanceFromCenterForValue(r.ticks.reverse?e.min:e.max),o=h.options._parseFont(a);t.save(),t.font=o.string,t.textBaseline="middle";for(var l=e.chart.data.labels.length-1;l>=0;l--){var s=l===0?n/2:0,u=e.getPointPosition(l,i+s+5),d=Wt(a.fontColor,l,_.global.defaultFontColor);t.fillStyle=d;var f=e.getIndexAngle(l),c=h.toDegrees(f);t.textAlign=gi(c),mi(c,e._pointLabelSizes[l],u),pi(t,e.pointLabels[l],u,o.lineHeight)}t.restore()}function xi(e,t,r,a){var n=e.ctx,i=t.circular,o=e.chart.data.labels.length,l=Wt(t.color,a-1),s=Wt(t.lineWidth,a-1),u;if(!(!i&&!o||!l||!s)){if(n.save(),n.strokeStyle=l,n.lineWidth=s,n.setLineDash&&(n.setLineDash(t.borderDash||[]),n.lineDashOffset=t.borderDashOffset||0),n.beginPath(),i)n.arc(e.xCenter,e.yCenter,r,0,Math.PI*2);else{u=e.getPointPosition(0,r),n.moveTo(u.x,u.y);for(var d=1;d0&&a>0?r:0)},_drawGrid:function(){var e=this,t=e.ctx,r=e.options,a=r.gridLines,n=r.angleLines,i=it(n.lineWidth,a.lineWidth),o=it(n.color,a.color),l,s,u;if(r.pointLabels.display&&bi(e),a.display&&h.each(e.ticks,function(d,f){f!==0&&(s=e.getDistanceFromCenterForValue(e.ticksAsNumbers[f]),xi(e,a,s,f))}),n.display&&i&&o){for(t.save(),t.lineWidth=i,t.strokeStyle=o,t.setLineDash&&(t.setLineDash(Br([n.borderDash,a.borderDash,[]])),t.lineDashOffset=Br([n.borderDashOffset,a.borderDashOffset,0])),l=e.chart.data.labels.length-1;l>=0;l--)s=e.getDistanceFromCenterForValue(r.ticks.reverse?e.min:e.max),u=e.getPointPosition(l,s),t.beginPath(),t.moveTo(e.xCenter,e.yCenter),t.lineTo(u.x,u.y),t.stroke();t.restore()}},_drawLabels:function(){var e=this,t=e.ctx,r=e.options,a=r.ticks;if(!!a.display){var n=e.getIndexAngle(0),i=h.options._parseFont(a),o=it(a.fontColor,_.global.defaultFontColor),l,s;t.save(),t.font=i.string,t.translate(e.xCenter,e.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",h.each(e.ticks,function(u,d){d===0&&!a.reverse||(l=e.getDistanceFromCenterForValue(e.ticksAsNumbers[d]),a.showLabelBackdrop&&(s=t.measureText(u).width,t.fillStyle=a.backdropColor,t.fillRect(-s/2-a.backdropPaddingX,-l-i.size/2-a.backdropPaddingY,s+a.backdropPaddingX*2,i.size+a.backdropPaddingY*2)),t.fillStyle=o,t.fillText(u,0,-l))}),t.restore()}},_drawTitle:h.noop}),yi=hi;zr._defaults=yi;var Vt=h._deprecated,Er=h.options.resolve,_i=h.valueOrDefault,Wr=Number.MIN_SAFE_INTEGER||-9007199254740991,jt=Number.MAX_SAFE_INTEGER||9007199254740991,st={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}},V=Object.keys(st);function Hr(e,t){return e-t}function ki(e){var t={},r=[],a,n,i;for(a=0,n=e.length;at&&u=0&&a<=n;)if(i=a+n>>1,o=e[i-1]||null,l=e[i],o)if(l[t]r)n=i-1;else return{lo:o,hi:l};else return{lo:null,hi:l};return{lo:l,hi:null}}function Ae(e,t,r,a){var n=Mi(e,t,r),i=n.lo?n.hi?n.lo:e[e.length-2]:e[0],o=n.lo?n.hi?n.hi:e[e.length-1]:e[1],l=o[t]-i[t],s=l?(r-i[t])/l:0,u=(o[a]-i[a])*s;return i[a]+u}function qt(e,t){var r=e._adapter,a=e.options.time,n=a.parser,i=n||a.format,o=t;return typeof n=="function"&&(o=n(o)),h.isFinite(o)||(o=typeof i=="string"?r.parse(o,i):r.parse(o)),o!==null?+o:(!n&&typeof i=="function"&&(o=i(t),h.isFinite(o)||(o=r.parse(o))),o)}function ke(e,t){if(h.isNullOrUndef(t))return null;var r=e.options.time,a=qt(e,e.getRightValue(t));return a===null||r.round&&(a=+e._adapter.startOf(a,r.round)),a}function qr(e,t,r,a){var n=V.length,i,o,l;for(i=V.indexOf(e);i=V.indexOf(r);i--)if(o=V[i],st[o].common&&e._adapter.diff(n,a,o)>=t-1)return o;return V[r?V.indexOf(r):0]}function Ci(e){for(var t=V.indexOf(e)+1,r=V.length;t1e5*s)throw t+" and "+r+" are too far apart with stepSize of "+s+" "+l;for(c=d;c=0&&(t[s].major=!0);return t}function Ur(e,t,r){var a=[],n={},i=t.length,o,l;for(o=0;o1?ki(l).sort(Hr):l.sort(Hr),i=Math.min(i,l[0]),o=Math.max(o,l[l.length-1])),i=ke(e,Vr(a))||i,o=ke(e,jr(a))||o,i=i===jt?+r.startOf(Date.now(),n):i,o=o===Wr?+r.endOf(Date.now(),n)+1:o,e.min=Math.min(i,o),e.max=Math.max(i+1,o),e._table=[],e._timestamps={data:l,datasets:s,labels:u}},buildTicks:function(){var e=this,t=e.min,r=e.max,a=e.options,n=a.ticks,i=a.time,o=e._timestamps,l=[],s=e.getLabelCapacity(t),u=n.source,d=a.distribution,f,c,v;for(u==="data"||u==="auto"&&d==="series"?o=o.data:u==="labels"?o=o.labels:o=Di(e,t,r,s),a.bounds==="ticks"&&o.length&&(t=o[0],r=o[o.length-1]),t=ke(e,Vr(a))||t,r=ke(e,jr(a))||r,f=0,c=o.length;f=t&&v<=r&&l.push(v);return e.min=t,e.max=r,e._unit=i.unit||(n.autoSkip?qr(i.minUnit,e.min,e.max,s):Si(e,l.length,i.minUnit,e.min,e.max)),e._majorUnit=!n.major.enabled||e._unit==="year"?void 0:Ci(e._unit),e._table=wi(e._timestamps.data,t,r,d),e._offsets=Pi(e._table,l,t,r,a),n.reverse&&l.reverse(),Ur(e,l,e._majorUnit)},getLabelForIndex:function(e,t){var r=this,a=r._adapter,n=r.chart.data,i=r.options.time,o=n.labels&&e=0&&e0?l:1}}),Fi=Ti;$r._defaults=Fi;var Ii={category:Or,linear:Lr,logarithmic:Rr,radialLinear:zr,time:$r},Oi={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};Ot._date.override(typeof O=="function"?{_id:"moment",formats:function(){return Oi},parse:function(e,t){return typeof e=="string"&&typeof t=="string"?e=O(e,t):e instanceof O||(e=O(e)),e.isValid()?e.valueOf():null},format:function(e,t){return O(e).format(t)},add:function(e,t,r){return O(e).add(t,r).valueOf()},diff:function(e,t,r){return O(e).diff(O(t),r)},startOf:function(e,t,r){return e=O(e),t==="isoWeek"?e.isoWeekday(r).valueOf():e.startOf(t).valueOf()},endOf:function(e,t){return O(e).endOf(t).valueOf()},_create:function(e){return O(e)}}:{}),_._set("global",{plugins:{filler:{propagate:!0}}});var Li={dataset:function(e){var t=e.fill,r=e.chart,a=r.getDatasetMeta(t),n=a&&r.isDatasetVisible(t),i=n&&a.dataset._children||[],o=i.length||0;return o?function(l,s){return s=r?!1:i;switch(n){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return n;default:return!1}}function Bi(e){var t=e.el._model||{},r=e.el._scale||{},a=e.fill,n=null,i;if(isFinite(a))return null;if(a==="start"?n=t.scaleBottom===void 0?r.bottom:t.scaleBottom:a==="end"?n=t.scaleTop===void 0?r.top:t.scaleTop:t.scaleZero!==void 0?n=t.scaleZero:r.getBasePixel&&(n=r.getBasePixel()),n!=null){if(n.x!==void 0&&n.y!==void 0)return n;if(h.isFinite(n))return i=r.isHorizontal(),{x:i?n:null,y:i?null:n}}return null}function Ni(e){var t=e.el._scale,r=t.options,a=t.chart.data.labels.length,n=e.fill,i=[],o,l,s,u,d;if(!a)return null;for(o=r.ticks.reverse?t.max:t.min,l=r.ticks.reverse?t.min:t.max,s=t.getPointPositionForValue(0,o),u=0;u0;--i)e.arc(o,l,s,r[i].angle,r[i-1].angle,!0);return}for(e.lineTo(r[n-1].x,r[n-1].y),i=n-1;i>0;--i)h.canvas.lineTo(e,r[i],r[i-1],!0)}}function Hi(e,t,r,a,n,i){var o=t.length,l=a.spanGaps,s=[],u=[],d=0,f=0,c,v,g,p,m,b,x,y;for(e.beginPath(),c=0,v=o;c=0;--n)a=t[n].$filler,!(!a||!a.visible)&&(i=a.el,o=i._view,l=i._children||[],s=a.mapper,u=o.backgroundColor||_.global.defaultColor,s&&u&&l.length&&(h.canvas.clipArea(r,e.chartArea),Hi(r,l,s,o,u,i._loop),h.canvas.unclipArea(r)))}},ji=h.rtl.getRtlAdapter,de=h.noop,fe=h.valueOrDefault;_._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var r=t.datasetIndex,a=this.chart,n=a.getDatasetMeta(r);n.hidden=n.hidden===null?!a.data.datasets[r].hidden:null,a.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,r=e.options.legend||{},a=r.labels&&r.labels.usePointStyle;return e._getSortedDatasetMetas().map(function(n){var i=n.controller.getStyle(a?0:void 0);return{text:t[n.index].label,fillStyle:i.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:i.borderWidth,strokeStyle:i.borderColor,pointStyle:i.pointStyle,rotation:i.rotation,datasetIndex:n.index}},this)}}},legendCallback:function(e){var t=document.createElement("ul"),r=e.data.datasets,a,n,i,o;for(t.setAttribute("class",e.id+"-legend"),a=0,n=r.length;at?t:e.boxWidth}var Xr=ee.extend({initialize:function(e){var t=this;h.extend(t,e),t.legendHitBoxes=[],t._hoveredItem=null,t.doughnutMode=!1},beforeUpdate:de,update:function(e,t,r){var a=this;return a.beforeUpdate(),a.maxWidth=e,a.maxHeight=t,a.margins=r,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:de,beforeSetDimensions:de,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:de,beforeBuildLabels:de,buildLabels:function(){var e=this,t=e.options.labels||{},r=h.callback(t.generateLabels,[e.chart],e)||[];t.filter&&(r=r.filter(function(a){return t.filter(a,e.chart.data)})),e.options.reverse&&r.reverse(),e.legendItems=r},afterBuildLabels:de,beforeFit:de,fit:function(){var e=this,t=e.options,r=t.labels,a=t.display,n=e.ctx,i=h.options._parseFont(r),o=i.size,l=e.legendHitBoxes=[],s=e.minSize,u=e.isHorizontal();if(u?(s.width=e.maxWidth,s.height=a?10:0):(s.width=a?10:0,s.height=e.maxHeight),!a){e.width=s.width=e.height=s.height=0;return}if(n.font=i.string,u){var d=e.lineWidths=[0],f=0;n.textAlign="left",n.textBaseline="middle",h.each(e.legendItems,function(x,y){var w=Ut(r,o),k=w+o/2+n.measureText(x.text).width;(y===0||d[d.length-1]+k+2*r.padding>s.width)&&(f+=o+r.padding,d[d.length-(y>0?0:1)]=0),l[y]={left:0,top:0,width:k,height:o},d[d.length-1]+=k+r.padding}),s.height+=f}else{var c=r.padding,v=e.columnWidths=[],g=e.columnHeights=[],p=r.padding,m=0,b=0;h.each(e.legendItems,function(x,y){var w=Ut(r,o),k=w+o/2+n.measureText(x.text).width;y>0&&b+o+2*c>s.height&&(p+=m+r.padding,v.push(m),g.push(b),m=0,b=0),m=Math.max(m,k),b+=o+c,l[y]={left:0,top:0,width:k,height:o}}),p+=m,v.push(m),g.push(b),s.width+=p}e.width=s.width,e.height=s.height},afterFit:de,isHorizontal:function(){return this.options.position==="top"||this.options.position==="bottom"},draw:function(){var e=this,t=e.options,r=t.labels,a=_.global,n=a.defaultColor,i=a.elements.line,o=e.height,l=e.columnHeights,s=e.width,u=e.lineWidths;if(!!t.display){var d=ji(t.rtl,e.left,e.minSize.width),f=e.ctx,c=fe(r.fontColor,a.defaultFontColor),v=h.options._parseFont(r),g=v.size,p;f.textAlign=d.textAlign("left"),f.textBaseline="middle",f.lineWidth=.5,f.strokeStyle=c,f.fillStyle=c,f.font=v.string;var m=Ut(r,g),b=e.legendHitBoxes,x=function(C,P,T){if(!(isNaN(m)||m<=0)){f.save();var R=fe(T.lineWidth,i.borderWidth);if(f.fillStyle=fe(T.fillStyle,n),f.lineCap=fe(T.lineCap,i.borderCapStyle),f.lineDashOffset=fe(T.lineDashOffset,i.borderDashOffset),f.lineJoin=fe(T.lineJoin,i.borderJoinStyle),f.lineWidth=R,f.strokeStyle=fe(T.strokeStyle,n),f.setLineDash&&f.setLineDash(fe(T.lineDash,i.borderDash)),r&&r.usePointStyle){var L=m*Math.SQRT2/2,I=d.xPlus(C,m/2),B=P+g/2;h.canvas.drawPoint(f,T.pointStyle,L,I,B,T.rotation)}else f.fillRect(d.leftForLtr(C,m),P,m,g),R!==0&&f.strokeRect(d.leftForLtr(C,m),P,m,g);f.restore()}},y=function(C,P,T,R){var L=g/2,I=d.xPlus(C,m+L),B=P+L;f.fillText(T.text,I,B),T.hidden&&(f.beginPath(),f.lineWidth=2,f.moveTo(I,B),f.lineTo(d.xPlus(I,R),B),f.stroke())},w=function(C,P){switch(t.align){case"start":return r.padding;case"end":return C-P;default:return(C-P+r.padding)/2}},k=e.isHorizontal();k?p={x:e.left+w(s,u[0]),y:e.top+r.padding,line:0}:p={x:e.left+r.padding,y:e.top+w(o,l[0]),line:0},h.rtl.overrideTextDirection(e.ctx,t.textDirection);var D=g+r.padding;h.each(e.legendItems,function(C,P){var T=f.measureText(C.text).width,R=m+g/2+T,L=p.x,I=p.y;d.setWidth(e.minSize.width),k?P>0&&L+R+r.padding>e.left+e.minSize.width&&(I=p.y+=D,p.line++,L=p.x=e.left+w(s,u[p.line])):P>0&&I+D>e.top+e.minSize.height&&(L=p.x=L+e.columnWidths[p.line]+r.padding,p.line++,I=p.y=e.top+w(o,l[p.line]));var B=d.x(L);x(B,I,C),b[P].left=d.leftForLtr(B,b[P].width),b[P].top=I,y(B,I,C,T),k?p.x+=R+r.padding:p.y+=D}),h.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var r=this,a,n,i;if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom){for(i=r.legendHitBoxes,a=0;a=n.left&&e<=n.left+n.width&&t>=n.top&&t<=n.top+n.height)return r.legendItems[a]}return null},handleEvent:function(e){var t=this,r=t.options,a=e.type==="mouseup"?"click":e.type,n;if(a==="mousemove"){if(!r.onHover&&!r.onLeave)return}else if(a==="click"){if(!r.onClick)return}else return;n=t._getLegendItemAt(e.x,e.y),a==="click"?n&&r.onClick&&r.onClick.call(t,e.native,n):(r.onLeave&&n!==t._hoveredItem&&(t._hoveredItem&&r.onLeave.call(t,e.native,t._hoveredItem),t._hoveredItem=n),r.onHover&&n&&r.onHover.call(t,e.native,n))}});function Kr(e,t){var r=new Xr({ctx:e.ctx,options:t,chart:e});Z.configure(e,r,t),Z.addBox(e,r),e.legend=r}var qi={id:"legend",_element:Xr,beforeInit:function(e){var t=e.options.legend;t&&Kr(e,t)},beforeUpdate:function(e){var t=e.options.legend,r=e.legend;t?(h.mergeIf(t,_.global.legend),r?(Z.configure(e,r,t),r.options=t):Kr(e,t)):r&&(Z.removeBox(e,r),delete e.legend)},afterEvent:function(e,t){var r=e.legend;r&&r.handleEvent(t)}},le=h.noop;_._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Zr=ee.extend({initialize:function(e){var t=this;h.extend(t,e),t.legendHitBoxes=[]},beforeUpdate:le,update:function(e,t,r){var a=this;return a.beforeUpdate(),a.maxWidth=e,a.maxHeight=t,a.margins=r,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:le,beforeSetDimensions:le,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:le,beforeBuildLabels:le,buildLabels:le,afterBuildLabels:le,beforeFit:le,fit:function(){var e=this,t=e.options,r=e.minSize={},a=e.isHorizontal(),n,i;if(!t.display){e.width=r.width=e.height=r.height=0;return}n=h.isArray(t.text)?t.text.length:1,i=n*h.options._parseFont(t).lineHeight+t.padding*2,e.width=r.width=a?e.maxWidth:i,e.height=r.height=a?i:e.maxHeight},afterFit:le,isHorizontal:function(){var e=this.options.position;return e==="top"||e==="bottom"},draw:function(){var e=this,t=e.ctx,r=e.options;if(!!r.display){var a=h.options._parseFont(r),n=a.lineHeight,i=n/2+r.padding,o=0,l=e.top,s=e.left,u=e.bottom,d=e.right,f,c,v;t.fillStyle=h.valueOrDefault(r.fontColor,_.global.defaultFontColor),t.font=a.string,e.isHorizontal()?(c=s+(d-s)/2,v=l+i,f=d-s):(c=r.position==="left"?s+i:d-i,v=l+(u-l)/2,f=u-l,o=Math.PI*(r.position==="left"?-.5:.5)),t.save(),t.translate(c,v),t.rotate(o),t.textAlign="center",t.textBaseline="middle";var g=r.text;if(h.isArray(g))for(var p=0,m=0;mae.selectedCompanyCurrency);to(()=>{$.labels&&j&&(j.reset(),ut())}),ro(()=>{let Y=Ie.value.getContext("2d"),Ue=ea({responsive:!0,maintainAspectRatio:!1,tooltips:{enabled:!0,callbacks:{label:function(q,ce){return O.formatMoney(Math.round(q.value*100),F.value)}}},legend:{display:!1}}),we=ea({labels:$.labels,datasets:[{label:"Sales",fill:!1,lineTension:.3,backgroundColor:"rgba(230, 254, 249)",borderColor:"#040405",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",pointBorderColor:"#040405",pointBackgroundColor:"#fff",pointBorderWidth:1,pointHoverRadius:5,pointHoverBackgroundColor:"#040405",pointHoverBorderColor:"rgba(220,220,220,1)",pointHoverBorderWidth:2,pointRadius:4,pointHitRadius:10,data:$.invoices.map(q=>q/100)},{label:"Receipts",fill:!1,lineTension:.3,backgroundColor:"rgba(230, 254, 249)",borderColor:"rgb(2, 201, 156)",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",pointBorderColor:"rgb(2, 201, 156)",pointBackgroundColor:"#fff",pointBorderWidth:1,pointHoverRadius:5,pointHoverBackgroundColor:"rgb(2, 201, 156)",pointHoverBorderColor:"rgba(220,220,220,1)",pointHoverBorderWidth:2,pointRadius:4,pointHitRadius:10,data:$.receipts.map(q=>q/100)},{label:"Expenses",fill:!1,lineTension:.3,backgroundColor:"rgba(245, 235, 242)",borderColor:"rgb(255,0,0)",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",pointBorderColor:"rgb(255,0,0)",pointBackgroundColor:"#fff",pointBorderWidth:1,pointHoverRadius:5,pointHoverBackgroundColor:"rgb(255,0,0)",pointHoverBorderColor:"rgba(220,220,220,1)",pointHoverBorderWidth:2,pointRadius:4,pointHitRadius:10,data:$.expenses.map(q=>q/100)},{label:"Net Income",fill:!1,lineTension:.3,backgroundColor:"rgba(236, 235, 249)",borderColor:"rgba(88, 81, 216, 1)",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",pointBorderColor:"rgba(88, 81, 216, 1)",pointBackgroundColor:"#fff",pointBorderWidth:1,pointHoverRadius:5,pointHoverBackgroundColor:"rgba(88, 81, 216, 1)",pointHoverBorderColor:"rgba(220,220,220,1)",pointHoverBorderWidth:2,pointRadius:4,pointHitRadius:10,data:$.income.map(q=>q/100)}]});j=new so(Y,{type:"line",data:we,options:Ue})});function ut(){j.data.labels=$.labels,j.data.datasets[0].data=$.invoices.map(Y=>Y/100),j.data.datasets[1].data=$.receipts.map(Y=>Y/100),j.data.datasets[2].data=$.expenses.map(Y=>Y/100),j.data.datasets[3].data=$.income.map(Y=>Y/100),j.update({lazy:!0})}return(Y,Ue)=>(ao(),no("div",lo,[io("canvas",{id:"graph",ref:(we,q)=>{q.graph=we,Ie.value=we}},null,512)]))}};export{ho as _};