forked from alexarch21/history-explorer-card
-
Notifications
You must be signed in to change notification settings - Fork 5
/
history-explorer-card.js
93 lines (93 loc) · 325 KB
/
history-explorer-card.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
(()=>{var t={560:t=>{
/*!
* Chart.js
* http://chartjs.org/
* Version: 2.7.1
*
* Copyright 2017 Nick Downie
* Released under the MIT license
* https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
*/
var e;e=function(){return function t(e,i,n){function a(r,s){if(!i[r]){if(!e[r]){if(o)return o(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var d=i[r]={exports:{}};e[r][0].call(d.exports,(function(t){var i=e[r][1][t];return a(i||t)}),d,d.exports,t,e,i,n)}return i[r].exports}for(var o=void 0,r=0;r<n.length;r++)a(n[r]);return a}({1:[function(t,e,i){},{}],2:[function(t,e,i){var n=t(6);function a(t){if(t){var e=[0,0,0],i=1,a=t.match(/^#([a-fA-F0-9]{3})$/i);if(a){a=a[1];for(var o=0;o<e.length;o++)e[o]=parseInt(a[o]+a[o],16)}else if(a=t.match(/^#([a-fA-F0-9]{6})$/i))for(a=a[1],o=0;o<e.length;o++)e[o]=parseInt(a.slice(2*o,2*o+2),16);else if(a=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(o=0;o<e.length;o++)e[o]=parseInt(a[o+1]);i=parseFloat(a[4])}else if(a=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(o=0;o<e.length;o++)e[o]=Math.round(2.55*parseFloat(a[o+1]));i=parseFloat(a[4])}else if(a=t.match(/(\w+)/)){if("transparent"==a[1])return[0,0,0,0];if(!(e=n[a[1]]))return}for(o=0;o<e.length;o++)e[o]=h(e[o],0,255);return i=i||0==i?h(i,0,1):1,e[3]=i,e}}function o(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var i=parseFloat(e[4]);return[h(parseInt(e[1]),0,360),h(parseFloat(e[2]),0,100),h(parseFloat(e[3]),0,100),h(isNaN(i)?1:i,0,1)]}}}function r(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var i=parseFloat(e[4]);return[h(parseInt(e[1]),0,360),h(parseFloat(e[2]),0,100),h(parseFloat(e[3]),0,100),h(isNaN(i)?1:i,0,1)]}}}function s(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function l(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function d(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function h(t,e,i){return Math.min(Math.max(e,t),i)}function c(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}e.exports={getRgba:a,getHsla:o,getRgb:function(t){var e=a(t);return e&&e.slice(0,3)},getHsl:function(t){var e=o(t);return e&&e.slice(0,3)},getHwb:r,getAlpha:function(t){var e=a(t);return e||(e=o(t))||(e=r(t))?e[3]:void 0},hexString:function(t){return"#"+c(t[0])+c(t[1])+c(t[2])},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?s(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:s,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return l(t,e);var i=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+i+"%, "+n+"%, "+a+"%)"},percentaString:l,hslString:function(t,e){return e<1||t[3]&&t[3]<1?d(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:d,hwbString:function(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return u[t.slice(0,3)]}};var u={};for(var f in n)u[n[f]]=f},{6:6}],3:[function(t,e,i){var n=t(5),a=t(2),o=function(t){return t instanceof o?t:this instanceof o?(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},void("string"==typeof t?(e=a.getRgba(t))?this.setValues("rgb",e):(e=a.getHsla(t))?this.setValues("hsl",e):(e=a.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new o(t);var e};o.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 t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return a.hexString(this.values.rgb)},rgbString:function(){return a.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return a.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return a.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return a.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return a.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return a.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return a.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],i=0;i<t.length;i++){var n=t[i]/255;e[i]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(e+.05)/(i+.05):(i+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,i=(e[0]+t)%360;return e[0]=i<0?360+i:i,this.setValues("hsl",e),this},mix:function(t,e){var i=this,n=t,a=void 0===e?.5:e,o=2*a-1,r=i.alpha()-n.alpha(),s=((o*r==-1?o:(o+r)/(1+o*r))+1)/2,l=1-s;return this.rgb(s*i.red()+l*n.red(),s*i.green()+l*n.green(),s*i.blue()+l*n.blue()).alpha(i.alpha()*a+n.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,i=new o,n=this.values,a=i.values;for(var r in n)n.hasOwnProperty(r)&&(t=n[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return i}},o.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},o.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},o.prototype.getValues=function(t){for(var e=this.values,i={},n=0;n<t.length;n++)i[t.charAt(n)]=e[t][n];return 1!==e.alpha&&(i.a=e.alpha),i},o.prototype.setValues=function(t,e){var i,a,o=this.values,r=this.spaces,s=this.maxes,l=1;if(this.valid=!0,"alpha"===t)l=e;else if(e.length)o[t]=e.slice(0,t.length),l=e[t.length];else if(void 0!==e[t.charAt(0)]){for(i=0;i<t.length;i++)o[t][i]=e[t.charAt(i)];l=e.a}else if(void 0!==e[r[t][0]]){var d=r[t];for(i=0;i<t.length;i++)o[t][i]=e[d[i]];l=e.alpha}if(o.alpha=Math.max(0,Math.min(1,void 0===l?o.alpha:l)),"alpha"===t)return!1;for(i=0;i<t.length;i++)a=Math.max(0,Math.min(s[t][i],o[t][i])),o[t][i]=Math.round(a);for(var h in r)h!==t&&(o[h]=n[t][h](o[t]));return!0},o.prototype.setSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i),this)},o.prototype.setChannel=function(t,e,i){var n=this.values[t];return void 0===i?n[e]:(i===n[e]||(n[e]=i,this.setValues(t,n)),this)},e.exports=o},{2:2,5:5}],4:[function(t,e,i){function n(t){var e,i,n=t[0]/255,a=t[1]/255,o=t[2]/255,r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r;return s==r?e=0:n==s?e=(a-o)/l:a==s?e=2+(o-n)/l:o==s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(r+s)/2,[e,100*(s==r?0:i<=.5?l/(s+r):l/(2-s-r)),100*i]}function a(t){var e,i,n=t[0],a=t[1],o=t[2],r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r;return i=0==s?0:l/s*1e3/10,s==r?e=0:n==s?e=(a-o)/l:a==s?e=2+(o-n)/l:o==s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,i,s/255*1e3/10]}function o(t){var e=t[0],i=t[1],a=t[2];return[n(t)[0],1/255*Math.min(e,Math.min(i,a))*100,100*(a=1-1/255*Math.max(e,Math.max(i,a)))]}function s(t){var e,i=t[0]/255,n=t[1]/255,a=t[2]/255;return[100*((1-i-(e=Math.min(1-i,1-n,1-a)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]}function l(t){return M[JSON.stringify(t)]}function d(t){var e=t[0]/255,i=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*i+.0722*n),100*(.0193*e+.1192*i+.9505*n)]}function h(t){var e=d(t),i=e[0],n=e[1],a=e[2];return n/=100,a/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(i-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]}function c(t){var e,i,n,a,o,r=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[o=255*l,o,o];e=2*l-(i=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var d=0;d<3;d++)(n=r+1/3*-(d-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,a[d]=255*o;return a}function u(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),r=255*n*(1-i),s=255*n*(1-i*o),l=255*n*(1-i*(1-o));switch(n*=255,a){case 0:return[n,l,r];case 1:return[s,n,r];case 2:return[r,n,l];case 3:return[r,s,n];case 4:return[l,r,n];case 5:return[n,r,s]}}function f(t){var e,i,n,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,d=s+l;switch(d>1&&(s/=d,l/=d),n=6*o-(e=Math.floor(6*o)),1&e&&(n=1-n),a=s+n*((i=1-l)-s),e){default:case 6:case 0:r=i,g=a,b=s;break;case 1:r=a,g=i,b=s;break;case 2:r=s,g=i,b=a;break;case 3:r=s,g=a,b=i;break;case 4:r=a,g=s,b=i;break;case 5:r=i,g=s,b=a}return[255*r,255*g,255*b]}function p(t){var e=t[0]/100,i=t[1]/100,n=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a))]}function m(t){var e,i,n,a=t[0]/100,o=t[1]/100,r=t[2]/100;return i=-.9689*a+1.8758*o+.0415*r,n=.0557*a+-.204*o+1.057*r,e=(e=3.2406*a+-1.5372*o+-.4986*r)>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1))]}function v(t){var e=t[0],i=t[1],n=t[2];return i/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(e-i),200*(i-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]}function y(t){var e,i,n,a,o=t[0],r=t[1],s=t[2];return o<=8?a=(i=100*o/903.3)/100*7.787+16/116:(i=100*Math.pow((o+16)/116,3),a=Math.pow(i/100,1/3)),[e=e/95.047<=.008856?e=95.047*(r/500+a-16/116)/7.787:95.047*Math.pow(r/500+a,3),i,n=n/108.883<=.008859?n=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3)]}function x(t){var e,i=t[0],n=t[1],a=t[2];return(e=360*Math.atan2(a,n)/2/Math.PI)<0&&(e+=360),[i,Math.sqrt(n*n+a*a),e]}function _(t){return m(y(t))}function k(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]}function w(t){return S[t]}e.exports={rgb2hsl:n,rgb2hsv:a,rgb2hwb:o,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:d,rgb2lab:h,rgb2lch:function(t){return x(h(t))},hsl2rgb:c,hsl2hsv:function(t){var e=t[0],i=t[1]/100,n=t[2]/100;return 0===n?[0,0,0]:[e,2*(i*=(n*=2)<=1?n:2-n)/(n+i)*100,(n+i)/2*100]},hsl2hwb:function(t){return o(c(t))},hsl2cmyk:function(t){return s(c(t))},hsl2keyword:function(t){return l(c(t))},hsv2rgb:u,hsv2hsl:function(t){var e,i,n=t[0],a=t[1]/100,o=t[2]/100;return e=a*o,[n,100*(e=(e/=(i=(2-a)*o)<=1?i:2-i)||0),100*(i/=2)]},hsv2hwb:function(t){return o(u(t))},hsv2cmyk:function(t){return s(u(t))},hsv2keyword:function(t){return l(u(t))},hwb2rgb:f,hwb2hsl:function(t){return n(f(t))},hwb2hsv:function(t){return a(f(t))},hwb2cmyk:function(t){return s(f(t))},hwb2keyword:function(t){return l(f(t))},cmyk2rgb:p,cmyk2hsl:function(t){return n(p(t))},cmyk2hsv:function(t){return a(p(t))},cmyk2hwb:function(t){return o(p(t))},cmyk2keyword:function(t){return l(p(t))},keyword2rgb:w,keyword2hsl:function(t){return n(w(t))},keyword2hsv:function(t){return a(w(t))},keyword2hwb:function(t){return o(w(t))},keyword2cmyk:function(t){return s(w(t))},keyword2lab:function(t){return h(w(t))},keyword2xyz:function(t){return d(w(t))},xyz2rgb:m,xyz2lab:v,xyz2lch:function(t){return x(v(t))},lab2xyz:y,lab2rgb:_,lab2lch:x,lch2lab:k,lch2xyz:function(t){return y(k(t))},lch2rgb:function(t){return _(k(t))}};var S={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]},M={};for(var C in S)M[JSON.stringify(S[C])]=C},{}],5:[function(t,e,i){var n=t(4),a=function(){return new d};for(var o in n){a[o+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),n[t](e)}}(o);var r=/(\w+)2(\w+)/.exec(o),s=r[1],l=r[2];(a[s]=a[s]||{})[l]=a[o]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var i=n[t](e);if("string"==typeof i||void 0===i)return i;for(var a=0;a<i.length;a++)i[a]=Math.round(i[a]);return i}}(o)}var d=function(){this.convs={}};d.prototype.routeSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i))},d.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},d.prototype.getValues=function(t){var e=this.convs[t];if(!e){var i=this.space,n=this.convs[i];e=a[i][t](n),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach((function(t){d.prototype[t]=function(e){return this.routeSpace(t,arguments)}})),e.exports=a},{4:4}],6:[function(t,e,i){"use strict";e.exports={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]}},{}],7:[function(t,e,i){var n=t(29)();n.helpers=t(45),t(27)(n),n.defaults=t(25),n.Element=t(26),n.elements=t(40),n.Interaction=t(28),n.platform=t(48),t(31)(n),t(22)(n),t(23)(n),t(24)(n),t(30)(n),t(33)(n),t(32)(n),t(35)(n),t(54)(n),t(52)(n),t(53)(n),t(55)(n),t(56)(n),t(57)(n),t(15)(n),t(16)(n),t(17)(n),t(18)(n),t(19)(n),t(20)(n),t(21)(n),t(8)(n),t(9)(n),t(10)(n),t(11)(n),t(12)(n),t(13)(n),t(14)(n);var a=[];a.push(t(49)(n),t(50)(n),t(51)(n)),n.plugins.register(a),n.platform.initialize(),e.exports=n,"undefined"!=typeof window&&(window.HXLocal_Chart=n),n.canvasHelpers=n.helpers.canvas},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,35:35,40:40,45:45,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,8:8,9:9}],8:[function(t,e,i){"use strict";e.exports=function(t){t.Bar=function(e,i){return i.type="bar",new t(e,i)}}},{}],9:[function(t,e,i){"use strict";e.exports=function(t){t.Bubble=function(e,i){return i.type="bubble",new t(e,i)}}},{}],10:[function(t,e,i){"use strict";e.exports=function(t){t.Doughnut=function(e,i){return i.type="doughnut",new t(e,i)}}},{}],11:[function(t,e,i){"use strict";e.exports=function(t){t.Line=function(e,i){return i.type="line",new t(e,i)}}},{}],12:[function(t,e,i){"use strict";e.exports=function(t){t.PolarArea=function(e,i){return i.type="polarArea",new t(e,i)}}},{}],13:[function(t,e,i){"use strict";e.exports=function(t){t.Radar=function(e,i){return i.type="radar",new t(e,i)}}},{}],14:[function(t,e,i){"use strict";e.exports=function(t){t.Scatter=function(e,i){return i.type="scatter",new t(e,i)}}},{}],15:[function(t,e,i){"use strict";var n=t(25),a=t(40),o=t(45);n._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),n._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{position:"left",type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{callbacks:{title:function(t,e){var i="";return t.length>0&&(t[0].yLabel?i=t[0].yLabel:e.labels.length>0&&t[0].index<e.labels.length&&(i=e.labels[t[0].index])),i},label:function(t,e){return(e.datasets[t.datasetIndex].label||"")+": "+t.xLabel}},mode:"index",axis:"y"}}),e.exports=function(t){t.controllers.bar=t.DatasetController.extend({dataElementType:a.Rectangle,initialize:function(){var e,i=this;t.DatasetController.prototype.initialize.apply(i,arguments),(e=i.getMeta()).stack=i.getDataset().stack,e.bar=!0},update:function(t){var e,i,n=this,a=n.getMeta().data;for(n._ruler=n.getRuler(),e=0,i=a.length;e<i;++e)n.updateElement(a[e],e,t)},updateElement:function(t,e,i){var n=this,a=n.chart,r=n.getMeta(),s=n.getDataset(),l=t.custom||{},d=a.options.elements.rectangle;t._xScale=n.getScaleForId(r.xAxisID),t._yScale=n.getScaleForId(r.yAxisID),t._datasetIndex=n.index,t._index=e,t._model={datasetLabel:s.label,label:a.data.labels[e],borderSkipped:l.borderSkipped?l.borderSkipped:d.borderSkipped,backgroundColor:l.backgroundColor?l.backgroundColor:o.valueAtIndexOrDefault(s.backgroundColor,e,d.backgroundColor),borderColor:l.borderColor?l.borderColor:o.valueAtIndexOrDefault(s.borderColor,e,d.borderColor),borderWidth:l.borderWidth?l.borderWidth:o.valueAtIndexOrDefault(s.borderWidth,e,d.borderWidth)},n.updateElementGeometry(t,e,i),t.pivot()},updateElementGeometry:function(t,e,i){var n=this,a=t._model,o=n.getValueScale(),r=o.getBasePixel(),s=o.isHorizontal(),l=n._ruler||n.getRuler(),d=n.calculateBarValuePixels(n.index,e),h=n.calculateBarIndexPixels(n.index,e,l);a.horizontal=s,a.base=i?r:d.base,a.x=s?i?r:d.head:h.center,a.y=s?h.center:i?r:d.head,a.height=s?h.size:void 0,a.width=s?void 0:h.size},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())},getStackCount:function(t){var e,i,n=this.chart,a=this.getIndexScale().options.stacked,o=void 0===t?n.data.datasets.length:t+1,r=[];for(e=0;e<o;++e)(i=n.getDatasetMeta(e)).bar&&n.isDatasetVisible(e)&&(!1===a||!0===a&&-1===r.indexOf(i.stack)||void 0===a&&(void 0===i.stack||-1===r.indexOf(i.stack)))&&r.push(i.stack);return r.length},getStackIndex:function(t){return this.getStackCount(t)-1},getRuler:function(){var t,e,i=this,n=i.getIndexScale(),a=i.getStackCount(),o=i.index,r=[],s=n.isHorizontal(),l=s?n.left:n.top,d=l+(s?n.width:n.height);for(t=0,e=i.getMeta().data.length;t<e;++t)r.push(n.getPixelForValue(null,t,o));return{pixels:r,start:l,end:d,stackCount:a,scale:n}},calculateBarValuePixels:function(t,e){var i,n,a,o,r,s,l=this,d=l.chart,h=l.getMeta(),c=l.getValueScale(),u=d.data.datasets,f=c.getRightValue(u[t].data[e]),p=c.options.stacked,g=h.stack,m=0;if(p||void 0===p&&void 0!==g)for(i=0;i<t;++i)(n=d.getDatasetMeta(i)).bar&&n.stack===g&&n.controller.getValueScaleId()===c.id&&d.isDatasetVisible(i)&&(a=c.getRightValue(u[i].data[e]),(f<0&&a<0||f>=0&&a>0)&&(m+=a));return o=c.getPixelForValue(m),{size:s=((r=c.getPixelForValue(m+f))-o)/2,base:o,head:r,center:r+s/2}},calculateBarIndexPixels:function(t,e,i){var n,a,r,s,l,d=i.scale.options,h=this.getStackIndex(t),c=i.pixels,u=c[e],f=c.length,p=i.start,g=i.end;return 1===f?(n=u>p?u-p:g-u,a=u<g?g-u:u-p):(e>0&&(n=(u-c[e-1])/2,e===f-1&&(a=n)),e<f-1&&(a=(c[e+1]-u)/2,0===e&&(n=a))),l=(s=((r=n*d.categoryPercentage)+a*d.categoryPercentage)/i.stackCount)*d.barPercentage,u-=r,u+=s*h,{size:l=Math.min(o.valueOrDefault(d.barThickness,l),o.valueOrDefault(d.maxBarThickness,1/0)),base:u+=(s-l)/2,head:u+l,center:u+l/2}},draw:function(){var t=this,e=t.chart,i=t.getValueScale(),n=t.getMeta().data,a=t.getDataset(),r=n.length,s=0;for(o.canvas.clipArea(e.ctx,e.chartArea);s<r;++s)isNaN(i.getRightValue(a.data[s]))||n[s].draw();o.canvas.unclipArea(e.ctx)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},a=t._model;a.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:o.valueAtIndexOrDefault(e.hoverBackgroundColor,i,o.getHoverColor(a.backgroundColor)),a.borderColor=n.hoverBorderColor?n.hoverBorderColor:o.valueAtIndexOrDefault(e.hoverBorderColor,i,o.getHoverColor(a.borderColor)),a.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:o.valueAtIndexOrDefault(e.hoverBorderWidth,i,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},a=t._model,r=this.chart.options.elements.rectangle;a.backgroundColor=n.backgroundColor?n.backgroundColor:o.valueAtIndexOrDefault(e.backgroundColor,i,r.backgroundColor),a.borderColor=n.borderColor?n.borderColor:o.valueAtIndexOrDefault(e.borderColor,i,r.borderColor),a.borderWidth=n.borderWidth?n.borderWidth:o.valueAtIndexOrDefault(e.borderWidth,i,r.borderWidth)}}),t.controllers.horizontalBar=t.controllers.bar.extend({getValueScaleId:function(){return this.getMeta().xAxisID},getIndexScaleId:function(){return this.getMeta().yAxisID}})}},{25:25,40:40,45:45}],16:[function(t,e,i){"use strict";var n=t(25),a=t(40),o=t(45);n._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var i=e.datasets[t.datasetIndex].label||"",n=e.datasets[t.datasetIndex].data[t.index];return i+": ("+t.xLabel+", "+t.yLabel+", "+n.r+")"}}}}),e.exports=function(t){t.controllers.bubble=t.DatasetController.extend({dataElementType:a.Point,update:function(t){var e=this,i=e.getMeta().data;o.each(i,(function(i,n){e.updateElement(i,n,t)}))},updateElement:function(t,e,i){var n=this,a=n.getMeta(),o=t.custom||{},r=n.getScaleForId(a.xAxisID),s=n.getScaleForId(a.yAxisID),l=n._resolveElementOptions(t,e),d=n.getDataset().data[e],h=n.index,c=i?r.getPixelForDecimal(.5):r.getPixelForValue("object"==typeof d?d:NaN,e,h),u=i?s.getBasePixel():s.getPixelForValue(d,e,h);t._xScale=r,t._yScale=s,t._options=l,t._datasetIndex=h,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,radius:i?0:l.radius,skip:o.skip||isNaN(c)||isNaN(u),x:c,y:u},t.pivot()},setHoverStyle:function(t){var e=t._model,i=t._options;e.backgroundColor=o.valueOrDefault(i.hoverBackgroundColor,o.getHoverColor(i.backgroundColor)),e.borderColor=o.valueOrDefault(i.hoverBorderColor,o.getHoverColor(i.borderColor)),e.borderWidth=o.valueOrDefault(i.hoverBorderWidth,i.borderWidth),e.radius=i.radius+i.hoverRadius},removeHoverStyle:function(t){var e=t._model,i=t._options;e.backgroundColor=i.backgroundColor,e.borderColor=i.borderColor,e.borderWidth=i.borderWidth,e.radius=i.radius},_resolveElementOptions:function(t,e){var i,n,a,r=this,s=r.chart,l=s.data.datasets[r.index],d=t.custom||{},h=s.options.elements.point,c=o.options.resolve,u=l.data[e],f={},p={chart:s,dataIndex:e,dataset:l,datasetIndex:r.index},g=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle"];for(i=0,n=g.length;i<n;++i)f[a=g[i]]=c([d[a],l[a],h[a]],p,e);return f.radius=c([d.radius,u?u.r:void 0,l.radius,h.radius],p,e),f}})}},{25:25,40:40,45:45}],17:[function(t,e,i){"use strict";var n=t(25),a=t(40),o=t(45);n._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var i=t.data,n=i.datasets,a=i.labels;if(n.length)for(var o=0;o<n[0].data.length;++o)e.push('<li><span style="background-color:'+n[0].backgroundColor[o]+'"></span>'),a[o]&&e.push(a[o]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(i,n){var a=t.getDatasetMeta(0),r=e.datasets[0],s=a.data[n],l=s&&s.custom||{},d=o.valueAtIndexOrDefault,h=t.options.elements.arc;return{text:i,fillStyle:l.backgroundColor?l.backgroundColor:d(r.backgroundColor,n,h.backgroundColor),strokeStyle:l.borderColor?l.borderColor:d(r.borderColor,n,h.borderColor),lineWidth:l.borderWidth?l.borderWidth:d(r.borderWidth,n,h.borderWidth),hidden:isNaN(r.data[n])||a.data[n].hidden,index:n}})):[]}},onClick:function(t,e){var i,n,a,o=e.index,r=this.chart;for(i=0,n=(r.data.datasets||[]).length;i<n;++i)(a=r.getDatasetMeta(i)).data[o]&&(a.data[o].hidden=!a.data[o].hidden);r.update()}},cutoutPercentage:50,rotation:-.5*Math.PI,circumference:2*Math.PI,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var i=e.labels[t.index],n=": "+e.datasets[t.datasetIndex].data[t.index];return o.isArray(i)?(i=i.slice())[0]+=n:i+=n,i}}}}),n._set("pie",o.clone(n.doughnut)),n._set("pie",{cutoutPercentage:0}),e.exports=function(t){t.controllers.doughnut=t.controllers.pie=t.DatasetController.extend({dataElementType:a.Arc,linkScales:o.noop,getRingIndex:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&++e;return e},update:function(t){var e=this,i=e.chart,n=i.chartArea,a=i.options,r=a.elements.arc,s=n.right-n.left-r.borderWidth,l=n.bottom-n.top-r.borderWidth,d=Math.min(s,l),h={x:0,y:0},c=e.getMeta(),u=a.cutoutPercentage,f=a.circumference;if(f<2*Math.PI){var p=a.rotation%(2*Math.PI),g=(p+=2*Math.PI*(p>=Math.PI?-1:p<-Math.PI?1:0))+f,m={x:Math.cos(p),y:Math.sin(p)},v={x:Math.cos(g),y:Math.sin(g)},y=p<=0&&g>=0||p<=2*Math.PI&&2*Math.PI<=g,b=p<=.5*Math.PI&&.5*Math.PI<=g||p<=2.5*Math.PI&&2.5*Math.PI<=g,x=p<=-Math.PI&&-Math.PI<=g||p<=Math.PI&&Math.PI<=g,_=p<=.5*-Math.PI&&.5*-Math.PI<=g||p<=1.5*Math.PI&&1.5*Math.PI<=g,k=u/100,w={x:x?-1:Math.min(m.x*(m.x<0?1:k),v.x*(v.x<0?1:k)),y:_?-1:Math.min(m.y*(m.y<0?1:k),v.y*(v.y<0?1:k))},S={x:y?1:Math.max(m.x*(m.x>0?1:k),v.x*(v.x>0?1:k)),y:b?1:Math.max(m.y*(m.y>0?1:k),v.y*(v.y>0?1:k))},M={width:.5*(S.x-w.x),height:.5*(S.y-w.y)};d=Math.min(s/M.width,l/M.height),h={x:-.5*(S.x+w.x),y:-.5*(S.y+w.y)}}i.borderWidth=e.getMaxBorderWidth(c.data),i.outerRadius=Math.max((d-i.borderWidth)/2,0),i.innerRadius=Math.max(u?i.outerRadius/100*u:0,0),i.radiusLength=(i.outerRadius-i.innerRadius)/i.getVisibleDatasetCount(),i.offsetX=h.x*i.outerRadius,i.offsetY=h.y*i.outerRadius,c.total=e.calculateTotal(),e.outerRadius=i.outerRadius-i.radiusLength*e.getRingIndex(e.index),e.innerRadius=Math.max(e.outerRadius-i.radiusLength,0),o.each(c.data,(function(i,n){e.updateElement(i,n,t)}))},updateElement:function(t,e,i){var n=this,a=n.chart,r=a.chartArea,s=a.options,l=s.animation,d=(r.left+r.right)/2,h=(r.top+r.bottom)/2,c=s.rotation,u=s.rotation,f=n.getDataset(),p=i&&l.animateRotate||t.hidden?0:n.calculateCircumference(f.data[e])*(s.circumference/(2*Math.PI)),g=i&&l.animateScale?0:n.innerRadius,m=i&&l.animateScale?0:n.outerRadius,v=o.valueAtIndexOrDefault;o.extend(t,{_datasetIndex:n.index,_index:e,_model:{x:d+a.offsetX,y:h+a.offsetY,startAngle:c,endAngle:u,circumference:p,outerRadius:m,innerRadius:g,label:v(f.label,e,a.data.labels[e])}});var y=t._model;this.removeHoverStyle(t),i&&l.animateRotate||(y.startAngle=0===e?s.rotation:n.getMeta().data[e-1]._model.endAngle,y.endAngle=y.startAngle+y.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,e=this.getDataset(),i=this.getMeta(),n=0;return o.each(i.data,(function(i,a){t=e.data[a],isNaN(t)||i.hidden||(n+=Math.abs(t))})),n},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,i,n=0,a=this.index,o=t.length,r=0;r<o;r++)e=t[r]._model?t[r]._model.borderWidth:0,n=(i=t[r]._chart?t[r]._chart.config.data.datasets[a].hoverBorderWidth:0)>(n=e>n?e:n)?i:n;return n}})}},{25:25,40:40,45:45}],18:[function(t,e,i){"use strict";var n=t(25),a=t(40),o=t(45);n._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}}),e.exports=function(t){function e(t,e){return o.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,update:function(t){var i,n,a,r=this,s=r.getMeta(),l=s.dataset,d=s.data||[],h=r.chart.options,c=h.elements.line,u=r.getScaleForId(s.yAxisID),f=r.getDataset(),p=e(f,h);for(p&&(a=l.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),l._scale=u,l._datasetIndex=r.index,l._children=d,l._model={spanGaps:f.spanGaps?f.spanGaps:h.spanGaps,tension:a.tension?a.tension:o.valueOrDefault(f.lineTension,c.tension),backgroundColor:a.backgroundColor?a.backgroundColor:f.backgroundColor||c.backgroundColor,borderWidth:a.borderWidth?a.borderWidth:f.borderWidth||c.borderWidth,borderColor:a.borderColor?a.borderColor:f.borderColor||c.borderColor,borderCapStyle:a.borderCapStyle?a.borderCapStyle:f.borderCapStyle||c.borderCapStyle,borderDash:a.borderDash?a.borderDash:f.borderDash||c.borderDash,borderDashOffset:a.borderDashOffset?a.borderDashOffset:f.borderDashOffset||c.borderDashOffset,borderJoinStyle:a.borderJoinStyle?a.borderJoinStyle:f.borderJoinStyle||c.borderJoinStyle,fill:a.fill?a.fill:void 0!==f.fill?f.fill:c.fill,steppedLine:a.steppedLine?a.steppedLine:o.valueOrDefault(f.steppedLine,c.stepped),cubicInterpolationMode:a.cubicInterpolationMode?a.cubicInterpolationMode:o.valueOrDefault(f.cubicInterpolationMode,c.cubicInterpolationMode)},l.pivot()),i=0,n=d.length;i<n;++i)r.updateElement(d[i],i,t);for(p&&0!==l._model.tension&&r.updateBezierControlPoints(),i=0,n=d.length;i<n;++i)d[i].pivot()},getPointBackgroundColor:function(t,e){var i=this.chart.options.elements.point.backgroundColor,n=this.getDataset(),a=t.custom||{};return a.backgroundColor?i=a.backgroundColor:n.pointBackgroundColor?i=o.valueAtIndexOrDefault(n.pointBackgroundColor,e,i):n.backgroundColor&&(i=n.backgroundColor),i},getPointBorderColor:function(t,e){var i=this.chart.options.elements.point.borderColor,n=this.getDataset(),a=t.custom||{};return a.borderColor?i=a.borderColor:n.pointBorderColor?i=o.valueAtIndexOrDefault(n.pointBorderColor,e,i):n.borderColor&&(i=n.borderColor),i},getPointBorderWidth:function(t,e){var i=this.chart.options.elements.point.borderWidth,n=this.getDataset(),a=t.custom||{};return isNaN(a.borderWidth)?!isNaN(n.pointBorderWidth)||o.isArray(n.pointBorderWidth)?i=o.valueAtIndexOrDefault(n.pointBorderWidth,e,i):isNaN(n.borderWidth)||(i=n.borderWidth):i=a.borderWidth,i},updateElement:function(t,e,i){var n,a,r=this,s=r.getMeta(),l=t.custom||{},d=r.getDataset(),h=r.index,c=d.data[e],u=r.getScaleForId(s.yAxisID),f=r.getScaleForId(s.xAxisID),p=r.chart.options.elements.point;void 0!==d.radius&&void 0===d.pointRadius&&(d.pointRadius=d.radius),void 0!==d.hitRadius&&void 0===d.pointHitRadius&&(d.pointHitRadius=d.hitRadius),n=f.getPixelForValue("object"==typeof c?c:NaN,e,h),a=i?u.getBasePixel():r.calculatePointY(c,e,h),t._xScale=f,t._yScale=u,t._datasetIndex=h,t._index=e,t._model={x:n,y:a,skip:l.skip||isNaN(n)||isNaN(a),radius:l.radius||o.valueAtIndexOrDefault(d.pointRadius,e,p.radius),pointStyle:l.pointStyle||o.valueAtIndexOrDefault(d.pointStyle,e,p.pointStyle),backgroundColor:r.getPointBackgroundColor(t,e),borderColor:r.getPointBorderColor(t,e),borderWidth:r.getPointBorderWidth(t,e),tension:s.dataset._model?s.dataset._model.tension:0,steppedLine:!!s.dataset._model&&s.dataset._model.steppedLine,hitRadius:l.hitRadius||o.valueAtIndexOrDefault(d.pointHitRadius,e,p.hitRadius)}},calculatePointY:function(t,e,i){var n,a,o,r=this,s=r.chart,l=r.getMeta(),d=r.getScaleForId(l.yAxisID),h=0,c=0;if(d.options.stacked){for(n=0;n<i;n++)if(a=s.data.datasets[n],"line"===(o=s.getDatasetMeta(n)).type&&o.yAxisID===d.id&&s.isDatasetVisible(n)){var u=Number(d.getRightValue(a.data[e]));u<0?c+=u||0:h+=u||0}var f=Number(d.getRightValue(t));return f<0?d.getPixelForValue(c+f):d.getPixelForValue(h+f)}return d.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,i,n,a=this,r=a.getMeta(),s=a.chart.chartArea,l=r.data||[];function d(t,e,i){return Math.max(Math.min(t,i),e)}if(r.dataset._model.spanGaps&&(l=l.filter((function(t){return!t._model.skip}))),"monotone"===r.dataset._model.cubicInterpolationMode)o.splineCurveMonotone(l);else for(t=0,e=l.length;t<e;++t)i=l[t]._model,n=o.splineCurve(o.previousItem(l,t)._model,i,o.nextItem(l,t)._model,r.dataset._model.tension),i.controlPointPreviousX=n.previous.x,i.controlPointPreviousY=n.previous.y,i.controlPointNextX=n.next.x,i.controlPointNextY=n.next.y;if(a.chart.options.elements.line.capBezierPoints)for(t=0,e=l.length;t<e;++t)(i=l[t]._model).controlPointPreviousX=d(i.controlPointPreviousX,s.left,s.right),i.controlPointPreviousY=d(i.controlPointPreviousY,s.top,s.bottom),i.controlPointNextX=d(i.controlPointNextX,s.left,s.right),i.controlPointNextY=d(i.controlPointNextY,s.top,s.bottom)},draw:function(){var t=this,i=t.chart,n=t.getMeta(),a=n.data||[],r=i.chartArea,s=a.length,l=0;const d={left:r.left,right:r.right,top:r.top-(i.options.topClipMargin??0),bottom:r.bottom+(i.options.bottomClipMargin??0)};for(o.canvas.clipArea(i.ctx,d),e(t.getDataset(),i.options)&&n.dataset.draw(),o.canvas.unclipArea(i.ctx);l<s;++l)a[l].draw(r)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},a=t._model;a.radius=n.hoverRadius||o.valueAtIndexOrDefault(e.pointHoverRadius,i,this.chart.options.elements.point.hoverRadius),a.backgroundColor=n.hoverBackgroundColor||o.valueAtIndexOrDefault(e.pointHoverBackgroundColor,i,o.getHoverColor(a.backgroundColor)),a.borderColor=n.hoverBorderColor||o.valueAtIndexOrDefault(e.pointHoverBorderColor,i,o.getHoverColor(a.borderColor)),a.borderWidth=n.hoverBorderWidth||o.valueAtIndexOrDefault(e.pointHoverBorderWidth,i,a.borderWidth)},removeHoverStyle:function(t){var e=this,i=e.chart.data.datasets[t._datasetIndex],n=t._index,a=t.custom||{},r=t._model;void 0!==i.radius&&void 0===i.pointRadius&&(i.pointRadius=i.radius),r.radius=a.radius||o.valueAtIndexOrDefault(i.pointRadius,n,e.chart.options.elements.point.radius),r.backgroundColor=e.getPointBackgroundColor(t,n),r.borderColor=e.getPointBorderColor(t,n),r.borderWidth=e.getPointBorderWidth(t,n)}})}},{25:25,40:40,45:45}],19:[function(t,e,i){"use strict";var n=t(25),a=t(40),o=t(45);n._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var i=t.data,n=i.datasets,a=i.labels;if(n.length)for(var o=0;o<n[0].data.length;++o)e.push('<li><span style="background-color:'+n[0].backgroundColor[o]+'"></span>'),a[o]&&e.push(a[o]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(i,n){var a=t.getDatasetMeta(0),r=e.datasets[0],s=a.data[n].custom||{},l=o.valueAtIndexOrDefault,d=t.options.elements.arc;return{text:i,fillStyle:s.backgroundColor?s.backgroundColor:l(r.backgroundColor,n,d.backgroundColor),strokeStyle:s.borderColor?s.borderColor:l(r.borderColor,n,d.borderColor),lineWidth:s.borderWidth?s.borderWidth:l(r.borderWidth,n,d.borderWidth),hidden:isNaN(r.data[n])||a.data[n].hidden,index:n}})):[]}},onClick:function(t,e){var i,n,a,o=e.index,r=this.chart;for(i=0,n=(r.data.datasets||[]).length;i<n;++i)(a=r.getDatasetMeta(i)).data[o].hidden=!a.data[o].hidden;r.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}}),e.exports=function(t){t.controllers.polarArea=t.DatasetController.extend({dataElementType:a.Arc,linkScales:o.noop,update:function(t){var e=this,i=e.chart,n=i.chartArea,a=e.getMeta(),r=i.options,s=r.elements.arc,l=Math.min(n.right-n.left,n.bottom-n.top);i.outerRadius=Math.max((l-s.borderWidth/2)/2,0),i.innerRadius=Math.max(r.cutoutPercentage?i.outerRadius/100*r.cutoutPercentage:1,0),i.radiusLength=(i.outerRadius-i.innerRadius)/i.getVisibleDatasetCount(),e.outerRadius=i.outerRadius-i.radiusLength*e.index,e.innerRadius=e.outerRadius-i.radiusLength,a.count=e.countVisibleElements(),o.each(a.data,(function(i,n){e.updateElement(i,n,t)}))},updateElement:function(t,e,i){for(var n=this,a=n.chart,r=n.getDataset(),s=a.options,l=s.animation,d=a.scale,h=a.data.labels,c=n.calculateCircumference(r.data[e]),u=d.xCenter,f=d.yCenter,p=0,g=n.getMeta(),m=0;m<e;++m)isNaN(r.data[m])||g.data[m].hidden||++p;var v=s.startAngle,y=t.hidden?0:d.getDistanceFromCenterForValue(r.data[e]),b=v+c*p,x=b+(t.hidden?0:c),_=l.animateScale?0:d.getDistanceFromCenterForValue(r.data[e]);o.extend(t,{_datasetIndex:n.index,_index:e,_scale:d,_model:{x:u,y:f,innerRadius:0,outerRadius:i?_:y,startAngle:i&&l.animateRotate?v:b,endAngle:i&&l.animateRotate?v:x,label:o.valueAtIndexOrDefault(h,e,h[e])}}),n.removeHoverStyle(t),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),i=0;return o.each(e.data,(function(e,n){isNaN(t.data[n])||e.hidden||i++})),i},calculateCircumference:function(t){var e=this.getMeta().count;return e>0&&!isNaN(t)?2*Math.PI/e:0}})}},{25:25,40:40,45:45}],20:[function(t,e,i){"use strict";var n=t(25),a=t(40),o=t(45);n._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,linkScales:o.noop,update:function(t){var e=this,i=e.getMeta(),n=i.dataset,a=i.data,r=n.custom||{},s=e.getDataset(),l=e.chart.options.elements.line,d=e.chart.scale;void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),o.extend(i.dataset,{_datasetIndex:e.index,_scale:d,_children:a,_loop:!0,_model:{tension:r.tension?r.tension:o.valueOrDefault(s.lineTension,l.tension),backgroundColor:r.backgroundColor?r.backgroundColor:s.backgroundColor||l.backgroundColor,borderWidth:r.borderWidth?r.borderWidth:s.borderWidth||l.borderWidth,borderColor:r.borderColor?r.borderColor:s.borderColor||l.borderColor,fill:r.fill?r.fill:void 0!==s.fill?s.fill:l.fill,borderCapStyle:r.borderCapStyle?r.borderCapStyle:s.borderCapStyle||l.borderCapStyle,borderDash:r.borderDash?r.borderDash:s.borderDash||l.borderDash,borderDashOffset:r.borderDashOffset?r.borderDashOffset:s.borderDashOffset||l.borderDashOffset,borderJoinStyle:r.borderJoinStyle?r.borderJoinStyle:s.borderJoinStyle||l.borderJoinStyle}}),i.dataset.pivot(),o.each(a,(function(i,n){e.updateElement(i,n,t)}),e),e.updateBezierControlPoints()},updateElement:function(t,e,i){var n=this,a=t.custom||{},r=n.getDataset(),s=n.chart.scale,l=n.chart.options.elements.point,d=s.getPointPositionForValue(e,r.data[e]);void 0!==r.radius&&void 0===r.pointRadius&&(r.pointRadius=r.radius),void 0!==r.hitRadius&&void 0===r.pointHitRadius&&(r.pointHitRadius=r.hitRadius),o.extend(t,{_datasetIndex:n.index,_index:e,_scale:s,_model:{x:i?s.xCenter:d.x,y:i?s.yCenter:d.y,tension:a.tension?a.tension:o.valueOrDefault(r.lineTension,n.chart.options.elements.line.tension),radius:a.radius?a.radius:o.valueAtIndexOrDefault(r.pointRadius,e,l.radius),backgroundColor:a.backgroundColor?a.backgroundColor:o.valueAtIndexOrDefault(r.pointBackgroundColor,e,l.backgroundColor),borderColor:a.borderColor?a.borderColor:o.valueAtIndexOrDefault(r.pointBorderColor,e,l.borderColor),borderWidth:a.borderWidth?a.borderWidth:o.valueAtIndexOrDefault(r.pointBorderWidth,e,l.borderWidth),pointStyle:a.pointStyle?a.pointStyle:o.valueAtIndexOrDefault(r.pointStyle,e,l.pointStyle),hitRadius:a.hitRadius?a.hitRadius:o.valueAtIndexOrDefault(r.pointHitRadius,e,l.hitRadius)}}),t._model.skip=a.skip?a.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,e=this.getMeta();o.each(e.data,(function(i,n){var a=i._model,r=o.splineCurve(o.previousItem(e.data,n,!0)._model,a,o.nextItem(e.data,n,!0)._model,a.tension);a.controlPointPreviousX=Math.max(Math.min(r.previous.x,t.right),t.left),a.controlPointPreviousY=Math.max(Math.min(r.previous.y,t.bottom),t.top),a.controlPointNextX=Math.max(Math.min(r.next.x,t.right),t.left),a.controlPointNextY=Math.max(Math.min(r.next.y,t.bottom),t.top),i.pivot()}))},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t.custom||{},n=t._index,a=t._model;a.radius=i.hoverRadius?i.hoverRadius:o.valueAtIndexOrDefault(e.pointHoverRadius,n,this.chart.options.elements.point.hoverRadius),a.backgroundColor=i.hoverBackgroundColor?i.hoverBackgroundColor:o.valueAtIndexOrDefault(e.pointHoverBackgroundColor,n,o.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor?i.hoverBorderColor:o.valueAtIndexOrDefault(e.pointHoverBorderColor,n,o.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth?i.hoverBorderWidth:o.valueAtIndexOrDefault(e.pointHoverBorderWidth,n,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t.custom||{},n=t._index,a=t._model,r=this.chart.options.elements.point;a.radius=i.radius?i.radius:o.valueAtIndexOrDefault(e.pointRadius,n,r.radius),a.backgroundColor=i.backgroundColor?i.backgroundColor:o.valueAtIndexOrDefault(e.pointBackgroundColor,n,r.backgroundColor),a.borderColor=i.borderColor?i.borderColor:o.valueAtIndexOrDefault(e.pointBorderColor,n,r.borderColor),a.borderWidth=i.borderWidth?i.borderWidth:o.valueAtIndexOrDefault(e.pointBorderWidth,n,r.borderWidth)}})}},{25:25,40:40,45:45}],21:[function(t,e,i){"use strict";t(25)._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),e.exports=function(t){t.controllers.scatter=t.controllers.line}},{25:25}],22:[function(t,e,i){"use strict";var n=t(25),a=t(26),o=t(45);n._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:o.noop,onComplete:o.noop}}),e.exports=function(t){t.Animation=a.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,i,n){var a,o,r=this.animations;for(e.chart=t,n||(t.animating=!0),a=0,o=r.length;a<o;++a)if(r[a].chart===t)return void(r[a]=e);r.push(e),1===r.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=o.findIndex(this.animations,(function(e){return e.chart===t}));-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=o.requestAnimFrame.call(window,(function(){t.request=null,t.startDigest()})))},startDigest:function(){var t=this,e=Date.now(),i=0;t.dropFrames>1&&(i=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+i);var n=Date.now();t.dropFrames+=(n-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var e,i,n=this.animations,a=0;a<n.length;)i=(e=n[a]).chart,e.currentStep=(e.currentStep||0)+t,e.currentStep=Math.min(e.currentStep,e.numSteps),o.callback(e.render,[i,e],i),o.callback(e.onAnimationProgress,[e],i),e.currentStep>=e.numSteps?(o.callback(e.onAnimationComplete,[e],i),i.animating=!1,n.splice(a,1)):++a}},Object.defineProperty(t.Animation.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(t.Animation.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})}},{25:25,26:26,45:45}],23:[function(t,e,i){"use strict";var n=t(25),a=t(45),o=t(28),r=t(48);e.exports=function(t){var e=t.plugins;function i(t){return"top"===t||"bottom"===t}t.types={},t.instances={},t.controllers={},a.extend(t.prototype,{construct:function(e,i){var o=this;i=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=a.configMerge(n.global,n[t.type],t.options||{}),t}(i);var s=r.acquireContext(e,i),l=s&&s.canvas,d=l&&l.height,h=l&&l.width;o.id=a.uid(),o.ctx=s,o.canvas=l,o.config=i,o.width=h,o.height=d,o.aspectRatio=d?h/d:null,o.options=i.options,o._bufferedRender=!1,o.chart=o,o.controller=o,t.instances[o.id]=o,Object.defineProperty(o,"data",{get:function(){return o.config.data},set:function(t){o.config.data=t}}),s&&l?(o.initialize(),o.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return e.notify(t,"beforeInit"),a.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),e.notify(t,"afterInit"),t},clear:function(){return a.canvas.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t,i){var n=this,o=n.options,r=n.canvas,s=o.maintainAspectRatio&&n.aspectRatio||null,l=Math.max(0,Math.floor(a.getMaximumWidth(r))),d=Math.max(0,Math.floor(s?l/s:a.getMaximumHeight(r)));if(i&&(d=i),(n.width!==l||n.height!==d)&&(r.width=n.width=l,r.height=n.height=d,r.style.width=l+"px",r.style.height=d+"px",a.retinaScale(n,o.devicePixelRatio),!t)){var h={width:l,height:d};e.notify(n,"resize",[h]),n.options.onResize&&n.options.onResize(n,h),n.stop(),n.update(n.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},i=t.scale;a.each(e.xAxes,(function(t,e){t.id=t.id||"x-axis-"+e})),a.each(e.yAxes,(function(t,e){t.id=t.id||"y-axis-"+e})),i&&(i.id=i.id||"scale")},buildScales:function(){var e=this,n=e.options,o=e.scales={},r=[];n.scales&&(r=r.concat((n.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(n.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),n.scale&&r.push({options:n.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),a.each(r,(function(n){var r=n.options,s=a.valueOrDefault(r.type,n.dtype),l=t.scaleService.getScaleConstructor(s);if(l){i(r.position)!==i(n.dposition)&&(r.position=n.dposition);var d=new l({id:r.id,options:r,ctx:e.ctx,chart:e});o[d.id]=d,d.mergeTicksOptions(),n.isDefault&&(e.scale=d)}})),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,i=[],n=[];return a.each(e.data.datasets,(function(a,o){var r=e.getDatasetMeta(o),s=a.type||e.config.type;if(r.type&&r.type!==s&&(e.destroyDatasetMeta(o),r=e.getDatasetMeta(o)),r.type=s,i.push(r.type),r.controller)r.controller.updateIndex(o);else{var l=t.controllers[r.type];if(void 0===l)throw new Error('"'+r.type+'" is not a chart type.');r.controller=new l(e,o),n.push(r.controller)}}),e),n},resetElements:function(){var t=this;a.each(t.data.datasets,(function(e,i){t.getDatasetMeta(i).controller.reset()}),t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var i,n,o=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),(n=(i=o).options).scale?i.scale.options=n.scale:n.scales&&n.scales.xAxes.concat(n.scales.yAxes).forEach((function(t){i.scales[t.id].options=t})),i.tooltip._options=n.tooltips,!1!==e.notify(o,"beforeUpdate")){o.tooltip._data=o.data;var r=o.buildOrUpdateControllers();a.each(o.data.datasets,(function(t,e){o.getDatasetMeta(e).controller.buildOrUpdateElements()}),o),o.updateLayout(),a.each(r,(function(t){t.reset()})),o.updateDatasets(),o.tooltip.initialize(),o.lastActive=[],e.notify(o,"afterUpdate"),o._bufferedRender?o._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:o.render(t)}},updateLayout:function(){var i=this;!1!==e.notify(i,"beforeLayout")&&(t.layoutService.update(this,this.width,this.height),e.notify(i,"afterScaleUpdate"),e.notify(i,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==e.notify(t,"beforeDatasetsUpdate")){for(var i=0,n=t.data.datasets.length;i<n;++i)t.updateDataset(i);e.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var i=this,n=i.getDatasetMeta(t),a={meta:n,index:t};!1!==e.notify(i,"beforeDatasetUpdate",[a])&&(n.controller.update(),e.notify(i,"afterDatasetUpdate",[a]))},render:function(i){var n=this;i&&"object"==typeof i||(i={duration:i,lazy:arguments[1]});var o=i.duration,r=i.lazy;if(!1!==e.notify(n,"beforeRender")){var s=n.options.animation,l=function(t){e.notify(n,"afterRender"),a.callback(s&&s.onComplete,[t],n)};if(s&&(void 0!==o&&0!==o||void 0===o&&0!==s.duration)){var d=new t.Animation({numSteps:(o||s.duration)/16.66,easing:i.easing||s.easing,render:function(t,e){var i=a.easing.effects[e.easing],n=e.currentStep,o=n/e.numSteps;t.draw(i(o),o,n)},onAnimationProgress:s.onProgress,onAnimationComplete:l});t.animationService.addAnimation(n,d,o,r)}else n.draw(),l(new t.Animation({numSteps:0,chart:n}));return n}},draw:function(t){var i=this;i.clear(),a.isNullOrUndef(t)&&(t=1),i.transition(t),!1!==e.notify(i,"beforeDraw",[t])&&(a.each(i.boxes,(function(t){t.draw(i.chartArea)}),i),i.scale&&i.scale.draw(),i.drawDatasets(t),i._drawTooltip(t),e.notify(i,"afterDraw",[t]))},transition:function(t){for(var e=this,i=0,n=(e.data.datasets||[]).length;i<n;++i)e.isDatasetVisible(i)&&e.getDatasetMeta(i).controller.transition(t);e.tooltip.transition(t)},drawDatasets:function(t){var i=this;if(!1!==e.notify(i,"beforeDatasetsDraw",[t])){for(var n=(i.data.datasets||[]).length-1;n>=0;--n)i.isDatasetVisible(n)&&i.drawDataset(n,t);e.notify(i,"afterDatasetsDraw",[t])}},drawDataset:function(t,i){var n=this,a=n.getDatasetMeta(t),o={meta:a,index:t,easingValue:i};!1!==e.notify(n,"beforeDatasetDraw",[o])&&(a.controller.draw(i),e.notify(n,"afterDatasetDraw",[o]))},_drawTooltip:function(t){var i=this,n=i.tooltip,a={tooltip:n,easingValue:t};!1!==e.notify(i,"beforeTooltipDraw",[a])&&(n.draw(),e.notify(i,"afterTooltipDraw",[a]))},getElementAtEvent:function(t){return o.modes.single(this,t)},getElementsAtEvent:function(t){return o.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return o.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,i){var n=o.modes[e];return"function"==typeof n?n(this,t,i):[]},getDatasetAtEvent:function(t){return o.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,i=e.data.datasets[t];i._meta||(i._meta={});var n=i._meta[e.id];return n||(n=i._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,i=this.data.datasets.length;e<i;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,i=this.data.datasets[t],n=i._meta&&i._meta[e];n&&(n.controller.destroy(),delete i._meta[e])},destroy:function(){var i,n,o=this,s=o.canvas;for(o.stop(),i=0,n=o.data.datasets.length;i<n;++i)o.destroyDatasetMeta(i);s&&(o.unbindEvents(),a.canvas.clear(o),r.releaseContext(o.ctx),o.canvas=null,o.ctx=null),e.notify(o,"destroy"),delete t.instances[o.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new t.Tooltip({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var t=this,e=t._listeners={},i=function(){t.eventHandler.apply(t,arguments)};a.each(t.options.events,(function(n){r.addEventListener(t,n,i),e[n]=i})),t.options.responsive&&(i=function(){t.resize()},r.addEventListener(t,"resize",i),e.resize=i)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,a.each(e,(function(e,i){r.removeEventListener(t,i,e)})))},updateHoverStyle:function(t,e,i){var n,a,o,r=i?"setHoverStyle":"removeHoverStyle";for(a=0,o=t.length;a<o;++a)(n=t[a])&&this.getDatasetMeta(n._datasetIndex).controller[r](n)},eventHandler:function(t){var i=this,n=i.tooltip;if(!1!==e.notify(i,"beforeEvent",[t])){i._bufferedRender=!0,i._bufferedRequest=null;var a=i.handleEvent(t);a|=n&&n.handleEvent(t),e.notify(i,"afterEvent",[t]);var o=i._bufferedRequest;return o?i.render(o):a&&!i.animating&&(i.stop(),i.render(i.options.hover.animationDuration,!0)),i._bufferedRender=!1,i._bufferedRequest=null,i}},handleEvent:function(t){var e,i=this,n=i.options||{},o=n.hover;return i.lastActive=i.lastActive||[],"mouseout"===t.type?i.active=[]:i.active=i.getElementsAtEventForMode(t,o.mode,o),a.callback(n.onHover||n.hover.onHover,[t.native,i.active],i),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(i,t.native,i.active),i.lastActive.length&&i.updateHoverStyle(i.lastActive,o.mode,!1),i.active.length&&o.mode&&i.updateHoverStyle(i.active,o.mode,!0),e=!a.arrayEquals(i.active,i.lastActive),i.lastActive=i.active,e}}),t.Controller=t}},{25:25,28:28,45:45,48:48}],24:[function(t,e,i){"use strict";var n=t(45);e.exports=function(t){var e=["push","pop","shift","splice","unshift"];function i(t,i){var n=t._chartjs;if(n){var a=n.listeners,o=a.indexOf(i);-1!==o&&a.splice(o,1),a.length>0||(e.forEach((function(e){delete t[e]})),delete t._chartjs)}}t.DatasetController=function(t,e){this.initialize(t,e)},n.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var i=this;i.chart=t,i.index=e,i.linkScales(),i.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),i=t.getDataset();null===e.xAxisID&&(e.xAxisID=i.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(e.yAxisID=i.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&i(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,i=e.dataElementType;return i&&new i({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,i=this,n=i.getMeta(),a=i.getDataset().data||[],o=n.data;for(t=0,e=a.length;t<e;++t)o[t]=o[t]||i.createMetaData(t);n.dataset=n.dataset||i.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t,a,o=this,r=o.getDataset(),s=r.data||(r.data=[]);o._data!==s&&(o._data&&i(o._data,o),a=o,(t=s)._chartjs?t._chartjs.listeners.push(a):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[a]}}),e.forEach((function(e){var i="onData"+e.charAt(0).toUpperCase()+e.slice(1),a=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),o=a.apply(this,e);return n.each(t._chartjs.listeners,(function(t){"function"==typeof t[i]&&t[i].apply(t,e)})),o}})}))),o._data=s),o.resyncElements()},update:n.noop,transition:function(t){for(var e=this.getMeta(),i=e.data||[],n=i.length,a=0;a<n;++a)i[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],i=e.length,n=0;for(t.dataset&&t.dataset.draw();n<i;++n)e[n].draw()},removeHoverStyle:function(t,e){var i=this.chart.data.datasets[t._datasetIndex],a=t._index,o=t.custom||{},r=n.valueAtIndexOrDefault,s=t._model;s.backgroundColor=o.backgroundColor?o.backgroundColor:r(i.backgroundColor,a,e.backgroundColor),s.borderColor=o.borderColor?o.borderColor:r(i.borderColor,a,e.borderColor),s.borderWidth=o.borderWidth?o.borderWidth:r(i.borderWidth,a,e.borderWidth)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,a=t.custom||{},o=n.valueAtIndexOrDefault,r=n.getHoverColor,s=t._model;s.backgroundColor=a.hoverBackgroundColor?a.hoverBackgroundColor:o(e.hoverBackgroundColor,i,r(s.backgroundColor)),s.borderColor=a.hoverBorderColor?a.hoverBorderColor:o(e.hoverBorderColor,i,r(s.borderColor)),s.borderWidth=a.hoverBorderWidth?a.hoverBorderWidth:o(e.hoverBorderWidth,i,s.borderWidth)},resyncElements:function(){var t=this,e=t.getMeta(),i=t.getDataset().data,n=e.data.length,a=i.length;a<n?e.data.splice(a,n-a):a>n&&t.insertElements(n,a-n)},insertElements:function(t,e){for(var i=0;i<e;++i)this.addElementAndReset(t+i)},onDataPush:function(){this.insertElements(this.getDataset().data.length-1,arguments.length)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),t.DatasetController.extend=n.inherits}},{45:45}],25:[function(t,e,i){"use strict";var n=t(45);e.exports={_set:function(t,e){return n.merge(this[t]||(this[t]={}),e)}}},{45:45}],26:[function(t,e,i){"use strict";var n=t(3),a=t(45),o=function(t){a.extend(this,t),this.initialize.apply(this,arguments)};a.extend(o.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=a.clone(t._model)),t._start={},t},transition:function(t){var e=this,i=e._model,a=e._start,o=e._view;return i&&1!==t?(o||(o=e._view={}),a||(a=e._start={}),function(t,e,i,a){var o,r,s,l,d,h,c,u,f,p=Object.keys(i);for(o=0,r=p.length;o<r;++o)if(h=i[s=p[o]],e.hasOwnProperty(s)||(e[s]=h),(l=e[s])!==h&&"_"!==s[0]){if(t.hasOwnProperty(s)||(t[s]=l),(c=typeof h)==typeof(d=t[s]))if("string"===c){if((u=n(d)).valid&&(f=n(h)).valid){e[s]=f.mix(u,a).rgbString();continue}}else if("number"===c&&isFinite(d)&&isFinite(h)){e[s]=d+(h-d)*a;continue}e[s]=h}}(a,o,i,t),e):(e._view=i,e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return a.isNumber(this._model.x)&&a.isNumber(this._model.y)}}),o.extend=a.inherits,e.exports=o},{3:3,45:45}],27:[function(t,e,i){"use strict";var n=t(3),a=t(25),o=t(45);e.exports=function(t){function e(t,e,i){var n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}function i(t){return null!=t&&"none"!==t}function r(t,n,a){var o=document.defaultView,r=t.parentNode,s=o.getComputedStyle(t)[n],l=o.getComputedStyle(r)[n],d=i(s),h=i(l),c=Number.POSITIVE_INFINITY;return d||h?Math.min(d?e(s,t,a):c,h?e(l,r,a):c):"none"}o.configMerge=function(){return o.merge(o.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,i,n,a){var r=i[e]||{},s=n[e];"scales"===e?i[e]=o.scaleMerge(r,s):"scale"===e?i[e]=o.merge(r,[t.scaleService.getScaleDefaults(s.type),s]):o._merger(e,i,n,a)}})},o.scaleMerge=function(){return o.merge(o.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,i,n,a){if("xAxes"===e||"yAxes"===e){var r,s,l,d=n[e].length;for(i[e]||(i[e]=[]),r=0;r<d;++r)l=n[e][r],s=o.valueOrDefault(l.type,"xAxes"===e?"category":"linear"),r>=i[e].length&&i[e].push({}),!i[e][r].type||l.type&&l.type!==i[e][r].type?o.merge(i[e][r],[t.scaleService.getScaleDefaults(s),l]):o.merge(i[e][r],l)}else o._merger(e,i,n,a)}})},o.where=function(t,e){if(o.isArray(t)&&Array.prototype.filter)return t.filter(e);var i=[];return o.each(t,(function(t){e(t)&&i.push(t)})),i},o.findIndex=Array.prototype.findIndex?function(t,e,i){return t.findIndex(e,i)}:function(t,e,i){i=void 0===i?t:i;for(var n=0,a=t.length;n<a;++n)if(e.call(i,t[n],n,t))return n;return-1},o.findNextWhere=function(t,e,i){o.isNullOrUndef(i)&&(i=-1);for(var n=i+1;n<t.length;n++){var a=t[n];if(e(a))return a}},o.findPreviousWhere=function(t,e,i){o.isNullOrUndef(i)&&(i=t.length);for(var n=i-1;n>=0;n--){var a=t[n];if(e(a))return a}},o.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},o.almostEquals=function(t,e,i){return Math.abs(t-e)<i},o.almostWhole=function(t,e){var i=Math.round(t);return i-e<t&&i+e>t},o.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},o.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},o.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},o.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},o.toRadians=function(t){return t*(Math.PI/180)},o.toDegrees=function(t){return t*(180/Math.PI)},o.getAngleFromPoint=function(t,e){var i=e.x-t.x,n=e.y-t.y,a=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:a}},o.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},o.aliasPixel=function(t){return t%2==0?0:.5},o.splineCurve=function(t,e,i,n){var a=t.skip?e:t,o=e,r=i.skip?e:i,s=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),l=Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),d=s/(s+l),h=l/(s+l),c=n*(d=isNaN(d)?0:d),u=n*(h=isNaN(h)?0:h);return{previous:{x:o.x-c*(r.x-a.x),y:o.y-c*(r.y-a.y)},next:{x:o.x+u*(r.x-a.x),y:o.y+u*(r.y-a.y)}}},o.EPSILON=Number.EPSILON||1e-14,o.splineCurveMonotone=function(t){var e,i,n,a,r,s,l,d,h,c=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),u=c.length;for(e=0;e<u;++e)if(!(n=c[e]).model.skip){if(i=e>0?c[e-1]:null,(a=e<u-1?c[e+1]:null)&&!a.model.skip){var f=a.model.x-n.model.x;n.deltaK=0!==f?(a.model.y-n.model.y)/f:0}!i||i.model.skip?n.mK=n.deltaK:!a||a.model.skip?n.mK=i.deltaK:this.sign(i.deltaK)!==this.sign(n.deltaK)?n.mK=0:n.mK=(i.deltaK+n.deltaK)/2}for(e=0;e<u-1;++e)n=c[e],a=c[e+1],n.model.skip||a.model.skip||(o.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=a.mK=0:(r=n.mK/n.deltaK,s=a.mK/n.deltaK,(d=Math.pow(r,2)+Math.pow(s,2))<=9||(l=3/Math.sqrt(d),n.mK=r*l*n.deltaK,a.mK=s*l*n.deltaK)));for(e=0;e<u;++e)(n=c[e]).model.skip||(i=e>0?c[e-1]:null,a=e<u-1?c[e+1]:null,i&&!i.model.skip&&(h=(n.model.x-i.model.x)/3,n.model.controlPointPreviousX=n.model.x-h,n.model.controlPointPreviousY=n.model.y-h*n.mK),a&&!a.model.skip&&(h=(a.model.x-n.model.x)/3,n.model.controlPointNextX=n.model.x+h,n.model.controlPointNextY=n.model.y+h*n.mK))},o.nextItem=function(t,e,i){return i?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},o.previousItem=function(t,e,i){return i?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},o.niceNum=function(t,e){var i=Math.floor(o.log10(t)),n=t/Math.pow(10,i);return(e?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,i)},o.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},o.getRelativePosition=function(t,e){var i,n,a=t.originalEvent||t,r=t.currentTarget||t.srcElement,s=r.getBoundingClientRect(),l=a.touches;l&&l.length>0?(i=l[0].clientX,n=l[0].clientY):(i=a.clientX,n=a.clientY);var d=parseFloat(o.getStyle(r,"padding-left")),h=parseFloat(o.getStyle(r,"padding-top")),c=parseFloat(o.getStyle(r,"padding-right")),u=parseFloat(o.getStyle(r,"padding-bottom")),f=s.right-s.left-d-c,p=s.bottom-s.top-h-u;return{x:i=Math.round((i-s.left-d)/f*r.width/e.currentDevicePixelRatio),y:n=Math.round((n-s.top-h)/p*r.height/e.currentDevicePixelRatio)}},o.getConstraintWidth=function(t){return r(t,"max-width","clientWidth")},o.getConstraintHeight=function(t){return r(t,"max-height","clientHeight")},o.getMaximumWidth=function(t){var e=t.parentNode;if(!e)return t.clientWidth;var i=parseInt(o.getStyle(e,"padding-left"),10),n=parseInt(o.getStyle(e,"padding-right"),10),a=e.clientWidth-i-n,r=o.getConstraintWidth(t);return isNaN(r)?a:Math.min(a,r)},o.getMaximumHeight=function(t){var e=t.parentNode;if(!e)return t.clientHeight;var i=parseInt(o.getStyle(e,"padding-top"),10),n=parseInt(o.getStyle(e,"padding-bottom"),10),a=e.clientHeight-i-n,r=o.getConstraintHeight(t);return isNaN(r)?a:Math.min(a,r)},o.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},o.retinaScale=function(t,e){var i=t.currentDevicePixelRatio=e||window.devicePixelRatio||1;if(1!==i){var n=t.canvas,a=t.height,o=t.width;n.height=a*i,n.width=o*i,t.ctx.scale(i,i),n.style.height=a+"px",n.style.width=o+"px"}},o.fontString=function(t,e,i){return e+" "+t+"px "+i},o.longestText=function(t,e,i,n){var a=(n=n||{}).data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},r=n.garbageCollect=[],n.font=e),t.font=e;var s=0;o.each(i,(function(e){null!=e&&!0!==o.isArray(e)?s=o.measureText(t,a,r,s,e):o.isArray(e)&&o.each(e,(function(e){null==e||o.isArray(e)||(s=o.measureText(t,a,r,s,e))}))}));var l=r.length/2;if(l>i.length){for(var d=0;d<l;d++)delete a[r[d]];r.splice(0,l)}return s},o.measureText=function(t,e,i,n,a){var o=e[a];return o||(o=e[a]=t.measureText(a).width,i.push(a)),o>n&&(n=o),n},o.numberOfLabelLines=function(t){var e=1;return o.each(t,(function(t){o.isArray(t)&&t.length>e&&(e=t.length)})),e},o.color=n?function(t){return t instanceof CanvasGradient&&(t=a.global.defaultColor),n(t)}:function(t){return console.error("Color.js not found!"),t},o.getHoverColor=function(t){return t instanceof CanvasPattern?t:o.color(t).saturate(.5).darken(.1).rgbString()}}},{25:25,3:3,45:45}],28:[function(t,e,i){"use strict";var n=t(45);function a(t,e){return t.native?{x:t.x,y:t.y}:n.getRelativePosition(t,e)}function o(t,e){var i,n,a,o,r;for(n=0,o=t.data.datasets.length;n<o;++n)if(t.isDatasetVisible(n))for(a=0,r=(i=t.getDatasetMeta(n)).data.length;a<r;++a){var s=i.data[a];s._view.skip||e(s)}}function r(t,e){var i=[];return o(t,(function(t){t.inRange(e.x,e.y)&&i.push(t)})),i}function s(t,e,i,n){var a=Number.POSITIVE_INFINITY,r=[];return o(t,(function(t){if(!i||t.inRange(e.x,e.y)){var o=t.getCenterPoint(),s=n(e,o);s<a?(r=[t],a=s):s===a&&r.push(t)}})),r}function l(t){var e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){var a=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function d(t,e,i){var n=a(e,t);i.axis=i.axis||"x";var o=l(i.axis),d=i.intersect?r(t,n):s(t,n,!1,o),h=[];return d.length?(t.data.datasets.forEach((function(e,i){if(t.isDatasetVisible(i)){var n=t.getDatasetMeta(i).data[d[0]._index];n&&!n._view.skip&&h.push(n)}})),h):[]}e.exports={modes:{single:function(t,e){var i=a(e,t),n=[];return o(t,(function(t){if(t.inRange(i.x,i.y))return n.push(t),n})),n.slice(0,1)},label:d,index:d,dataset:function(t,e,i){var n=a(e,t);i.axis=i.axis||"xy";var o=l(i.axis),d=i.intersect?r(t,n):s(t,n,!1,o);return d.length>0&&(d=t.getDatasetMeta(d[0]._datasetIndex).data),d},"x-axis":function(t,e){return d(t,e,{intersect:!1})},point:function(t,e){return r(t,a(e,t))},nearest:function(t,e,i){var n=a(e,t);i.axis=i.axis||"xy";var o=l(i.axis),r=s(t,n,i.intersect,o);r.length>1&&r.sort((function(t,e){var i=t.getArea()-e.getArea();return 0===i&&(i=t._datasetIndex-e._datasetIndex),i}));let d=r.slice(0,1);if(!i.intersect&&d.length>0){const t=d[0].getCenterPoint(),e=n.y-t.y;(e>20||e<-5)&&(d=[])}return d},x:function(t,e,i){var n=a(e,t),r=[],s=!1;return o(t,(function(t){t.inXRange(n.x)&&r.push(t),t.inRange(n.x,n.y)&&(s=!0)})),i.intersect&&!s&&(r=[]),r},y:function(t,e,i){var n=a(e,t),r=[],s=!1;return o(t,(function(t){t.inYRange(n.y)&&r.push(t),t.inRange(n.x,n.y)&&(s=!0)})),i.intersect&&!s&&(r=[]),r}}}},{45:45}],29:[function(t,e,i){"use strict";t(25)._set("global",{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}}),e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.Chart=t,t}},{25:25}],30:[function(t,e,i){"use strict";var n=t(45);e.exports=function(t){function e(t,e){return n.where(t,(function(t){return t.position===e}))}function i(t,e){t.forEach((function(t,e){return t._tmpIndex_=e,t})),t.sort((function(t,i){var n=e?i:t,a=e?t:i;return n.weight===a.weight?n._tmpIndex_-a._tmpIndex_:n.weight-a.weight})),t.forEach((function(t){delete t._tmpIndex_}))}t.layoutService={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure:function(t,e,i){for(var n,a=["fullWidth","position","weight"],o=a.length,r=0;r<o;++r)n=a[r],i.hasOwnProperty(n)&&(e[n]=i[n])},update:function(t,a,o){if(t){var r=t.options.layout||{},s=n.options.toPadding(r.padding),l=s.left,d=s.right,h=s.top,c=s.bottom;for(let e=0;e<t.boxes.length;e++)t.boxes[e]._dataLimitsCached=!1;var u=e(t.boxes,"left"),f=e(t.boxes,"right"),p=e(t.boxes,"top"),g=e(t.boxes,"bottom"),m=e(t.boxes,"chartArea");i(u,!0),i(f,!1),i(p,!0),i(g,!1);var v=a-l-d,y=o-h-c,b=y/2,x=(a-v/2)/(u.length+f.length),_=(o-b)/(p.length+g.length),k=v,w=y,S=[];n.each(u.concat(f,p,g),(function(t){var e,i=t.isHorizontal();i?(e=t.update(t.fullWidth?v:k,_),w-=e.height):(e=t.update(x,b),k-=e.width),S.push({horizontal:i,minSize:e,box:t})}));var M=0,C=0,D=0,T=0;n.each(p.concat(g),(function(t){if(t.getPadding){var e=t.getPadding();M=Math.max(M,e.left),C=Math.max(C,e.right)}})),n.each(u.concat(f),(function(t){if(t.getPadding){var e=t.getPadding();D=Math.max(D,e.top),T=Math.max(T,e.bottom)}}));var A=l,R=d,L=h,P=c;n.each(u.concat(f),z),n.each(u,(function(t){A+=t.width})),n.each(f,(function(t){R+=t.width})),n.each(p.concat(g),z),n.each(p,(function(t){L+=t.height})),n.each(g,(function(t){P+=t.height})),n.each(u.concat(f),(function(t){var e=n.findNextWhere(S,(function(e){return e.box===t})),i={left:0,right:0,top:L,bottom:P};e&&t.update(e.minSize.width,w,i)})),A=l,R=d,L=h,P=c,n.each(u,(function(t){A+=t.width})),n.each(f,(function(t){R+=t.width})),n.each(p,(function(t){L+=t.height})),n.each(g,(function(t){P+=t.height}));var I=Math.max(M-A,0);A+=I,R+=Math.max(C-R,0);var O=Math.max(D-L,0);L+=O,P+=Math.max(T-P,0);var H=o-L-P,F=a-A-R;F===k&&H===w||(n.each(u,(function(t){t.height=H})),n.each(f,(function(t){t.height=H})),n.each(p,(function(t){t.fullWidth||(t.width=F)})),n.each(g,(function(t){t.fullWidth||(t.width=F)})),w=H,k=F);var Y=l+I,W=h+O;n.each(u.concat(p),E),Y+=k,W+=w,n.each(f,E),n.each(g,E),t.chartArea={left:A,top:L,right:A+k,bottom:L+w},n.each(m,(function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(k,w)}))}function z(t){var e=n.findNextWhere(S,(function(e){return e.box===t}));if(e)if(t.isHorizontal()){var i={left:Math.max(A,M),right:Math.max(R,C),top:0,bottom:0};t.update(t.fullWidth?v:k,y/2,i)}else t.update(e.minSize.width,w)}function E(t){t.isHorizontal()?(t.left=t.fullWidth?l:A,t.right=t.fullWidth?a-d:A+k,t.top=W,t.bottom=W+t.height,W=t.bottom):(t.left=Y,t.right=Y+t.width,t.top=L,t.bottom=L+w,Y=t.right)}}}}},{45:45}],31:[function(t,e,i){"use strict";var n=t(25),a=t(26),o=t(45);n._set("global",{plugins:{}}),e.exports=function(t){t.plugins={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach((function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,i){var n,a,o,r,s,l=this.descriptors(t),d=l.length;for(n=0;n<d;++n)if("function"==typeof(s=(o=(a=l[n]).plugin)[e])&&((r=[t].concat(i||[])).push(a.options),!1===s.apply(o,r)))return!1;return!0},descriptors:function(t){var e=t._plugins||(t._plugins={});if(e.id===this._cacheId)return e.descriptors;var i=[],a=[],r=t&&t.config||{},s=r.options&&r.options.plugins||{};return this._plugins.concat(r.plugins||[]).forEach((function(t){if(-1===i.indexOf(t)){var e=t.id,r=s[e];!1!==r&&(!0===r&&(r=o.clone(n.global.plugins[e])),i.push(t),a.push({plugin:t,options:r||{}}))}})),e.descriptors=a,e.id=this._cacheId,a}},t.pluginService=t.plugins,t.PluginBase=a.extend({})}},{25:25,26:26,45:45}],32:[function(t,e,i){"use strict";var n=t(25),a=t(26),o=t(45),r=t(34);function s(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(t[e].label);return n}function l(t,e,i){var n=t.getPixelForTick(e);return i&&(n-=0===e?(t.getPixelForTick(1)-n)/2:(n-t.getPixelForTick(e-1))/2),n}n._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:"",lineHeight:1.2,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:r.formatters.values,minor:{},major:{}}}),e.exports=function(t){function e(t,e,i){return o.isArray(e)?o.longestText(t,i,e):t.measureText(e).width}function i(t){var e=o.valueOrDefault,i=n.global,a=e(t.fontSize,i.defaultFontSize),r=e(t.fontStyle,i.defaultFontStyle),s=e(t.fontFamily,i.defaultFontFamily);return{size:a,style:r,family:s,font:o.fontString(a,r,s)}}function r(t){return o.options.toLineHeight(o.valueOrDefault(t.lineHeight,1.2),o.valueOrDefault(t.fontSize,n.global.defaultFontSize))}t.Scale=a.extend({getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;for(var e in!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1}),t)"major"!==e&&"minor"!==e&&(void 0===t.minor[e]&&(t.minor[e]=t[e]),void 0===t.major[e]&&(t.major[e]=t[e]))},beforeUpdate:function(){o.callback(this.options.beforeUpdate,[this])},update:function(t,e,i){var n,a,r,s,l,d,h=this;for(h.beforeUpdate(),h.maxWidth=t,h.maxHeight=e,h.margins=o.extend({left:0,right:0,top:0,bottom:0},i),h.longestTextCache=h.longestTextCache||{},h.beforeSetDimensions(),h.setDimensions(),h.afterSetDimensions(),h._dataLimitsCached||(h.beforeDataLimits(),h.determineDataLimits(),h.afterDataLimits(),h._dataLimitsCached=!0),h.beforeBuildTicks(),l=h.buildTicks()||[],h.afterBuildTicks(),h.beforeTickToLabelConversion(),r=h.convertTicksToLabels(l)||h.ticks,h.afterTickToLabelConversion(),h.options.ticks.removeEdgeTicks&&(r[0]=" ",r[r.length-1]=" "),h.ticks=r,n=0,a=r.length;n<a;++n)s=r[n],(d=l[n])?d.label=s:l.push(d={label:s,major:!1});return h._ticks=l,h.beforeCalculateTickRotation(),h.calculateTickRotation(),h.afterCalculateTickRotation(),h.beforeFit(),h.fit(),h.afterFit(),h.afterUpdate(),h.minSize},afterUpdate:function(){o.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){o.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=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:function(){o.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){o.callback(this.options.beforeDataLimits,[this])},determineDataLimits:o.noop,afterDataLimits:function(){o.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){o.callback(this.options.beforeBuildTicks,[this])},buildTicks:o.noop,afterBuildTicks:function(){o.callback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){o.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){o.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){o.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,n=t.options.ticks,a=s(t._ticks),r=i(n);e.font=r.font;var l=n.minRotation||0;if(a.length&&t.options.display&&t.isHorizontal())for(var d,h=o.longestText(e,r.font,a,t.longestTextCache),c=h,u=t.getPixelForTick(1)-t.getPixelForTick(0)-6;c>u&&l<n.maxRotation;){var f=o.toRadians(l);if(d=Math.cos(f),Math.sin(f)*h>t.maxHeight){l--;break}l++,c=d*h}t.labelRotation=l},afterCalculateTickRotation:function(){o.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){o.callback(this.options.beforeFit,[this])},fit:function(){var t=this,n=t.minSize={width:0,height:0},a=s(t._ticks),l=t.options,d=l.ticks,h=l.scaleLabel,c=l.gridLines,u=l.display,f=t.isHorizontal(),p=i(d),g=l.gridLines.tickMarkLength;if(n.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:u&&c.drawTicks?g:0,n.height=f?u&&c.drawTicks?g:0:t.maxHeight,h.display&&u){var m=r(h)+o.options.toPadding(h.padding).height;f?n.height+=m:n.width+=m}if(d.display&&u){var v=o.longestText(t.ctx,p.font,a,t.longestTextCache),y=o.numberOfLabelLines(a),b=.5*p.size,x=t.options.ticks.padding;if(f){t.longestLabelWidth=v;var _=o.toRadians(t.labelRotation),k=Math.cos(_),w=Math.sin(_)*v+p.size*y+b*(y-1)+b;n.height=Math.min(t.maxHeight,n.height+w+x),t.ctx.font=p.font;var S=e(t.ctx,a[0],p.font),M=e(t.ctx,a[a.length-1],p.font);0!==t.labelRotation?(t.paddingLeft="bottom"===l.position?k*S+3:k*b+3,t.paddingRight="bottom"===l.position?k*b+3:k*M+3):(t.paddingLeft=S/2+3,t.paddingRight=M/2+3)}else d.mirror?v=0:v+=x+b,n.width=Math.min(t.maxWidth,n.width+v),t.paddingTop=p.size/2,t.paddingBottom=p.size/2}t.handleMargins(),t.width=n.width,t.height=n.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){o.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(o.isNullOrUndef(t))return NaN;if("number"==typeof t&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:o.noop,getPixelForValue:o.noop,getValueForPixel:o.noop,getPixelForTick:function(t){var e=this,i=e.options.offset;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(i?0:1),1),a=n*t+e.paddingLeft;i&&(a+=n/2);var o=e.left+Math.round(a);return o+=e.isFullWidth()?e.margins.left:0}var r=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(r/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var i=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft,n=e.left+Math.round(i);return n+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,i=t.max;return t.beginAtZero?0:e<0&&i<0?i:e>0&&i>0?e:0},_autoSkip:function(t){var e,i,n,a,r=this,s=r.isHorizontal(),l=r.options.ticks.minor,d=t.length,h=o.toRadians(r.labelRotation),c=Math.cos(h),u=r.longestLabelWidth*c,f=[];for(l.maxTicksLimit&&(a=l.maxTicksLimit),s&&(e=!1,(u+l.autoSkipPadding)*d>r.width-(r.paddingLeft+r.paddingRight)&&(e=1+Math.floor((u+l.autoSkipPadding)*d/(r.width-(r.paddingLeft+r.paddingRight)))),a&&d>a&&(e=Math.max(e,Math.floor(d/a)))),i=0;i<d;i++)n=t[i],(e>1&&i%e>0||i%e==0&&i+e>=d)&&i!==d-1&&delete n.label,f.push(n);return f},draw:function(t){var e=this,a=e.options;if(a.display){var s=e.ctx,d=n.global,h=a.ticks.minor,c=a.ticks.major||h,u=a.gridLines,f=a.scaleLabel,p=0!==e.labelRotation,g=e.isHorizontal(),m=h.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),v=o.valueOrDefault(h.fontColor,d.defaultFontColor),y=i(h),b=o.valueOrDefault(c.fontColor,d.defaultFontColor),x=i(c),_=u.drawTicks?u.tickMarkLength:0,k=o.valueOrDefault(f.fontColor,d.defaultFontColor),w=i(f),S=o.options.toPadding(f.padding),M=o.toRadians(e.labelRotation),C=[],D="right"===a.position?e.left:e.right-_,T="right"===a.position?e.left+_:e.right,A="bottom"===a.position?e.top:e.bottom-_,R="bottom"===a.position?e.top+_:e.bottom;if(o.each(m,(function(i,n){if(!o.isNullOrUndef(i.label)){var r,s,c,f,v,y,b,x,k,w,S,L,P,I,O=i.label;n===e.zeroLineIndex&&a.offset===u.offsetGridLines?(r=u.zeroLineWidth,s=u.zeroLineColor,c=u.zeroLineBorderDash,f=u.zeroLineBorderDashOffset):(r=o.valueAtIndexOrDefault(u.lineWidth,n),s=o.valueAtIndexOrDefault(u.color,n),c=o.valueOrDefault(u.borderDash,d.borderDash),f=o.valueOrDefault(u.borderDashOffset,d.borderDashOffset));var H="middle",F="middle",Y=h.padding;if(g){var W=_+Y;"bottom"===a.position?(F=p?"middle":"top",H=p?"right":"center",I=e.top+W):(F=p?"middle":"bottom",H=p?"left":"center",I=e.bottom-W);var z=l(e,n,u.offsetGridLines&&m.length>1);z<e.left&&(s="rgba(0,0,0,0)"),z+=o.aliasPixel(r),P=e.getPixelForTick(n)+h.labelOffset,v=b=k=S=z,y=A,x=R,w=t.top,L=t.bottom}else{var E,V="left"===a.position;h.mirror?(H=V?"left":"right",E=Y):(H=V?"right":"left",E=_+Y),P=V?e.right-E:e.left+E;var $=l(e,n,u.offsetGridLines&&m.length>1);$<e.top&&(s="rgba(0,0,0,0)"),$+=o.aliasPixel(r),I=e.getPixelForTick(n)+h.labelOffset,v=D,b=T,k=t.left,S=t.right,y=x=w=L=$}C.push({tx1:v,ty1:y,tx2:b,ty2:x,x1:k,y1:w,x2:S,y2:L,labelX:P,labelY:I,glWidth:r,glColor:s,glBorderDash:c,glBorderDashOffset:f,rotation:-1*M,label:O,major:i.major,textBaseline:F,textAlign:H})}})),o.each(C,(function(t){if(u.display&&(s.save(),s.lineWidth=t.glWidth,s.strokeStyle=t.glColor,s.setLineDash&&(s.setLineDash(t.glBorderDash),s.lineDashOffset=t.glBorderDashOffset),s.beginPath(),u.drawTicks&&(s.moveTo(t.tx1,t.ty1),s.lineTo(t.tx2,t.ty2)),u.drawOnChartArea&&(s.moveTo(t.x1,t.y1),s.lineTo(t.x2,t.y2)),s.stroke(),s.restore()),h.display){s.save(),s.translate(t.labelX,t.labelY),s.rotate(t.rotation),s.font=t.major?x.font:y.font,s.fillStyle=t.major?b:v,s.textBaseline=t.textBaseline,s.textAlign=t.textAlign;var e=t.label;if(o.isArray(e))for(var i=0,n=0;i<e.length;++i)s.fillText(""+e[i],0,n),n+=1.5*y.size;else s.fillText(e,0,0);s.restore()}})),f.display){var L,P,I=0,O=r(f)/2;if(g)L=e.left+(e.right-e.left)/2,P="bottom"===a.position?e.bottom-O-S.bottom:e.top+O+S.top;else{var H="left"===a.position;L=H?e.left+O+S.top:e.right-O-S.top,P=e.top+(e.bottom-e.top)/2,I=H?-.5*Math.PI:.5*Math.PI}s.save(),s.translate(L,P),s.rotate(I),s.textAlign="center",s.textBaseline="middle",s.fillStyle=k,s.font=w.font,s.fillText(f.labelString,0,0),s.restore()}if(u.drawBorder){s.lineWidth=o.valueAtIndexOrDefault(u.lineWidth,0),s.strokeStyle=o.valueAtIndexOrDefault(u.color,0);var F=e.left,Y=e.right,W=e.top,z=e.bottom,E=o.aliasPixel(s.lineWidth);g?(W=z="top"===a.position?e.bottom:e.top,W+=E,z+=E):(F=Y="left"===a.position?e.right:e.left,F+=E,Y+=E),s.beginPath(),s.moveTo(F,W),s.lineTo(Y,z),s.stroke()}}}})}},{25:25,26:26,34:34,45:45}],33:[function(t,e,i){"use strict";var n=t(25),a=t(45);e.exports=function(t){t.scaleService={constructors:{},defaults:{},registerScaleType:function(t,e,i){this.constructors[t]=e,this.defaults[t]=a.clone(i)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?a.merge({},[n.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var i=this;i.defaults.hasOwnProperty(t)&&(i.defaults[t]=a.extend(i.defaults[t],e))},addScalesToLayout:function(e){a.each(e.scales,(function(i){i.fullWidth=i.options.fullWidth,i.position=i.options.position,i.weight=i.options.weight,t.layoutService.addBox(e,i)}))}}}},{25:25,45:45}],34:[function(t,e,i){"use strict";var n=t(45);e.exports={generators:{linear:function(t,e){var i,a=[];if(t.stepSize&&t.stepSize>0)i=t.stepSize;else{var o=n.niceNum(e.max-e.min,!1);i=n.niceNum(o/(t.maxTicks-1),!0)}var r=Math.floor(e.min/i)*i,s=Math.ceil(e.max/i)*i;t.min&&t.max&&t.stepSize&&n.almostWhole((t.max-t.min)/t.stepSize,i/1e3)&&(r=t.min,s=t.max);var l=(s-r)/i;l=n.almostEquals(l,Math.round(l),i/1e3)?Math.round(l):Math.ceil(l),a.push(void 0!==t.min?t.min:r);for(var d=1;d<l;++d)a.push(r+d*i);return a.push(void 0!==t.max?t.max:s),a},logarithmic:function(t,e){var i,a,o=[],r=n.valueOrDefault,s=r(t.min,Math.pow(10,Math.floor(n.log10(e.min)))),l=Math.floor(n.log10(e.max)),d=Math.ceil(e.max/Math.pow(10,l));0===s?(i=Math.floor(n.log10(e.minNotZero)),a=Math.floor(e.minNotZero/Math.pow(10,i)),o.push(s),s=a*Math.pow(10,i)):(i=Math.floor(n.log10(s)),a=Math.floor(s/Math.pow(10,i)));do{o.push(s),10==++a&&(a=1,++i),s=a*Math.pow(10,i)}while(i<l||i===l&&a<d);var h=r(t.max,s);return o.push(h),o}},formatters:{values:function(t){return n.isArray(t)?t:""+t},linear:function(t,e,i){var a=i.length>3?i[2]-i[1]:i[1]-i[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var o=n.log10(Math.abs(a)),r="";if(0!==t){var s=-1*Math.floor(o);s=Math.max(Math.min(s,20),0),r=t.toFixed(s)}else r="0";return r},logarithmic:function(t,e,i){var a=t/Math.pow(10,Math.floor(n.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===e||e===i.length-1?t.toExponential():""}}}},{45:45}],35:[function(t,e,i){"use strict";var n=t(25),a=t(26),o=t(45);n._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:o.noop,title:function(t,e){var i="",n=e.labels,a=n?n.length:0;if(t.length>0){var o=t[0];o.xLabel?i=o.xLabel:a>0&&o.index<a&&(i=n[o.index])}return i},afterTitle:o.noop,beforeBody:o.noop,beforeLabel:o.noop,label:function(t,e){var i=e.datasets[t.datasetIndex].label||"";return i&&(i+=": "),i+=t.yLabel},labelColor:function(t,e){var i=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:i.borderColor,backgroundColor:i.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:o.noop,afterBody:o.noop,beforeFooter:o.noop,footer:o.noop,afterFooter:o.noop}}}),e.exports=function(t){function e(t,e){var i=o.color(t);return i.alpha(e*i.alpha()).rgbaString()}function i(t,e){return e&&(o.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function r(t){var e=n.global,i=o.valueOrDefault;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:i(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:i(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:i(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:i(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:i(t.titleFontStyle,e.defaultFontStyle),titleFontSize:i(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:i(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:i(t.footerFontStyle,e.defaultFontStyle),footerFontSize:i(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}t.Tooltip=a.extend({initialize:function(){this._model=r(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options.callbacks,n=e.beforeTitle.apply(t,arguments),a=e.title.apply(t,arguments),o=e.afterTitle.apply(t,arguments),r=[];return r=i(r,n),r=i(r,a),r=i(r,o)},getBeforeBody:function(){var t=this._options.callbacks.beforeBody.apply(this,arguments);return o.isArray(t)?t:void 0!==t?[t]:[]},getBody:function(t,e){var n=this,a=n._options.callbacks,r=[];return o.each(t,(function(t){var o={before:[],lines:[],after:[]};i(o.before,a.beforeLabel.call(n,t,e)),i(o.lines,a.label.call(n,t,e)),i(o.after,a.afterLabel.call(n,t,e)),r.push(o)})),r},getAfterBody:function(){var t=this._options.callbacks.afterBody.apply(this,arguments);return o.isArray(t)?t:void 0!==t?[t]:[]},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),a=e.footer.apply(t,arguments),o=e.afterFooter.apply(t,arguments),r=[];return r=i(r,n),r=i(r,a),r=i(r,o)},update:function(e){var i,n,a,s,l,d,h,c=this,u=c._options,f=c._model,p=c._model=r(u),g=c._active,m=c._data,v={xAlign:f.xAlign,yAlign:f.yAlign},y={x:f.x,y:f.y},b={width:f.width,height:f.height},x={x:f.caretX,y:f.caretY};if(g.length){p.opacity=1;var _=[],k=[];x=t.Tooltip.positioners[u.position].call(c,g,c._eventPosition);var w=[];for(i=0,n=g.length;i<n;++i)w.push((a=g[i],s=void 0,l=void 0,d=void 0,h=void 0,s=a._xScale,l=a._yScale||a._scale,d=a._index,h=a._datasetIndex,{xLabel:s?s.getLabelForIndex(d,h):"",yLabel:l?l.getLabelForIndex(d,h):"",index:d,datasetIndex:h,x:a._model.x,y:a._model.y}));u.filter&&(w=w.filter((function(t){return u.filter(t,m)}))),u.itemSort&&(w=w.sort((function(t,e){return u.itemSort(t,e,m)}))),o.each(w,(function(t){_.push(u.callbacks.labelColor.call(c,t,c._chart)),k.push(u.callbacks.labelTextColor.call(c,t,c._chart))})),p.title=c.getTitle(w,m),p.beforeBody=c.getBeforeBody(w,m),p.body=c.getBody(w,m),p.afterBody=c.getAfterBody(w,m),p.footer=c.getFooter(w,m),p.x=Math.round(x.x),p.y=Math.round(x.y),p.caretPadding=u.caretPadding,p.labelColors=_,p.labelTextColors=k,p.dataPoints=w,b=function(t,e){var i=t._chart.ctx,n=2*e.yPadding,a=0,r=e.body,s=r.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0);s+=e.beforeBody.length+e.afterBody.length;var l=e.title.length,d=e.footer.length,h=e.titleFontSize,c=e.bodyFontSize,u=e.footerFontSize;n+=l*h,n+=l?(l-1)*e.titleSpacing:0,n+=l?e.titleMarginBottom:0,n+=s*c,n+=s?(s-1)*e.bodySpacing:0,n+=d?e.footerMarginTop:0,n+=d*u,n+=d?(d-1)*e.footerSpacing:0;var f=0,p=function(t){a=Math.max(a,i.measureText(t).width+f)};return i.font=o.fontString(h,e._titleFontStyle,e._titleFontFamily),o.each(e.title,p),i.font=o.fontString(c,e._bodyFontStyle,e._bodyFontFamily),o.each(e.beforeBody.concat(e.afterBody),p),f=e.displayColors?c+2:0,o.each(r,(function(t){o.each(t.before,p),o.each(t.lines,p),o.each(t.after,p)})),f=0,i.font=o.fontString(u,e._footerFontStyle,e._footerFontFamily),o.each(e.footer,p),{width:a+=2*e.xPadding,height:n}}(this,p),v=function(t,e){var i=t._model,n=t._chart,a=t._chart.chartArea,o="center",r="center";const s="nocenter"===t._options?.yAlign?11:0;var l,d,h,c,u;i.y<e.height?r="top":i.y>n.height-e.height-s&&(r="bottom");var f=(a.left+a.right)/2,p=(a.top+a.bottom)/2;"center"===r?(l=function(t){return t<=f},d=function(t){return t>f}):(l=function(t){return t<=e.width/2},d=function(t){return t>=n.width-e.width/2}),h=function(t){return t+e.width>n.width},c=function(t){return t-e.width<0},u=function(t){return t<=p?"top":"bottom"},l(i.x)?(o="left",h(i.x)&&(o="center",r=u(i.y))):d(i.x)&&(o="right",c(i.x)&&(o="center",r=u(i.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:o,yAlign:g.yAlign?"nocenter"==g.yAlign?"center"==r?"top":r:g.yAlign:r}}(this,b),y=function(t,e,i){var n=t.x,a=t.y,o=t.caretSize,r=t.caretPadding,s=t.cornerRadius,l=i.xAlign,d=i.yAlign,h=o+r,c=s+r;return"right"===l?n-=e.width:"center"===l&&(n-=e.width/2),"top"===d?a+=h:a-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===l?n+=h:"right"===l&&(n-=h):"left"===l?n-=c:"right"===l&&(n+=c),{x:n,y:a}}(p,b,v)}else p.opacity=0;return p.xAlign=v.xAlign,p.yAlign=v.yAlign,p.x=y.x,p.y=y.y,p.width=b.width,p.height=b.height,p.caretX=x.x,p.caretY=x.y,c._model=p,e&&u.custom&&u.custom.call(c,p),c},drawCaret:function(t,e){var i=this._chart.ctx,n=this._view,a=this.getCaretPosition(t,e,n);i.lineTo(a.x1,a.y1),i.lineTo(a.x2,a.y2),i.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,i){var n,a,o,r,s,l,d=i.caretSize,h=i.cornerRadius,c=i.xAlign,u=i.yAlign,f=t.x,p=t.y,g=e.width,m=e.height;if("center"===u)s=p+m/2,"left"===c?(a=(n=f)-d,o=n,r=s+d,l=s-d):(a=(n=f+g)+d,o=n,r=s-d,l=s+d);else if("left"===c?(n=(a=f+h+d)-d,o=a+d):"right"===c?(n=(a=f+g-h-d)-d,o=a+d):(n=(a=f+g/2)-d,o=a+d),"top"===u)s=(r=p)-d,l=r;else{s=(r=p+m)+d,l=r;var v=o;o=n,n=v}return{x1:n,x2:a,x3:o,y1:r,y2:s,y3:l}},drawTitle:function(t,i,n,a){var r=i.title;if(r.length){n.textAlign=i._titleAlign,n.textBaseline="top";var s,l,d=i.titleFontSize,h=i.titleSpacing;for(n.fillStyle=e(i.titleFontColor,a),n.font=o.fontString(d,i._titleFontStyle,i._titleFontFamily),s=0,l=r.length;s<l;++s)n.fillText(r[s],t.x,t.y),t.y+=d+h,s+1===r.length&&(t.y+=i.titleMarginBottom-h)}},drawBody:function(t,i,n,a){var r=i.bodyFontSize,s=i.bodySpacing,l=i.body;n.textAlign=i._bodyAlign,n.textBaseline="top",n.font=o.fontString(r,i._bodyFontStyle,i._bodyFontFamily);var d=0,h=function(e){n.fillText(e,t.x+d,t.y),t.y+=r+s};n.fillStyle=e(i.bodyFontColor,a),o.each(i.beforeBody,h);var c=i.displayColors;d=c?r+2:0,o.each(l,(function(s,l){var d=e(i.labelTextColors[l],a);n.fillStyle=d,o.each(s.before,h),o.each(s.lines,(function(o){c&&(n.fillStyle=e(i.legendColorBackground,a),n.fillRect(t.x,t.y,r,r),n.lineWidth=1,n.strokeStyle=e(i.labelColors[l].borderColor,a),n.strokeRect(t.x,t.y,r,r),n.fillStyle=e(i.labelColors[l].backgroundColor,a),n.fillRect(t.x+1,t.y+1,r-2,r-2),n.fillStyle=d),h(o)})),o.each(s.after,h)})),d=0,o.each(i.afterBody,h),t.y-=s},drawFooter:function(t,i,n,a){var r=i.footer;r.length&&(t.y+=i.footerMarginTop,n.textAlign=i._footerAlign,n.textBaseline="top",n.fillStyle=e(i.footerFontColor,a),n.font=o.fontString(i.footerFontSize,i._footerFontStyle,i._footerFontFamily),o.each(r,(function(e){n.fillText(e,t.x,t.y),t.y+=i.footerFontSize+i.footerSpacing})))},drawBackground:function(t,i,n,a,o){n.fillStyle=e(i.backgroundColor,o),n.strokeStyle=e(i.borderColor,o),n.lineWidth=i.borderWidth;var r=i.xAlign,s=i.yAlign,l=t.x,d=t.y,h=a.width,c=a.height,u=i.cornerRadius;n.beginPath(),n.moveTo(l+u,d),"top"===s&&this.drawCaret(t,a),n.lineTo(l+h-u,d),n.quadraticCurveTo(l+h,d,l+h,d+u),"center"===s&&"right"===r&&this.drawCaret(t,a),n.lineTo(l+h,d+c-u),n.quadraticCurveTo(l+h,d+c,l+h-u,d+c),"bottom"===s&&this.drawCaret(t,a),n.lineTo(l+u,d+c),n.quadraticCurveTo(l,d+c,l,d+c-u),"center"===s&&"left"===r&&this.drawCaret(t,a),n.lineTo(l,d+u),n.quadraticCurveTo(l,d,l+u,d),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var i={width:e.width,height:e.height},n={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity;a<1&&(a=0);var o=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&o&&(this.drawBackground(n,e,t,i,a),n.x+=e.xPadding,n.y+=e.yPadding,this.drawTitle(n,e,t,a),this.drawBody(n,e,t,a),this.drawFooter(n,e,t,a))}},handleEvent:function(t){var e=this,i=e._options,n=!1;if(e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,i.mode,i),!(n=!o.arrayEquals(e._active,e._lastActive)))return!1;if(e._lastActive=e._active,i.enabled||i.custom){e._eventPosition={x:t.x,y:t.y};var a=e._model;e.update(!0),e.pivot(),n|=a.x!==e._model.x||a.y!==e._model.y}return n}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,i,n=0,a=0,o=0;for(e=0,i=t.length;e<i;++e){var r=t[e];if(r&&r.hasValue()){var s=r.tooltipPosition();n+=s.x,a+=s.y,++o}}return{x:Math.round(n/o),y:Math.round(a/o)}},nearest:function(t,e){var i,n,a,r=e.x,s=e.y,l=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){var d=t[i];if(d&&d.hasValue()){var h=d.getCenterPoint(),c=o.distanceBetweenPoints(e,h);c<l&&(l=c,a=d)}}if(a){var u=a.tooltipPosition();r=u.x,s=u.y}return{x:r,y:s}}}}},{25:25,26:26,45:45}],36:[function(t,e,i){"use strict";var n=t(25),a=t(26),o=t(45);n._set("global",{elements:{arc:{backgroundColor:n.global.defaultColor,borderColor:"#fff",borderWidth:2}}}),e.exports=a.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var i=this._view;if(i){for(var n=o.getAngleFromPoint(i,{x:t,y:e}),a=n.angle,r=n.distance,s=i.startAngle,l=i.endAngle;l<s;)l+=2*Math.PI;for(;a>l;)a-=2*Math.PI;for(;a<s;)a+=2*Math.PI;var d=a>=s&&a<=l,h=r>=i.innerRadius&&r<=i.outerRadius;return d&&h}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,i=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t=this._chart.ctx,e=this._view,i=e.startAngle,n=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,i,n),t.arc(e.x,e.y,e.innerRadius,n,i,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})},{25:25,26:26,45:45}],37:[function(t,e,i){"use strict";var n=t(25),a=t(26),o=t(45),r=n.global;n._set("global",{elements:{line:{tension:.4,backgroundColor:r.defaultColor,borderWidth:3,borderColor:r.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=a.extend({draw:function(){var t,e,i,n,a=this,s=a._view,l=a._chart.ctx,d=s.spanGaps,h=a._children.slice(),c=r.elements.line,u=-1;for(a._loop&&h.length&&h.push(h[0]),l.save(),l.lineCap=s.borderCapStyle||c.borderCapStyle,l.setLineDash&&l.setLineDash(s.borderDash||c.borderDash),l.lineDashOffset=s.borderDashOffset||c.borderDashOffset,l.lineJoin=s.borderJoinStyle||c.borderJoinStyle,l.lineWidth=s.borderWidth||c.borderWidth,l.strokeStyle=s.borderColor||r.defaultColor,l.beginPath(),u=-1,t=0;t<h.length;++t)e=h[t],i=o.previousItem(h,t),n=e._view,0===t?n.skip||(l.moveTo(n.x,n.y),u=t):(i=-1===u?i:h[u],n.skip||(u!==t-1&&!d||-1===u?l.moveTo(n.x,n.y):o.canvas.lineTo(l,i._view,e._view),u=t));l.stroke(),l.restore()}})},{25:25,26:26,45:45}],38:[function(t,e,i){"use strict";var n=t(25),a=t(26),o=t(45),r=n.global.defaultColor;function s(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hitRadius,2)}n._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:r,borderColor:r,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}}),e.exports=a.extend({inRange:function(t,e){var i=this._view;return!!i&&Math.pow(t-i.x,2)+Math.pow(e-i.y,2)<Math.pow(i.hitRadius+i.radius,2)},inLabelRange:s,inXRange:s,inYRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.y,2)<Math.pow(e.radius+e.hitRadius,2)},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,i=this._model,a=this._chart.ctx,s=e.pointStyle,l=e.radius,d=e.x,h=e.y,c=o.color,u=1.01,f=0;e.skip||(a.strokeStyle=e.borderColor||r,a.lineWidth=o.valueOrDefault(e.borderWidth,n.global.elements.point.borderWidth),a.fillStyle=e.backgroundColor||r,void 0!==t&&(i.x<t.left||t.right*u<i.x||i.y<t.top||t.bottom*u<i.y)&&(i.x<t.left?f=(d-i.x)/(t.left-i.x):t.right*u<i.x?f=(i.x-d)/(i.x-t.right):i.y<t.top?f=(h-i.y)/(t.top-i.y):t.bottom*u<i.y&&(f=(i.y-h)/(i.y-t.bottom)),f=Math.round(100*f)/100,a.strokeStyle=c(a.strokeStyle).alpha(f).rgbString(),a.fillStyle=c(a.fillStyle).alpha(f).rgbString()),o.canvas.drawPoint(a,s,l,d,h))}})},{25:25,26:26,45:45}],39:[function(t,e,i){"use strict";var n=t(25),a=t(26);function o(t){return void 0!==t._view.width}function r(t){var e,i,n,a,r=t._view;if(o(t)){var s=r.width/2;e=r.x-s,i=r.x+s,n=Math.min(r.y,r.base),a=Math.max(r.y,r.base)}else{var l=r.height/2;e=Math.min(r.x,r.base),i=Math.max(r.x,r.base),n=r.y-l,a=r.y+l}return{left:e,top:n,right:i,bottom:a}}n._set("global",{elements:{rectangle:{backgroundColor:n.global.defaultColor,borderColor:n.global.defaultColor,borderSkipped:"bottom",borderWidth:0}}}),e.exports=a.extend({draw:function(){var t,e,i,n,a,o,r,s=this._chart.ctx,l=this._view,d=l.borderWidth;if(l.horizontal?(t=l.base,e=l.x,i=l.y-l.height/2,n=l.y+l.height/2,a=e>t?1:-1,o=1,r=l.borderSkipped||"left"):(t=l.x-l.width/2,e=l.x+l.width/2,i=l.y,a=1,o=(n=l.base)>i?1:-1,r=l.borderSkipped||"bottom"),d){var h=Math.min(Math.abs(t-e),Math.abs(i-n)),c=(d=d>h?h:d)/2,u=t+("left"!==r?c*a:0),f=e+("right"!==r?-c*a:0),p=i+("top"!==r?c*o:0),g=n+("bottom"!==r?-c*o:0);u!==f&&(i=p,n=g),p!==g&&(t=u,e=f)}s.beginPath(),s.fillStyle=l.backgroundColor,s.strokeStyle=l.borderColor,s.lineWidth=d;var m=[[t,n],[t,i],[e,i],[e,n]],v=["bottom","left","top","right"].indexOf(r,0);function y(t){return m[(v+t)%4]}-1===v&&(v=0);var b=y(0);s.moveTo(b[0],b[1]);for(var x=1;x<4;x++)b=y(x),s.lineTo(b[0],b[1]);s.fill(),d&&s.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var i=!1;if(this._view){var n=r(this);i=t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}return i},inLabelRange:function(t,e){var i=this;if(!i._view)return!1;var n=r(i);return o(i)?t>=n.left&&t<=n.right:e>=n.top&&e<=n.bottom},inXRange:function(t){var e=r(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=r(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,i=this._view;return o(this)?(t=i.x,e=(i.y+i.base)/2):(t=(i.x+i.base)/2,e=i.y),{x:t,y:e}},getArea:function(){var t=this._view;return t.width*Math.abs(t.y-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})},{25:25,26:26}],40:[function(t,e,i){"use strict";e.exports={},e.exports.Arc=t(36),e.exports.Line=t(37),e.exports.Point=t(38),e.exports.Rectangle=t(39)},{36:36,37:37,38:38,39:39}],41:[function(t,e,i){"use strict";var n=t(42);i=e.exports={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,i,n,a,o){if(o){var r=Math.min(o,n/2),s=Math.min(o,a/2);t.moveTo(e+r,i),t.lineTo(e+n-r,i),t.quadraticCurveTo(e+n,i,e+n,i+s),t.lineTo(e+n,i+a-s),t.quadraticCurveTo(e+n,i+a,e+n-r,i+a),t.lineTo(e+r,i+a),t.quadraticCurveTo(e,i+a,e,i+a-s),t.lineTo(e,i+s),t.quadraticCurveTo(e,i,e+r,i)}else t.rect(e,i,n,a)},drawPoint:function(t,e,i,n,a){var o,r,s,l,d,h;if(!e||"object"!=typeof e||"[object HTMLImageElement]"!==(o=e.toString())&&"[object HTMLCanvasElement]"!==o){if(!(isNaN(i)||i<=0)){switch(e){default:t.beginPath(),t.arc(n,a,i,0,2*Math.PI),t.closePath(),t.fill();break;case"triangle":t.beginPath(),d=(r=3*i/Math.sqrt(3))*Math.sqrt(3)/2,t.moveTo(n-r/2,a+d/3),t.lineTo(n+r/2,a+d/3),t.lineTo(n,a-2*d/3),t.closePath(),t.fill();break;case"rect":h=1/Math.SQRT2*i,t.beginPath(),t.fillRect(n-h,a-h,2*h,2*h),t.strokeRect(n-h,a-h,2*h,2*h);break;case"rectRounded":var c=i/Math.SQRT2,u=n-c,f=a-c,p=Math.SQRT2*i;t.beginPath(),this.roundedRect(t,u,f,p,p,i/2),t.closePath(),t.fill();break;case"rectRot":h=1/Math.SQRT2*i,t.beginPath(),t.moveTo(n-h,a),t.lineTo(n,a+h),t.lineTo(n+h,a),t.lineTo(n,a-h),t.closePath(),t.fill();break;case"cross":t.beginPath(),t.moveTo(n,a+i),t.lineTo(n,a-i),t.moveTo(n-i,a),t.lineTo(n+i,a),t.closePath();break;case"crossRot":t.beginPath(),s=Math.cos(Math.PI/4)*i,l=Math.sin(Math.PI/4)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n-s,a+l),t.lineTo(n+s,a-l),t.closePath();break;case"star":t.beginPath(),t.moveTo(n,a+i),t.lineTo(n,a-i),t.moveTo(n-i,a),t.lineTo(n+i,a),s=Math.cos(Math.PI/4)*i,l=Math.sin(Math.PI/4)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n-s,a+l),t.lineTo(n+s,a-l),t.closePath();break;case"line":t.beginPath(),t.moveTo(n-i,a),t.lineTo(n+i,a),t.closePath();break;case"dash":t.beginPath(),t.moveTo(n,a),t.lineTo(n+i,a),t.closePath()}t.stroke()}}else t.drawImage(e,n-e.width/2,a-e.height/2,e.width,e.height)},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,i,n){if(i.steppedLine)return"after"===i.steppedLine&&!n||"after"!==i.steppedLine&&n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y),void t.lineTo(i.x,i.y);i.tension?t.bezierCurveTo(n?e.controlPointPreviousX:e.controlPointNextX,n?e.controlPointPreviousY:e.controlPointNextY,n?i.controlPointNextX:i.controlPointPreviousX,n?i.controlPointNextY:i.controlPointPreviousY,i.x,i.y):t.lineTo(i.x,i.y)}},n.clear=i.clear,n.drawRoundedRectangle=function(t){t.beginPath(),i.roundedRect.apply(i,arguments),t.closePath()}},{42:42}],42:[function(t,e,i){"use strict";var n,a={noop:function(){},uid:(n=0,function(){return n++}),isNullOrUndef:function(t){return null==t},isArray:Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,i){return a.valueOrDefault(a.isArray(t)?t[e]:t,i)},callback:function(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)},each:function(t,e,i,n){var o,r,s;if(a.isArray(t))if(r=t.length,n)for(o=r-1;o>=0;o--)e.call(i,t[o],o);else for(o=0;o<r;o++)e.call(i,t[o],o);else if(a.isObject(t))for(r=(s=Object.keys(t)).length,o=0;o<r;o++)e.call(i,t[s[o]],s[o])},arrayEquals:function(t,e){var i,n,o,r;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(o=t[i],r=e[i],o instanceof Array&&r instanceof Array){if(!a.arrayEquals(o,r))return!1}else if(o!==r)return!1;return!0},clone:function(t){if(a.isArray(t))return t.map(a.clone);if(a.isObject(t)){for(var e={},i=Object.keys(t),n=i.length,o=0;o<n;++o)e[i[o]]=a.clone(t[i[o]]);return e}return t},_merger:function(t,e,i,n){var o=e[t],r=i[t];a.isObject(o)&&a.isObject(r)?a.merge(o,r,n):e[t]=a.clone(r)},_mergerIf:function(t,e,i){var n=e[t],o=i[t];a.isObject(n)&&a.isObject(o)?a.mergeIf(n,o):e.hasOwnProperty(t)||(e[t]=a.clone(o))},merge:function(t,e,i){var n,o,r,s,l,d=a.isArray(e)?e:[e],h=d.length;if(!a.isObject(t))return t;for(n=(i=i||{}).merger||a._merger,o=0;o<h;++o)if(e=d[o],a.isObject(e))for(l=0,s=(r=Object.keys(e)).length;l<s;++l)n(r[l],t,e,i);return t},mergeIf:function(t,e){return a.merge(t,e,{merger:a._mergerIf})},extend:function(t){for(var e=function(e,i){t[i]=e},i=1,n=arguments.length;i<n;++i)a.each(arguments[i],e);return t},inherits:function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},n=function(){this.constructor=i};return n.prototype=e.prototype,i.prototype=new n,i.extend=a.inherits,t&&a.extend(i.prototype,t),i.__super__=e.prototype,i}};e.exports=a,a.callCallback=a.callback,a.indexOf=function(t,e,i){return Array.prototype.indexOf.call(t,e,i)},a.getValueOrDefault=a.valueOrDefault,a.getValueAtIndexOrDefault=a.valueAtIndexOrDefault},{}],43:[function(t,e,i){"use strict";var n=t(42),a={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},easeOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},easeInOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:2==(t/=.5)?1:(i||(i=.45),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),t<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-a.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*a.easeInBounce(2*t):.5*a.easeOutBounce(2*t-1)+.5}};e.exports={effects:a},n.easingEffects=a},{42:42}],44:[function(t,e,i){"use strict";var n=t(42);e.exports={toLineHeight:function(t,e){var i=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,i,a,o;return n.isObject(t)?(e=+t.top||0,i=+t.right||0,a=+t.bottom||0,o=+t.left||0):e=i=a=o=+t||0,{top:e,right:i,bottom:a,left:o,height:e+a,width:o+i}},resolve:function(t,e,i){var a,o,r;for(a=0,o=t.length;a<o;++a)if(void 0!==(r=t[a])&&(void 0!==e&&"function"==typeof r&&(r=r(e)),void 0!==i&&n.isArray(r)&&(r=r[i]),void 0!==r))return r}}},{42:42}],45:[function(t,e,i){"use strict";e.exports=t(42),e.exports.easing=t(43),e.exports.canvas=t(41),e.exports.options=t(44)},{41:41,42:42,43:43,44:44}],46:[function(t,e,i){e.exports={acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}}},{}],47:[function(t,e,i){"use strict";var n=t(45),a="$chartjs",o="chartjs-",r=o+"render-monitor",s=o+"render-animation",l=["animationstart","webkitAnimationStart"],d={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function h(t,e){var i=n.getStyle(t,e),a=i&&i.match(/^(\d+)(\.\d+)?px$/);return a?Number(a[1]):void 0}var c=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function u(t,e,i){t.addEventListener(e,i,c)}function f(t,e,i){t.removeEventListener(e,i,c)}function p(t,e,i,n,a){return{type:t,chart:e,native:a||null,x:void 0!==i?i:null,y:void 0!==n?n:null}}function g(t,e,i){var d,h,c,f,g=t[a]||(t[a]={}),m=g.resizer=function(t){var e=document.createElement("div"),i=o+"size-monitor",n=1e6,a="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;";e.style.cssText=a,e.className=i,e.innerHTML='<div class="'+i+'-expand" style="'+a+'"><div style="position:absolute;width:'+n+"px;height:"+n+'px;left:0;top:0"></div></div><div class="'+i+'-shrink" style="'+a+'"><div style="position:absolute;width:200%;height:200%;left:0; top:0"></div></div>';var r=e.childNodes[0],s=e.childNodes[1];e._reset=function(){r.scrollLeft=n,r.scrollTop=n,s.scrollLeft=n,s.scrollTop=n};var l=function(){e._reset(),t()};return u(r,"scroll",l.bind(r,"expand")),u(s,"scroll",l.bind(s,"shrink")),e}((d=function(){if(g.resizer)return e(p("resize",i))},c=!1,f=[],function(){f=Array.prototype.slice.call(arguments),h=h||this,c||(c=!0,n.requestAnimFrame.call(window,(function(){c=!1,d.apply(h,f)})))}));!function(t,e){var i=t[a]||(t[a]={}),o=i.renderProxy=function(t){t.animationName===s&&e()};n.each(l,(function(e){u(t,e,o)})),i.reflow=!!t.offsetParent,t.classList.add(r)}(t,(function(){if(g.resizer){var e=t.parentNode;e&&e!==m.parentNode&&e.insertBefore(m,e.firstChild),m._reset()}}))}function m(t){var e=t[a]||{},i=e.resizer;delete e.resizer,function(t){var e=t[a]||{},i=e.renderProxy;i&&(n.each(l,(function(e){f(t,e,i)})),delete e.renderProxy),t.classList.remove(r)}(t),i&&i.parentNode&&i.parentNode.removeChild(i)}e.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function(){var t,e,i,n="from{opacity:0.99}to{opacity:1}";e="@-webkit-keyframes "+s+"{"+n+"}@keyframes "+s+"{"+n+"}."+r+"{-webkit-animation:"+s+" 0.001s;animation:"+s+" 0.001s;}",i=(t=this)._style||document.createElement("style"),t._style||(t._style=i,e="/* Chart.js */\n"+e,i.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(i)),i.appendChild(document.createTextNode(e))},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){var i=t.style,n=t.getAttribute("height"),o=t.getAttribute("width");if(t[a]={initial:{height:n,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",null===o||""===o){var r=h(t,"width");void 0!==r&&(t.width=r)}if(null===n||""===n)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var s=h(t,"height");void 0!==r&&(t.height=s)}}(t,e),i):null},releaseContext:function(t){var e=t.canvas;if(e[a]){var i=e[a].initial;["height","width"].forEach((function(t){var a=i[t];n.isNullOrUndef(a)?e.removeAttribute(t):e.setAttribute(t,a)})),n.each(i.style||{},(function(t,i){e.style[i]=t})),e.width=e.width,delete e[a]}},addEventListener:function(t,e,i){var o=t.canvas;if("resize"!==e){var r=i[a]||(i[a]={}),s=(r.proxies||(r.proxies={}))[t.id+"_"+e]=function(e){i(function(t,e){var i=d[t.type]||t.type,a=n.getRelativePosition(t,e);return p(i,e,a.x,a.y,t)}(e,t))};u(o,e,s)}else g(o,i,t)},removeEventListener:function(t,e,i){var n=t.canvas;if("resize"!==e){var o=((i[a]||{}).proxies||{})[t.id+"_"+e];o&&f(n,e,o)}else m(n)}},n.addEvent=u,n.removeEvent=f},{45:45}],48:[function(t,e,i){"use strict";var n=t(45),a=t(46),o=t(47),r=o._enabled?o:a;e.exports=n.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},r)},{45:45,46:46,47:47}],49:[function(t,e,i){"use strict";var n=t(25),a=t(40),o=t(45);n._set("global",{plugins:{filler:{propagate:!0}}}),e.exports=function(){var t={dataset:function(t){var e=t.fill,i=t.chart,n=i.getDatasetMeta(e),a=n&&i.isDatasetVisible(e)&&n.dataset._children||[],o=a.length||0;return o?function(t,e){return e<o&&a[e]._view||null}:null},boundary:function(t){var e=t.boundary,i=e?e.x:null,n=e?e.y:null;return function(t){return{x:null===i?t.x:i,y:null===n?t.y:n}}}};function e(t,e,i){var n,a=t._model||{},o=a.fill;if(void 0===o&&(o=!!a.backgroundColor),!1===o||null===o)return!1;if(!0===o)return"origin";if(n=parseFloat(o,10),isFinite(n)&&Math.floor(n)===n)return"-"!==o[0]&&"+"!==o[0]||(n=e+n),!(n===e||n<0||n>=i)&&n;switch(o){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return o;default:return!1}}function i(t){var e,i=t.el._model||{},n=t.el._scale||{},a=t.fill,o=null;if(isFinite(a))return null;if("start"===a?o=void 0===i.scaleBottom?n.bottom:i.scaleBottom:"end"===a?o=void 0===i.scaleTop?n.top:i.scaleTop:void 0!==i.scaleZero?o=i.scaleZero:n.getBasePosition?o=n.getBasePosition():n.getBasePixel&&(o=n.getBasePixel()),null!=o){if(void 0!==o.x&&void 0!==o.y)return o;if("number"==typeof o&&isFinite(o))return{x:(e=n.isHorizontal())?o:null,y:e?null:o}}return null}function r(t,e,i){var n,a=t[e].fill,o=[e];if(!i)return a;for(;!1!==a&&-1===o.indexOf(a);){if(!isFinite(a))return a;if(!(n=t[a]))return!1;if(n.visible)return a;o.push(a),a=n.fill}return!1}function s(e){var i=e.fill,n="dataset";return!1===i?null:(isFinite(i)||(n="boundary"),t[n](e))}function l(t){return t&&!t.skip}function d(t,e,i,n,a){var r;if(n&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<n;++r)o.canvas.lineTo(t,e[r-1],e[r]);for(t.lineTo(i[a-1].x,i[a-1].y),r=a-1;r>0;--r)o.canvas.lineTo(t,i[r],i[r-1],!0)}}return{id:"filler",afterDatasetsUpdate:function(t,n){var o,l,d,h,c=(t.data.datasets||[]).length,u=n.propagate,f=[];for(l=0;l<c;++l)h=null,(d=(o=t.getDatasetMeta(l)).dataset)&&d._model&&d instanceof a.Line&&(h={visible:t.isDatasetVisible(l),fill:e(d,l,c),chart:t,el:d}),o.$filler=h,f.push(h);for(l=0;l<c;++l)(h=f[l])&&(h.fill=r(f,l,u),h.boundary=i(h),h.mapper=s(h))},beforeDatasetDraw:function(t,e){var i=e.meta.$filler;if(i){var a=t.ctx,r=i.el,s=r._view,h=r._children||[],c=i.mapper,u=s.backgroundColor||n.global.defaultColor;c&&u&&h.length&&(o.canvas.clipArea(a,t.chartArea),function(t,e,i,n,a,o){var r,s,h,c,u,f,p,g=e.length,m=n.spanGaps,v=[],y=[],b=0,x=0;for(t.beginPath(),r=0,s=g+!!o;r<s;++r)u=i(c=e[h=r%g]._view,h,n),f=l(c),p=l(u),f&&p?(b=v.push(c),x=y.push(u)):b&&x&&(m?(f&&v.push(c),p&&y.push(u)):(d(t,v,y,b,x),b=x=0,v=[],y=[]));d(t,v,y,b,x),t.closePath(),t.fillStyle=a,t.fill()}(a,h,c,s,u,r._loop),o.canvas.unclipArea(a))}}}}},{25:25,40:40,45:45}],50:[function(t,e,i){"use strict";var n=t(25),a=t(26),o=t(45);n._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var i=e.datasetIndex,n=this.chart,a=n.getDatasetMeta(i);a.hidden=null===a.hidden?!n.data.datasets[i].hidden:null,n.update()},onHover:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return o.isArray(e.datasets)?e.datasets.map((function(e,i){return{text:e.label,fillStyle:o.isArray(e.backgroundColor)?e.backgroundColor[0]:e.backgroundColor,hidden:!t.isDatasetVisible(i),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:i}}),this):[]}}},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');for(var i=0;i<t.data.datasets.length;i++)e.push('<li><span style="background-color:'+t.data.datasets[i].backgroundColor+'"></span>'),t.data.datasets[i].label&&e.push(t.data.datasets[i].label),e.push("</li>");return e.push("</ul>"),e.join("")}}),e.exports=function(t){var e=t.layoutService,i=o.noop;function r(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}function s(i,n){var a=new t.Legend({ctx:i.ctx,options:n,chart:i});e.configure(i,a,n),e.addBox(i,a),i.legend=a}return t.Legend=a.extend({initialize:function(t){o.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:i,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:i,beforeSetDimensions:i,setDimensions:function(){var t=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,t.minSize={width:0,height:0}},afterSetDimensions:i,beforeBuildLabels:i,buildLabels:function(){var t=this,e=t.options.labels||{},i=o.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(i=i.filter((function(i){return e.filter(i,t.chart.data)}))),t.options.reverse&&i.reverse(),t.legendItems=i},afterBuildLabels:i,beforeFit:i,fit:function(){var t=this,e=t.options,i=e.labels,a=e.display,s=t.ctx,l=n.global,d=o.valueOrDefault,h=d(i.fontSize,l.defaultFontSize),c=d(i.fontStyle,l.defaultFontStyle),u=d(i.fontFamily,l.defaultFontFamily),f=o.fontString(h,c,u),p=t.legendHitBoxes=[],g=t.minSize,m=t.isHorizontal();if(m?(g.width=t.maxWidth,g.height=a?10:0):(g.width=a?10:0,g.height=t.maxHeight),a)if(s.font=f,m){var v=t.lineWidths=[0],y=t.legendItems.length?h+i.padding:0;s.textAlign="left",s.textBaseline="top",o.each(t.legendItems,(function(e,n){var a=r(i,h)+h/2+s.measureText(e.text).width;v[v.length-1]+a+i.padding>=t.width&&(y+=h+i.padding,v[v.length]=t.left),p[n]={left:0,top:0,width:a,height:h},v[v.length-1]+=a+i.padding})),g.height+=y}else{var b=i.padding,x=t.columnWidths=[],_=i.padding,k=0,w=0,S=h+b;o.each(t.legendItems,(function(t,e){var n=r(i,h)+h/2+s.measureText(t.text).width;w+S>g.height&&(_+=k+i.padding,x.push(k),k=0,w=0),k=Math.max(k,n),w+=S,p[e]={left:0,top:0,width:n,height:h}})),_+=k,x.push(k),g.width+=_}t.width=g.width,t.height=g.height},afterFit:i,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,i=e.labels,a=n.global,s=a.elements.line,l=t.width,d=t.lineWidths;if(e.display){var h,c=t.ctx,u=o.valueOrDefault,f=u(i.fontColor,a.defaultFontColor),p=u(i.fontSize,a.defaultFontSize),g=u(i.fontStyle,a.defaultFontStyle),m=u(i.fontFamily,a.defaultFontFamily),v=o.fontString(p,g,m);c.textAlign="left",c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=v;var y=r(i,p),b=t.legendHitBoxes,x=t.isHorizontal();h=x?{x:t.left+(l-d[0])/2,y:t.top+i.padding,line:0}:{x:t.left+i.padding,y:t.top+i.padding,line:0};var _=p+i.padding;o.each(t.legendItems,(function(n,r){var f=c.measureText(n.text).width,g=y+p/2+f,m=h.x,v=h.y;x?m+g>=l&&(v=h.y+=_,h.line++,m=h.x=t.left+(l-d[h.line])/2):v+_>t.bottom&&(m=h.x=m+t.columnWidths[h.line]+i.padding,v=h.y=t.top+i.padding,h.line++),function(t,i,n){if(!(isNaN(y)||y<=0)){c.save(),c.fillStyle=u(n.fillStyle,a.defaultColor),c.lineCap=u(n.lineCap,s.borderCapStyle),c.lineDashOffset=u(n.lineDashOffset,s.borderDashOffset),c.lineJoin=u(n.lineJoin,s.borderJoinStyle),c.lineWidth=u(n.lineWidth,s.borderWidth),c.strokeStyle=u(n.strokeStyle,a.defaultColor);var r=0===u(n.lineWidth,s.borderWidth);if(c.setLineDash&&c.setLineDash(u(n.lineDash,s.borderDash)),e.labels&&e.labels.usePointStyle){var l=p*Math.SQRT2/2,d=l/Math.SQRT2,h=t+d,f=i+d;o.canvas.drawPoint(c,n.pointStyle,l,h,f)}else r||c.strokeRect(t,i,y,p),c.fillRect(t,i,y,p);c.restore()}}(m,v,n),b[r].left=m,b[r].top=v,function(t,e,i,n){var a=p/2,o=y+a+t,r=e+a;c.fillText(i.text,o,r),i.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(o,r),c.lineTo(o+n,r),c.stroke())}(m,v,n,f),x?h.x+=g+i.padding:h.y+=_}))}},handleEvent:function(t){var e=this,i=e.options,n="mouseup"===t.type?"click":t.type,a=!1;if("mousemove"===n){if(!i.onHover)return}else{if("click"!==n)return;if(!i.onClick)return}var o=t.x,r=t.y;if(o>=e.left&&o<=e.right&&r>=e.top&&r<=e.bottom)for(var s=e.legendHitBoxes,l=0;l<s.length;++l){var d=s[l];if(o>=d.left&&o<=d.left+d.width&&r>=d.top&&r<=d.top+d.height){if("click"===n){i.onClick.call(e,t.native,e.legendItems[l]),a=!0;break}if("mousemove"===n){i.onHover.call(e,t.native,e.legendItems[l]),a=!0;break}}}return a}}),{id:"legend",beforeInit:function(t){var e=t.options.legend;e&&s(t,e)},beforeUpdate:function(t){var i=t.options.legend,a=t.legend;i?(o.mergeIf(i,n.global.legend),a?(e.configure(t,a,i),a.options=i):s(t,i)):a&&(e.removeBox(t,a),delete t.legend)},afterEvent:function(t,e){var i=t.legend;i&&i.handleEvent(e)}}}},{25:25,26:26,45:45}],51:[function(t,e,i){"use strict";var n=t(25),a=t(26),o=t(45);n._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}}),e.exports=function(t){var e=t.layoutService,i=o.noop;function r(i,n){var a=new t.Title({ctx:i.ctx,options:n,chart:i});e.configure(i,a,n),e.addBox(i,a),i.titleBlock=a}return t.Title=a.extend({initialize:function(t){o.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:i,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:i,beforeSetDimensions:i,setDimensions:function(){var t=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,t.minSize={width:0,height:0}},afterSetDimensions:i,beforeBuildLabels:i,buildLabels:i,afterBuildLabels:i,beforeFit:i,fit:function(){var t=this,e=o.valueOrDefault,i=t.options,a=i.display,r=e(i.fontSize,n.global.defaultFontSize),s=t.minSize,l=o.isArray(i.text)?i.text.length:1,d=o.options.toLineHeight(i.lineHeight,r),h=a?l*d+2*i.padding:0;t.isHorizontal()?(s.width=t.maxWidth,s.height=h):(s.width=h,s.height=t.maxHeight),t.width=s.width,t.height=s.height},afterFit:i,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,i=o.valueOrDefault,a=t.options,r=n.global;if(a.display){var s,l,d,h=i(a.fontSize,r.defaultFontSize),c=i(a.fontStyle,r.defaultFontStyle),u=i(a.fontFamily,r.defaultFontFamily),f=o.fontString(h,c,u),p=o.options.toLineHeight(a.lineHeight,h),g=p/2+a.padding,m=0,v=t.top,y=t.left,b=t.bottom,x=t.right;e.fillStyle=i(a.fontColor,r.defaultFontColor),e.font=f,t.isHorizontal()?(l=y+(x-y)/2,d=v+g,s=x-y):(l="left"===a.position?y+g:x-g,d=v+(b-v)/2,s=b-v,m=Math.PI*("left"===a.position?-.5:.5)),e.save(),e.translate(l,d),e.rotate(m),e.textAlign="center",e.textBaseline="middle";var _=a.text;if(o.isArray(_))for(var k=0,w=0;w<_.length;++w)e.fillText(_[w],0,k,s),k+=p;else e.fillText(_,0,0,s);e.restore()}}}),{id:"title",beforeInit:function(t){var e=t.options.title;e&&r(t,e)},beforeUpdate:function(i){var a=i.options.title,s=i.titleBlock;a?(o.mergeIf(a,n.global.title),s?(e.configure(i,s,a),s.options=a):r(i,a)):s&&(t.layoutService.removeBox(i,s),delete i.titleBlock)}}}},{25:25,26:26,45:45}],52:[function(t,e,i){"use strict";e.exports=function(t){var e=t.Scale.extend({getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t,e=this,i=e.getLabels();e.minIndex=0,e.maxIndex=i.length-1,void 0!==e.options.ticks.min&&(t=i.indexOf(e.options.ticks.min),e.minIndex=-1!==t?t:e.minIndex),void 0!==e.options.ticks.max&&(t=i.indexOf(e.options.ticks.max),e.maxIndex=-1!==t?t:e.maxIndex),e.min=i[e.minIndex],e.max=i[e.maxIndex]},buildTicks:function(){var t=this,e=t.getLabels();t.ticks=0===t.minIndex&&t.maxIndex===e.length-1?e:e.slice(t.minIndex,t.maxIndex+1)},getLabelForIndex:function(t,e){var i=this,n=i.chart.data,a=i.isHorizontal();return n.yLabels&&!a?i.getRightValue(n.datasets[e].data[t]):i.ticks[t-i.minIndex]},getPixelForValue:function(t,e){var i,n=this,a=n.options.offset,o=Math.max(n.maxIndex+1-n.minIndex-(a?0:1),1);if(null!=t&&(i=n.isHorizontal()?t.x:t.y),void 0!==i||void 0!==t&&isNaN(e)){t=i||t;var r=n.getLabels().indexOf(t);e=-1!==r?r:e}if(n.isHorizontal()){var s=n.width/o,l=s*(e-n.minIndex);return a&&(l+=s/2),n.left+Math.round(l)}var d=n.height/o,h=d*(e-n.minIndex);return a&&(h+=d/2),n.top+Math.round(h)},getPixelForTick:function(t){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null)},getValueForPixel:function(t){var e=this,i=e.options.offset,n=Math.max(e._ticks.length-(i?0:1),1),a=e.isHorizontal(),o=(a?e.width:e.height)/n;return t-=a?e.left:e.top,i&&(t-=o/2),(t<=0?0:Math.round(t/o))+e.minIndex},getBasePixel:function(){return this.bottom}});t.scaleService.registerScaleType("category",e,{position:"bottom"})}},{}],53:[function(t,e,i){"use strict";var n=t(25),a=t(45),o=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:o.formatters.linear}},i=t.LinearScaleBase.extend({determineDataLimits:function(){var t=this,e=t.options,i=t.chart,n=i.data.datasets,o=t.isHorizontal();function r(e){return o?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null;var s=e.stacked;if(void 0===s&&a.each(n,(function(t,e){if(!s){var n=i.getDatasetMeta(e);i.isDatasetVisible(e)&&r(n)&&void 0!==n.stack&&(s=!0)}})),e.stacked||s){var l={};a.each(n,(function(n,o){var s=i.getDatasetMeta(o),d=[s.type,void 0===e.stacked&&void 0===s.stack?o:"",s.stack].join(".");void 0===l[d]&&(l[d]={positiveValues:[],negativeValues:[]});var h=l[d].positiveValues,c=l[d].negativeValues;i.isDatasetVisible(o)&&r(s)&&a.each(n.data,(function(i,n){var a=+t.getRightValue(i);isNaN(a)||s.data[n].hidden||(h[n]=h[n]||0,c[n]=c[n]||0,e.relativePoints?h[n]=100:a<0?c[n]+=a:h[n]+=a)}))})),a.each(l,(function(e){var i=e.positiveValues.concat(e.negativeValues),n=a.min(i),o=a.max(i);t.min=null===t.min?n:Math.min(t.min,n),t.max=null===t.max?o:Math.max(t.max,o)}))}else a.each(n,(function(e,n){var o=i.getDatasetMeta(n);i.isDatasetVisible(n)&&r(o)&&a.each(e.data,(function(e,i){var n=+t.getRightValue(e);isNaN(n)||o.data[i].hidden||((null===t.min||n<t.min)&&(t.min=n),(null===t.max||n>t.max)&&(t.max=n))}))}));t.min=isFinite(t.min)&&!isNaN(t.min)?t.min:0,t.max=isFinite(t.max)&&!isNaN(t.max)?t.max:1,this.handleTickRangeOptions()},getTickLimit:function(){var t,e=this,i=e.options.ticks;if(e.isHorizontal())t=Math.min(i.maxTicksLimit?i.maxTicksLimit:11,Math.ceil(e.width/50));else{var o=a.valueOrDefault(i.fontSize,n.global.defaultFontSize);t=Math.min(i.maxTicksLimit?i.maxTicksLimit:11,Math.ceil(e.height/(2*o)))}return t},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e,i=this,n=i.start,a=+i.getRightValue(t),o=i.end-n;return i.isHorizontal()?(e=i.left+i.width/o*(a-n),Math.round(e)):(e=i.bottom-i.height/o*(a-n),Math.round(e))},getValueForPixel:function(t){var e=this,i=e.isHorizontal(),n=i?e.width:e.height,a=(i?t-e.left:e.bottom-t)/n;return e.start+(e.end-e.start)*a},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",i,e)}},{25:25,34:34,45:45}],54:[function(t,e,i){"use strict";var n=t(45),a=t(34);e.exports=function(t){var e=n.noop;t.LinearScaleBase=t.Scale.extend({getRightValue:function(e){return"string"==typeof e?+e:t.Scale.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var i=n.sign(t.min),a=n.sign(t.max);i<0&&a<0?t.max=0:i>0&&a>0&&(t.min=0)}var o=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),o!==r&&t.min>=t.max&&(o?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:e,handleDirectionalChanges:e,buildTicks:function(){var t=this,e=t.options.ticks,i=t.getTickLimit(),o={maxTicks:i=Math.max(2,i),min:e.min,max:e.max,stepSize:n.valueOrDefault(e.fixedStepSize,e.stepSize)},r=t.ticks=a.generators.linear(o,t);t.handleDirectionalChanges(),t.max=n.max(r),t.min=n.min(r),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(e)}})}},{34:34,45:45}],55:[function(t,e,i){"use strict";var n=t(45),a=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:a.formatters.logarithmic}},i=t.Scale.extend({determineDataLimits:function(){var t=this,e=t.options,i=e.ticks,a=t.chart,o=a.data.datasets,r=n.valueOrDefault,s=t.isHorizontal();function l(e){return s?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null,t.minNotZero=null;var d=e.stacked;if(void 0===d&&n.each(o,(function(t,e){if(!d){var i=a.getDatasetMeta(e);a.isDatasetVisible(e)&&l(i)&&void 0!==i.stack&&(d=!0)}})),e.stacked||d){var h={};n.each(o,(function(i,o){var r=a.getDatasetMeta(o),s=[r.type,void 0===e.stacked&&void 0===r.stack?o:"",r.stack].join(".");a.isDatasetVisible(o)&&l(r)&&(void 0===h[s]&&(h[s]=[]),n.each(i.data,(function(i,n){var a=h[s],o=+t.getRightValue(i);isNaN(o)||r.data[n].hidden||(a[n]=a[n]||0,e.relativePoints?a[n]=100:a[n]+=o)})))})),n.each(h,(function(e){var i=n.min(e),a=n.max(e);t.min=null===t.min?i:Math.min(t.min,i),t.max=null===t.max?a:Math.max(t.max,a)}))}else n.each(o,(function(e,i){var o=a.getDatasetMeta(i);a.isDatasetVisible(i)&&l(o)&&n.each(e.data,(function(e,i){var n=+t.getRightValue(e);isNaN(n)||o.data[i].hidden||((null===t.min||n<t.min)&&(t.min=n),(null===t.max||n>t.max)&&(t.max=n),0!==n&&(null===t.minNotZero||n<t.minNotZero)&&(t.minNotZero=n))}))}));t.min=r(i.min,t.min),t.max=r(i.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(n.log10(t.min))-1),t.max=Math.pow(10,Math.floor(n.log10(t.max))+1)):(t.min=1,t.max=10))},buildTicks:function(){var t=this,e=t.options.ticks,i={min:e.min,max:e.max},o=t.ticks=a.generators.logarithmic(i,t);t.isHorizontal()||o.reverse(),t.max=n.max(o),t.min=n.min(o),e.reverse?(o.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),t.Scale.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){return this.getPixelForValue(this.tickValues[t])},getPixelForValue:function(t){var e,i,a,o=this,r=o.start,s=+o.getRightValue(t),l=o.options.ticks;return o.isHorizontal()?(a=n.log10(o.end)-n.log10(r),0===s?i=o.left:(e=o.width,i=o.left+e/a*(n.log10(s)-n.log10(r)))):(e=o.height,0!==r||l.reverse?0===o.end&&l.reverse?(a=n.log10(o.start)-n.log10(o.minNotZero),i=s===o.end?o.top:s===o.minNotZero?o.top+.02*e:o.top+.02*e+.98*e/a*(n.log10(s)-n.log10(o.minNotZero))):0===s?i=l.reverse?o.top:o.bottom:(a=n.log10(o.end)-n.log10(r),e=o.height,i=o.bottom-e/a*(n.log10(s)-n.log10(r))):(a=n.log10(o.end)-n.log10(o.minNotZero),i=s===r?o.bottom:s===o.minNotZero?o.bottom-.02*e:o.bottom-.02*e-.98*e/a*(n.log10(s)-n.log10(o.minNotZero)))),i},getValueForPixel:function(t){var e,i,a=this,o=n.log10(a.end)-n.log10(a.start);return a.isHorizontal()?(i=a.width,e=a.start*Math.pow(10,(t-a.left)*o/i)):(i=a.height,e=Math.pow(10,(a.bottom-t)*o/i)/a.start),e}});t.scaleService.registerScaleType("logarithmic",i,e)}},{34:34,45:45}],56:[function(t,e,i){"use strict";var n=t(25),a=t(45),o=t(34);e.exports=function(t){var e=n.global,i={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:o.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function r(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function s(t){var i=t.options.pointLabels,n=a.valueOrDefault(i.fontSize,e.defaultFontSize),o=a.valueOrDefault(i.fontStyle,e.defaultFontStyle),r=a.valueOrDefault(i.fontFamily,e.defaultFontFamily);return{size:n,style:o,family:r,font:a.fontString(n,o,r)}}function l(t,e,i,n,a){return t===n||t===a?{start:e-i/2,end:e+i/2}:t<n||t>a?{start:e-i-5,end:e}:{start:e,end:e+i+5}}function d(t){return 0===t||180===t?"center":t<180?"left":"right"}function h(t,e,i,n){if(a.isArray(e))for(var o=i.y,r=1.5*n,s=0;s<e.length;++s)t.fillText(e[s],i.x,o),o+=r;else t.fillText(e,i.x,i.y)}function c(t,e,i){90===t||270===t?i.y-=e.h/2:(t>270||t<90)&&(i.y-=e.h)}function u(t){return a.isNumber(t)?t:0}var f=t.LinearScaleBase.extend({setDimensions:function(){var t=this,i=t.options,n=i.ticks;t.width=t.maxWidth,t.height=t.maxHeight,t.xCenter=Math.round(t.width/2),t.yCenter=Math.round(t.height/2);var o=a.min([t.height,t.width]),r=a.valueOrDefault(n.fontSize,e.defaultFontSize);t.drawingArea=i.display?o/2-(r/2+n.backdropPaddingY):o/2},determineDataLimits:function(){var t=this,e=t.chart,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;a.each(e.data.datasets,(function(o,r){if(e.isDatasetVisible(r)){var s=e.getDatasetMeta(r);a.each(o.data,(function(e,a){var o=+t.getRightValue(e);isNaN(o)||s.data[a].hidden||(i=Math.min(o,i),n=Math.max(o,n))}))}})),t.min=i===Number.POSITIVE_INFINITY?0:i,t.max=n===Number.NEGATIVE_INFINITY?0:n,t.handleTickRangeOptions()},getTickLimit:function(){var t=this.options.ticks,i=a.valueOrDefault(t.fontSize,e.defaultFontSize);return Math.min(t.maxTicksLimit?t.maxTicksLimit:11,Math.ceil(this.drawingArea/(1.5*i)))},convertTicksToLabels:function(){var e=this;t.LinearScaleBase.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(e.options.pointLabels.callback,e)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t,e;this.options.pointLabels.display?function(t){var e,i,n,o=s(t),d=Math.min(t.height/2,t.width/2),h={r:t.width,l:0,t:t.height,b:0},c={};t.ctx.font=o.font,t._pointLabelSizes=[];var u,f,p,g=r(t);for(e=0;e<g;e++){n=t.getPointPosition(e,d),u=t.ctx,f=o.size,p=t.pointLabels[e]||"",i=a.isArray(p)?{w:a.longestText(u,u.font,p),h:p.length*f+1.5*(p.length-1)*f}:{w:u.measureText(p).width,h:f},t._pointLabelSizes[e]=i;var m=t.getIndexAngle(e),v=a.toDegrees(m)%360,y=l(v,n.x,i.w,0,180),b=l(v,n.y,i.h,90,270);y.start<h.l&&(h.l=y.start,c.l=m),y.end>h.r&&(h.r=y.end,c.r=m),b.start<h.t&&(h.t=b.start,c.t=m),b.end>h.b&&(h.b=b.end,c.b=m)}t.setReductions(d,h,c)}(this):(t=this,e=Math.min(t.height/2,t.width/2),t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0))},setReductions:function(t,e,i){var n=this,a=e.l/Math.sin(i.l),o=Math.max(e.r-n.width,0)/Math.sin(i.r),r=-e.t/Math.cos(i.t),s=-Math.max(e.b-n.height,0)/Math.cos(i.b);a=u(a),o=u(o),r=u(r),s=u(s),n.drawingArea=Math.min(Math.round(t-(a+o)/2),Math.round(t-(r+s)/2)),n.setCenterPoint(a,o,r,s)},setCenterPoint:function(t,e,i,n){var a=this,o=a.width-e-a.drawingArea,r=t+a.drawingArea,s=i+a.drawingArea,l=a.height-n-a.drawingArea;a.xCenter=Math.round((r+o)/2+a.left),a.yCenter=Math.round((s+l)/2+a.top)},getIndexAngle:function(t){return t*(2*Math.PI/r(this))+(this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(null===t)return 0;var i=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*i:(t-e.min)*i},getPointPosition:function(t,e){var i=this,n=i.getIndexAngle(t)-Math.PI/2;return{x:Math.round(Math.cos(n)*e)+i.xCenter,y:Math.round(Math.sin(n)*e)+i.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this,e=t.min,i=t.max;return t.getPointPositionForValue(0,t.beginAtZero?0:e<0&&i<0?i:e>0&&i>0?e:0)},draw:function(){var t=this,i=t.options,n=i.gridLines,o=i.ticks,l=a.valueOrDefault;if(i.display){var u=t.ctx,f=this.getIndexAngle(0),p=l(o.fontSize,e.defaultFontSize),g=l(o.fontStyle,e.defaultFontStyle),m=l(o.fontFamily,e.defaultFontFamily),v=a.fontString(p,g,m);a.each(t.ticks,(function(i,s){if(s>0||o.reverse){var d=t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]);if(n.display&&0!==s&&function(t,e,i,n){var o=t.ctx;if(o.strokeStyle=a.valueAtIndexOrDefault(e.color,n-1),o.lineWidth=a.valueAtIndexOrDefault(e.lineWidth,n-1),t.options.gridLines.circular)o.beginPath(),o.arc(t.xCenter,t.yCenter,i,0,2*Math.PI),o.closePath(),o.stroke();else{var s=r(t);if(0===s)return;o.beginPath();var l=t.getPointPosition(0,i);o.moveTo(l.x,l.y);for(var d=1;d<s;d++)l=t.getPointPosition(d,i),o.lineTo(l.x,l.y);o.closePath(),o.stroke()}}(t,n,d,s),o.display){var h=l(o.fontColor,e.defaultFontColor);if(u.font=v,u.save(),u.translate(t.xCenter,t.yCenter),u.rotate(f),o.showLabelBackdrop){var c=u.measureText(i).width;u.fillStyle=o.backdropColor,u.fillRect(-c/2-o.backdropPaddingX,-d-p/2-o.backdropPaddingY,c+2*o.backdropPaddingX,p+2*o.backdropPaddingY)}u.textAlign="center",u.textBaseline="middle",u.fillStyle=h,u.fillText(i,0,-d),u.restore()}}})),(i.angleLines.display||i.pointLabels.display)&&function(t){var i=t.ctx,n=a.valueOrDefault,o=t.options,l=o.angleLines,u=o.pointLabels;i.lineWidth=l.lineWidth,i.strokeStyle=l.color;var f=t.getDistanceFromCenterForValue(o.ticks.reverse?t.min:t.max),p=s(t);i.textBaseline="top";for(var g=r(t)-1;g>=0;g--){if(l.display){var m=t.getPointPosition(g,f);i.beginPath(),i.moveTo(t.xCenter,t.yCenter),i.lineTo(m.x,m.y),i.stroke(),i.closePath()}if(u.display){var v=t.getPointPosition(g,f+5),y=n(u.fontColor,e.defaultFontColor);i.font=p.font,i.fillStyle=y;var b=t.getIndexAngle(g),x=a.toDegrees(b);i.textAlign=d(x),c(x,t._pointLabelSizes[g],v),h(i,t.pointLabels[g]||"",v,p.size)}}}(t)}}});t.scaleService.registerScaleType("radialLinear",f,i)}},{25:25,34:34,45:45}],57:[function(t,e,i){"use strict";var n=t(1);n="function"==typeof n?n:window.HXLocal_moment;var a=t(25),o=t(45),r=Number.MIN_SAFE_INTEGER||-9007199254740991,s=Number.MAX_SAFE_INTEGER||9007199254740991,l={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:2628e6,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},d=Object.keys(l);function h(t,e){return t-e}function c(t){var e,i,n,a={},o=[];for(e=0,i=t.length;e<i;++e)a[n=t[e]]||(a[n]=!0,o.push(n));return o}function u(t,e,i,n){var a=function(t,e,i){for(var n,a,o,r=0,s=t.length-1;r>=0&&r<=s;){if(a=t[(n=r+s>>1)-1]||null,o=t[n],!a)return{lo:null,hi:o};if(o[e]<i)r=n+1;else{if(!(a[e]>i))return{lo:a,hi:o};s=n-1}}return{lo:o,hi:null}}(t,e,i),o=a.lo?a.hi?a.lo:t[t.length-2]:t[0],r=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=r[e]-o[e],l=s?(i-o[e])/s:0,d=(r[n]-o[n])*l;return o[n]+d}var f=new Map;function p(t,e){var i=e.parser,a=e.parser||e.format;return"function"==typeof i?i(t):"string"==typeof t&&"string"==typeof a?n(t,a):(t instanceof n||(t=function(t){let e;return void 0!==t&&(f.has(t)?e=f.get(t):(e=n(t),f.set(t,e))),e}(t)),t.isValid()?t:"function"==typeof a?a(t):t)}function g(t,e){if(o.isNullOrUndef(t))return null;var i=e.options.time,n=p(e.getRightValue(t),i);return n.isValid()?(i.round&&n.startOf(i.round),n.valueOf()):null}function m(t){for(var e=d.indexOf(t)+1,i=d.length;e<i;++e)if(l[d[e]].common)return d[e]}function v(t,e,i,a){var r,h=a.time,c=h.unit||function(t,e,i,n){var a,o,r,h=d.length;for(a=d.indexOf(t);a<h-1;++a)if(r=(o=l[d[a]]).steps?o.steps[o.steps.length-1]:s,o.common&&Math.ceil((i-e)/(r*o.size))<=n)return d[a];return d[h-1]}(h.minUnit,t,e,i),u=m(c),f=o.valueOrDefault(h.stepSize,h.unitStepSize),p="week"===c&&h.isoWeekday,g=a.ticks.major.enabled,v=l[c],y=n(t),b=n(e),x=[];for(f||(f=function(t,e,i,n){var a,o,r,s=e-t,d=l[i],h=d.size,c=d.steps;if(!c)return Math.ceil(s/((n||1)*h));for(a=0,o=c.length;a<o&&(r=c[a],!(Math.ceil(s/(h*r))<=n));++a);return r}(t,e,c,i)),p&&(y=y.isoWeekday(p),b=b.isoWeekday(p)),y=y.startOf(p?"day":c),(b=b.startOf(p?"day":c))<e&&b.add(1,c),r=n(y),g&&u&&!p&&!h.round&&(r.startOf(u),r.add(~~((y-r)/(v.size*f))*f,c));r<b;r.add(f,c))x.push(+r);return x.push(+r),x}e.exports=function(t){var e=t.Scale.extend({initialize:function(){if(!n)throw new Error("Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com");this.mergeTicksOptions(),t.Scale.prototype.initialize.call(this)},update:function(){var e=this.options;return e.time&&e.time.format&&console.warn("options.time.format is deprecated and replaced by options.time.parser."),t.Scale.prototype.update.apply(this,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),t.Scale.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var t,e,i,a,l,d,u=this,f=u.chart,p=u.options.time,m=s,v=r,y=[],b=[],x=[];for(t=0,i=f.data.labels.length;t<i;++t)x.push(g(f.data.labels[t],u));for(t=0,i=(f.data.datasets||[]).length;t<i;++t)if(f.isDatasetVisible(t))if(l=f.data.datasets[t].data,o.isObject(l[0]))for(b[t]=[],e=0,a=l.length;e<a;++e)d=g(l[e],u),y.push(d),b[t][e]=d;else y.push.apply(y,x),b[t]=x.slice(0);else b[t]=[];x.length&&(x=c(x).sort(h),m=Math.min(m,x[0]),v=Math.max(v,x[x.length-1])),y.length&&(y=c(y).sort(h),m=Math.min(m,y[0]),v=Math.max(v,y[y.length-1])),m=g(p.min,u)||m,v=g(p.max,u)||v,m=m===s?+n().startOf("day"):m,v=v===r?+n().endOf("day")+1:v,u.min=Math.min(m,v),u.max=Math.max(m+1,v),u._horizontal=u.isHorizontal(),u._table=[],u._timestamps={data:y,datasets:b,labels:x}},buildTicks:function(){var t,e,i,a=this,o=a.min,r=a.max,s=a.options,h=s.time,c=[],f=[];switch(s.ticks.source){case"data":c=a._timestamps.data;break;case"labels":c=a._timestamps.labels;break;default:c=v(o,r,a.getLabelCapacity(o),s)}for("ticks"===s.bounds&&c.length&&(o=c[0],r=c[c.length-1]),o=g(h.min,a)||o,r=g(h.max,a)||r,t=0,e=c.length;t<e;++t)(i=c[t])>=o&&i<=r&&f.push(i);return a.min=o,a.max=r,a._unit=h.unit||function(t,e,i,a){var o,r,s=n.duration(n(a).diff(n(i)));for(o=d.length-1;o>=d.indexOf(e);o--)if(r=d[o],l[r].common&&s.as(r)>=t.length)return r;return d[e?d.indexOf(e):0]}(f,h.minUnit,a.min,a.max),a._majorUnit=m(a._unit),a._table=function(t,e,i,n){if("linear"===n||!t.length)return[{time:e,pos:0},{time:i,pos:1}];var a,o,r,s,l,d=[],h=[e];for(a=0,o=t.length;a<o;++a)(s=t[a])>e&&s<i&&h.push(s);for(h.push(i),a=0,o=h.length;a<o;++a)l=h[a+1],r=h[a-1],s=h[a],void 0!==r&&void 0!==l&&Math.round((l+r)/2)===s||d.push({time:s,pos:a/(o-1)});return d}(a._timestamps.data,o,r,s.distribution),a._offsets=function(t,e,i,n,a){var o,r,s=0,l=0;return a.offset&&e.length&&(a.time.min||(o=e.length>1?e[1]:n,r=e[0],s=(u(t,"time",o,"pos")-u(t,"time",r,"pos"))/2),a.time.max||(o=e[e.length-1],r=e.length>1?e[e.length-2]:i,l=(u(t,"time",o,"pos")-u(t,"time",r,"pos"))/2)),{left:s,right:l}}(a._table,f,o,r,s),function(t,e){var i,a,o,r,s=[];for(i=0,a=t.length;i<a;++i)o=t[i],r=!!e&&o===+n(o).startOf(e),s.push({value:o,major:r});return s}(f,a._majorUnit)},getLabelForIndex:function(t,e){var i=this,n=i.chart.data,a=i.options.time,r=n.labels&&t<n.labels.length?n.labels[t]:"",s=n.datasets[e].data[t];return o.isObject(s)&&(r=i.getRightValue(s)),a.tooltipFormat&&(r=p(r,a).format(a.tooltipFormat)),r},tickFormatFunction:function(t,e,i,n){var a=this,r=a.options,s=t.valueOf(),l=r.time.displayFormats,d=l[a._unit],h=a._majorUnit,c=l[h],u=t.clone().startOf(h).valueOf(),f=r.ticks.major,p=f.enabled&&h&&c&&s===u,g=t.format(n||(p?c:d)),m=p?f:r.ticks.minor,v=o.valueOrDefault(m.callback,m.userCallback);return v?v(g,e,i):g},convertTicksToLabels:function(t){var e,i,a=[];for(e=0,i=t.length;e<i;++e)a.push(this.tickFormatFunction(n(t[e].value),e,t));return a},getPixelForOffset:function(t){var e=this,i=e._horizontal?e.width:e.height,n=e._horizontal?e.left:e.top,a=u(e._table,"time",t,"pos");return n+i*(e._offsets.left+a)/(e._offsets.left+1+e._offsets.right)},getPixelForValue:function(t,e,i){var n=this,a=null;if(void 0!==e&&void 0!==i&&(a=n._timestamps.datasets[i][e]),null===a&&(a=g(t,n)),null!==a)return n.getPixelForOffset(a)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,i=e._horizontal?e.width:e.height,a=e._horizontal?e.left:e.top,o=(i?(t-a)/i:0)*(e._offsets.left+1+e._offsets.left)-e._offsets.right,r=u(e._table,"pos",o,"time");return n(r)},getLabelWidth:function(t){var e=this.options.ticks,i=this.ctx.measureText(t).width,n=o.toRadians(e.maxRotation),r=Math.cos(n),s=Math.sin(n);return i*r+o.valueOrDefault(e.fontSize,a.global.defaultFontSize)*s},getLabelCapacity:function(t){var e=this,i=e.options.time.displayFormats.millisecond,a=e.tickFormatFunction(n(t),0,[],i),o=e.getLabelWidth(a),r=e.isHorizontal()?e.width:e.height;return Math.floor(r/o)}});t.scaleService.registerScaleType("time",e,{position:"bottom",distribution:"linear",bounds:"data",time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{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"}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}})}},{1:1,25:25,45:45}]},{},[7])(7)},t.exports=e()},3:function(t,e,i){var n="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof i.g&&i.g.global===i.g?i.g:this;function a(t,e,i){var n=new XMLHttpRequest;n.open("GET",t),n.responseType="blob",n.onload=function(){l(n.response,e,i)},n.onerror=function(){console.error("could not download file")},n.send()}function o(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function r(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(i){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var s=n.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=n.saveAs||("object"!=typeof window||window!==n?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(t,e,i){var s=n.URL||n.webkitURL,l=document.createElement("a");e=e||t.name||"download",l.download=e,l.rel="noopener","string"==typeof t?(l.href=t,l.origin!==location.origin?o(l.href)?a(t,e,i):r(l,l.target="_blank"):r(l)):(l.href=s.createObjectURL(t),setTimeout((function(){s.revokeObjectURL(l.href)}),4e4),setTimeout((function(){r(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,e,i){if(e=e||t.name||"download","string"==typeof t)if(o(t))a(t,e,i);else{var n=document.createElement("a");n.href=t,n.target="_blank",setTimeout((function(){r(n)}))}else navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}(t,i),e)}:function(t,e,i,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return a(t,e,i);var r="application/octet-stream"===t.type,l=/constructor/i.test(n.HTMLElement)||n.safari,d=/CriOS\/[\d]+/.test(navigator.userAgent);if((d||r&&l||s)&&"undefined"!=typeof FileReader){var h=new FileReader;h.onloadend=function(){var t=h.result;t=d?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location=t,o=null},h.readAsDataURL(t)}else{var c=n.URL||n.webkitURL,u=c.createObjectURL(t);o?o.location=u:location.href=u,o=null,setTimeout((function(){c.revokeObjectURL(u)}),4e4)}});n.saveAs=l.saveAs=l,t.exports=l},632:()=>{var t,e,i,n,a,o,r,s,l;t=window,e=function(t,e){var i=t[0],s=t[1],d=t[2],h=t[3];i=n(i,s,d,h,e[0],7,-680876936),h=n(h,i,s,d,e[1],12,-389564586),d=n(d,h,i,s,e[2],17,606105819),s=n(s,d,h,i,e[3],22,-1044525330),i=n(i,s,d,h,e[4],7,-176418897),h=n(h,i,s,d,e[5],12,1200080426),d=n(d,h,i,s,e[6],17,-1473231341),s=n(s,d,h,i,e[7],22,-45705983),i=n(i,s,d,h,e[8],7,1770035416),h=n(h,i,s,d,e[9],12,-1958414417),d=n(d,h,i,s,e[10],17,-42063),s=n(s,d,h,i,e[11],22,-1990404162),i=n(i,s,d,h,e[12],7,1804603682),h=n(h,i,s,d,e[13],12,-40341101),d=n(d,h,i,s,e[14],17,-1502002290),s=n(s,d,h,i,e[15],22,1236535329),i=a(i,s,d,h,e[1],5,-165796510),h=a(h,i,s,d,e[6],9,-1069501632),d=a(d,h,i,s,e[11],14,643717713),s=a(s,d,h,i,e[0],20,-373897302),i=a(i,s,d,h,e[5],5,-701558691),h=a(h,i,s,d,e[10],9,38016083),d=a(d,h,i,s,e[15],14,-660478335),s=a(s,d,h,i,e[4],20,-405537848),i=a(i,s,d,h,e[9],5,568446438),h=a(h,i,s,d,e[14],9,-1019803690),d=a(d,h,i,s,e[3],14,-187363961),s=a(s,d,h,i,e[8],20,1163531501),i=a(i,s,d,h,e[13],5,-1444681467),h=a(h,i,s,d,e[2],9,-51403784),d=a(d,h,i,s,e[7],14,1735328473),s=a(s,d,h,i,e[12],20,-1926607734),i=o(i,s,d,h,e[5],4,-378558),h=o(h,i,s,d,e[8],11,-2022574463),d=o(d,h,i,s,e[11],16,1839030562),s=o(s,d,h,i,e[14],23,-35309556),i=o(i,s,d,h,e[1],4,-1530992060),h=o(h,i,s,d,e[4],11,1272893353),d=o(d,h,i,s,e[7],16,-155497632),s=o(s,d,h,i,e[10],23,-1094730640),i=o(i,s,d,h,e[13],4,681279174),h=o(h,i,s,d,e[0],11,-358537222),d=o(d,h,i,s,e[3],16,-722521979),s=o(s,d,h,i,e[6],23,76029189),i=o(i,s,d,h,e[9],4,-640364487),h=o(h,i,s,d,e[12],11,-421815835),d=o(d,h,i,s,e[15],16,530742520),s=o(s,d,h,i,e[2],23,-995338651),i=r(i,s,d,h,e[0],6,-198630844),h=r(h,i,s,d,e[7],10,1126891415),d=r(d,h,i,s,e[14],15,-1416354905),s=r(s,d,h,i,e[5],21,-57434055),i=r(i,s,d,h,e[12],6,1700485571),h=r(h,i,s,d,e[3],10,-1894986606),d=r(d,h,i,s,e[10],15,-1051523),s=r(s,d,h,i,e[1],21,-2054922799),i=r(i,s,d,h,e[8],6,1873313359),h=r(h,i,s,d,e[15],10,-30611744),d=r(d,h,i,s,e[6],15,-1560198380),s=r(s,d,h,i,e[13],21,1309151649),i=r(i,s,d,h,e[4],6,-145523070),h=r(h,i,s,d,e[11],10,-1120210379),d=r(d,h,i,s,e[2],15,718787259),s=r(s,d,h,i,e[9],21,-343485551),t[0]=l(i,t[0]),t[1]=l(s,t[1]),t[2]=l(d,t[2]),t[3]=l(h,t[3])},i=function(t,e,i,n,a,o){return e=l(l(e,t),l(n,o)),l(e<<a|e>>>32-a,i)},n=function(t,e,n,a,o,r,s){return i(e&n|~e&a,t,e,o,r,s)},a=function(t,e,n,a,o,r,s){return i(e&a|n&~a,t,e,o,r,s)},o=function(t,e,n,a,o,r,s){return i(e^n^a,t,e,o,r,s)},r=function(t,e,n,a,o,r,s){return i(n^(e|~a),t,e,o,r,s)},t.md5hx=function(t){var i,n=t.length,a=[1732584193,-271733879,-1732584194,271733878];for(i=64;i<=t.length;i+=64)e(a,s(t.substring(i-64,i)));t=t.substring(i-64);var o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<t.length;i++)o[i>>2]|=t.charCodeAt(i)<<(i%4<<3);if(o[i>>2]|=128<<(i%4<<3),i>55)for(e(a,o),i=0;i<16;i++)o[i]=0;return o[14]=8*n,e(a,o),a},s=function(t){var e,i=[];for(e=0;e<64;e+=4)i[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return i},l=function(t,e){return t+e&4294967295}},806:function(t,e,i){t=i.nmd(t);
//! moment.js
//! version : 2.18.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
var n;n=function(){"use strict";var e;function i(){return e.apply(null,arguments)}function n(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function o(t){return void 0===t}function r(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function s(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function l(t,e){var i,n=[];for(i=0;i<t.length;++i)n.push(e(t[i],i));return n}function d(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function h(t,e){for(var i in e)d(e,i)&&(t[i]=e[i]);return d(e,"toString")&&(t.toString=e.toString),d(e,"valueOf")&&(t.valueOf=e.valueOf),t}function c(t,e,i,n){return Ae(t,e,i,n,!0).utc()}function u(t){return null==t._pf&&(t._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),t._pf}var f=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,n=0;n<i;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};function p(t){if(null==t._isValid){var e=u(t),i=f.call(e.parsedDateParts,(function(t){return null!=t})),n=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&i);if(t._strict&&(n=n&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return n;t._isValid=n}return t._isValid}function g(t){var e=c(NaN);return null!=t?h(u(e),t):u(e).userInvalidated=!0,e}var m=i.momentProperties=[];function v(t,e){var i,n,a;if(o(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),o(e._i)||(t._i=e._i),o(e._f)||(t._f=e._f),o(e._l)||(t._l=e._l),o(e._strict)||(t._strict=e._strict),o(e._tzm)||(t._tzm=e._tzm),o(e._isUTC)||(t._isUTC=e._isUTC),o(e._offset)||(t._offset=e._offset),o(e._pf)||(t._pf=u(e)),o(e._locale)||(t._locale=e._locale),m.length>0)for(i=0;i<m.length;i++)o(a=e[n=m[i]])||(t[n]=a);return t}var y=!1;function b(t){v(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===y&&(y=!0,i.updateOffset(this),y=!1)}function x(t){return t instanceof b||null!=t&&null!=t._isAMomentObject}function _(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function k(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=_(e)),i}function w(t,e,i){var n,a=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),r=0;for(n=0;n<a;n++)(i&&t[n]!==e[n]||!i&&k(t[n])!==k(e[n]))&&r++;return r+o}function S(t){!1===i.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function M(t,e){var n=!0;return h((function(){if(null!=i.deprecationHandler&&i.deprecationHandler(null,t),n){for(var a,o=[],r=0;r<arguments.length;r++){if(a="","object"==typeof arguments[r]){for(var s in a+="\n["+r+"] ",arguments[0])a+=s+": "+arguments[0][s]+", ";a=a.slice(0,-2)}else a=arguments[r];o.push(a)}S(t+"\nArguments: "+Array.prototype.slice.call(o).join("")+"\n"+(new Error).stack),n=!1}return e.apply(this,arguments)}),e)}var C={};function D(t,e){null!=i.deprecationHandler&&i.deprecationHandler(t,e),C[t]||(S(e),C[t]=!0)}function T(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function A(t,e){var i,n=h({},t);for(i in e)d(e,i)&&(a(t[i])&&a(e[i])?(n[i]={},h(n[i],t[i]),h(n[i],e[i])):null!=e[i]?n[i]=e[i]:delete n[i]);for(i in t)d(t,i)&&!d(e,i)&&a(t[i])&&(n[i]=h({},n[i]));return n}function R(t){null!=t&&this.set(t)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null;var L=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)d(t,e)&&i.push(e);return i},P={};function I(t,e){var i=t.toLowerCase();P[i]=P[i+"s"]=P[e]=t}function O(t){return"string"==typeof t?P[t]||P[t.toLowerCase()]:void 0}function H(t){var e,i,n={};for(i in t)d(t,i)&&(e=O(i))&&(n[e]=t[i]);return n}var F={};function Y(t,e){F[t]=e}function W(t,e){return function(n){return null!=n?(E(this,t,n),i.updateOffset(this,e),this):z(this,t)}}function z(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function E(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function V(t,e,i){var n=""+Math.abs(t),a=e-n.length;return(t>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+n}var $=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,B=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,N={},U={};function q(t,e,i,n){var a=n;"string"==typeof n&&(a=function(){return this[n]()}),t&&(U[t]=a),e&&(U[e[0]]=function(){return V(a.apply(this,arguments),e[1],e[2])}),i&&(U[i]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function j(t,e){return t.isValid()?(e=G(e,t.localeData()),N[e]=N[e]||function(t){var e,i,n,a=t.match($);for(e=0,i=a.length;e<i;e++)U[a[e]]?a[e]=U[a[e]]:a[e]=(n=a[e]).match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"");return function(e){var n,o="";for(n=0;n<i;n++)o+=T(a[n])?a[n].call(e,t):a[n];return o}}(e),N[e](t)):t.localeData().invalidDate()}function G(t,e){var i=5;function n(t){return e.longDateFormat(t)||t}for(B.lastIndex=0;i>=0&&B.test(t);)t=t.replace(B,n),B.lastIndex=0,i-=1;return t}var Z=/\d/,X=/\d\d/,J=/\d{3}/,K=/\d{4}/,Q=/[+-]?\d{6}/,tt=/\d\d?/,et=/\d\d\d\d?/,it=/\d\d\d\d\d\d?/,nt=/\d{1,3}/,at=/\d{1,4}/,ot=/[+-]?\d{1,6}/,rt=/\d+/,st=/[+-]?\d+/,lt=/Z|[+-]\d\d:?\d\d/gi,dt=/Z|[+-]\d\d(?::?\d\d)?/gi,ht=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ct={};function ut(t,e,i){ct[t]=T(e)?e:function(t,n){return t&&i?i:e}}function ft(t,e){return d(ct,t)?ct[t](e._strict,e._locale):new RegExp(pt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,n,a){return e||i||n||a}))))}function pt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var gt={};function mt(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),r(e)&&(n=function(t,i){i[e]=k(t)}),i=0;i<t.length;i++)gt[t[i]]=n}function vt(t,e){mt(t,(function(t,i,n,a){n._w=n._w||{},e(t,n._w,n,a)}))}function yt(t,e,i){null!=e&&d(gt,t)&>[t](e,i._a,i,t)}var bt=0,xt=1,_t=2,kt=3,wt=4,St=5,Mt=6,Ct=7,Dt=8,Tt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function At(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}q("M",["MM",2],"Mo",(function(){return this.month()+1})),q("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),q("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),I("month","M"),Y("month",8),ut("M",tt),ut("MM",tt,X),ut("MMM",(function(t,e){return e.monthsShortRegex(t)})),ut("MMMM",(function(t,e){return e.monthsRegex(t)})),mt(["M","MM"],(function(t,e){e[xt]=k(t)-1})),mt(["MMM","MMMM"],(function(t,e,i,n){var a=i._locale.monthsParse(t,n,i._strict);null!=a?e[xt]=a:u(i).invalidMonth=t}));var Rt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Lt="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Pt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function It(t,e,i){var n,a,o,r=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)o=c([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(o,"").toLocaleLowerCase();return i?"MMM"===e?-1!==(a=Tt.call(this._shortMonthsParse,r))?a:null:-1!==(a=Tt.call(this._longMonthsParse,r))?a:null:"MMM"===e?-1!==(a=Tt.call(this._shortMonthsParse,r))||-1!==(a=Tt.call(this._longMonthsParse,r))?a:null:-1!==(a=Tt.call(this._longMonthsParse,r))||-1!==(a=Tt.call(this._shortMonthsParse,r))?a:null}function Ot(t,e){var i;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=k(e);else if(!r(e=t.localeData().monthsParse(e)))return t;return i=Math.min(t.date(),At(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t}function Ht(t){return null!=t?(Ot(this,t),i.updateOffset(this,!0),this):z(this,"Month")}var Ft=ht,Yt=ht;function Wt(){function t(t,e){return e.length-t.length}var e,i,n=[],a=[],o=[];for(e=0;e<12;e++)i=c([2e3,e]),n.push(this.monthsShort(i,"")),a.push(this.months(i,"")),o.push(this.months(i,"")),o.push(this.monthsShort(i,""));for(n.sort(t),a.sort(t),o.sort(t),e=0;e<12;e++)n[e]=pt(n[e]),a[e]=pt(a[e]);for(e=0;e<24;e++)o[e]=pt(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function zt(t){return Et(t)?366:365}function Et(t){return t%4==0&&t%100!=0||t%400==0}q("Y",0,0,(function(){var t=this.year();return t<=9999?""+t:"+"+t})),q(0,["YY",2],0,(function(){return this.year()%100})),q(0,["YYYY",4],0,"year"),q(0,["YYYYY",5],0,"year"),q(0,["YYYYYY",6,!0],0,"year"),I("year","y"),Y("year",1),ut("Y",st),ut("YY",tt,X),ut("YYYY",at,K),ut("YYYYY",ot,Q),ut("YYYYYY",ot,Q),mt(["YYYYY","YYYYYY"],bt),mt("YYYY",(function(t,e){e[bt]=2===t.length?i.parseTwoDigitYear(t):k(t)})),mt("YY",(function(t,e){e[bt]=i.parseTwoDigitYear(t)})),mt("Y",(function(t,e){e[bt]=parseInt(t,10)})),i.parseTwoDigitYear=function(t){return k(t)+(k(t)>68?1900:2e3)};var Vt=W("FullYear",!0);function $t(t,e,i,n,a,o,r){var s=new Date(t,e,i,n,a,o,r);return t<100&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function Bt(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function Nt(t,e,i){var n=7+e-i;return-(7+Bt(t,0,n).getUTCDay()-e)%7+n-1}function Ut(t,e,i,n,a){var o,r,s=1+7*(e-1)+(7+i-n)%7+Nt(t,n,a);return s<=0?r=zt(o=t-1)+s:s>zt(t)?(o=t+1,r=s-zt(t)):(o=t,r=s),{year:o,dayOfYear:r}}function qt(t,e,i){var n,a,o=Nt(t.year(),e,i),r=Math.floor((t.dayOfYear()-o-1)/7)+1;return r<1?n=r+jt(a=t.year()-1,e,i):r>jt(t.year(),e,i)?(n=r-jt(t.year(),e,i),a=t.year()+1):(a=t.year(),n=r),{week:n,year:a}}function jt(t,e,i){var n=Nt(t,e,i),a=Nt(t+1,e,i);return(zt(t)-n+a)/7}q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),Y("week",5),Y("isoWeek",5),ut("w",tt),ut("ww",tt,X),ut("W",tt),ut("WW",tt,X),vt(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=k(t)})),q("d",0,"do","day"),q("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),q("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),q("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),ut("d",tt),ut("e",tt),ut("E",tt),ut("dd",(function(t,e){return e.weekdaysMinRegex(t)})),ut("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),ut("dddd",(function(t,e){return e.weekdaysRegex(t)})),vt(["dd","ddd","dddd"],(function(t,e,i,n){var a=i._locale.weekdaysParse(t,n,i._strict);null!=a?e.d=a:u(i).invalidWeekday=t})),vt(["d","e","E"],(function(t,e,i,n){e[n]=k(t)}));var Gt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Zt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Jt(t,e,i){var n,a,o,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=c([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(a=Tt.call(this._weekdaysParse,r))?a:null:"ddd"===e?-1!==(a=Tt.call(this._shortWeekdaysParse,r))?a:null:-1!==(a=Tt.call(this._minWeekdaysParse,r))?a:null:"dddd"===e?-1!==(a=Tt.call(this._weekdaysParse,r))||-1!==(a=Tt.call(this._shortWeekdaysParse,r))||-1!==(a=Tt.call(this._minWeekdaysParse,r))?a:null:"ddd"===e?-1!==(a=Tt.call(this._shortWeekdaysParse,r))||-1!==(a=Tt.call(this._weekdaysParse,r))||-1!==(a=Tt.call(this._minWeekdaysParse,r))?a:null:-1!==(a=Tt.call(this._minWeekdaysParse,r))||-1!==(a=Tt.call(this._weekdaysParse,r))||-1!==(a=Tt.call(this._shortWeekdaysParse,r))?a:null}var Kt=ht,Qt=ht,te=ht;function ee(){function t(t,e){return e.length-t.length}var e,i,n,a,o,r=[],s=[],l=[],d=[];for(e=0;e<7;e++)i=c([2e3,1]).day(e),n=this.weekdaysMin(i,""),a=this.weekdaysShort(i,""),o=this.weekdays(i,""),r.push(n),s.push(a),l.push(o),d.push(n),d.push(a),d.push(o);for(r.sort(t),s.sort(t),l.sort(t),d.sort(t),e=0;e<7;e++)s[e]=pt(s[e]),l[e]=pt(l[e]),d[e]=pt(d[e]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function ie(){return this.hours()%12||12}function ne(t,e){q(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function ae(t,e){return e._meridiemParse}q("H",["HH",2],0,"hour"),q("h",["hh",2],0,ie),q("k",["kk",2],0,(function(){return this.hours()||24})),q("hmm",0,0,(function(){return""+ie.apply(this)+V(this.minutes(),2)})),q("hmmss",0,0,(function(){return""+ie.apply(this)+V(this.minutes(),2)+V(this.seconds(),2)})),q("Hmm",0,0,(function(){return""+this.hours()+V(this.minutes(),2)})),q("Hmmss",0,0,(function(){return""+this.hours()+V(this.minutes(),2)+V(this.seconds(),2)})),ne("a",!0),ne("A",!1),I("hour","h"),Y("hour",13),ut("a",ae),ut("A",ae),ut("H",tt),ut("h",tt),ut("k",tt),ut("HH",tt,X),ut("hh",tt,X),ut("kk",tt,X),ut("hmm",et),ut("hmmss",it),ut("Hmm",et),ut("Hmmss",it),mt(["H","HH"],kt),mt(["k","kk"],(function(t,e,i){var n=k(t);e[kt]=24===n?0:n})),mt(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),mt(["h","hh"],(function(t,e,i){e[kt]=k(t),u(i).bigHour=!0})),mt("hmm",(function(t,e,i){var n=t.length-2;e[kt]=k(t.substr(0,n)),e[wt]=k(t.substr(n)),u(i).bigHour=!0})),mt("hmmss",(function(t,e,i){var n=t.length-4,a=t.length-2;e[kt]=k(t.substr(0,n)),e[wt]=k(t.substr(n,2)),e[St]=k(t.substr(a)),u(i).bigHour=!0})),mt("Hmm",(function(t,e,i){var n=t.length-2;e[kt]=k(t.substr(0,n)),e[wt]=k(t.substr(n))})),mt("Hmmss",(function(t,e,i){var n=t.length-4,a=t.length-2;e[kt]=k(t.substr(0,n)),e[wt]=k(t.substr(n,2)),e[St]=k(t.substr(a))}));var oe,re=W("Hours",!0),se={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Lt,monthsShort:Pt,week:{dow:0,doy:6},weekdays:Gt,weekdaysMin:Xt,weekdaysShort:Zt,meridiemParse:/[ap]\.?m?\.?/i},le={},de={};function he(t){return t?t.toLowerCase().replace("_","-"):t}function ce(e){var i=null;if(!le[e]&&t&&t.exports)try{i=oe._abbr,Object(function(){var t=new Error("Cannot find module 'undefined'");throw t.code="MODULE_NOT_FOUND",t}()),ue(i)}catch(t){}return le[e]}function ue(t,e){var i;return t&&(i=o(e)?pe(t):fe(t,e))&&(oe=i),oe._abbr}function fe(t,e){if(null!==e){var i=se;if(e.abbr=t,null!=le[t])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=le[t]._config;else if(null!=e.parentLocale){if(null==le[e.parentLocale])return de[e.parentLocale]||(de[e.parentLocale]=[]),de[e.parentLocale].push({name:t,config:e}),null;i=le[e.parentLocale]._config}return le[t]=new R(A(i,e)),de[t]&&de[t].forEach((function(t){fe(t.name,t.config)})),ue(t),le[t]}return delete le[t],null}function pe(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return oe;if(!n(t)){if(e=ce(t))return e;t=[t]}return function(t){for(var e,i,n,a,o=0;o<t.length;){for(e=(a=he(t[o]).split("-")).length,i=(i=he(t[o+1]))?i.split("-"):null;e>0;){if(n=ce(a.slice(0,e).join("-")))return n;if(i&&i.length>=e&&w(a,i,!0)>=e-1)break;e--}o++}return null}(t)}function ge(t){var e,i=t._a;return i&&-2===u(t).overflow&&(e=i[xt]<0||i[xt]>11?xt:i[_t]<1||i[_t]>At(i[bt],i[xt])?_t:i[kt]<0||i[kt]>24||24===i[kt]&&(0!==i[wt]||0!==i[St]||0!==i[Mt])?kt:i[wt]<0||i[wt]>59?wt:i[St]<0||i[St]>59?St:i[Mt]<0||i[Mt]>999?Mt:-1,u(t)._overflowDayOfYear&&(e<bt||e>_t)&&(e=_t),u(t)._overflowWeeks&&-1===e&&(e=Ct),u(t)._overflowWeekday&&-1===e&&(e=Dt),u(t).overflow=e),t}var me=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ve=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ye=/Z|[+-]\d\d(?::?\d\d)?/,be=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],xe=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],_e=/^\/?Date\((\-?\d+)/i;function ke(t){var e,i,n,a,o,r,s=t._i,l=me.exec(s)||ve.exec(s);if(l){for(u(t).iso=!0,e=0,i=be.length;e<i;e++)if(be[e][1].exec(l[1])){a=be[e][0],n=!1!==be[e][2];break}if(null==a)return void(t._isValid=!1);if(l[3]){for(e=0,i=xe.length;e<i;e++)if(xe[e][1].exec(l[3])){o=(l[2]||" ")+xe[e][0];break}if(null==o)return void(t._isValid=!1)}if(!n&&null!=o)return void(t._isValid=!1);if(l[4]){if(!ye.exec(l[4]))return void(t._isValid=!1);r="Z"}t._f=a+(o||"")+(r||""),De(t)}else t._isValid=!1}var we=/^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;function Se(t){var e,i,n,a,o,r,s,l={" GMT":" +0000"," EDT":" -0400"," EST":" -0500"," CDT":" -0500"," CST":" -0600"," MDT":" -0600"," MST":" -0700"," PDT":" -0700"," PST":" -0800"};if(e=t._i.replace(/\([^\)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s|\s$/g,""),i=we.exec(e)){if(n=i[1]?"ddd"+(5===i[1].length?", ":" "):"",a="D MMM "+(i[2].length>10?"YYYY ":"YY "),o="HH:mm"+(i[4]?":ss":""),i[1]){var d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][new Date(i[2]).getDay()];if(i[1].substr(0,3)!==d)return u(t).weekdayMismatch=!0,void(t._isValid=!1)}switch(i[5].length){case 2:r=0===s?" +0000":((s="YXWVUTSRQPONZABCDEFGHIKLM".indexOf(i[5][1].toUpperCase())-12)<0?" -":" +")+(""+s).replace(/^-?/,"0").match(/..$/)[0]+"00";break;case 4:r=l[i[5]];break;default:r=l[" GMT"]}i[5]=r,t._i=i.splice(1).join(""),t._f=n+a+o+" ZZ",De(t),u(t).rfc2822=!0}else t._isValid=!1}function Me(t,e,i){return null!=t?t:null!=e?e:i}function Ce(t){var e,n,a,o,r=[];if(!t._d){for(a=function(t){var e=new Date(i.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[_t]&&null==t._a[xt]&&function(t){var e,i,n,a,o,r,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)o=1,r=4,i=Me(e.GG,t._a[bt],qt(Re(),1,4).year),n=Me(e.W,1),((a=Me(e.E,1))<1||a>7)&&(l=!0);else{o=t._locale._week.dow,r=t._locale._week.doy;var d=qt(Re(),o,r);i=Me(e.gg,t._a[bt],d.year),n=Me(e.w,d.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+o,(e.e<0||e.e>6)&&(l=!0)):a=o}n<1||n>jt(i,o,r)?u(t)._overflowWeeks=!0:null!=l?u(t)._overflowWeekday=!0:(s=Ut(i,n,a,o,r),t._a[bt]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(o=Me(t._a[bt],a[bt]),(t._dayOfYear>zt(o)||0===t._dayOfYear)&&(u(t)._overflowDayOfYear=!0),n=Bt(o,0,t._dayOfYear),t._a[xt]=n.getUTCMonth(),t._a[_t]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=r[e]=a[e];for(;e<7;e++)t._a[e]=r[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[kt]&&0===t._a[wt]&&0===t._a[St]&&0===t._a[Mt]&&(t._nextDay=!0,t._a[kt]=0),t._d=(t._useUTC?Bt:$t).apply(null,r),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[kt]=24)}}function De(t){if(t._f!==i.ISO_8601)if(t._f!==i.RFC_2822){t._a=[],u(t).empty=!0;var e,n,a,o,r,s=""+t._i,l=s.length,d=0;for(a=G(t._f,t._locale).match($)||[],e=0;e<a.length;e++)o=a[e],(n=(s.match(ft(o,t))||[])[0])&&((r=s.substr(0,s.indexOf(n))).length>0&&u(t).unusedInput.push(r),s=s.slice(s.indexOf(n)+n.length),d+=n.length),U[o]?(n?u(t).empty=!1:u(t).unusedTokens.push(o),yt(o,n,t)):t._strict&&!n&&u(t).unusedTokens.push(o);u(t).charsLeftOver=l-d,s.length>0&&u(t).unusedInput.push(s),t._a[kt]<=12&&!0===u(t).bigHour&&t._a[kt]>0&&(u(t).bigHour=void 0),u(t).parsedDateParts=t._a.slice(0),u(t).meridiem=t._meridiem,t._a[kt]=function(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[kt],t._meridiem),Ce(t),ge(t)}else Se(t);else ke(t)}function Te(t){var e=t._i,d=t._f;return t._locale=t._locale||pe(t._l),null===e||void 0===d&&""===e?g({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),x(e)?new b(ge(e)):(s(e)?t._d=e:n(d)?function(t){var e,i,n,a,o;if(0===t._f.length)return u(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;a<t._f.length;a++)o=0,e=v({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[a],De(e),p(e)&&(o+=u(e).charsLeftOver,o+=10*u(e).unusedTokens.length,u(e).score=o,(null==n||o<n)&&(n=o,i=e));h(t,i||e)}(t):d?De(t):function(t){var e=t._i;o(e)?t._d=new Date(i.now()):s(e)?t._d=new Date(e.valueOf()):"string"==typeof e?function(t){var e=_e.exec(t._i);null===e?(ke(t),!1===t._isValid&&(delete t._isValid,Se(t),!1===t._isValid&&(delete t._isValid,i.createFromInputFallback(t)))):t._d=new Date(+e[1])}(t):n(e)?(t._a=l(e.slice(0),(function(t){return parseInt(t,10)})),Ce(t)):a(e)?function(t){if(!t._d){var e=H(t._i);t._a=l([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),Ce(t)}}(t):r(e)?t._d=new Date(e):i.createFromInputFallback(t)}(t),p(t)||(t._d=null),t))}function Ae(t,e,i,o,r){var s,l={};return!0!==i&&!1!==i||(o=i,i=void 0),(a(t)&&function(t){var e;for(e in t)return!1;return!0}(t)||n(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=r,l._l=i,l._i=t,l._f=e,l._strict=o,(s=new b(ge(Te(l))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Re(t,e,i,n){return Ae(t,e,i,n,!1)}i.createFromInputFallback=M("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),i.ISO_8601=function(){},i.RFC_2822=function(){};var Le=M("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Re.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:g()})),Pe=M("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Re.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:g()}));function Ie(t,e){var i,a;if(1===e.length&&n(e[0])&&(e=e[0]),!e.length)return Re();for(i=e[0],a=1;a<e.length;++a)e[a].isValid()&&!e[a][t](i)||(i=e[a]);return i}var Oe=["year","quarter","month","week","day","hour","minute","second","millisecond"];function He(t){var e=H(t),i=e.year||0,n=e.quarter||0,a=e.month||0,o=e.week||0,r=e.day||0,s=e.hour||0,l=e.minute||0,d=e.second||0,h=e.millisecond||0;this._isValid=function(t){for(var e in t)if(-1===Oe.indexOf(e)||null!=t[e]&&isNaN(t[e]))return!1;for(var i=!1,n=0;n<Oe.length;++n)if(t[Oe[n]]){if(i)return!1;parseFloat(t[Oe[n]])!==k(t[Oe[n]])&&(i=!0)}return!0}(e),this._milliseconds=+h+1e3*d+6e4*l+1e3*s*60*60,this._days=+r+7*o,this._months=+a+3*n+12*i,this._data={},this._locale=pe(),this._bubble()}function Fe(t){return t instanceof He}function Ye(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function We(t,e){q(t,0,0,(function(){var t=this.utcOffset(),i="+";return t<0&&(t=-t,i="-"),i+V(~~(t/60),2)+e+V(~~t%60,2)}))}We("Z",":"),We("ZZ",""),ut("Z",dt),ut("ZZ",dt),mt(["Z","ZZ"],(function(t,e,i){i._useUTC=!0,i._tzm=Ee(dt,t)}));var ze=/([\+\-]|\d\d)/gi;function Ee(t,e){var i=(e||"").match(t);if(null===i)return null;var n=((i[i.length-1]||[])+"").match(ze)||["-",0,0],a=60*n[1]+k(n[2]);return 0===a?0:"+"===n[0]?a:-a}function Ve(t,e){var n,a;return e._isUTC?(n=e.clone(),a=(x(t)||s(t)?t.valueOf():Re(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+a),i.updateOffset(n,!1),n):Re(t).local()}function $e(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Be(){return!!this.isValid()&&this._isUTC&&0===this._offset}i.updateOffset=function(){};var Ne=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ue=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;function qe(t,e){var i,n,a,o,s,l,h=t,c=null;return Fe(t)?h={ms:t._milliseconds,d:t._days,M:t._months}:r(t)?(h={},e?h[e]=t:h.milliseconds=t):(c=Ne.exec(t))?(i="-"===c[1]?-1:1,h={y:0,d:k(c[_t])*i,h:k(c[kt])*i,m:k(c[wt])*i,s:k(c[St])*i,ms:k(Ye(1e3*c[Mt]))*i}):(c=Ue.exec(t))?(i="-"===c[1]?-1:1,h={y:je(c[2],i),M:je(c[3],i),w:je(c[4],i),d:je(c[5],i),h:je(c[6],i),m:je(c[7],i),s:je(c[8],i)}):null==h?h={}:"object"==typeof h&&("from"in h||"to"in h)&&(o=Re(h.from),s=Re(h.to),a=o.isValid()&&s.isValid()?(s=Ve(s,o),o.isBefore(s)?l=Ge(o,s):((l=Ge(s,o)).milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0},(h={}).ms=a.milliseconds,h.M=a.months),n=new He(h),Fe(t)&&d(t,"_locale")&&(n._locale=t._locale),n}function je(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function Ge(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function Ze(t,e){return function(i,n){var a;return null===n||isNaN(+n)||(D(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=i,i=n,n=a),Xe(this,qe(i="string"==typeof i?+i:i,n),t),this}}function Xe(t,e,n,a){var o=e._milliseconds,r=Ye(e._days),s=Ye(e._months);t.isValid()&&(a=null==a||a,o&&t._d.setTime(t._d.valueOf()+o*n),r&&E(t,"Date",z(t,"Date")+r*n),s&&Ot(t,z(t,"Month")+s*n),a&&i.updateOffset(t,r||s))}qe.fn=He.prototype,qe.invalid=function(){return qe(NaN)};var Je=Ze(1,"add"),Ke=Ze(-1,"subtract");function Qe(t){var e;return void 0===t?this._locale._abbr:(null!=(e=pe(t))&&(this._locale=e),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ti=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function ei(){return this._locale}function ii(t,e){q(0,[t,t.length],0,e)}function ni(t,e,i,n,a){var o;return null==t?qt(this,n,a).year:(e>(o=jt(t,n,a))&&(e=o),ai.call(this,t,e,i,n,a))}function ai(t,e,i,n,a){var o=Ut(t,e,i,n,a),r=Bt(o.year,0,o.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}q(0,["gg",2],0,(function(){return this.weekYear()%100})),q(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),ii("gggg","weekYear"),ii("ggggg","weekYear"),ii("GGGG","isoWeekYear"),ii("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),ut("G",st),ut("g",st),ut("GG",tt,X),ut("gg",tt,X),ut("GGGG",at,K),ut("gggg",at,K),ut("GGGGG",ot,Q),ut("ggggg",ot,Q),vt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=k(t)})),vt(["gg","GG"],(function(t,e,n,a){e[a]=i.parseTwoDigitYear(t)})),q("Q",0,"Qo","quarter"),I("quarter","Q"),Y("quarter",7),ut("Q",Z),mt("Q",(function(t,e){e[xt]=3*(k(t)-1)})),q("D",["DD",2],"Do","date"),I("date","D"),Y("date",9),ut("D",tt),ut("DD",tt,X),ut("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),mt(["D","DD"],_t),mt("Do",(function(t,e){e[_t]=k(t.match(tt)[0])}));var oi=W("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),Y("dayOfYear",4),ut("DDD",nt),ut("DDDD",J),mt(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=k(t)})),q("m",["mm",2],0,"minute"),I("minute","m"),Y("minute",14),ut("m",tt),ut("mm",tt,X),mt(["m","mm"],wt);var ri=W("Minutes",!1);q("s",["ss",2],0,"second"),I("second","s"),Y("second",15),ut("s",tt),ut("ss",tt,X),mt(["s","ss"],St);var si,li=W("Seconds",!1);for(q("S",0,0,(function(){return~~(this.millisecond()/100)})),q(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),q(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),q(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),q(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),q(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),q(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),I("millisecond","ms"),Y("millisecond",16),ut("S",nt,Z),ut("SS",nt,X),ut("SSS",nt,J),si="SSSS";si.length<=9;si+="S")ut(si,rt);function di(t,e){e[Mt]=k(1e3*("0."+t))}for(si="S";si.length<=9;si+="S")mt(si,di);var hi=W("Milliseconds",!1);q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");var ci=b.prototype;function ui(t){return t}ci.add=Je,ci.calendar=function(t,e){var n=t||Re(),a=Ve(n,this).startOf("day"),o=i.calendarFormat(this,a)||"sameElse",r=e&&(T(e[o])?e[o].call(this,n):e[o]);return this.format(r||this.localeData().calendar(o,this,Re(n)))},ci.clone=function(){return new b(this)},ci.diff=function(t,e,i){var n,a,o,r;return this.isValid()&&(n=Ve(t,this)).isValid()?(a=6e4*(n.utcOffset()-this.utcOffset()),"year"===(e=O(e))||"month"===e||"quarter"===e?(r=function(t,e){var i,n=12*(e.year()-t.year())+(e.month()-t.month()),a=t.clone().add(n,"months");return i=e-a<0?(e-a)/(a-t.clone().add(n-1,"months")):(e-a)/(t.clone().add(n+1,"months")-a),-(n+i)||0}(this,n),"quarter"===e?r/=3:"year"===e&&(r/=12)):(o=this-n,r="second"===e?o/1e3:"minute"===e?o/6e4:"hour"===e?o/36e5:"day"===e?(o-a)/864e5:"week"===e?(o-a)/6048e5:o),i?r:_(r)):NaN},ci.endOf=function(t){return void 0===(t=O(t))||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))},ci.format=function(t){t||(t=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var e=j(this,t);return this.localeData().postformat(e)},ci.from=function(t,e){return this.isValid()&&(x(t)&&t.isValid()||Re(t).isValid())?qe({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},ci.fromNow=function(t){return this.from(Re(),t)},ci.to=function(t,e){return this.isValid()&&(x(t)&&t.isValid()||Re(t).isValid())?qe({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},ci.toNow=function(t){return this.to(Re(),t)},ci.get=function(t){return T(this[t=O(t)])?this[t]():this},ci.invalidAt=function(){return u(this).overflow},ci.isAfter=function(t,e){var i=x(t)?t:Re(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=O(o(e)?"millisecond":e))?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf())},ci.isBefore=function(t,e){var i=x(t)?t:Re(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=O(o(e)?"millisecond":e))?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf())},ci.isBetween=function(t,e,i,n){return("("===(n=n||"()")[0]?this.isAfter(t,i):!this.isBefore(t,i))&&(")"===n[1]?this.isBefore(e,i):!this.isAfter(e,i))},ci.isSame=function(t,e){var i,n=x(t)?t:Re(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=O(e||"millisecond"))?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf()))},ci.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},ci.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},ci.isValid=function(){return p(this)},ci.lang=ti,ci.locale=Qe,ci.localeData=ei,ci.max=Pe,ci.min=Le,ci.parsingFlags=function(){return h({},u(this))},ci.set=function(t,e){if("object"==typeof t)for(var i=function(t){var e=[];for(var i in t)e.push({unit:i,priority:F[i]});return e.sort((function(t,e){return t.priority-e.priority})),e}(t=H(t)),n=0;n<i.length;n++)this[i[n].unit](t[i[n].unit]);else if(T(this[t=O(t)]))return this[t](e);return this},ci.startOf=function(t){switch(t=O(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this},ci.subtract=Ke,ci.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},ci.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},ci.toDate=function(){return new Date(this.valueOf())},ci.toISOString=function(){if(!this.isValid())return null;var t=this.clone().utc();return t.year()<0||t.year()>9999?j(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):T(Date.prototype.toISOString)?this.toDate().toISOString():j(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},ci.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var i="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=e+'[")]';return this.format(i+n+"-MM-DD[T]HH:mm:ss.SSS"+a)},ci.toJSON=function(){return this.isValid()?this.toISOString():null},ci.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},ci.unix=function(){return Math.floor(this.valueOf()/1e3)},ci.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},ci.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},ci.year=Vt,ci.isLeapYear=function(){return Et(this.year())},ci.weekYear=function(t){return ni.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},ci.isoWeekYear=function(t){return ni.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},ci.quarter=ci.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},ci.month=Ht,ci.daysInMonth=function(){return At(this.year(),this.month())},ci.week=ci.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},ci.isoWeek=ci.isoWeeks=function(t){var e=qt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},ci.weeksInYear=function(){var t=this.localeData()._week;return jt(this.year(),t.dow,t.doy)},ci.isoWeeksInYear=function(){return jt(this.year(),1,4)},ci.date=oi,ci.day=ci.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},ci.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},ci.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},ci.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},ci.hour=ci.hours=re,ci.minute=ci.minutes=ri,ci.second=ci.seconds=li,ci.millisecond=ci.milliseconds=hi,ci.utcOffset=function(t,e,n){var a,o=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Ee(dt,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(a=$e(this)),this._offset=t,this._isUTC=!0,null!=a&&this.add(a,"m"),o!==t&&(!e||this._changeInProgress?Xe(this,qe(t-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:$e(this)},ci.utc=function(t){return this.utcOffset(0,t)},ci.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract($e(this),"m")),this},ci.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Ee(lt,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},ci.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Re(t).utcOffset():0,(this.utcOffset()-t)%60==0)},ci.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ci.isLocal=function(){return!!this.isValid()&&!this._isUTC},ci.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ci.isUtc=Be,ci.isUTC=Be,ci.zoneAbbr=function(){return this._isUTC?"UTC":""},ci.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ci.dates=M("dates accessor is deprecated. Use date instead.",oi),ci.months=M("months accessor is deprecated. Use month instead",Ht),ci.years=M("years accessor is deprecated. Use year instead",Vt),ci.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),ci.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var t={};if(v(t,this),(t=Te(t))._a){var e=t._isUTC?c(t._a):Re(t._a);this._isDSTShifted=this.isValid()&&w(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var fi=R.prototype;function pi(t,e,i,n){var a=pe(),o=c().set(n,e);return a[i](o,t)}function gi(t,e,i){if(r(t)&&(e=t,t=void 0),t=t||"",null!=e)return pi(t,e,i,"month");var n,a=[];for(n=0;n<12;n++)a[n]=pi(t,n,i,"month");return a}function mi(t,e,i,n){"boolean"==typeof t?(r(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,r(e)&&(i=e,e=void 0),e=e||"");var a,o=pe(),s=t?o._week.dow:0;if(null!=i)return pi(e,(i+s)%7,n,"day");var l=[];for(a=0;a<7;a++)l[a]=pi(e,(a+s)%7,n,"day");return l}fi.calendar=function(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return T(n)?n.call(e,i):n},fi.longDateFormat=function(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},fi.invalidDate=function(){return this._invalidDate},fi.ordinal=function(t){return this._ordinal.replace("%d",t)},fi.preparse=ui,fi.postformat=ui,fi.relativeTime=function(t,e,i,n){var a=this._relativeTime[i];return T(a)?a(t,e,i,n):a.replace(/%d/i,t)},fi.pastFuture=function(t,e){var i=this._relativeTime[t>0?"future":"past"];return T(i)?i(e):i.replace(/%s/i,e)},fi.set=function(t){var e,i;for(i in t)T(e=t[i])?this[i]=e:this["_"+i]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},fi.months=function(t,e){return t?n(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Rt).test(e)?"format":"standalone"][t.month()]:n(this._months)?this._months:this._months.standalone},fi.monthsShort=function(t,e){return t?n(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Rt.test(e)?"format":"standalone"][t.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},fi.monthsParse=function(t,e,i){var n,a,o;if(this._monthsParseExact)return It.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(a=c([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(o="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(o.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(i&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!i&&this._monthsParse[n].test(t))return n}},fi.monthsRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||Wt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=Yt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},fi.monthsShortRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||Wt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Ft),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},fi.week=function(t){return qt(t,this._week.dow,this._week.doy).week},fi.firstDayOfYear=function(){return this._week.doy},fi.firstDayOfWeek=function(){return this._week.dow},fi.weekdays=function(t,e){return t?n(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:n(this._weekdays)?this._weekdays:this._weekdays.standalone},fi.weekdaysMin=function(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin},fi.weekdaysShort=function(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort},fi.weekdaysParse=function(t,e,i){var n,a,o;if(this._weekdaysParseExact)return Jt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(a=c([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}},fi.weekdaysRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ee.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Kt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},fi.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ee.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Qt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},fi.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ee.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=te),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},fi.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},fi.meridiem=function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},ue("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),i.lang=M("moment.lang is deprecated. Use moment.locale instead.",ue),i.langData=M("moment.langData is deprecated. Use moment.localeData instead.",pe);var vi=Math.abs;function yi(t,e,i,n){var a=qe(e,i);return t._milliseconds+=n*a._milliseconds,t._days+=n*a._days,t._months+=n*a._months,t._bubble()}function bi(t){return t<0?Math.floor(t):Math.ceil(t)}function xi(t){return 4800*t/146097}function _i(t){return 146097*t/4800}function ki(t){return function(){return this.as(t)}}var wi=ki("ms"),Si=ki("s"),Mi=ki("m"),Ci=ki("h"),Di=ki("d"),Ti=ki("w"),Ai=ki("M"),Ri=ki("y");function Li(t){return function(){return this.isValid()?this._data[t]:NaN}}var Pi=Li("milliseconds"),Ii=Li("seconds"),Oi=Li("minutes"),Hi=Li("hours"),Fi=Li("days"),Yi=Li("months"),Wi=Li("years"),zi=Math.round,Ei={ss:44,s:45,m:45,h:22,d:26,M:11};function Vi(t,e,i,n,a){return a.relativeTime(e||1,!!i,t,n)}var $i=Math.abs;function Bi(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i=$i(this._milliseconds)/1e3,n=$i(this._days),a=$i(this._months);t=_(i/60),e=_(t/60),i%=60,t%=60;var o=_(a/12),r=a%=12,s=n,l=e,d=t,h=i,c=this.asSeconds();return c?(c<0?"-":"")+"P"+(o?o+"Y":"")+(r?r+"M":"")+(s?s+"D":"")+(l||d||h?"T":"")+(l?l+"H":"")+(d?d+"M":"")+(h?h+"S":""):"P0D"}var Ni=He.prototype;return Ni.isValid=function(){return this._isValid},Ni.abs=function(){var t=this._data;return this._milliseconds=vi(this._milliseconds),this._days=vi(this._days),this._months=vi(this._months),t.milliseconds=vi(t.milliseconds),t.seconds=vi(t.seconds),t.minutes=vi(t.minutes),t.hours=vi(t.hours),t.months=vi(t.months),t.years=vi(t.years),this},Ni.add=function(t,e){return yi(this,t,e,1)},Ni.subtract=function(t,e){return yi(this,t,e,-1)},Ni.as=function(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=O(t))||"year"===t)return e=this._days+n/864e5,i=this._months+xi(e),"month"===t?i:i/12;switch(e=this._days+Math.round(_i(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},Ni.asMilliseconds=wi,Ni.asSeconds=Si,Ni.asMinutes=Mi,Ni.asHours=Ci,Ni.asDays=Di,Ni.asWeeks=Ti,Ni.asMonths=Ai,Ni.asYears=Ri,Ni.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},Ni._bubble=function(){var t,e,i,n,a,o=this._milliseconds,r=this._days,s=this._months,l=this._data;return o>=0&&r>=0&&s>=0||o<=0&&r<=0&&s<=0||(o+=864e5*bi(_i(s)+r),r=0,s=0),l.milliseconds=o%1e3,t=_(o/1e3),l.seconds=t%60,e=_(t/60),l.minutes=e%60,i=_(e/60),l.hours=i%24,r+=_(i/24),s+=a=_(xi(r)),r-=bi(_i(a)),n=_(s/12),s%=12,l.days=r,l.months=s,l.years=n,this},Ni.get=function(t){return t=O(t),this.isValid()?this[t+"s"]():NaN},Ni.milliseconds=Pi,Ni.seconds=Ii,Ni.minutes=Oi,Ni.hours=Hi,Ni.days=Fi,Ni.weeks=function(){return _(this.days()/7)},Ni.months=Yi,Ni.years=Wi,Ni.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),i=function(t,e,i){var n=qe(t).abs(),a=zi(n.as("s")),o=zi(n.as("m")),r=zi(n.as("h")),s=zi(n.as("d")),l=zi(n.as("M")),d=zi(n.as("y")),h=a<=Ei.ss&&["s",a]||a<Ei.s&&["ss",a]||o<=1&&["m"]||o<Ei.m&&["mm",o]||r<=1&&["h"]||r<Ei.h&&["hh",r]||s<=1&&["d"]||s<Ei.d&&["dd",s]||l<=1&&["M"]||l<Ei.M&&["MM",l]||d<=1&&["y"]||["yy",d];return h[2]=e,h[3]=+t>0,h[4]=i,Vi.apply(null,h)}(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)},Ni.toISOString=Bi,Ni.toString=Bi,Ni.toJSON=Bi,Ni.locale=Qe,Ni.localeData=ei,Ni.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Bi),Ni.lang=ti,q("X",0,0,"unix"),q("x",0,0,"valueOf"),ut("x",st),ut("X",/[+-]?\d+(\.\d{1,3})?/),mt("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))})),mt("x",(function(t,e,i){i._d=new Date(k(t))})),i.version="2.18.1",e=Re,i.fn=ci,i.min=function(){return Ie("isBefore",[].slice.call(arguments,0))},i.max=function(){return Ie("isAfter",[].slice.call(arguments,0))},i.now=function(){return Date.now?Date.now():+new Date},i.utc=c,i.unix=function(t){return Re(1e3*t)},i.months=function(t,e){return gi(t,e,"months")},i.isDate=s,i.locale=ue,i.invalid=g,i.duration=qe,i.isMoment=x,i.weekdays=function(t,e,i){return mi(t,e,i,"weekdays")},i.parseZone=function(){return Re.apply(null,arguments).parseZone()},i.localeData=pe,i.isDuration=Fe,i.monthsShort=function(t,e){return gi(t,e,"monthsShort")},i.weekdaysMin=function(t,e,i){return mi(t,e,i,"weekdaysMin")},i.defineLocale=fe,i.updateLocale=function(t,e){if(null!=e){var i,n=se;null!=le[t]&&(n=le[t]._config),(i=new R(e=A(n,e))).parentLocale=le[t],le[t]=i,ue(t)}else null!=le[t]&&(null!=le[t].parentLocale?le[t]=le[t].parentLocale:null!=le[t]&&delete le[t]);return le[t]},i.locales=function(){return L(le)},i.weekdaysShort=function(t,e,i){return mi(t,e,i,"weekdaysShort")},i.normalizeUnits=O,i.relativeTimeRounding=function(t){return void 0===t?zi:"function"==typeof t&&(zi=t,!0)},i.relativeTimeThreshold=function(t,e){return void 0!==Ei[t]&&(void 0===e?Ei[t]:(Ei[t]=e,"s"===t&&(Ei.ss=e-1),!0))},i.calendarFormat=function(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},i.prototype=ci,i},window.HXLocal_moment=n()},281:()=>{var t=window.HXLocal_Chart,e=window.HXLocal_moment;const i=t.helpers;i.isArray;var n=t.helpers.color,a=new Map;function o(t,i){var n=i.parser,o=i.parser||i.format;return"function"==typeof n?n(t):"string"==typeof t&&"string"==typeof o?e(t,o):(t instanceof e||(t=function(t){let i;return void 0!==t&&(a.has(t)?i=a.get(t):(i=e(t),a.set(t,i))),i}(t)),t.isValid()?t:"function"==typeof o?o(t):t)}function r(t,e){if(i.isNullOrUndef(t))return null;var n=e.options.time,a=o(e.getRightValue(t),n);return a.isValid()?(n.round&&a.startOf(n.round),a.valueOf()):null}var s=Number.MIN_SAFE_INTEGER||-9007199254740991,l=Number.MAX_SAFE_INTEGER||9007199254740991,d=t.scaleService.getScaleConstructor("time").extend({determineDataLimits:function(){var t,i,n,a,o,d,h,c=this,u=c.chart,f=c.options.time,p=c.chart.options.elements,g=l,m=s,v=[],y={},b=[];for(t=0,n=(u.data.datasets||[]).length;t<n;++t)if(u.isDatasetVisible(t))for(o=u.data.datasets[t].data,b[t]=[],i=0,a=o.length;i<a;++i)(d=r(o[i][p.keyStart],c))>(h=r(o[i][p.keyEnd],c))&&([d,h]=[h,d]),g>d&&d&&(g=d),m<h&&h&&(m=h),b[t][i]=[d,h,o[i][p.keyValue]],Object.prototype.hasOwnProperty.call(y,d)&&(y[d]=!0,v.push(d)),Object.prototype.hasOwnProperty.call(y,h)&&(y[h]=!0,v.push(h));else b[t]=[];v.size&&v.sort((function(t,e){return t-e})),g=r(f.min,c)||g,m=r(f.max,c)||m,g=g===l?+e().startOf("day"):g,m=m===s?+e().endOf("day")+1:m,c.min=Math.min(g,m),c.max=Math.max(g+1,m),c._horizontal=c.isHorizontal(),c._table=[],c._timestamps={data:v,datasets:b,labels:[]}}});t.scaleService.registerScaleType("timeline",d,{position:"bottom",tooltips:{mode:"nearest"},adapters:{},time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",distribution:"linear",bounds:"data",displayFormats:{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"}},ticks:{autoSkip:!0}}),t.controllers.timeline=t.controllers.bar.extend({getBarBounds:function(t){var e,i,n=t._view;return e=n.x,i=n.x+n.width,{left:e,top:n.y,right:i,bottom:n.y+n.height}},update:function(e){var n=this,a=n.getMeta(),o=n.chart.options;if(o.textPadding||o.minBarWidth||o.showText||o.colorFunction){var r=n.chart.options.elements;r.textPadding=o.textPadding||r.textPadding,r.minBarWidth=o.minBarWidth||r.minBarWidth,r.colorFunction=o.colorFunction||r.colorFunction,r.minBarWidth=o.minBarWidth||r.minBarWidth,!0!==t._tl_depwarn&&(console.log("Timeline Chart: Configuration deprecated. Please check document on Github."),t._tl_depwarn=!0)}if(a.data.length>0){let t=n.getRuler(0);n.barHeight=n.calculateBarHeight(t)+4,i.each(a.data,(function(t,i){n.updateElement(t,i,e)}),n)}},updateElement:function(e,a,o){var r=this,s=r.getMeta(),l=r.getScaleForId(s.xAxisID),d=r.getScaleForId(s.yAxisID),h=r.getDataset(),c=h.data[a],u=e.custom||{},f=r.index,p=r.chart.options.elements||t.defaults.timeline.elements,g=p.rectangle,m=p.textPadding,v=p.minBarWidth;e._xScale=l,e._yScale=d,e._datasetIndex=r.index,e._index=a;var y=p.textFunction(c[p.keyValue],r.chart.data.datasets,f),b=l.getPixelForValue(c[p.keyStart]),x=l.getPixelForValue(c[p.keyEnd]),_=d.getPixelForValue(c,f,f),k=x-b,w=r.barHeight,S=n(p.colorFunction(y,c,r.chart.data.datasets,f)),M=p.showText,C=p.font;C||(C='bold 12px "Helvetica Neue", Helvetica, Arial, sans-serif');var D=_-w/2;e._model={x:o?b-k:b,y:D,width:Math.max(k,v),height:w,base:b+k,backgroundColor:S.rgbaString(),borderSkipped:u.borderSkipped?u.borderSkipped:g.borderSkipped,borderColor:u.borderColor?u.borderColor:i.getValueAtIndexOrDefault(h.borderColor,a,g.borderColor),borderWidth:u.borderWidth?u.borderWidth:i.getValueAtIndexOrDefault(h.borderWidth,a,g.borderWidth),label:r.chart.data.labels[a],datasetLabel:h.label,text:y,textColor:S.luminosity()>.5?"#333333":"#ffffff"},e.draw=function(){var t=this._chart.ctx,e=this._view,i=t.globalAlpha,n=t.globalCompositeOperation;if(t.fillStyle=e.backgroundColor,t.lineWidth=e.borderWidth,t.globalCompositeOperation="destination-over",t.fillRect(e.x,e.y,e.width,e.height),t.globalAlpha=.5,t.globalCompositeOperation="source-over",t.fillRect(e.x,e.y,e.width,e.height),t.globalAlpha=i,t.globalCompositeOperation=n,M){t.beginPath();var a=t.measureText(e.text);a.width>0&&a.width+m+2<e.width&&(t.font=C,t.fillStyle=e.textColor,t.lineWidth=0,t.strokeStyle=e.textColor,t.textBaseline="middle",t.fillText(e.text,e.x+m,e.y+e.height/2)),t.fill()}},e.inXRange=function(t){var e=r.getBarBounds(this);return t>=e.left&&t<=e.right},e.tooltipPosition=function(){var t=this.getCenterPoint();return{x:t.x,y:t.y}},e.getCenterPoint=function(){var t=this._view;return{x:t.x+t.width/2,y:t.y+t.height/2}},e.inRange=function(t,e){var i=!1;if(this._view){var n=r.getBarBounds(this);i=t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}return i},e.pivot()},getBarCount:function(){var t=this,e=0;return i.each(t.chart.data.datasets,(function(i,n){t.chart.getDatasetMeta(n).bar&&t.chart.isDatasetVisible(n)&&++e}),t),e},draw:function(t){var e,i,n=this.getMeta().data;for(e=0,i=n.length;e<i;e++)n[e].draw()},calculateBarHeight:function(t){var e=this.getScaleForId(this.getMeta().yAxisID);return e.options.barThickness?e.options.barThickness:e.options.stacked?t.categoryHeight:t.barHeight},removeHoverStyle:function(t){},setHoverStyle:function(t){}}),t.defaults.timeline={elements:{colorFunction:function(){return n("black")},showText:!0,textPadding:4,minBarWidth:1,keyStart:0,keyEnd:1,keyValue:2},layout:{padding:{left:0,right:0,top:0,bottom:0}},legend:{display:!1},scales:{xAxes:[{type:"timeline",position:"bottom",distribution:"linear",categoryPercentage:.8,barPercentage:.9,gridLines:{display:!0,drawBorder:!0,drawTicks:!0},ticks:{maxRotation:0},unit:"day"}],yAxes:[{type:"category",position:"left",barThickness:20,categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{display:!0,offsetGridLines:!0,drawBorder:!0,drawTicks:!0}}]},tooltips:{callbacks:{title:function(t,e){this._chart.options.elements;return e.labels[t[0].datasetIndex]},label:function(t,i){var n=this._chart.options.elements,a=i.datasets[t.datasetIndex].data[t.index];return[a[n.keyValue],e(a[n.keyStart]).format("D MMM, HH:mm:ss"),e(a[n.keyEnd]).format("D MMM, HH:mm:ss")]}}}};var h=t.scaleService.getScaleConstructor("time").extend({determineDataLimits:function(){var t,i,n,a,o,d,h,c=this,u=c.chart,f=c.options.time,p=c.chart.options.elements,g=l,m=s,v=[],y={},b=[];for(t=0,n=(u.data.datasets||[]).length;t<n;++t)if(u.isDatasetVisible(t))for(o=u.data.datasets[t].data,b[t]=[],i=0,a=o.length;i<a;++i)(d=r(o[i][p.keyStart],c))>(h=r(o[i][p.keyEnd],c))&&([d,h]=[h,d]),g>d&&d&&(g=d),m<h&&h&&(m=h),b[t][i]=[d,h,o[i][p.keyValue]],Object.prototype.hasOwnProperty.call(y,d)&&(y[d]=!0,v.push(d)),Object.prototype.hasOwnProperty.call(y,h)&&(y[h]=!0,v.push(h));else b[t]=[];v.size&&v.sort((function(t,e){return t-e})),g=r(f.min,c)||g,m=r(f.max,c)||m,g=g===l?+e().startOf("day"):g,m=m===s?+e().endOf("day")+1:m,c.min=Math.min(g,m),c.max=Math.max(g+1,m),c._horizontal=c.isHorizontal(),c._table=[],c._timestamps={data:v,datasets:b,labels:[]}}}),c=new Map;t.scaleService.registerScaleType("arrowline",h,{position:"bottom",tooltips:{mode:"nearest"},adapters:{},time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",distribution:"linear",bounds:"data",displayFormats:{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"}},ticks:{autoSkip:!0}}),t.controllers.arrowline=t.controllers.bar.extend({getBarBounds:function(t){var e,i,n=t._view;return e=n.x,i=n.x+n.width,{left:e,top:n.y,right:i,bottom:n.y+n.height}},update:function(t){var e=this,n=e.getMeta();if(n.data.length>0){let a=e.getRuler(0);e.barHeight=e.calculateBarHeight(a)+4,i.each(n.data,(function(i,n){e.updateElement(i,n,t)}),e)}},updateElement:function(e,n,a){var o=this,r=o.getMeta(),s=o.getScaleForId(r.xAxisID),l=o.getScaleForId(r.yAxisID),d=o.getDataset(),h=d.data[n],c=e.custom||{},u=o.index,f=o.chart.options.elements||t.defaults.timeline.elements,p=f.rectangle,g=f.minBarWidth;e._xScale=s,e._yScale=l,e._datasetIndex=o.index,e._index=n;var m=h[f.keyValue],v=s.getPixelForValue(h[f.keyStart]),y=s.getPixelForValue(h[f.keyEnd]),b=l.getPixelForValue(h,u,u),x=y-v,_=o.barHeight,k=b-_/2;e._model={x:a?v-x:v,y:k,width:Math.max(x,g),height:_,base:v+x,backgroundColor:"#000000",borderSkipped:c.borderSkipped?c.borderSkipped:p.borderSkipped,borderColor:c.borderColor?c.borderColor:i.getValueAtIndexOrDefault(d.borderColor,n,p.borderColor),borderWidth:c.borderWidth?c.borderWidth:i.getValueAtIndexOrDefault(d.borderWidth,n,p.borderWidth),label:o.chart.data.labels[n],datasetLabel:d.label,text:m,textColor:"#ffffff"},e.getPosition=function(t){return this._view.x+(t?this._view.width:0)},e.getMidPosition=function(){return this._view.y+this._view.height/2},e.getValue=function(){return this._view.text},e.inXRange=function(t){var e=o.getBarBounds(this);return t>=e.left&&t<=e.right},e.tooltipPosition=function(){var t=this.getCenterPoint();return{x:t.x,y:t.y}},e.getCenterPoint=function(){var t=this._view;return{x:t.x+t.width/2,y:t.y+t.height/2}},e.inRange=function(t,e){var i=!1;if(this._view){var n=o.getBarBounds(this);i=t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}return i},e.pivot()},getBarCount:function(){var t=this,e=0;return i.each(t.chart.data.datasets,(function(i,n){t.chart.getDatasetMeta(n).bar&&t.chart.isDatasetVisible(n)&&++e}),t),e},draw:function(t){let i=this.index<this.chart.data.datasets.length?this.chart.data.datasets[this.index].arrowColor:void 0,n=this.index<this.chart.data.datasets.length?this.chart.data.datasets[this.index].arrowBackground:void 0;if(!c.has(i)){let t=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="${i??this.chart.options.elements.arrowColor}" d="M7.03 9.97H11.03V18.89L13.04 18.92V9.97H17.03L12.03 4.97Z" /></svg>`,e=new Blob([t],{type:"image/svg+xml;charset=utf-8"}),n=(window.URL||window.webkitURL||window).createObjectURL(e),a=new Image;a.onload=()=>{c.set(i,a)},a.src=n}var a=this.getMeta().data;if(!a.length||!c.has(i))return;const o=c.get(i),r=this.chart.chartArea,s=Math.ceil((r.right-r.left)/30),l=a[0].getMidPosition();if(n){const t=l-o.height/2;this.chart.ctx.fillStyle=n,this.chart.ctx.lineWidth=0,this.chart.ctx.fillRect(r.left,t-3,r.right-r.left,o.height+6)}const d=this.chart.ctx.getTransform();let h=this.getScaleForId(this.getMeta().xAxisID).getPixelForValue(e().startOf("day"))%30,u=0;for(let t=0;t<s;t++){let e=null;const i=30*t+r.left+h,n=l-o.height/2,s=i+o.width/2;for(;u<a.length;u++){const t=a[u].getPosition(0);if(a[u].getPosition(1)>s){s>=t&&(e=1*a[u].getValue());break}}if(null!=e){let t=i+o.width/2,a=n+o.height/2;this.chart.ctx.setTransform(d),this.chart.ctx.translate(t,a),this.chart.ctx.rotate((e+180)/180*Math.PI),this.chart.ctx.translate(-t,-a),this.chart.ctx.drawImage(o,i,n,o.width,o.height)}}this.chart.ctx.setTransform(d)},calculateBarHeight:function(t){var e=this.getScaleForId(this.getMeta().yAxisID);return e.options.barThickness?e.options.barThickness:e.options.stacked?t.categoryHeight:t.barHeight},removeHoverStyle:function(t){},setHoverStyle:function(t){}}),t.defaults.arrowline={elements:{minBarWidth:1,keyStart:0,keyEnd:1,keyValue:2},layout:{padding:{left:0,right:0,top:0,bottom:0}},legend:{display:!1},scales:{xAxes:[{type:"timeline",position:"bottom",distribution:"linear",categoryPercentage:.8,barPercentage:.9,gridLines:{display:!0,drawBorder:!0,drawTicks:!0},ticks:{maxRotation:0},unit:"day"}],yAxes:[{type:"category",position:"left",barThickness:20,categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{display:!0,offsetGridLines:!0,drawBorder:!0,drawTicks:!0}}]}}}},e={};function i(n){var a=e[n];if(void 0!==a)return a.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};(()=>{"use strict";i.d(n,{GD:()=>L,ap:()=>R,Fr:()=>D});i(806),i(560),i(281),i(632),i(3);const t={id:"vertline",afterInit:t=>{t.vertline={x:0,draw:!1}},afterEvent:(t,e)=>{const i=t.callerInstance.pconfig;if(D||"hide"===i.cursorMode)return;if(!i.cursorTypes.includes("all")&&!i.cursorTypes.includes(t.config.type))return;const{chartArea:{top:n,bottom:a,left:o,right:r}}=t,s=e.x>=o&&e.x<=r&&e.y>=n&&e.y<=a;if("auto"===i.cursorMode)t.vertline={x:e.x,draw:s},t.draw();else if("all"===i.cursorMode)for(let i of t.callerInstance.graphs)i.chart.vertline={x:e.x,draw:s},i.chart.draw()},afterDatasetsDraw:(t,e,i)=>{const{ctx:n,chartArea:{top:a,bottom:o,left:r,right:s}}=t;t.vertline.draw&&(n.lineWidth=1,n.strokeStyle=i.color||"black",n.save(),n.beginPath(),n.moveTo(t.vertline.x,o),n.lineTo(t.vertline.x,a),n.stroke(),n.restore())}};function e(t,e){return!e||null==t||""===t||(i=t,isNaN(parseFloat(i))||isNaN(i-0))?t:e.format(+t);var i}function a(t,e){return null!=e&&String(e).indexOf(t)>=0?`"${e}"`:e}class o{constructor(){this.overlay=null,this.separator=void 0,this.timeFormat=void 0,this.saveAttributes=void 0,this._hass=null}exportCallback(t){let i=[],n=[],o=null;this.numberLocale&&(o=new Intl.NumberFormat(this.numberLocale,{maximumSignificantDigits:20})),i.push(`Time stamp${this.separator}State\r\n`);for(let r in t){const l=t[r];if(!l.length)continue;let d=r;if(this.saveAttributes&&(n=[],this._hass.states[r])){d+=`${this.separator}State`;for(let t in this._hass.states[r].attributes)s.includes(t)||(n.push(t),d+=`${this.separator}${t}`)}i.push(d+"\r\n");for(let t of l){const r=moment(1e3*t.lu).format(this.timeFormat);let s=e(t.s,o),l=r+this.separator+a(this.separator,s);if(this.saveAttributes)for(let i of n)s=t.a?e(t.a[i],o):"",l+=this.separator+a(this.separator,s);i.push(l+"\r\n")}}const r=new Blob(i,{type:"text/plain;charset=utf-8"});document.body.removeChild(this.overlay),saveAs(r,"entities-"+moment().format("YYYY-MM-DD_HH:mm:ss")+".csv")}exportFailed(t){document.body.removeChild(this.overlay),console.log(t)}exportFile(t){this.separator=t.pconfig.exportSeparator??",",this.timeFormat=t.pconfig.exportTimeFormat??"YYYY-MM-DD HH:mm:ss",this.saveAttributes=t.pconfig.exportAttributes,this.numberLocale=t.pconfig.exportNumberLocale,this._hass=t._hass;let e=0,i=t.startTime.replace("+","%2b"),n=t.endTime.replace("+","%2b"),a=[];for(let i of t.graphs)for(let t of i.entities)a.push(t.entity),e++;if(e>0){this.overlay=t.ui.spinOverlay,document.body.appendChild(this.overlay);let e={type:"history/history_during_period",start_time:moment(i).format("YYYY-MM-DDTHH:mm:ssZ"),end_time:moment(n).format("YYYY-MM-DDTHH:mm:ssZ"),minimal_response:!this.saveAttributes,no_attributes:!this.saveAttributes,entity_ids:a};t._hass.callWS(e).then(this.exportCallback.bind(this),this.exportFailed.bind(this))}}}class r{constructor(){this.overlay=null,this.separator=void 0,this.timeFormat=void 0}exportCallback(t){let i=[],n=null;this.numberLocale&&(n=new Intl.NumberFormat(this.numberLocale,{maximumSignificantDigits:20})),i.push(`Time stamp${this.separator}State${this.separator}Mean${this.separator}Min${this.separator}Max\r\n`);for(let o in t){const r=t[o];if(r.length){i.push(o+"\r\n");for(let t of r){const o=moment(t.start).format(this.timeFormat);let r=t.state?e(t.state,n):"",s=t.mean?e(t.mean,n):"",l=t.min?e(t.min,n):"",d=t.max?e(t.max,n):"";r=a(this.separator,r),s=a(this.separator,s),l=a(this.separator,l),d=a(this.separator,d),i.push(o+this.separator+r+this.separator+s+this.separator+l+this.separator+d+"\r\n")}}}const o=new Blob(i,{type:"text/plain;charset=utf-8"});document.body.removeChild(this.overlay),saveAs(o,"entities-"+moment().format("YYYY-MM-DD_HH:mm:ss")+".csv")}exportFailed(t){document.body.removeChild(this.overlay),console.log(t)}exportFile(t){this.separator=t.pconfig.exportSeparator??",",this.timeFormat=t.pconfig.exportTimeFormat??"YYYY-MM-DD HH:mm:ss",this.numberLocale=t.pconfig.exportNumberLocale;let e=0,i=t.startTime.replace("+","%2b"),n=t.endTime.replace("+","%2b"),a=[];for(let i of t.graphs)for(let t of i.entities)a.push(t.entity),e++;if(e>0){this.overlay=t.ui.spinOverlay,document.body.appendChild(this.overlay);let e={type:t.version[0]>2022||t.version[1]>=11?"recorder/statistics_during_period":"history/statistics_during_period",start_time:moment(i).format("YYYY-MM-DDTHH:mm:ssZ"),end_time:moment(n).format("YYYY-MM-DDTHH:mm:ssZ"),period:t.pconfig.exportStatsPeriod??"hour",statistic_ids:a};t._hass.callWS(e).then(this.exportCallback.bind(this),this.exportFailed.bind(this))}}}var s=["entity_id","assumed_state","attribution","custom_ui_more_info","custom_ui_state_card","device_class","editable","emulated_hue_name","emulated_hue","entity_picture","friendly_name","haaska_hidden","haaska_name","icon","initial_state","last_reset","restored","state_class","supported_features","unit_of_measurement"];const l=[{color:"#3e95cd",fill:"rgba(151,187,205,0.15)"},{color:"#95cd3e",fill:"rgba(187,205,151,0.15)"},{color:"#cd3e3e",fill:"rgba(205,151,151,0.15)"},{color:"#3ecd95",fill:"rgba(151,205,187,0.15)"},{color:"#cd953e",fill:"rgba(205,187,151,0.15)"},{color:"#953ecd",fill:"rgba(187,151,205,0.15)"},{color:"#175ec8",fill:"rgba(151,187,205,0.15)"},{color:"#ff7f00",fill:"rgba(225,179,133,0.15)"},{color:"#cd3e95",fill:"rgba(205,151,187,0.15)"}],d="#66a61e",h="#b5342d",c="#e5ad23",u="#3ecd3e",f="rgb(142, 213, 142)",p="#dddddd",g="#383838",m={unknown:"#888888",unavailable:"#aaaaaa",idle:"#aaaaaa",on:"#cd3e3e",off:p,"binary_sensor.multiple":"rgb(213, 142, 142)","battery_charging.on":u,"battery_charging.multiple":f,"plug.on":u,"plug.multiple":f,"running.on":u,"running.multiple":f,"update.on":u,"update.multiple":f,"connectivity.on":d,"connectivity.off":h,"connectivity.multiple":c,"power.on":d,"power.off":h,"power.multiple":c,"presence.on":d,"presence.off":h,"presence.multiple":c,"gas.on":h,"gas.off":d,"gas.multiple":c,"smoke.on":h,"smoke.off":d,"smoke.multiple":c,"problem.on":h,"problem.off":d,"problem.multiple":c,"safety.on":h,"safety.off":d,"safety.multiple":c,"person.home":"#66a61e","person.not_home":"#b5342d","person.arriving":"#d5bd43","person.leaving":"#d5bd43","person.multiple":"#e5ad23","weather.cloudy":"#91acce","weather.fog":"#adadad","weather.rainy":"#5285df","weather.partlycloudy":"#11a3e9","weather.sunny":"#e9db11","weather.multiple":"#aaaaaa","automation.on":u,"automation.multiple":f,"input_select.Arret":p,"input_select.Eco":"#44739e","input_select.Confort - 2":"#53b8ba","input_select.Confort - 1":"#984ea3","input_select.Confort":"#e99745","sensor.WCDMA":"#44739e","sensor.LTE":"#984ea3"},v={off:g,"input_select.Arret":g};function y(t){if(t&&t.constructor==Object)return t;for(;t&&t.startsWith("--");)t=getComputedStyle(document.body).getPropertyValue(t);return t}function b(t,e){let i,n,a,o;for(let r in t){const s=1*r;e>=s&&(null==a||s>a)&&(i=t[r],a=s),e<s&&(null==o||s<o)&&(n=t[r],o=s)}return i??n}const x={en:{ui:{label:{type_to_search:"Type to search for an entity to add",error_retreiving:"Could not retrieve available entities !",loading:"Loading available entities..."},popup:{remove_all:"Remove all dynamically added graphs ?",enable_panel:"Enable entity history info panel ?",disable_panel:"Disable entity history info panel ?"},menu:{export_csv:"Export as CSV",export_stats:"Export statistics as CSV",remove_all:"Remove all added graphs",enable_panel:"Enable history info panel",disable_panel:"Disable history info panel"},ranges:{l_hour:"< 1 H",hour:"1 H",n_hours:"%1 H",day:"1 Day",n_days:"%1 Days",week:"1 Week",n_weeks:"%1 Weeks",month:"1 Month",n_months:"%1 Months",year:"1 Year"},interval:{_10m:"10 min",hourly:"Hourly",daily:"Daily",monthly:"Monthly",rawline:"As line"}}},fr:{ui:{label:{type_to_search:"Tapez ici pour rechercher une entité à ajouter",error_retreiving:"Impossible de récupérer les entités !",loading:"Chargement des entités disponibles..."},popup:{remove_all:"Supprimer tous les graphiques ajoutés dynamiquement ?",enable_panel:"Activer le panneau d'historique des entités ?",disable_panel:"Déactiver le panneau d'historique des entités ?"},menu:{export_csv:"Exporter le CSV",export_stats:"Exporter le CSV des statistiques",remove_all:"Supprimer tous les graphiques",enable_panel:"Activer le panneau d'historique",disable_panel:"Déactiver le panneau d'historique"},ranges:{l_hour:"< 1 H",hour:"1 H",n_hours:"%1 H",day:"1 Jour",n_days:"%1 Jours",week:"1 Sem",n_weeks:"%1 Sem",month:"1 Mois",n_months:"%1 Mois",year:"1 An"},interval:{_10m:"10 min",hourly:"Heure",daily:"Journée",monthly:"Mensuel",rawline:"Linéaire"}}},de:{ui:{label:{type_to_search:"Entität suchen oder auswählen",error_retreiving:"Entitäten konnten nicht geladen werden !",loading:"Lade verfügbare Entitäten..."},popup:{remove_all:"Alle dynamisch hinzugefügten Diagramme entfernen ?",enable_panel:"Verlaufsinfo für Entitäten aktivieren ?",disable_panel:"Verlaufsinfo für Entitäten deaktivieren ?"},menu:{export_csv:"Als CSV exportieren",export_stats:"Statistik als CSV exportieren",remove_all:"Alle Diagramme entfernen",enable_panel:"Verlaufsinfo aktivieren",disable_panel:"Verlaufsinfo deaktivieren"},ranges:{l_hour:"< 1 Std",hour:"1 Stunde",n_hours:"%1 Stdn.",day:"1 Tag",n_days:"%1 Tage",week:"1 Woche",n_weeks:"%1 Wo.",month:"1 Monat",n_months:"%1 Monate",year:"1 Jahr"},interval:{_10m:"10 Min",hourly:"Stündlich",daily:"Täglich",monthly:"Monatlich",rawline:"Als Linie"}}},es:{ui:{label:{type_to_search:"Seleccionar entidad a añadir",error_retreiving:"No se encuentran entidades disponibles!",loading:"Cargando entidades ..."},popup:{remove_all:"Borrar gráficos añadidos dinámicamente ?",enable_panel:"Habilitar panel info historia entidades ?",disable_panel:"Deshabilitar panel info historia entidades ?"},menu:{export_csv:"Exportar como CSV",export_stats:"Exportar estadísticas como CSV",remove_all:"Borrar gráficos añadidos",enable_panel:"Activar panel info historia",disable_panel:"Desactivar panel info historia"},ranges:{l_hour:"< 1 H",hour:"1 H",n_hours:"%1 H",day:"1 Día",n_days:"%1 Días",week:"1 Sem.",n_weeks:"%1 Sem.",month:"1 Mes",n_months:"%1 Meses",year:"1 Año"},interval:{_10m:"10 min",hourly:"Horario",daily:"Diario",monthly:"Mensual",rawline:"Línea"}}},nl:{ui:{label:{type_to_search:"Typ om te zoeken naar een entiteit om toe te voegen",error_retreiving:"Kan beschikbare entiteiten niet ophalen !",loading:"Beschikbare entiteiten laden..."},popup:{remove_all:"Alle dynamisch toegevoegde grafieken verwijderen ?",enable_panel:"Schakel het informatiepaneel over de geschiedenis van de entiteit in ?",disable_panel:"Schakel het informatiepaneel over de geschiedenis van de entiteit uit ?"},menu:{export_csv:"Exporteren als CSV",export_stats:"Exporteer statistieken als CSV",remove_all:"Verwijder alle toegevoegde grafieken",enable_panel:"Deelvenster Geschiedenisinfo inschakelen",disable_panel:"Schakel geschiedenisinfopaneel uit"},ranges:{l_hour:"< 1 u",hour:"1 u",n_hours:"%1 u",day:"1 Dag",n_days:"%1 Dagen",week:"1 Week",n_weeks:"%1 Weken",month:"1 Maand",n_months:"%1 Maand",year:"1 Jaar"},interval:{_10m:"10 minuten",hourly:"Per uur",daily:"Dagelijks",monthly:"Maandelijks",rawline:"Lijngrafiek"}}},pl:{ui:{label:{type_to_search:"Wpisz, aby wyszukać i dodać encję",error_retreiving:"Nie można pobrać dostępnych elementów !",loading:"Ładowanie dostępnych elementów..."},popup:{remove_all:"Usuń wszystkie wykresy ?",enable_panel:"Włącz panel informacji o historii ?",disable_panel:"Wyłącz panel informacji o historii ?"},menu:{export_csv:"Eksportuj w CSV",export_stats:"Eksportuj statystyki w CSV",remove_all:"Usuń wszystkie dodane grafiki",enable_panel:"Włącz panel historia",disable_panel:"Wyłącz panel historia"},ranges:{l_hour:"< 1 H",hour:"1 H",n_hours:"%1 H",day:"1 Dzień",n_days:"%1 Dni",week:"1 Tydzień",n_weeks:"%1 Tyg",month:"1 Miesiąc",n_months:"%1 Mies",year:"1 Rok"},interval:{_10m:"10 minut",hourly:"Godzina",daily:"Dzień",monthly:"Miesiąc",rawline:"As line"}}},sv:{ui:{label:{type_to_search:"Skriv för att söka efter en enhet att lägga till",error_retreiving:"Kunde inte hämta tillgängliga enheter!",loading:"Laddar tillgängliga enheter..."},popup:{remove_all:"Ta bort alla dynamiskt tillagda grafer?",enable_panel:"Aktivera panelen för enhetens historikinformation?",disable_panel:"Inaktivera panelen för enhetens historikinformation?"},menu:{export_csv:"Exportera som CSV",export_stats:"Exportera statistik som CSV",remove_all:"Ta bort alla tillagda grafer",enable_panel:"Aktivera historikinfo-panelen",disable_panel:"Inaktivera historikinfo-panelen"},ranges:{l_hour:"< 1 tim",hour:"1 tim",n_hours:"%1 timmar",day:"1 dag",n_days:"%1 dagar",week:"1 vecka",n_weeks:"%1 veckor",month:"1 månad",n_months:"%1 månader",year:"1 år"},interval:{_10m:"10 min",hourly:"Varje timme",daily:"Varje dag",monthly:"Varje månad",rawline:"As line"}}},da:{ui:{label:{type_to_search:"Indtast for at søge efter en entitet, der skal tilføjes",error_retreiving:"Fejl ved indlæsning af entiteter !",loading:"Indlæser tilgængelige entiteter..."},popup:{remove_all:"Fjern alle dynamisk tilføjede grafer ?",enable_panel:"Brug historik graf som standard ?",disable_panel:"Fravælg historik graf som standard ?"},menu:{export_csv:"Eksporter som CSV",export_stats:"Eksporter statistik som CSV",remove_all:"Fjern alle tilføjede grafer ",enable_panel:"Brug historik graf som standard",disable_panel:"Deaktivér historik graf som standard"},ranges:{l_hour:"< 1 T",hour:"1 T",n_hours:"%1 T",day:"1 dag",n_days:"%1 dage",week:"1 uge",n_weeks:"%1 uger",month:"1 måned",n_months:"%1 måneder",year:"1 år"},interval:{_10m:"10 min",hourly:"Hver time",daily:"Daglig",monthly:"Månedlig",rawline:"As line"}}},sk:{ui:{label:{type_to_search:"Napíšte, ak chcete vyhľadať entitu, ktorú chcete pridať",error_retreiving:"Nepodarilo sa načítať dostupné entity !",loading:"Načitavanie dostupných entít..."},popup:{remove_all:"Odstrániť všetky dynamicky pridané grafy ?",enable_panel:"Povoliť informačný panel histórie ?",disable_panel:"Zakázať informačný panel histórie ?"},menu:{export_csv:"Export ako CSV",export_stats:"Export štatistiky ako CSV",remove_all:"Odstrániť všetky pridané grafy",enable_panel:"Povoliť informačný panel histórie",disable_panel:"Zakázať informačný panel histórie"},ranges:{l_hour:"< 1 H",hour:"1 H",n_hours:"%1 H",day:"1 deň",n_days:"%1 dní",week:"1 týždeň",n_weeks:"%1 týždňov",month:"1 mesiac",n_months:"%1 mesiacov",year:"1 rok"},interval:{_10m:"10 min",hourly:"Hodinovo",daily:"Denne",monthly:"Mesačné",rawline:"Ako čiara"}}},ru:{ui:{label:{type_to_search:"Начните поиск объекта для добавления",error_retreiving:"Невозможно загрузить доступные объекты!",loading:"Загрузка доступных объектов..."},popup:{remove_all:"Очистить все добавленные графики?",enable_panel:"Активировать историю в панели информации",disable_panel:"Деактивировать историю в панели информации"},menu:{export_csv:"Экспортировать как CSV",export_stats:"Экспортировать статистику как CSV",remove_all:"Очистить все добавленные графики",enable_panel:"Активировать историю в панели информации",disable_panel:"Деактивировать историю в панели информации"},ranges:{l_hour:"< 1 Ч",hour:"1 Ч",n_hours:"%1 Ч",day:"1 День",n_days:"%1 Дн",week:"1 Неделя",n_weeks:"%1 Нед",month:"1 Месяц",n_months:"%1 Мес",year:"1 Год"},interval:{_10m:"10 мин",hourly:"По часам",daily:"По дням",monthly:"По месяцам",rawline:"Линия"}}}};let _="en";function k(t,e){let i=t.split(".").reduce(((t,e)=>t[e]),x[_]);return void 0===i&&(i=t.split(".").reduce(((t,e)=>t[e]),x.en)),i&&e&&(i=i.replace("%1",e)),i}const w=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1);let S={};S.config=null,S.show=void 0,S.entity=null,S.iid=null,S.lc=null,S.iid=setInterval((function(){let t=customElements.get("ha-more-info-history");function e(t){return t.substr(0,t.indexOf("."))}function i(t,e){return t.states[e]?.attributes?.device_class}function n(t,n){return!!S?.config?.exclude&&(S.config.exclude[n]||S.config.exclude[e(n)]||S.config.exclude[i(t,n)])}function a(){let t=JSON.parse(window.localStorage.getItem("history-explorer-info-panel"));t&&(S.config=t.config)}t&&(clearInterval(S.iid),S.iid=null,t.prototype._databaseCallback=function(t){if(void 0===S.show&&(S.show=t,!t)){let t=this.shadowRoot.querySelector("#maincard");t&&(t.style.display="none")}},t.prototype._setEntityOptions=function(t){const e=this.__entityId,i=t.getEntityOptions(e),n=t.getUnitOfMeasure(e),a=t.getStateClass(e),o=i?.type?i.type:"total_increasing"===a?"bar":null==n&&"measurement"!==a?"timeline":"line";t.pconfig.nextDefaultColor=0,t.pconfig.labelAreaWidth="timeline"==o||"arrowline"==o?0:55;let r=[{entity:e,process:i?.process}];if("line"==o||"arrowline"==o||"bar"==o){if(i?.color)r[0].color=i?.color,r[0].fill=i?.fill??"rgba(0,0,0,0)";else{const e=t.getNextDefaultColor();r[0].color=e.color,r[0].fill=i?.fill??e.fill}r[0].width=i?.width??1.001,r[0].lineMode=i?.lineMode,r[0].scale=i?.scale,"bar"==o&&(r[0].fill=r[0].color,r[0].lineMode=i?.lineMode??"lines")}const s={type:o,entities:r,options:i};t.pconfig.graphConfig=[],t.pconfig.graphConfig.push({graph:s,id:t.g_id}),t.graphs=[];for(let e of t.pconfig.graphConfig)t.addFixedGraph(e)},t.prototype._injectHistoryExplorer=function(t){t.initLocalization(),t.insertUIHtmlText(0);for(let e=0;e<1;e++)t._this.querySelector(`#b1_${e}`)?.addEventListener("click",t.subDay.bind(t),!1),t._this.querySelector(`#b2_${e}`)?.addEventListener("click",t.addDay.bind(t),!1),t._this.querySelector(`#b4_${e}`)?.addEventListener("click",t.decZoom.bind(t),!1),t._this.querySelector(`#b5_${e}`)?.addEventListener("click",t.incZoom.bind(t),!1),t._this.querySelector(`#bx_${e}`)?.addEventListener("click",t.todayNoReset.bind(t),!1),t._this.querySelector(`#bx_${e}`)?.addEventListener("dblclick",t.todayReset.bind(t),!1),t._this.querySelector(`#by_${e}`)?.addEventListener("change",t.timeRangeSelected.bind(t)),t._this.querySelector(`#bz_${e}`)?.addEventListener("click",t.toggleZoom.bind(t),!1),t._this.querySelector(`#bo_${e}`)?.addEventListener("click",t.menuClicked.bind(t),!1),t.ui.dateSelector[e]=t._this.querySelector(`#bx_${e}`),t.ui.rangeSelector[e]=t._this.querySelector(`#by_${e}`),t.ui.zoomButton[e]=t._this.querySelector(`#bz_${e}`);D||t._this.querySelector("#maincard").addEventListener("wheel",t.wheelScrolled.bind(t),{passive:!1});const e=S.config??{};if(t.g_id=0,t.pconfig.customStateColors={},t.stateColors={...m},t.stateColorsDark={...v},t.stateColors.off=d,t.stateColors["binary_sensor.multiple"]="#e5ad23",t.stateColors["battery_charging.off"]=p,t.stateColors["plug.off"]=p,t.stateColors["running.off"]=p,t.stateColors["update.on"]=p,t.stateColorsDark["battery_charging.off"]=g,t.stateColorsDark["plug.off"]=g,t.stateColorsDark["running.off"]=g,t.stateColorsDark["update.on"]=g,e.stateColors)for(let i in e.stateColors)t.pconfig.customStateColors[i]=y(e.stateColors[i]);t.pconfig.entityOptions=e.entityOptions,t.pconfig.labelsVisible=!1,t.pconfig.cursorMode=e.cursor?.mode??"hide",t.pconfig.cursorTypes=e.cursor?.types??["all"],t.pconfig.showTooltipColors[0]=e.tooltip?.showColorsLine??e.showTooltipColorsLine??!0,t.pconfig.showTooltipColors[1]=e.tooltip?.showColorsTimeline??e.showTooltipColorsTimeline??!0,t.pconfig.tooltipSize=e.tooltip?.size??e.tooltipSize??"auto",t.pconfig.tooltipShowDuration=e.tooltip?.showDuration??e.tooltipShowDuration??!0,t.pconfig.tooltipShowLabel=e.tooltip?.showLabel??!0,t.pconfig.tooltipStateTextMode=e.tooltip?.stateTextMode??e.stateTextMode??"auto",t.pconfig.colorSeed=e.stateColorSeed??137,t.pconfig.stateTextMode=e.stateTextMode??"auto",t.pconfig.decimation=e.decimation,t.pconfig.roundingPrecision=e.rounding||2,t.pconfig.defaultLineMode=e.lineMode??"lines",t.pconfig.defaultLineWidth=e.lineWidth??2,t.pconfig.showUnavailable=e.showUnavailable??!1,t.pconfig.showCurrentValues=!1,t.pconfig.axisAddMarginMin=void 0!==e.axisAddMarginMin&&e.axisAddMarginMin,t.pconfig.axisAddMarginMax=void 0!==e.axisAddMarginMax&&e.axisAddMarginMax,t.pconfig.recordedEntitiesOnly=!1,t.pconfig.filterEntities=null,t.pconfig.combineSameUnits=!1,t.pconfig.defaultTimeRange=e.defaultTimeRange??"24",t.pconfig.defaultTimeOffset=e.defaultTimeOffset??void 0,t.pconfig.timeTickDensity=e.timeTicks?.density??e.timeTickDensity??"high",t.pconfig.timeTickOverride=e.timeTicks?.densityOverride??void 0,t.pconfig.timeTickShortDate="short"===e.timeTicks?.dateFormat,t.pconfig.lineGraphHeight=1*(e.lineGraphHeight??250),t.pconfig.barGraphHeight=1*(e.barGraphHeight??150),t.pconfig.timelineBarHeight=1*(e.timelineBarHeight??24),t.pconfig.timelineBarSpacing=40,t.pconfig.hideLegend=!0,t.pconfig.refreshEnabled=void 0===e.refresh?.automatic||e.refresh.automatic,t.pconfig.refreshInterval=void 0,t.statistics.enabled=e.statistics?.enabled??!0,t.statistics.mode=e.statistics?.mode??"mean",t.statistics.retention=e.statistics?.retention??void 0,t.statistics.period=e.statistics?.period??"hour",t.statistics.force=void 0,t.ui.darkMode=t._hass.selectedTheme&&t._hass.selectedTheme.dark||t._hass.themes&&t._hass.themes.darkMode,e.uimode&&("dark"===e.uimode?t.ui.darkMode=!0:"light"===e.uimode&&(t.ui.darkMode=!1)),t.pconfig.graphLabelColor=y(e.uiColors?.labels??(t.ui.darkMode?"#9b9b9b":"#333")),t.pconfig.graphGridColor=y(e.uiColors?.gridlines??(t.ui.darkMode?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)")),t.pconfig.cursorLineColor=y(e.uiColors?.cursorline??t.pconfig.graphGridColor),this._setEntityOptions(t),t.contentValid=!0,t.databaseCallback=this._databaseCallback.bind(this),t.setTimeRangeFromString(String(t.pconfig.defaultTimeRange)),t.today(!1),new ResizeObserver((e=>{for(let e of t.graphs)e.chart.resize(void 0,e.graphHeight);t.setStepSize(!0)})).observe(this)},t.prototype._hec_updated=function(t){if(this.hec_instance){this._recreate&&(this._recreate=!1,this._setEntityOptions(this.hec_instance),this.hec_instance.updateHistoryWithClearCache());const t=this.__hass.states[this.__entityId]?.last_changed;S.lc!=t&&(S.lc=t,this.hec_instance.pconfig.refreshEnabled&&(this.hec_instance.cache[this.hec_instance.cacheSize].valid=!1,this.hec_instance.tid&&clearTimeout(this.hec_instance.tid),this.hec_instance.tid=setTimeout(this.hec_instance.updateHistoryAutoRefresh.bind(this.hec_instance),2e3)))}else{if(S.show=void 0,a(),this.hec_instance=new L,this.hec_instance._this=this.shadowRoot,this.hec_instance._hass=this.__hass,this.hec_instance.version=this.__hass.config.version.split(".").map(Number),n(this.__hass,this.__entityId))return this._oldUpdated(t);this._injectHistoryExplorer(this.hec_instance),S.lc=this.__hass.states[this.__entityId]?.last_changed}},t.prototype._hec_render=function(){this.hec_instance||a();const t=this.__entityId;if(n(this.__hass,t))return this._oldRender();const o=function(t,n,a){let o=n?.[a];if(!o){const r=i(t,a);if(o=r?n?.[r]:void 0,!o){const t=e(a);o=t?n?.[t]:void 0}}return o??void 0}(this.__hass,S?.config?.entityOptions,t),r=this.__hass.states[t]?.attributes?.unit_of_measurement,s=this.__hass.states[t]?.attributes?.state_class,l=o?.type?o.type:"total_increasing"===s?"bar":null==r&&"measurement"!==s?"timeline":"line",d=function(t){switch(t){case"line":return S?.config?.lineGraphHeight??250;case"bar":return(S?.config?.barGraphHeight??150)+24;default:return 90}}(l),h="var(--primary-text-color)",c="var(--card-background-color)",u=y(S?.config?.uiColors?.buttons??getComputedStyle(document.body).getPropertyValue("--primary-color")+"1f"),f=y(S?.config?.uiColors?.closeButton??"#0000001f"),p="hide"!=S?.config?.uiLayout?.toolbar,g=!0===S?.config?.uiLayout?.invertZoom,m="hide"!=S?.config?.uiLayout?.interval;S.entity!==this.__entityId&&(S.entity=this.__entityId,S.show=void 0,this.hec_instance&&(this._recreate=!0));return p?w`
<div id="maincard" style="display:${!1===S.show?"none":"block"};margin-bottom: 16px">
<div style="margin-bottom:10px;width:100%;min-height:30px;text-align:center;display:block;line-height:normal;">
<div id="dl_${0}" style="background-color:${u};float:left;margin-left:${D?-12:-4}px;display:inline-block;padding-left:10px;padding-right:10px;">
<button id="b1_${0}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px"><</button>
<button id="bx_${0}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px">-</button>
<button id="b2_${0}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px">></button>
</div>
<div id="dr_${0}" style="background-color:${u};float:right;margin-right:${D?-12:-4}px;display:inline-block;padding-left:${D?5:10}px;padding-right:10px;">
<button id="bz_${0}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000"><svg width="24" height="24" viewBox="0 0 24 24" style="vertical-align:middle;"><path fill="var(--primary-text-color)" d="M15.5,14L20.5,19L19,20.5L14,15.5V14.71L13.73,14.43C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.43,13.73L14.71,14H15.5M9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14M12,10H10V12H9V10H7V9H9V7H10V9H12V10Z" /></svg></button>
<button id="b${g?5:4}_${0}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px">-</button>
<select id="by_${0}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px;max-width:83px">
<option value="0" style="color:${h};background-color:${c}" hidden></option>
<option value="1" style="color:${h};background-color:${c}"></option>
<option value="2" style="color:${h};background-color:${c}"></option>
<option value="3" style="color:${h};background-color:${c}" hidden></option>
<option value="4" style="color:${h};background-color:${c}" hidden></option>
<option value="5" style="color:${h};background-color:${c}" hidden></option>
<option value="6" style="color:${h};background-color:${c}"></option>
<option value="7" style="color:${h};background-color:${c}" hidden></option>
<option value="8" style="color:${h};background-color:${c}" hidden></option>
<option value="9" style="color:${h};background-color:${c}" hidden></option>
<option value="10" style="color:${h};background-color:${c}" hidden></option>
<option value="11" style="color:${h};background-color:${c}" hidden></option>
<option value="12" style="color:${h};background-color:${c}"></option>
<option value="24" style="color:${h};background-color:${c}"></option>
<option value="48" style="color:${h};background-color:${c}"></option>
<option value="72" style="color:${h};background-color:${c}"></option>
<option value="96" style="color:${h};background-color:${c}" hidden></option>
<option value="120" style="color:${h};background-color:${c}" hidden></option>
<option value="144" style="color:${h};background-color:${c}" hidden></option>
<option value="168" style="color:${h};background-color:${c}"></option>
<option value="336" style="color:${h};background-color:${c}"></option>
<option value="504" style="color:${h};background-color:${c}"></option>
<option value="720" style="color:${h};background-color:${c}"></option>
<option value="2184" style="color:${h};background-color:${c}"></option>
<option value="4368" style="color:${h};background-color:${c}"></option>
<option value="8760" style="color:${h};background-color:${c}"></option>
</select>
<button id="b${g?4:5}_${0}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px">+</button>
</div>
</div>
<div id='graphlist' style="margin-left:-2px;margin-right:-10px">
<div>
<select id='bd-0' style="display:${"bar"==l&&m?"block":"none"};position:relative;float:right;width:80px;right:10px;color:var(--primary-text-color);background-color:${f};border:0px solid black;">
<option value="0" style="color:${h};background-color:${c}">10m</option>
<option value="1" style="color:${h};background-color:${c}" selected>Hourly</option>
<option value="2" style="color:${h};background-color:${c}">Daily</option>
<option value="3" style="color:${h};background-color:${c}">Monthly</option>
<option value="4" style="color:${h};background-color:${c}">As line</option>
</select>
<button id='ca-0' style="display:${"line"==l||"bar"==l?"block":"none"};position:absolute;margin-left:-12px;background:none;opacity:1.0;border:0px solid black;">
<svg style='display:none' width="18" height="18" viewBox="0 0 24 24"><path fill="var(--primary-text-color)" d="M12,17C10.89,17 10,16.1 10,15C10,13.89 10.89,13 12,13A2,2 0 0,1 14,15A2,2 0 0,1 12,17M18,20V10H6V20H18M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10C4,8.89 4.89,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z" /></svg>
</button>
<canvas id="graph0" height="${d}px" style='touch-action:pan-y'></canvas>
</div>
</div>
</div>
`:w`
<div id="maincard" style="display:${!1===S.show?"none":"block"};margin-bottom: 16px">
<div id='graphlist' style="margin-left:-2px;margin-right:-10px">
<div>
<select id='bd-0' style="display:${"bar"==l&&m?"block":"none"};position:relative;float:right;width:80px;right:10px;color:var(--primary-text-color);background-color:${f};border:0px solid black;">
<option value="0" style="color:${h};background-color:${c}">10m</option>
<option value="1" style="color:${h};background-color:${c}" selected>Hourly</option>
<option value="2" style="color:${h};background-color:${c}">Daily</option>
<option value="3" style="color:${h};background-color:${c}">Monthly</option>
<option value="4" style="color:${h};background-color:${c}">As line</option>
</select>
<button id='ca-0' style="display:${"line"==l||"bar"==l?"block":"none"};position:absolute;margin-top:-6px;margin-left:-12px;background:none;opacity:1.0;border:0px solid black;">
<svg style='display:none' width="18" height="18" viewBox="0 0 24 24"><path fill="var(--primary-text-color)" d="M12,17C10.89,17 10,16.1 10,15C10,13.89 10.89,13 12,13A2,2 0 0,1 14,15A2,2 0 0,1 12,17M18,20V10H6V20H18M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10C4,8.89 4.89,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z" /></svg>
</button>
<canvas id="graph0" height="${d}px" style='touch-action:pan-y'></canvas>
</div>
</div>
</div>
`},R&&(t.prototype._oldUpdated=t.prototype.updated,t.prototype._oldRender=t.prototype.render,t.prototype.updated=t.prototype._hec_updated,t.prototype.render=t.prototype._hec_render))}),100);var M=window.HXLocal_Chart,C=window.HXLocal_moment;const D=navigator.appVersion.indexOf("Mobi")>-1||navigator.userAgent.indexOf("HomeAssistant")>-1,T=[1,2,6,12,24,48,72,96,120,144,168,336,504,720,2184,4368,8760];var A={mx:0,lx:0,my:0,ly:0,tc:0,g:null,overlay:null,st0:null,st1:null};let R=!!JSON.parse(window.localStorage.getItem("history-explorer-info-panel"));class L{constructor(){this.colorMap=new Map,this.timeCache=new Map,this.stateTexts=new Map,this.stateMap=new Map,this.csvExporter=new o,this.statsExporter=new r,this.stateColors=m,this.stateColorsDark=v,this.ui={},this.ui.dateSelector=[],this.ui.rangeSelector=[],this.ui.zoomButton=[],this.ui.inputField=[],this.ui.darkMode=!1,this.ui.spinOverlay=null,this.ui.optionStyle="",this.ui.hideHeader=!1,this.ui.hideInterval=!1,this.ui.hideSelector=!1,this.ui.stickyTools=0,this.ui.wideInterval=!1,this.i18n={},this.i18n.valid=!1,this.i18n.styleDateSelector="",this.i18n.styleTimeTicks="",this.i18n.styleDateTicks="",this.i18n.styleDateTimeTooltip="",this.pconfig={},this.pconfig.graphLabelColor="#333",this.pconfig.graphGridColor="#00000000",this.pconfig.cursorLineColor="#00000000",this.pconfig.lineGraphHeight=250,this.pconfig.barGraphHeight=150,this.pconfig.timelineBarHeight=24,this.pconfig.timelineBarSpacing=40,this.pconfig.labelAreaWidth=65,this.pconfig.labelsVisible=!0,this.pconfig.cursorMode="auto",this.pconfig.cursorTypes=["all"],this.pconfig.showTooltipColors=[!0,!0],this.pconfig.tooltipSize="auto",this.pconfig.tooltipShowDuration=!1,this.pconfig.tooltipShowLabel=!0,this.pconfig.tooltipStateTextMode="raw",this.pconfig.closeButtonColor=void 0,this.pconfig.customStateColors=void 0,this.pconfig.colorSeed=137,this.pconfig.stateTextMode="raw",this.pconfig.graphConfig=[],this.pconfig.entityOptions=void 0,this.pconfig.lockAllGraphs=!1,this.pconfig.combineSameUnits=!1,this.pconfig.recordedEntitiesOnly=!1,this.pconfig.filterEntities=void 0,this.pconfig.decimation="fast",this.pconfig.roundingPrecision=2,this.pconfig.defaultLineMode=void 0,this.pconfig.defaultLineWidth=void 0,this.pconfig.nextDefaultColor=0,this.pconfig.showUnavailable=!0,this.pconfig.showCurrentValues=!1,this.pconfig.axisAddMarginMin=!0,this.pconfig.axisAddMarginMax=!0,this.pconfig.defaultTimeRange="24",this.pconfig.defaultTimeOffset=void 0,this.pconfig.timeTickDensity="high",this.pconfig.timeTickOverride=void 0,this.pconfig.timeTickShortDate=!1,this.pconfig.refreshEnabled=!1,this.pconfig.refreshInterval=void 0,this.pconfig.exportSeparator=void 0,this.pconfig.exportTimeFormat=void 0,this.pconfig.exportStatsPeriod=void 0,this.pconfig.entities=[],this.pconfig.infoPanelConfig=null,this.loader={},this.loader.startTime=0,this.loader.endTime=0,this.loader.startIndex=-1,this.loader.endIndex=-1,this.loader.loadingStats=!1,this.state={},this.state.drag=!1,this.state.selecting=!1,this.state.updateCanvas=null,this.state.loading=!1,this.state.zoomMode=!1,this.state.altGraph=null,this.state.autoScroll=!1,this.activeRange={},this.activeRange.timeRangeHours=24,this.activeRange.timeRangeMinutes=0,this.activeRange.tickStepSize=1,this.activeRange.tickStepUnit="hour",this.activeRange.dataClusterSize=0,this.statistics={},this.statistics.enabled=!1,this.statistics.retention=void 0,this.statistics.mode="",this.statistics.period="hour",this.id="",this.graphs=[],this.g_id=0,this.firstDynamicId=0,this.startTime,this.endTime,this.limitSlot=0,this.cacheSize=366,this.cache=[],this._hass=null,this._this=null,this.version=[],this.contentValid=!1,this.entitiesPopulated=!1,this.iid=0,this.tid=0,this.lastWidth=0,this.defocusCall=this.entitySelectorDefocus.bind(this),this.databaseCallback=null}getNextDefaultColor(){let t=this.pconfig.nextDefaultColor++;return this.pconfig.nextDefaultColor=this.pconfig.nextDefaultColor%l.length,l[t]}getStateColor(t,e,i,n){let a;if(null!=n&&""!==n||(n="unknown"),i){const t=i+"."+n;a=this.pconfig.customStateColors?.[t],a||(a=this.pconfig.customStateColors?.[i])}if(!a&&e){const t=e+"."+n;a=this.pconfig.customStateColors?.[t],a||(a=this.pconfig.customStateColors?.[e])}if(!a&&t){const e=t+"."+n;a=this.pconfig.customStateColors?.[e],a||(a=this.pconfig.customStateColors?.[t])}if(a||(a=this.pconfig.customStateColors?.[n]),!a&&e){const t=e+"."+n;a=this.ui.darkMode&&this.stateColorsDark[t]?this.stateColorsDark[t]:this.stateColors[t]}if(!a&&t){const e=t+"."+n;a=this.ui.darkMode&&this.stateColorsDark[e]?this.stateColorsDark[e]:this.stateColors[e]}if(a||(a=this.ui.darkMode&&this.stateColorsDark[n]?this.stateColorsDark[n]:this.stateColors[n]),!a)if(this.colorMap.has(n))a=this.colorMap.get(n);else{const t=md5hx(n);a="hsl("+(2147483647&t[0])*this.pconfig.colorSeed%359+","+(Math.ceil(45+(2147483647&t[1])%255/255*30)-(this.ui.darkMode?13:0))+"%,"+(Math.ceil(55+(2147483647&t[1])%255/255*10)-(this.ui.darkMode?5:0))+"%)",this.colorMap.set(n,a)}return a}getLocalizedState(t,e,i,n){const a=n+t;let o=this.stateTexts.get(a);return o||(o=i&&this._hass.localize(`component.${e}.entity_component.${i}.state.${t}`)||this._hass.localize(`component.${e}.entity_component._.state.${t}`)||i&&this._hass.localize(`component.${e}.state.${i}.${t}`)||this._hass.localize(`component.${e}.state._.${t}`)||t,this.stateTexts.set(a,o)),o}today(t=!1){if(!this.state.loading){t&&this.setTimeRangeFromString(String(this.pconfig.defaultTimeRange));let e=C();if(this.pconfig.defaultTimeOffset){const t=this.pconfig.defaultTimeOffset.slice(0,-1);switch(this.pconfig.defaultTimeOffset.slice(-1)[0]){case"m":e=e.add(t,"minute");break;case"h":e=e.add(t,"hour");break;case"d":e=e.add(t,"day");break;case"w":e=e.add(t,"week");break;case"o":e=e.add(t,"month");break;case"y":e=e.add(t,"year");break;case"H":e=C(e.format("YYYY-MM-DDTHH:00:00")).add(t,"hour");break;case"D":e=C(e.format("YYYY-MM-DDT00:00:00")).add(t,"day");break;case"O":e=C(e.format("YYYY-MM-01T00:00:00")).add(t,"month");break;case"Y":e=C(e.format("YYYY-01-01T00:00:00")).add(t,"year")}}this.endTime=e.format("YYYY-MM-DDTHH:mm:ss"),this.startTime=C(this.endTime).subtract(this.activeRange.timeRangeHours,"hour").subtract(this.activeRange.timeRangeMinutes,"minute").format("YYYY-MM-DDTHH:mm:ss"),this.updateHistory()}this.state.autoScroll=!0}todayNoReset(){this.today(!1)}todayReset(){this.today(!0)}subDay(){if(!this.state.loading){this.activeRange.timeRangeHours<24&&this.setTimeRange(24,!1);let t=C(this.startTime).subtract(1,this.activeRange.timeRangeHours<720?"day":"month"),e=C(t).add(this.activeRange.timeRangeHours,"hour");this.startTime=t.format("YYYY-MM-DD")+"T00:00:00",this.endTime=e.format("YYYY-MM-DD")+"T00:00:00",this.updateHistory()}}addDay(){if(!this.state.loading){this.activeRange.timeRangeHours<24&&this.setTimeRange(24,!1);let t=C(this.startTime).add(1,this.activeRange.timeRangeHours<720?"day":"month"),e=C(t).add(this.activeRange.timeRangeHours,"hour");this.startTime=t.format("YYYY-MM-DD")+"T00:00:00",this.endTime=e.format("YYYY-MM-DD")+"T00:00:00",this.updateHistory()}}toggleZoom(){this.state.zoomMode=!this.state.zoomMode;for(let t of this.ui.zoomButton)t&&(t.style.backgroundColor=this.state.zoomMode?this.ui.darkMode?"#ffffff3a":"#0000003a":"#0000");A.overlay&&(A.overlay.remove(),A.overlay=null)}decZoom(){this.decZoomStep()}incZoom(){this.incZoomStep()}timeRangeSelected(t){this.setTimeRange(t.target.value,!0)}exportFile(){this.menuSetVisibility(0,!1),this.menuSetVisibility(1,!1),this.csvExporter.exportFile(this)}exportStatistics(){this.menuSetVisibility(0,!1),this.menuSetVisibility(1,!1),this.statsExporter.exportFile(this)}toggleInfoPanel(){this.menuSetVisibility(0,!1),this.menuSetVisibility(1,!1),confirm(k(R?"ui.popup.disable_panel":"ui.popup.enable_panel"))&&(R=!R,this.writeInfoPanelConfig(!0),location.reload())}decZoomStep(t=null,e=.5){if(this.activeRange.timeRangeHours||(this.activeRange.timeRangeMinutes*=2,this.activeRange.timeRangeMinutes>=60&&(this.activeRange.timeRangeMinutes=0,this.activeRange.timeRangeHours=0)),this.activeRange.timeRangeMinutes)this.setTimeRangeMinutes(this.activeRange.timeRangeMinutes,!0,t,e);else{let i=T.findIndex((t=>t>=this.activeRange.timeRangeHours));i>=0&&(T[i]>this.activeRange.timeRangeHours&&i--,i<T.length-1&&this.setTimeRange(T[i+1],!0,t,e))}}incZoomStep(t=null,e=.5){const i=T.findIndex((t=>t>=this.activeRange.timeRangeHours));i>0?this.setTimeRange(T[i-1],!0,t,e):this.setTimeRangeMinutes((60*this.activeRange.timeRangeHours+this.activeRange.timeRangeMinutes)/2,!0,t,e)}selectBarInterval(t){const e=t.target.id.substr(t.target.id.indexOf("-")+1);for(let i=0;i<this.graphs.length;i++)if(this.graphs[i].id==e){this.graphs[i].interval=t.target.value;const e=4==t.target.value?"line":"bar";if(e!==this.graphs[i].type){if("line"==e)for(let t of this.graphs[i].chart.data.datasets)t.backgroundColor="rgba(0,0,0,0)",t.borderColor&&Array.isArray(t.borderColor)&&(t.borderColor=t.borderColor[0]);else for(let t of this.graphs[i].chart.data.datasets)t.backgroundColor=t.borderColor;this.graphs[i].chart.type=this.graphs[i].chart.config.type=this.graphs[i].type=e,this.graphs[i].chart.update(),this.graphs[i].yaxisLock&&this.scaleLockClicked({currentTarget:{id:`-${i}`}})}break}this.updateHistory()}createIntervalSelectorHtml(t,e,i,n){return void 0===i&&(i=1),`<select id='bd-${t}' style="position:absolute;right:50px;width:${this.ui.wideInterval?100:80}px;margin-top:${5-e}px;color:var(--primary-text-color);background-color:${this.pconfig.closeButtonColor};border:0px solid black;">\n <option value="0" ${n} ${0==i?"selected":""}>${k("ui.interval._10m")}</option>\n <option value="1" ${n} ${1==i?"selected":""}>${k("ui.interval.hourly")}</option>\n <option value="2" ${n} ${2==i?"selected":""}>${k("ui.interval.daily")}</option>\n <option value="3" ${n} ${3==i?"selected":""}>${k("ui.interval.monthly")}</option>\n <option value="4" ${n} ${4==i?"selected":""}>${k("ui.interval.rawline")}</option>\n </select>`}parseIntervalConfig(t){return{"10m":0,hourly:1,daily:2,monthly:3}[t]}scaleLockClicked(t){const e=t.currentTarget.id.substr(t.currentTarget.id.indexOf("-")+1);for(let t=0;t<this.graphs.length;t++)if(this.graphs[t].id==e){let e=this.graphs[t].chart;this.graphs[t].yaxisLock?(e.options.scales.yAxes[0].ticks.min=e.options.scales.yAxes[0].ticks.forceMin,e.options.scales.yAxes[0].ticks.removeEdgeTicks=!1,e.options.scales.yAxes[0].ticks.max=e.options.scales.yAxes[0].ticks.forceMax,e.options.scales.yAxes[0].ticks.removeEdgeTicks=!1,this.graphs[t].yaxisLock=0):this.graphs[t].yaxisLock=1,this.updateScaleLockState(this.graphs[t],!1);break}this.updateHistory()}createScaleLockIconHtml(t,e){return`<button id='ca-${t}' style="position:absolute;left:${0*(this.pconfig.labelAreaWidth-18)+10}px;margin-top:${5-e}px;background:none;opacity:1.0;border:0px solid black;">\n <svg style='display:none' width="18" height="18" viewBox="0 0 24 24"><path fill="var(--primary-text-color)" d="M12,17C10.89,17 10,16.1 10,15C10,13.89 10.89,13 12,13A2,2 0 0,1 14,15A2,2 0 0,1 12,17M18,20V10H6V20H18M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10C4,8.89 4.89,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z" /></svg>\n </button>`}updateScaleLockState(t,e){const i=t.chart.options.scales.yAxes[0].ticks.forceMin&&t.chart.options.scales.yAxes[0].ticks.forceMax;let n=this._this.querySelector(`#ca-${t.id}`);n&&(n.children[0].style.display=i&&!e?"none":"inherit",n.style.opacity=e||t.yaxisLock?1:.3)}computeTickDensity(t){const e={low:4,medium:3,high:2,higher:1,highest:0};let i=e[this.pconfig.timeTickDensity];return void 0===i&&(i=2),void 0===this.pconfig.timeTickOverride?Math.max(t<650?4:t<1100?3:t<1300?2:t<1900?1:0,i):e[this.pconfig.timeTickOverride]??2}setStepSize(t=!1){const e=this._this.querySelector("#maincard").clientWidth,i=this.computeTickDensity(e);if(this.activeRange.timeRangeHours){const t=this.activeRange.timeRangeHours,e=[];switch(e.push({1:"2m",2:"5m",3:"5m",4:"5m",5:"5m",6:"10m",7:"10m",8:"10m",9:"10m",10:"15m",11:"15m",12:"15m",24:"30m",48:"1h",72:"2h",96:"2h",120:"3h",144:"3h",168:"6h",336:"12h",504:"12h",720:"1d",2184:"1o",4368:"1o",8760:"1o"}),e.push({1:"2m",2:"5m",3:"10m",4:"10m",5:"10m",6:"15m",7:"15m",8:"20m",9:"20m",10:"30m",11:"30m",12:"30m",24:"1h",48:"2h",72:"3h",96:"3h",120:"6h",144:"6h",168:"12h",336:"1d",504:"1d",720:"1d",2184:"1o",4368:"1o",8760:"1o"}),e.push({1:"5m",2:"10m",3:"15m",4:"30m",5:"30m",6:"30m",7:"30m",8:"30m",9:"30m",10:"1h",11:"1h",12:"1h",24:"2h",48:"4h",72:"6h",96:"6h",120:"12h",144:"12h",168:"12h",336:"1d",504:"2d",720:"2d",2184:"1o",4368:"1o",8760:"1o"}),e.push({1:"10m",2:"20m",3:"30m",4:"1h",5:"1h",6:"1h",7:"1h",8:"1h",9:"1h",10:"2h",11:"2h",12:"2h",24:"4h",48:"8h",72:"12h",96:"1d",120:"1d",144:"1d",168:"2d",336:"3d",504:"4d",720:"7d",2184:"1o",4368:"1o",8760:"1o"}),e.push({1:"20m",2:"30m",3:"1h",4:"2h",5:"2h",6:"2h",7:"2h",8:"2h",9:"2h",10:"4h",11:"4h",12:"4h",24:"6h",48:"12h",72:"1d",96:"2d",120:"2d",144:"2d",168:"4d",336:"7d",504:"7d",720:"14d",2184:"1o",4368:"1o",8760:"1o"}),this.activeRange.tickStepSize=e[i][t].slice(0,-1),e[i][t].slice(-1)[0]){case"m":this.activeRange.tickStepUnit="minute";break;case"h":this.activeRange.tickStepUnit="hour";break;case"d":this.activeRange.tickStepUnit="day";break;case"o":this.activeRange.tickStepUnit="month"}}else if(this.activeRange.timeRangeMinutes){switch(i){case 0:case 1:this.activeRange.tickStepSize=1;break;case 2:this.activeRange.tickStepSize=this.activeRange.timeRangeMinutes<=20?1:5;break;case 3:this.activeRange.tickStepSize=this.activeRange.timeRangeMinutes<=10?1:this.activeRange.timeRangeMinutes<30?5:10;break;case 4:this.activeRange.tickStepSize=this.activeRange.timeRangeMinutes<=5?1:this.activeRange.timeRangeMinutes<25?5:10}this.activeRange.tickStepUnit="minute"}else this.activeRange.tickStepSize=24,this.activeRange.tickStepUnit="hour";if(t)for(let t of this.graphs)t.chart.options.scales.xAxes[0].time.unit=this.activeRange.tickStepUnit,t.chart.options.scales.xAxes[0].time.stepSize=this.activeRange.tickStepSize,t.chart.update()}validateRange(t,e=!1){if(e&&t<12&&t>0)return t;let i=T.findIndex((e=>e>=t));return i<T.length-1&&(i<0||T[i]!=t)&&i++,T[i]}setTimeRange(t,e,i=null,n=.5){if(this.state.loading)return;this.timeCache.clear(),n=Math.min(Math.max(n,0),1),t=Math.max(t,1);this.activeRange.dataClusterSize=t>=48?6e4*{48:2,72:5,96:10,120:30,144:30,168:60,336:60,504:120,720:240,2184:240,4368:240,8760:360}[t]:0,this.activeRange.timeRangeHours=t,this.activeRange.timeRangeMinutes=0,this.setStepSize(!e);for(let e of this.ui.rangeSelector)e&&(e.value=t);if(e){if(i){let t=C(i).add(this.activeRange.timeRangeHours*(1-n),"hour"),e=C(t).subtract(this.activeRange.timeRangeHours,"hour");this.startTime=e.format("YYYY-MM-DDTHH:mm:ss"),this.endTime=t.format("YYYY-MM-DDTHH:mm:ss")}else if(this.activeRange.timeRangeHours>24){let t=C(this.endTime),e=C(t).subtract(this.activeRange.timeRangeHours,"hour");this.startTime=e.format("YYYY-MM-DDTHH:mm:ss"),this.endTime=t.format("YYYY-MM-DDTHH:mm:ss")}else{let t=(C(this.endTime)+C(this.startTime))/2,e=C(t).add(this.activeRange.timeRangeHours/2,"hour"),i=C(e).subtract(this.activeRange.timeRangeHours,"hour");this.startTime=i.format("YYYY-MM-DDTHH:mm:ss"),this.endTime=e.format("YYYY-MM-DDTHH:mm:ss")}for(let t of this.graphs)t.chart.options.scales.xAxes[0].time.unit=this.activeRange.tickStepUnit,t.chart.options.scales.xAxes[0].time.stepSize=this.activeRange.tickStepSize,t.chart.options.scales.xAxes[0].time.min=this.startTime,t.chart.options.scales.xAxes[0].time.max=this.endTime,t.chart.update();this.updateHistory()}}setTimeRangeMinutes(t,e,i,n=.5){if(!this.state.loading){n=Math.min(Math.max(n,0),1),t=Math.max(t,1),this.activeRange.dataClusterSize=0,this.activeRange.timeRangeHours=0,this.activeRange.timeRangeMinutes=t,this.setStepSize(!e);for(let t of this.ui.rangeSelector)t&&(t.value="0");if(e){i||(i=(C(this.startTime)+C(this.endTime))/2);let t=C(i).add(this.activeRange.timeRangeMinutes*(1-n),"minute"),e=C(t).subtract(this.activeRange.timeRangeMinutes,"minute");this.startTime=e.format("YYYY-MM-DDTHH:mm:ss"),this.endTime=t.format("YYYY-MM-DDTHH:mm:ss");for(let t of this.graphs)t.chart.options.scales.xAxes[0].time.unit=this.activeRange.tickStepUnit,t.chart.options.scales.xAxes[0].time.stepSize=this.activeRange.tickStepSize,t.chart.options.scales.xAxes[0].time.min=this.startTime,t.chart.options.scales.xAxes[0].time.max=this.endTime,t.chart.update();this.updateHistory()}}}setTimeRangeFromString(t,e=!1,i=null){const n=t.slice(0,-1);let a=0;switch(t.slice(-1)[0]){case"m":a=1*n;break;case"h":a=60*n;break;case"d":a=n<=7?24*n*60:n<=14?20160:n<=21?30240:43200;break;case"w":a=n<=3?7*n*24*60:43200;break;case"o":a=n<=1?43200:n<=3?131040:n<=6?262080:525600;break;case"y":a=525600;break;default:a=60*t}const o=Math.floor(a/60);o>0?this.setTimeRange(this.validateRange(o,!0),e,i):this.setTimeRangeMinutes(a,e,i)}findFirstIndex(t,e,i){let n=e.start-1;for(;n++<e.end;)if(i(t[n]))return n;return-1}findLastIndex(t,e,i){let n=e.end+1;for(;n-- >e.start;)if(i(t[n]))return n;return-1}getFormattedLabelName(t,e,i){let n=t;const a=10**this.pconfig.roundingPrecision,o=Math.round(this._hass.states[e].state*a)/a;return isNaN(o)||(n+=" ("+o+(i?" "+i:"")+")"),n}initCache(){let t=C().format("YYYY-MM-DD")+"T00:00:00";t=C(t).subtract(this.cacheSize,"day").format("YYYY-MM-DD")+"T00:00:00";for(let e=0;e<this.cacheSize+1;e++){let e=C(t).add(1,"day").format("YYYY-MM-DD")+"T00:00:00";this.cache.push({start:t,end:e,start_m:C(t),end_m:C(e),data:[],valid:!1}),t=e}}growCache(t){if(this.cacheSize>=7300)return;let e=this.cache[0].start;for(let i=0;i<t;i++){let t=C(e).subtract(1,"day").format("YYYY-MM-DD")+"T00:00:00";this.cache.unshift({start:t,end:e,start_m:C(t),end_m:C(e),data:[],valid:!1}),e=t}this.cacheSize+=t,console.log(`Cache grown from ${this.cacheSize-t} to ${this.cacheSize} days`)}mapStartTimeToCacheSlot(t){let e=C(t);for(let t=0;t<this.cacheSize+1;t++)if(e>=this.cache[t].start_m&&e<this.cache[t].end_m)return t;return e<this.cache[0].start_m?0:-1}mapEndTimeToCacheSlot(t){let e=C(t);for(let t=0;t<this.cacheSize+1;t++)if(e>this.cache[t].start_m&&e<=this.cache[t].end_m)return t;return e>this.cache[this.cacheSize].end_m?this.cacheSize:-1}findCacheEntityIndex(t,e){if(!this.cache[t].valid)return-1;for(let i=0;i<this.cache[t].entities.length;i++)if(this.cache[t].entities[i]==e)return i;return-1}generateGraphDataFromCache(){let t=this.mapStartTimeToCacheSlot(this.startTime),e=this.mapEndTimeToCacheSlot(this.endTime);if(t>=0&&e>=0){let i=[];for(let n=t;n<=e;n++){let t=0;for(let e of this.graphs)for(let a of e.entities){null==i[t]&&(i[t]=[]);const e=this.findCacheEntityIndex(n,a.entity);e>=0&&(i[t]=i[t].concat(this.cache[n].data[e])),t++}}if(t>0&&this.cache[t-1].valid){let e=0;for(let n of this.graphs)for(let a of n.entities){for(let n=t-1;n>=0&&this.cache[n].valid;n--){const o=this.findCacheEntityIndex(n,a.entity);if(o>=0){let a=this.cache[n].data[o].length;if(a>0){i[e].unshift({last_changed:this.cache[t].start,state:this.cache[n].data[o][a-1].state});break}}}e++}}this.buildChartData(i)}else this.buildChartData(null)}searchFirstAffectedSlot(t,e,i){for(let n=t;n<=e;n++)if(this.cache[n].end_m>=i)return n}loaderCallback(t){this.databaseCallback&&this.databaseCallback(t.length>0);let e=!1,i=0;if(this.statistics.enabled&&!this.loader.loadingStats){i=this.cacheSize;for(let e of t){let t=this.searchFirstAffectedSlot(this.loader.startIndex,this.loader.endIndex,C(e[0].last_changed));t&&t<i&&(i=t)}if(t.length||(i=this.loader.endIndex+1),i>this.loader.startIndex&&this.statistics.retention){const t=this.cacheSize-this.statistics.retention;i>t&&(console.warn(`first partial slot ${i}, first history slot is ${t}`),i=t)}i>this.loader.startIndex&&i<this.cacheSize&&(i++,this.cache[i-1].valid=!1,this.limitSlot=i-1,e=!0)}if(this.loader.loadingStats=!1,this.loader.startIndex==this.loader.endIndex)this.loader.startIndex>=i&&(this.cache[this.loader.startIndex].data=t,this.cache[this.loader.startIndex].valid=!0);else{for(let t=this.loader.startIndex;t<=this.loader.endIndex;t++)this.cache[t].data=[],this.cache[t].valid=t>=i;for(let e of t){let t=0;for(let i=this.loader.startIndex;i<=this.loader.endIndex;i++){let n=C(this.cache[i].end),a=this.findFirstIndex(e,{start:t,end:e.length-1},(function(t){return C(t.last_changed)>=n}));a<0&&(a=e.length);let o=e.slice(t,a);this.cache[i].data.push(o),t=a}}}for(let e=this.loader.startIndex;e<=this.loader.endIndex;e++){this.cache[e].entities=[];for(let i of t)this.cache[e].entities.push(i[0].entity_id)}this.generateGraphDataFromCache(),this.state.loading=!1,e&&this.updateHistory()}loaderFailed(t){console.log("Database request failure"),console.log(t),this.databaseCallback&&this.databaseCallback(!1),this.buildChartData(null),this.state.loading=!1}loaderCallbackStats(t){const e=this.statistics.mode;let i=[];for(let n in t){const a=t[n];let o=[];o.push({last_changed:a[0].start,state:a[0][e]??a[0].state,entity_id:n});for(let t=1;t<a.length;t++)o.push({last_changed:a[t].start,state:a[t][e]??a[t].state});i.push(o)}this.loader.loadingStats=!0,this.loaderCallback(i)}loaderCallbackWS(t){let e=[];for(let i in t){const n=t[i];let a=[];a.push({last_changed:1e3*n[0].lu,state:n[0].s,entity_id:i});for(let t=1;t<n.length;t++)a.push({last_changed:1e3*n[t].lu,state:n[t].s});e.push(a)}this.loaderCallback(e)}process(t,e){if(""!==t&&null!=t||(t="unavailable"),e){let i=1*t;return isNaN(i)&&(i=t),e(i)}return t}processRaw(t,e){return null==t&&(t="unavailable"),e?e(t):t}buildProcessFunction(t){if(!t)return null;try{const e=new Function("state",`"use strict";return (${t});`);return e("undefined"),e}catch(t){return console.warn(t.message),null}}momentCache(t){let e;return void 0!==t&&(this.timeCache.has(t)?e=this.timeCache.get(t):(e=C(t),this.timeCache.set(t,e))),e}buildChartData(t){let e=C(),i=C(this.startTime),n=C(this.endTime);const a=t=>this.pconfig.showUnavailable||!["unavailable","unknown"].includes(t);let o=0;for(let d of this.graphs){let h=!1;for(let c=0;c<d.entities.length;c++,o++)if(!this.state.updateCanvas||this.state.updateCanvas===d.canvas){var r=[],s=[];if(t&&t.length>o){var l=t[o].length;const h=this.buildProcessFunction(d.entities[c].process);if("line"==d.type){const i=d.entities[c].scale??1,s=d.entities[c].decimation??this.pconfig.decimation??"fast";if(l>2&&s&&this.activeRange.dataClusterSize>0){let e=this.momentCache(t[o][0].last_changed),n=null,d=null,c=null,u=null;for(let f=0;f<l;f++){let l=this.process(t[o][f].state,h);if(a(l)){l*=i;let a=this.momentCache(t[o][f].last_changed);"accurate"==s&&((null===n||l>n)&&(n=l,d=a),(null===c||l<c)&&(c=l,u=a)),(!f||a.diff(e)>=this.activeRange.dataClusterSize)&&("accurate"==s?u<d?(r.push({x:u,y:c}),r.push({x:d,y:n})):(r.push({x:d,y:n}),r.push({x:u,y:c})):r.push({x:a,y:l}),e=a,n=c=null)}}}else for(let e=0;e<l;e++){const n=this.process(t[o][e].state,h);a(n)&&r.push({x:t[o][e].last_changed,y:n*i})}if(e>n&&r.length>0&&C(r[r.length-1].x)<n){const e=this.process(t[o][l-1].state,h);a(e)&&r.push({x:n,y:e*i})}else if(e<=n&&r.length>0&&C(r[r.length-1].x)<e){const n=this.process(t[o][l-1].state,h);a(n)&&r.push({x:e,y:n*i})}}else if("bar"==d.type&&l>0){const e=d.entities[c].scale??1,a=d.entities[c].netBars??!1,u=d.entities[c].color&&d.entities[c].color.constructor==Object?d.entities[c].color:null;let f;0==d.interval?f=C.duration(10,"minute"):1==d.interval?f=C.duration(1,"hour"):2==d.interval?f=C.duration(1,"day"):3==d.interval&&(f=C.duration(1,"month"));let p=0,g=1*this.process(t[o][0].state,h),m=g;const v=d.interval<=1?"YYYY-MM-DDTHH[:00:00]":d.interval<=2?"YYYY-MM-DDT[00:00:00]":"YYYY-MM-[01]T[00:00:00]";let y=C(C(i).format(v));for(;p<l&&C(t[o][p].last_changed)<=y;)g=1*this.process(t[o][p++].state,h);for(;y<=n+f;){let i=C(y).add(f);m=g;let n=0;for(;p<l&&this.momentCache(t[o][p].last_changed)<i;){const e=1*this.process(t[o][p].state,h);isNaN(e)||(!a&&e<m&&(n+=m-g,g=e),m=e),p++}n+=m-g,r.push({x:y+f/2,y:n*e}),u&&s.push(b(u,n)),y=i,g=m}}else if("timeline"==d.type||"arrowline"==d.type){let a=0!=(d.entities[c].decimation??this.pconfig.decimation??"fast");("arrowline"==d.type||h)&&(a=!1);let s,u,f,p=0;const g=e<n?e:n;for(let e=0;e<l;e++){let d=t[o][e].last_changed,c=e<l-1?t[o][e+1].last_changed:g;if(!p)for(f=this.processRaw(t[o][e].state,h);e<l-1&&this.processRaw(t[o][e].state,h)==this.processRaw(t[o][e+1].state,h);)++e,c=e<l-1?t[o][e+1].last_changed:g;let m=this.momentCache(d),v=c===g?C(c):this.momentCache(c);if(!a||v.diff(m)>=this.activeRange.dataClusterSize||e==l-1){if(p>0&&(d=s,c=u,m=C(d),v=C(c),e--),v>=i){if(v>n&&(c=this.endTime),m>n)break;m<i&&(d=this.startTime);let t=[];t.push(d),t.push(c),t.push(p>1?"multiple":String(f)),r.push(t)}p=0}else p||(s=d,f=this.processRaw(t[o][e].state,h)),u=c,p++}}}d.chart.data.datasets[c].data=r,s.length>0&&(d.chart.data.datasets[c].backgroundColor=s,d.chart.data.datasets[c].borderColor=s),h=!0}h&&(d.chart.options.scales.xAxes[0].time.unit=this.activeRange.tickStepUnit,d.chart.options.scales.xAxes[0].time.stepSize=this.activeRange.tickStepSize,d.chart.options.scales.xAxes[0].time.min=this.startTime,d.chart.options.scales.xAxes[0].time.max=this.endTime,d.chart.update())}}generateTooltipContents(t,e,i,n=1){if(this.pconfig.tooltipShowDuration){let i="",n=C(e[1]).diff(C(e[0]));if(n>=864e5){const t=Math.floor(n/864e5);n-=24*t*60*60*1e3,i=t>1?`${k("ui.ranges.n_days",t)}, `:`${k("ui.ranges.day")}, `}i+=C.utc(n).format("HH:mm:ss"),t=`${t} (for ${i})`}return"compact"==i||"slim"==i||"auto"==i&&n<2?[t,C(e[0]).format(this.i18n.styleDateTimeTooltip)+" -- "+C(e[1]).format(this.i18n.styleDateTimeTooltip)]:[t,C(e[0]).format(this.i18n.styleDateTimeTooltip),C(e[1]).format(this.i18n.styleDateTimeTooltip)]}newGraph(e,i,n,a){const o=e.getContext("2d");var r;let s;if("line"==i||"bar"==i){r={datasets:[]};for(let t of n)r.datasets.push({borderColor:t.bColor,backgroundColor:t.fillColor,borderWidth:t.width,borderDash:"points"===t.dashMode?[1,5]:"shortlines"===t.dashMode?[5,5]:"longlines"===t.dashMode?[10,8]:"pointline"===t.dashMode?[15,3,3,3]:void 0,pointRadius:a?.showSamples?4:0,hitRadius:5,label:this.pconfig.showCurrentValues?this.getFormattedLabelName(t.name,t.entity_id,t.unit):t.name,name:t.name,steppedLine:"stepped"===t.mode,cubicInterpolationMode:"stepped"!==t.mode&&"lines"!==t.mode?"monotone":"default",lineTension:"lines"===t.mode?0:void 0,domain:t.domain,entity_id:t.entity_id,unit:t.unit,hidden:t.hidden,data:{}}),s=s??t.unit}else if("timeline"==i||"arrowline"==i){r={labels:[],datasets:[]};for(let t of n)r.labels.push(this.pconfig.labelsVisible?t.name:""),r.datasets.push({domain:t.domain,device_class:t.device_class,entity_id:t.entity_id,unit:t.unit,arrowColor:t.bColor,arrowBackground:t.fillColor,data:[]})}const l=this.pconfig.tooltipSize;var d=new M(o,{type:i,data:r,options:{scales:{xAxes:[{type:"line"==i||"bar"==i?"time":"arrowline"==i?"arrowline":"timeline",time:{unit:this.activeRange.tickStepUnit,stepSize:this.activeRange.tickStepSize,displayFormats:{minute:this.i18n.styleTimeTicks,hour:this.i18n.styleTimeTicks,day:this.i18n.styleDateTicks,month:"MMM"},tooltipFormat:this.i18n.styleDateTimeTooltip},ticks:{fontColor:!1===a?.showTimeLabels?"rgba(0,0,0,0)":this.pconfig.graphLabelColor,major:{enabled:!0,unit:"day",fontStyle:"bold",unitStepSize:1,displayFormats:{day:this.i18n.styleDateTicks}},maxRotation:0},gridLines:{color:this.pconfig.graphGridColor},stacked:a?.stacked}],yAxes:[{afterFit:t=>{t.width=this.pconfig.labelAreaWidth},afterDataLimits:t=>{const e=1e-4;null==a?.ymin&&this.pconfig.axisAddMarginMin&&"line"==i&&(t.min-=e),null==a?.ymax&&this.pconfig.axisAddMarginMax&&"line"==i&&(t.max+=e)},ticks:{fontColor:this.pconfig.graphLabelColor,min:a?.ymin??void 0,max:a?.ymax??void 0,forceMin:a?.ymin??void 0,forceMax:a?.ymax??void 0,stepSize:a?.ystepSize??void 0},gridLines:{color:"line"==i||"bar"==i||n.length>1?this.pconfig.graphGridColor:"rgba(0,0,0,0)"},scaleLabel:{display:void 0!==s&&""!==s&&this.pconfig.labelsVisible,labelString:s,fontColor:this.pconfig.graphLabelColor},barThickness:this.pconfig.timelineBarHeight-4,stacked:a?.stacked}]},topClipMargin:null==a?.ymax?4:1,bottomClipMargin:null==a?.ymin?4:1,animation:{duration:0},tooltips:{callbacks:{label:(t,e)=>{if("line"==i||"bar"==i){let i="";this.pconfig.tooltipShowLabel&&(i=e.datasets[t.datasetIndex].name||""),i&&(i+=": ");const n=10**this.pconfig.roundingPrecision;return i+=Math.round(t.yLabel*n)/n,i+=" "+(e.datasets[t.datasetIndex].unit||""),i}if("timeline"==i){const i=e.datasets[t.datasetIndex],a=i.data[t.index];let o=a[2];return"auto"==this.pconfig.tooltipStateTextMode&&(o=this.getLocalizedState(o,i.domain,i.device_class,i.entity_id)),this.generateTooltipContents(o,a,l,n.length)}if("arrowline"==i){const i=e.datasets[t.datasetIndex].data[t.index],n=10**this.pconfig.roundingPrecision;let a=Math.round(i[2]*n)/n;return a+=" "+(e.datasets[t.datasetIndex].unit||""),this.generateTooltipContents(a,i,"slim")}},title:function(t,e){let n="";if(t.length>0)if("line"==i||"bar"==i)n=t[0].xLabel;else{let i=e.labels[t[0].datasetIndex];n="slim"!==l?i:""}return n}},yAlign:"line"==i||"bar"==i?void 0:"nocenter",caretPadding:8,displayColors:"line"==i?this.pconfig.showTooltipColors[0]:"timeline"==i&&this.pconfig.showTooltipColors[1]},hover:{mode:"nearest",intersect:"line"!=i},legend:{display:("line"==i||"bar"==i)&&1!=this.pconfig.hideLegend,labels:{fontColor:this.pconfig.graphLabelColor,usePointStyle:"line"==i||"bar"==i&&n.length>1,boxWidth:0}},elements:{textFunction:(t,e,i)=>{switch(this.pconfig.stateTextMode){case"auto":return this.getLocalizedState(t,e[i].domain,e[i].device_class,e[i].entity_id);case"hide":return"";default:return t}},colorFunction:(t,e,i,n)=>this.getStateColor(i[n].domain,i[n].device_class,i[n].entity_id,e[2]),showText:!0,font:'normal 13px "Helvetica Neue", Helvetica, Arial, sans-serif',textPadding:4,arrowColor:getComputedStyle(document.body).getPropertyValue("--primary-text-color")},responsive:!0,maintainAspectRatio:!1,plugins:{vertline:{color:this.pconfig.cursorLineColor}}},plugins:[t]});return d.callerInstance=this,d}updateHistory(){this.tid&&(clearTimeout(this.tid),this.tid=0);for(let t of this.ui.dateSelector)t&&(t.innerHTML=C(this.startTime).format(this.i18n.styleDateSelector));this.cache.length||this.initCache(),C(this.startTime)<this.cache[0].start_m&&this.growCache(365);let t=this.mapStartTimeToCacheSlot(this.startTime),e=this.mapEndTimeToCacheSlot(this.endTime),i=t>=0?this.findFirstIndex(this.cache,{start:t,end:e},(function(t){return!t.valid})):-1,n=e>=0?this.findLastIndex(this.cache,{start:t,end:e},(function(t){return!t.valid})):-1;if(i>=0){if(this.state.loading){if(i>=this.loader.startIndex&&n<=this.loader.endIndex)return;return console.log(`Slots ${i} to ${n} need loading`),void console.log(`Double loading blocked, slots ${this.loader.startIndex} to ${this.loader.endIndex} are currently loading`)}this.loader.startTime=this.cache[i].start,this.loader.endTime=this.cache[n].end,this.loader.startIndex=i,this.loader.endIndex=n;let t=0,e=this.loader.startTime.replace("+","%2b"),a=this.loader.endTime.replace("+","%2b"),o=[];for(let e of this.graphs)for(let i of e.entities)o.push(i.entity),t++;if(t>0)if(this.state.loading=!0,this.statistics.force&&(this.limitSlot=this.cacheSize+1),!this.statistics.enabled||i>this.limitSlot){const t={type:"history/history_during_period",start_time:C(e).format("YYYY-MM-DDTHH:mm:ssZ"),end_time:C(a).format("YYYY-MM-DDTHH:mm:ssZ"),minimal_response:!0,no_attributes:!0,entity_ids:o};this._hass.callWS(t).then(this.loaderCallbackWS.bind(this),this.loaderFailed.bind(this))}else{const t={type:this.version[0]>2022||this.version[1]>=11?"recorder/statistics_during_period":"history/statistics_during_period",start_time:C(e).format("YYYY-MM-DDTHH:mm:ssZ"),end_time:C(a).format("YYYY-MM-DDTHH:mm:ssZ"),period:this.statistics.period,statistic_ids:o};this._hass.callWS(t).then(this.loaderCallbackStats.bind(this),this.loaderFailed.bind(this))}}else this.generateGraphDataFromCache()}updateHistoryAutoRefresh(){const t=C(),e=C(this.endTime);this.state.autoScroll&&e<t?this.today():this.updateHistory()}updateHistoryWithClearCache(){this.state.loading||(this.cache.length=0,this.updateHistory())}updateAxes(){for(let t of this.graphs)this.state.updateCanvas&&this.state.updateCanvas!==t.canvas||(t.chart.options.scales.xAxes[0].time.min=this.startTime,t.chart.options.scales.xAxes[0].time.max=this.endTime,t.chart.update())}pixelPositionToTimecode(t){const e=(t-A.g.chart.chartArea.left)/(A.g.chart.chartArea.right-A.g.chart.chartArea.left);return this.factorToTimecode(e)}factorToTimecode(t){return C(this.startTime)+C(this.endTime).diff(this.startTime)*t}pointerDown(t){A.g=null;for(let e of this.graphs)if(e.canvas===t.target){A.g=e,e.chart.options.tooltips.enabled=!1,e.chart.options.scales.yAxes[0].ticks.min=A.y0=e.chart.scales["y-axis-0"].min,e.chart.options.scales.yAxes[0].ticks.max=A.y1=e.chart.scales["y-axis-0"].max,e.chart.options.topClipMargin=0,e.chart.options.bottomClipMargin=0;break}if(A.g)if(this.state.autoScroll=!1,A.mx=t.clientX,A.lx=t.clientX,A.my=t.clientY,A.ly=t.clientY,t.target?.setPointerCapture(t.pointerId),this.state.zoomMode){const t=A.mx-A.g.canvas.getBoundingClientRect().left;if(t>A.g.chart.chartArea.left&&t<A.g.chart.chartArea.right){if(!A.overlay){let t=document.createElement("canvas");t.style="position:absolute;pointer-events:none;",t.width=A.g.canvas.width,t.height=A.g.canvas.height,A.g.canvas.parentNode.insertBefore(t,A.g.canvas),A.overlay=t}A.st0=this.pixelPositionToTimecode(t),this.state.selecting=!0}}else this.state.drag=!0,A.tc=this.startTime,this.state.updateCanvas=this.pconfig.lockAllGraphs?null:t.target}pointerMove(t){if(this.state.drag){if(Math.abs(t.clientX-A.lx)>0){A.lx=t.clientX;const e=A.g.chart.chartArea.right-A.g.chart.chartArea.left,i=Math.floor((t.clientX-A.mx)*((3600*this.activeRange.timeRangeHours+60*this.activeRange.timeRangeMinutes)/e));if(i<0){let t=C(A.tc).add(-i,"second"),e=C(t).add(this.activeRange.timeRangeHours,"hour").add(this.activeRange.timeRangeMinutes,"minute");this.startTime=t.format("YYYY-MM-DDTHH:mm:ss"),this.endTime=e.format("YYYY-MM-DDTHH:mm:ss")}else if(i>0){let t=C(A.tc).subtract(i,"second"),e=C(t).add(this.activeRange.timeRangeHours,"hour").add(this.activeRange.timeRangeMinutes,"minute");this.startTime=t.format("YYYY-MM-DDTHH:mm:ss"),this.endTime=e.format("YYYY-MM-DDTHH:mm:ss")}this.state.loading?this.updateAxes():this.updateHistory()}if(t.shiftKey&&Math.abs(t.clientY-A.ly)>0){A.ly=t.clientY;const e=A.g.chart.chartArea.bottom-A.g.chart.chartArea.top,i=(t.clientY-A.my)*(A.y1-A.y0)/e;A.g.chart.options.scales.yAxes[0].ticks.min=A.y0+i,A.g.chart.options.scales.yAxes[0].ticks.max=A.y1+i,A.g.chart.options.scales.yAxes[0].ticks.removeEdgeTicks=!0,A.g.chart.update()}t.shiftKey?(2!==A.g.yaxisLock&&this.updateScaleLockState(A.g,!0),A.g.yaxisLock=2):(A.ly=A.my=t.clientY,A.y0=A.g.chart.options.scales.yAxes[0].ticks.min,A.y1=A.g.chart.options.scales.yAxes[0].ticks.max)}else if(this.state.selecting&&A.overlay){let e=A.overlay.getContext("2d");e.clearRect(0,0,A.overlay.width,A.overlay.height);const i=A.overlay.getBoundingClientRect(),n=A.mx-i.left,a=Math.max(Math.min(t.clientX-i.left,A.g.chart.chartArea.right),A.g.chart.chartArea.left);e.fillStyle=this.ui.darkMode?"#ffffff20":"#00000020",e.fillRect(n,A.g.chart.chartArea.top,a-n,A.g.chart.chartArea.bottom-A.g.chart.chartArea.top),A.st1=this.pixelPositionToTimecode(a)}else if(!this.state.altGraph&&t.altKey){for(let e of this.graphs)if(e.canvas===t.target){this.state.altGraph=e,e.chart.options.hover.mode="dataset";break}}else this.state.altGraph&&!t.altKey&&(this.state.altGraph.chart.options.hover.mode="nearest",this.state.altGraph=null)}pointerUp(t){if(this.state.drag&&(this.state.drag=!1,this.state.updateCanvas=null,A.g.chart.options.tooltips.enabled=!0,void 0!==A.g.chart.options.scales.yAxes[0].ticks.forceMin||A.g.yaxisLock?A.g.chart.options.bottomClipMargin=1:(A.g.chart.options.scales.yAxes[0].ticks.min=void 0,A.g.chart.options.bottomClipMargin=4),void 0!==A.g.chart.options.scales.yAxes[0].ticks.forceMax||A.g.yaxisLock?A.g.chart.options.topClipMargin=1:(A.g.chart.options.scales.yAxes[0].ticks.max=void 0,A.g.chart.options.topClipMargin=4),this.updateHistory()),this.state.selecting){this.state.selecting=!1,A.g.chart.options.tooltips.enabled=!0,A.overlay.remove(),A.overlay=null,A.st1<A.st0&&([A.st1,A.st0]=[A.st0,A.st1]);const t=(C(A.st1)+C(A.st0))/2,e=C.duration(A.st1-A.st0).asMinutes();let i=e>=60?Math.ceil(e/60):0;i<12?i<1?this.setTimeRangeMinutes(Math.ceil(e),!0,t):this.setTimeRange(i,!0,t):(i=Math.ceil(i/24),i<1?this.setTimeRange(12,!0,t):i<2?this.setTimeRange(24,!0,t):i<3?this.setTimeRange(48,!0,t):i<4?this.setTimeRange(72,!0,t):i<5?this.setTimeRange(96,!0,t):i<6?this.setTimeRange(120,!0,t):i<7?this.setTimeRange(144,!0,t):i<13?this.setTimeRange(168,!0,t):i<20?this.setTimeRange(336,!0,t):i<28?this.setTimeRange(504,!0,t):i<45?this.setTimeRange(720,!0,t):i<105?this.setTimeRange(2184,!0,t):this.setTimeRange(4368,!0,t)),this.toggleZoom()}A.g=null,this.state.autoScroll=C()<=C(this.endTime)}pointerCancel(t){this.state.drag&&(this.state.drag=!1,this.state.updateCanvas=null,A.g.chart.options.tooltips.enabled=!0,A.g.chart.options.scales.yAxes[0].ticks.min=void 0,A.g.chart.options.scales.yAxes[0].ticks.max=void 0,A.g.chart.options.topClipMargin=4,A.g.chart.options.bottomClipMargin=4),this.state.selecting&&(this.state.selecting=!1,A.g.chart.options.tooltips.enabled=!0,A.overlay.remove(),A.overlay=null),A.g=null,this.state.autoScroll=C()<=C(this.endTime)}wheelScrolled(t){if(t.ctrlKey){if(t.preventDefault(),!this.graphs.length||this.state.loading)return;const e=this.graphs[0].canvas.getBoundingClientRect(),i=this.graphs[0].chart.chartArea,n=(t.clientX-e.left-i.left)/(i.right-i.left),a=this.factorToTimecode(n);t.deltaY<0?this.incZoomStep(a,n):t.deltaY>0&&this.decZoomStep(a,n)}if(t.shiftKey){let e=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;for(let i of this.graphs){const n=i.canvas.getBoundingClientRect();if(t.clientY>=n.top&&t.clientY<=n.bottom){let t=e<0?.9:1/.9,n=i.chart.options.scales.yAxes[0].ticks;void 0===n.min&&(n.min=i.chart.scales["y-axis-0"].min),void 0===n.max&&(n.max=i.chart.scales["y-axis-0"].max);let a=n.max-n.min;a-=a*t,n.max-=.5*a,n.min+=.5*a,i.yaxisLock||(i.yaxisLock=2,this.updateScaleLockState(i,!0)),i.chart.options.scales.yAxes[0].ticks.removeEdgeTicks=!0,i.chart.update();break}}}}matchWildcardPattern(t){return t=(t=t.replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]","g"),"\\$&")).replace(/\\\*/g,".*"),new RegExp("^"+t+"$","i")}addEntitySelected(t){if(this.state.loading)return;let e=t.target?"b8_0"==t.target.id?0:1:-1;if(e<0)return;const i=this.ui.inputField[e]?.value;for(let t of this.ui.inputField)t&&(t.value="");if(i.indexOf("*")>=0){const t=this._this.querySelector(D?`#es_${e}`:`#b6_${this.cid}`);if(!t)return;const n=this.matchWildcardPattern(i);for(let e of Array.from(t.children)){const t=e.innerText;if(n.test(t)){if(null==this._hass.states[t])continue;this.addDynamicGraph(t),this.pconfig.entities.push(t)}}}else{if(null==this._hass.states[i])return;this.addDynamicGraph(i),this.pconfig.entities.push(i)}this.updateHistoryWithClearCache(),this.writeLocalState()}removeAllEntities(){if(this.menuSetVisibility(0,!1),this.menuSetVisibility(1,!1),!confirm(k("ui.popup.remove_all")))return;let t=0;for(t=0;t<this.graphs.length&&!(this.graphs[t].id>=this.firstDynamicId);t++);for(let e=t;e<this.graphs.length;e++)this.graphs[e].canvas.parentNode.remove();this.graphs.splice(t),this.pconfig.entities=[],this.writeLocalState()}getDomainForEntity(t){return t.substr(0,t.indexOf("."))}getDeviceClass(t){return this._hass.states[t]?.attributes?.device_class}getUnitOfMeasure(t,e){return void 0===e?this._hass.states[t]?.attributes?.unit_of_measurement:e}getStateClass(t){return this._hass.states[t]?.attributes?.state_class}getEntityOptions(t){let e=this.pconfig.entityOptions?.[t];if(!e){const i=this.getDeviceClass(t);if(e=i?this.pconfig.entityOptions?.[i]:void 0,!e){const i=this.getDomainForEntity(t);e=i?this.pconfig.entityOptions?.[i]:void 0}}return e??void 0}calcGraphHeight(t,e,i){switch(t){case"line":return i||this.pconfig.lineGraphHeight;case"bar":return(i||this.pconfig.barGraphHeight)+24;default:const t="full"==this.pconfig.tooltipSize?130:"slim"==this.pconfig.tooltipSize?90:115;return Math.max(34+e*this.pconfig.timelineBarSpacing,t)}}removeGraph(t){const e=t.target.id.substr(t.target.id.indexOf("-")+1);for(let t=0;t<this.graphs.length;t++)if(this.graphs[t].id==e){this.graphs[t].canvas.parentNode.remove();for(let e of this.graphs[t].entities){const t=this.pconfig.entities.indexOf(e.entity);t>=0&&this.pconfig.entities.splice(t,1)}this.graphs.splice(t,1);break}this.updateHistoryWithClearCache(),this.writeLocalState()}addFixedGraph(t){if("line"==t.graph.type||"bar"==t.graph.type){let e=[];for(let i of t.graph.entities){const n=this.getNextDefaultColor(),a=i.color??n.color;let o=i.fill??(i.color?"rgba(0,0,0,0)":n.fill);"bar"==t.graph.type&&(o=a),e.push({...i,color:a,fill:o})}this.addGraphToCanvas(t.id,t.graph.type,e,t.graph.options)}else this.addGraphToCanvas(t.id,t.graph.type,t.graph.entities,t.graph.options);"bar"==t.graph.type&&this._this.querySelector(`#bd-${t.id}`)?.addEventListener("change",this.selectBarInterval.bind(this)),"line"!=t.graph.type&&"bar"!=t.graph.type||this._this.querySelector(`#ca-${t.id}`)?.addEventListener("click",this.scaleLockClicked.bind(this))}addDynamicGraph(t){if(null==this._hass.states[t])return;var e=this.getEntityOptions(t);const i=this.getUnitOfMeasure(t),n=this.getStateClass(t),a=e?.type?e.type:"total_increasing"===n?"bar":null==i&&"measurement"!==n?"timeline":"line";let o=[{entity:t,color:"#000000",fill:"#00000000",process:e?.process}];if("line"==a||"arrowline"==a||"bar"==a){if(e?.color)o[0].color=e?.color,o[0].fill=e?.fill??"rgba(0,0,0,0)";else{const t=this.getNextDefaultColor();o[0].color=t.color,o[0].fill=e?.fill??t.fill}o[0].dashMode=e?.dashMode,o[0].width=e?.width,o[0].lineMode=e?.lineMode,o[0].scale=e?.scale,o[0].hidden=e?.hidden,o[0].netBars=e?.netBars,"bar"==a&&(o[0].fill=o[0].color,o[0].lineMode=e?.lineMode??"lines")}const r=this.graphs.length-1;r>=0&&"bar"!=a&&this.graphs[r].type===a&&("timeline"==a||this.pconfig.combineSameUnits&&this.getUnitOfMeasure(t)==this.getUnitOfMeasure(this.graphs[r].entities[0].entity))&&(o=this.graphs[this.graphs.length-1].entities.concat(o),this.graphs[this.graphs.length-1].canvas.parentNode.remove(),this.graphs.length--);const s=this.calcGraphHeight(a,o.length,e?.height);let l="";l+=`<div style='height:${s}px'>`,l+=`<canvas id="graph${this.g_id}" height="${s}px" style='touch-action:pan-y'></canvas>`,l+=`<button id='bc-${this.g_id}' style="position:absolute;right:20px;margin-top:${5-s}px;color:var(--primary-text-color);background-color:${this.pconfig.closeButtonColor};border:0px solid black;">×</button>`,"bar"!=a||this.ui.hideInterval||(l+=this.createIntervalSelectorHtml(this.g_id,s,this.parseIntervalConfig(e?.interval),this.ui.optionStyle)),"line"!=a&&"bar"!=a||(l+=this.createScaleLockIconHtml(this.g_id,s)),l+="</div>";let d=document.createElement("div");d.innerHTML=l,this._this.querySelector("#graphlist").appendChild(d),"bar"!=a||this.ui.hideInterval||this._this.querySelector(`#bd-${this.g_id}`).addEventListener("change",this.selectBarInterval.bind(this)),"line"!=a&&"bar"!=a||this._this.querySelector(`#ca-${this.g_id}`)?.addEventListener("click",this.scaleLockClicked.bind(this)),this._this.querySelector(`#bc-${this.g_id}`).addEventListener("click",this.removeGraph.bind(this)),this.addGraphToCanvas(this.g_id++,a,o,e)}addGraphToCanvas(t,e,i,n){const a=this._this.querySelector(`#graph${t}`);let o=[];for(let t of i)o.push({name:void 0===t.name?this._hass.states[t.entity]?.attributes?.friendly_name:t.name,bColor:y(t.color),fillColor:y(t.fill),dashMode:t.dashMode,mode:t.lineMode||this.pconfig.defaultLineMode,width:t.width||this.pconfig.defaultLineWidth,unit:this.getUnitOfMeasure(t.entity,t.unit),domain:this.getDomainForEntity(t.entity),device_class:this.getDeviceClass(t.entity),hidden:t.hidden,entity_id:t.entity});const r=this.newGraph(a,e,o,n),s={id:t,type:e,canvas:a,graphHeight:this.calcGraphHeight(e,i.length,n?.height),chart:r,entities:i,interval:this.parseIntervalConfig(n?.interval)??1};this.graphs.push(s),a.addEventListener("pointerdown",this.pointerDown.bind(this)),a.addEventListener("pointermove",this.pointerMove.bind(this)),a.addEventListener("pointerup",this.pointerUp.bind(this)),a.addEventListener("pointercancel",this.pointerCancel.bind(this)),"line"!=e&&"bar"!=e||this.updateScaleLockState(s,!1)}addUIHtml(t,e,i,n,a,o,r){let s="";if((t||e)&&this.ui.stickyTools&1<<r){s=`<div style="position:sticky;${r?"bottom:0px":"top:var(--header-height)"};padding-top:${this.ui.hideHeader?0:15}px;padding-bottom:10px;margin-top:-${this.ui.hideHeader?0:15}px;z-index:1;background-color:var(--card-background-color);line-height:0px;">`}(t||e)&&(s+='<div style="margin-left:0px;width:100%;min-height:30px;text-align:center;display:block;line-height:normal;">');const l=`<a id="eh_${r}" href="#" style="display:block;padding:5px 5px;text-decoration:none;color:inherit"></a>`;return t&&(s+=`\n <div id="dl_${r}" style="background-color:${i};float:left;margin-left:10px;display:inline-block;padding-left:10px;padding-right:10px;">\n <button id="b1_${r}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px"><</button>\n <button id="bx_${r}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px">-</button>\n <button id="b2_${r}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px">></button>\n </div>`),e&&D&&(s+=`\n <div id='sl_${r}' style="background-color:${i};display:none;padding-left:10px;padding-right:10px;">\n <input id="b7_${r}" ${a} autoComplete="on"/>\n <div id="es_${r}" style="display:none;position:absolute;text-align:left;min-width:260px;max-height:150px;overflow:auto;border:1px solid #444;z-index:1;color:var(--primary-text-color);background-color:var(--card-background-color)"></div>\n <button id="b8_${r}" style="border:0px solid black;color:inherit;background-color:#00000000;height:34px;margin-left:5px;">+</button>\n <button id="bo_${r}" style="border:0px solid black;color:inherit;background-color:#00000000;height:30px;margin-left:1px;margin-right:0px;"><svg width="18" height="18" viewBox="0 0 24 24" style="vertical-align:middle;"><path fill="var(--primary-text-color)" d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" /></svg></button>\n <div id="eo_${r}" style="display:none;position:absolute;text-align:left;min-width:150px;overflow:auto;border:1px solid #ddd;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);z-index:1;color:var(--primary-text-color);background-color:var(--card-background-color)">\n <a id="ef_${r}" href="#" style="display:block;padding:5px 5px;text-decoration:none;color:inherit"></a>\n ${this.statistics.enabled?l:""}\n <a id="eg_${r}" href="#" style="display:block;padding:5px 5px;text-decoration:none;color:inherit"></a>\n <a id="ei_${r}" href="#" style="display:block;padding:5px 5px;text-decoration:none;color:inherit"></a>\n </div>\n </div>`),e&&!D&&(s+=`\n <div id='sl_${r}' style="background-color:${i};display:none;padding-left:10px;padding-right:10px;">\n <input id="b7_${r}" ${a} autoComplete="on" list="b6_${this.cid}" placeholder="Type to search for an entity to add"/>\n <button id="b8_${r}" style="border:0px solid black;color:inherit;background-color:#00000000;height:34px;margin-left:5px;">+</button>\n <button id="bo_${r}" style="border:0px solid black;color:inherit;background-color:#00000000;height:30px;margin-left:1px;margin-right:0px;"><svg width="18" height="18" viewBox="0 0 24 24" style="vertical-align:middle;"><path fill="var(--primary-text-color)" d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" /></svg></button>\n <div id="eo_${r}" style="display:none;position:absolute;text-align:left;min-width:150px;overflow:auto;border:1px solid #ddd;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);z-index:1;color:var(--primary-text-color);background-color:var(--card-background-color)">\n <a id="ef_${r}" href="#" style="display:block;padding:5px 5px;text-decoration:none;color:inherit"></a>\n ${this.statistics.enabled?l:""}\n <a id="eg_${r}" href="#" style="display:block;padding:5px 5px;text-decoration:none;color:inherit"></a>\n <a id="ei_${r}" href="#" style="display:block;padding:5px 5px;text-decoration:none;color:inherit"></a>\n </div>\n </div>`),t&&(s+=`\n <div id="dr_${r}" style="background-color:${i};float:right;margin-right:10px;display:inline-block;padding-left:10px;padding-right:10px;">\n <button id="bz_${r}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000"><svg width="24" height="24" viewBox="0 0 24 24" style="vertical-align:middle;"><path fill="var(--primary-text-color)" d="M15.5,14L20.5,19L19,20.5L14,15.5V14.71L13.73,14.43C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.43,13.73L14.71,14H15.5M9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14M12,10H10V12H9V10H7V9H9V7H10V9H12V10Z" /></svg></button>\n <button id="b${o?5:4}_${r}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px">-</button>\n <select id="by_${r}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px;max-width:83px">\n <option value="0" ${n} hidden></option>\n <option value="1" ${n}></option>\n <option value="2" ${n}></option>\n <option value="3" ${n} hidden></option>\n <option value="4" ${n} hidden></option>\n <option value="5" ${n} hidden></option>\n <option value="6" ${n}></option>\n <option value="7" ${n} hidden></option>\n <option value="8" ${n} hidden></option>\n <option value="9" ${n} hidden></option>\n <option value="10" ${n} hidden></option>\n <option value="11" ${n} hidden></option>\n <option value="12" ${n}></option>\n <option value="24" ${n}></option>\n <option value="48" ${n}></option>\n <option value="72" ${n}></option>\n <option value="96" ${n} hidden></option>\n <option value="120" ${n} hidden></option>\n <option value="144" ${n} hidden></option>\n <option value="168" ${n}></option>\n <option value="336" ${n}></option>\n <option value="504" ${n}></option>\n <option value="720" ${n}></option>\n <option value="2184" ${n}></option>\n <option value="4368" ${n}></option>\n <option value="8760" ${n}></option>\n </select>\n <button id="b${o?4:5}_${r}" style="margin:0px;border:0px solid black;color:inherit;background-color:#00000000;height:30px">+</button>\n </div>`),(t||e)&&(s+="</div>"),s+=`<div id='rf_${r}' style="margin-left:0px;margin-top:10px;margin-bottom:0px;width:100%;text-align:center;display:none;line-height:normal;"></div>`,(t||e)&&this.ui.stickyTools&1<<r&&(s+="</div>"),s}insertUIHtmlText(t){let e=this._this.querySelector(`#ef_${t}`);e&&(e.innerHTML=k("ui.menu.export_csv"));let i=this._this.querySelector(`#eh_${t}`);i&&(i.innerHTML=k("ui.menu.export_stats"));let n=this._this.querySelector(`#eg_${t}`);n&&(n.innerHTML=k("ui.menu.remove_all"));let a=this._this.querySelector(`#ei_${t}`);a&&(a.innerHTML=k(R?"ui.menu.disable_panel":"ui.menu.enable_panel"));let o=this._this.querySelector(`#by_${t}`);o&&(o.children[0].innerHTML=k("ui.ranges.l_hour"),o.children[1].innerHTML=k("ui.ranges.hour"),o.children[2].innerHTML=k("ui.ranges.n_hours",2),o.children[3].innerHTML=k("ui.ranges.n_hours",3),o.children[4].innerHTML=k("ui.ranges.n_hours",4),o.children[5].innerHTML=k("ui.ranges.n_hours",5),o.children[6].innerHTML=k("ui.ranges.n_hours",6),o.children[7].innerHTML=k("ui.ranges.n_hours",7),o.children[8].innerHTML=k("ui.ranges.n_hours",8),o.children[9].innerHTML=k("ui.ranges.n_hours",9),o.children[10].innerHTML=k("ui.ranges.n_hours",10),o.children[11].innerHTML=k("ui.ranges.n_hours",11),o.children[12].innerHTML=k("ui.ranges.n_hours",12),o.children[13].innerHTML=k("ui.ranges.day"),o.children[14].innerHTML=k("ui.ranges.n_days",2),o.children[15].innerHTML=k("ui.ranges.n_days",3),o.children[16].innerHTML=k("ui.ranges.n_days",4),o.children[17].innerHTML=k("ui.ranges.n_days",5),o.children[18].innerHTML=k("ui.ranges.n_days",6),o.children[19].innerHTML=k("ui.ranges.week"),o.children[20].innerHTML=k("ui.ranges.n_weeks",2),o.children[21].innerHTML=k("ui.ranges.n_weeks",3),o.children[22].innerHTML=k("ui.ranges.month"),o.children[23].innerHTML=k("ui.ranges.n_months",3),o.children[24].innerHTML=k("ui.ranges.n_months",6),o.children[25].innerHTML=k("ui.ranges.year"))}resize(){const t=this._this.querySelector("#maincard").clientWidth;if(Math.abs(this.lastWidth-t)>2){const e=this.computeTickDensity(t)!=this.computeTickDensity(this.lastWidth);this.lastWidth=t;for(let t of this.graphs)t.chart.resize(void 0,t.graphHeight);e&&this.setStepSize(!0)}this.resizeSelector()}adjustSelectorPosition(t,e){const i=this._this.querySelector(`#rf_${e}`),n=this._this.querySelector(`#sl_${e}`);n.style.display="inline-block";const a="none"!==i.style.display;if(!t&&a){i.style.display="none";this._this.querySelector(`#dl_${e}`).after(n)}else t&&!a&&(i.style.display="block",i.appendChild(n))}resizeSelector(){const t=this._this.querySelector("#maincard").clientWidth;for(let e=0;e<2;++e){const i=this._this.querySelector(`#b7_${e}`);if(i){let n=t-120-(this._this.querySelector(`#dl_${e}`)?.clientWidth??0)-(this._this.querySelector(`#dr_${e}`)?.clientWidth??0);const a=n<220&&null!=this._this.querySelector(`#dl_${e}`);this.adjustSelectorPosition(a,e),a?i.style.width=t-108+"px":(n=Math.min(n,500),i.style.width=n+"px")}}}createContent(){if(!this.contentValid){this.contentValid=!0;for(let t=0;t<2;t++)this.insertUIHtmlText(t);let t=getComputedStyle(this._this.querySelector("#maincard")).backgroundColor.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);this.ui.darkMode=this._hass.selectedTheme&&this._hass.selectedTheme.dark||this._hass.themes&&this._hass.themes.darkMode,this.ui.darkMode|=t&&4==t.length&&(+t[1]+ +t[2]+ +t[3])/3<=100,this._this.config.uimode&&("dark"===this._this.config.uimode?this.ui.darkMode=!0:"light"===this._this.config.uimode&&(this.ui.darkMode=!1)),this.pconfig.graphLabelColor=y(this._this.config.uiColors?.labels??(this.ui.darkMode?"#9b9b9b":"#333")),this.pconfig.graphGridColor=y(this._this.config.uiColors?.gridlines??(this.ui.darkMode?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)")),this.pconfig.cursorLineColor=y(this._this.config.uiColors?.cursorline??this.pconfig.graphGridColor),this.pconfig.nextDefaultColor=0,this.graphs=[];for(let t of this.pconfig.graphConfig)this.addFixedGraph(t);this.resizeSelector();for(let t=0;t<2;t++)this._this.querySelector(`#b1_${t}`)?.addEventListener("click",this.subDay.bind(this),!1),this._this.querySelector(`#b2_${t}`)?.addEventListener("click",this.addDay.bind(this),!1),this._this.querySelector(`#b4_${t}`)?.addEventListener("click",this.decZoom.bind(this),!1),this._this.querySelector(`#b5_${t}`)?.addEventListener("click",this.incZoom.bind(this),!1),this._this.querySelector(`#b8_${t}`)?.addEventListener("click",this.addEntitySelected.bind(this)),this._this.querySelector(`#bx_${t}`)?.addEventListener("click",this.todayNoReset.bind(this),!1),this._this.querySelector(`#bx_${t}`)?.addEventListener("dblclick",this.todayReset.bind(this),!1),this._this.querySelector(`#by_${t}`)?.addEventListener("change",this.timeRangeSelected.bind(this)),this._this.querySelector(`#bz_${t}`)?.addEventListener("click",this.toggleZoom.bind(this),!1),this._this.querySelector(`#ef_${t}`)?.addEventListener("click",this.exportFile.bind(this),!1),this._this.querySelector(`#eh_${t}`)?.addEventListener("click",this.exportStatistics.bind(this),!1),this._this.querySelector(`#eg_${t}`)?.addEventListener("click",this.removeAllEntities.bind(this),!1),this._this.querySelector(`#ei_${t}`)?.addEventListener("click",this.toggleInfoPanel.bind(this),!1),this._this.querySelector(`#bo_${t}`)?.addEventListener("click",this.menuClicked.bind(this),!1),D&&(this._this.querySelector(`#b7_${t}`)?.addEventListener("focusin",this.entitySelectorFocus.bind(this),!0),this._this.querySelector(`#b7_${t}`)?.addEventListener("keyup",this.entitySelectorEntered.bind(this),!0)),this.ui.dateSelector[t]=this._this.querySelector(`#bx_${t}`),this.ui.rangeSelector[t]=this._this.querySelector(`#by_${t}`),this.ui.zoomButton[t]=this._this.querySelector(`#bz_${t}`);if(D||this._this.querySelector("#maincard").addEventListener("wheel",this.wheelScrolled.bind(this),{passive:!1}),this.readLocalState(),this.pconfig.nextDefaultColor=0,this.pconfig.entities)for(let t of this.pconfig.entities)this.addDynamicGraph(t);else this.pconfig.entities=[];this.setTimeRangeFromString(String(this.pconfig.defaultTimeRange)),this.today(!1),new ResizeObserver((t=>{this.resize()})).observe(this._this.querySelector("#maincard")),this.writeInfoPanelConfig(),this.pconfig.refreshInterval&&setInterval(this.refresh.bind(this),1e3*this.pconfig.refreshInterval)}}refresh(){this.cache[this.cacheSize].valid=!1,this.updateHistory()}updateContent(){if(!this.contentValid){this._this.querySelector("#maincard").clientWidth>0&&(clearInterval(this.iid),this.createContent(),this.iid=null)}}menuSetVisibility(t,e){const i=this._this.querySelector(`#eo_${t}`);if(i)if(this._this.querySelector(`#bo_${t}`).style.transform=e?"scale(1,-1)":"scale(1,1)",e){i.style.display="block";const e=this._this.querySelector("#maincard").clientWidth-4;let n=this._this.querySelector(`#bo_${t}`).offsetLeft-30;n+i.clientWidth>=e&&(n=e-i.clientWidth),i.style.left=n+"px"}else i.style.display="none"}menuClicked(t){if(!t.currentTarget)return;const e=1*t.currentTarget.id.substr(3);this.menuSetVisibility(e,"none"==this._this.querySelector(`#eo_${e}`)?.style.display)}setDropdownVisibility(t,e){let i=this._this.querySelector(`#b7_${t}`),n=this._this.querySelector(`#es_${t}`);if(i&&n)if(e){n.style["min-width"]=i.clientWidth+"px",n.style.display="block";for(let t of n.getElementsByTagName("a"))t.style.display="block"}else n.style.display="none"}entitySelectorFocus(t){if(!t.target)return;const e=1*t.target.id.substr(3);this.setDropdownVisibility(1^e,!1),this.setDropdownVisibility(e,!0),this.focusClick=!0,this.focusListener||(this.focusListener=!0,window.addEventListener("click",this.defocusCall))}entitySelectorDefocus(t){this.focusClick?this.focusClick=void 0:(window.removeEventListener("click",this.defocusCall),this.focusListener=void 0,this.setDropdownVisibility(0,!1),this.setDropdownVisibility(1,!1))}entitySelectorEntered(t){if(!t.target)return;const e=1*t.target.id.substr(3);let i=this._this.querySelector(`#es_${e}`),n=this._this.querySelector(`#b7_${e}`).value.toLowerCase(),a=i.getElementsByTagName("a");for(let t of a){t.textContent.toLowerCase().indexOf(n)>=0?t.style.display="block":t.style.display="none"}}entitySelectorEntryClicked(t){window.removeEventListener("click",this.defocusCall),this.focusListener=void 0;const e=t.target.href.slice(-1);let i=this._this.querySelector(`#b7_${e}`),n=this._this.querySelector(`#es_${e}`);i.value=t.target.id,n.style.display="none"}buildFilterRegexList(){let t=[];if(this.pconfig.filterEntities)if(Array.isArray(this.pconfig.filterEntities))for(let e of this.pconfig.filterEntities)e&&t.push(this.matchWildcardPattern(e));else t.push(this.matchWildcardPattern(this.pconfig.filterEntities));return t}matchRegexList(t,e){if(!t.length)return!0;for(let i of t)if(i.test(e))return!0;return!1}entityCollectorCallback(t){for(let e=0;e<(D?2:1);++e){const i=this._this.querySelector(D?`#es_${e}`:`#b6_${this.cid}`);if(!i)continue;for(;i.firstChild;)i.removeChild(i.firstChild);const n=this.buildFilterRegexList();let a=[];for(let e in t)this.matchRegexList(n,e)&&a.push(e);a.sort();for(let t of a){let n;D?(n=document.createElement("a"),n.href=`#s_${e}`,n.id=t,n.style="display:block;padding:2px 5px;text-decoration:none;color:inherit",n.addEventListener("click",this.entitySelectorEntryClicked.bind(this),!0)):n=document.createElement("option"),n.innerHTML=t,i.appendChild(n)}}for(let t of this.ui.inputField)t&&(t.placeholder=k("ui.label.type_to_search"))}entityCollectorFailed(t){console.log(t),this.entityCollectAll();for(let t of this.ui.inputField)t&&(t.placeholder=k("ui.label.error_retreiving"))}entityCollectAll(){for(let t=0;t<(D?2:1);++t){const e=this._this.querySelector(D?`#es_${t}`:`#b6_${this.cid}`);if(!e)continue;for(;e.firstChild;)e.removeChild(e.firstChild);const i=this.buildFilterRegexList();let n=[];for(let t in this._hass.states){if(!this.matchRegexList(i,t))continue;const e=this.getDomainForEntity(t);["automation","script","zone","camera","persistent_notification","timer"].includes(e)||n.push(t)}n.sort();for(let i of n){let n;D?(n=document.createElement("a"),n.href=`#s_${t}`,n.id=i,n.style="display:block;padding:2px 5px;text-decoration:none;color:inherit",n.addEventListener("click",this.entitySelectorEntryClicked.bind(this),!0)):n=document.createElement("option"),n.innerHTML=i,e.appendChild(n)}}for(let t of this.ui.inputField)t&&(t.placeholder=k("ui.label.type_to_search"))}requestEntityCollection(){if(!this.entitiesPopulated&&(this.entitiesPopulated=!0,!this.ui.hideSelector))if(this.ui.inputField[0]=this._this.querySelector("#b7_0"),this.ui.inputField[1]=this._this.querySelector("#b7_1"),this.pconfig.recordedEntitiesOnly){for(let t of this.ui.inputField)t&&(t.placeholder=k("ui.label.loading"));const t=C().subtract(1,"hour").format("YYYY-MM-DDTHH:mm:ss"),e=this.buildFilterRegexList();let i=[];for(let t in this._hass.states){if(!this.matchRegexList(e,t))continue;const n=this.getDomainForEntity(t);["automation","script","zone","camera","persistent_notification","timer"].includes(n)||i.push(t)}const n={type:"history/history_during_period",start_time:t,minimal_response:!0,no_attributes:!0,entity_ids:i};this._hass.callWS(n).then(this.entityCollectorCallback.bind(this),this.entityCollectorFailed.bind(this))}else this.entityCollectAll()}initLocalization(){if(this.i18n.valid)return;let t=this._hass.language?this._hass.language:"en-GB";!function(t){_="en";let e=t.replace("-","_").split("_");e&&e.length>0&&x[e[0]]&&(_=e[0])}(t),this.ui.wideInterval=["da","nl","sv","sk","ru"].includes(t);const e=P(t,{dateStyle:"medium"}),i="D"==e[0]?"D MMM":"MMM D";this.i18n.styleDateTicks=this.pconfig.timeTickShortDate?"D":i,this.i18n.styleDateSelector=D?i:e,"24"===this._hass.locale?.time_format&&(t="en-GB"),"12"===this._hass.locale?.time_format&&(t="en-US"),this.i18n.styleTimeTicks=P(t,{timeStyle:"short"}),this.i18n.styleDateTimeTooltip=this.i18n.styleDateTicks+", "+P(t,{timeStyle:"medium"}),this.i18n.valid=!0}writeLocalState(){const t={version:1,entities:this.pconfig.entities};window.localStorage.removeItem("history-explorer-card"),window.localStorage.removeItem("history-explorer_card_"+this.id),window.localStorage.setItem("history-explorer_card_"+this.id,JSON.stringify(t))}readLocalState(){let t=JSON.parse(window.localStorage.getItem("history-explorer_card_"+this.id));t&&1===t.version?this.pconfig.entities=t.entities:(t=JSON.parse(window.localStorage.getItem("history-explorer-card")),this.pconfig.entities=t||[])}writeInfoPanelConfig(t=!1){if(R){if(R&&(this.pconfig.infoPanelConfig||t)){let t={enabled:!0};t.config=this.pconfig.infoPanelConfig,window.localStorage.removeItem("history-explorer-info-panel"),window.localStorage.setItem("history-explorer-info-panel",JSON.stringify(t))}}else window.localStorage.removeItem("history-explorer-info-panel")}handleChangedEntities(){if(!this.pconfig.showCurrentValues&&!this.pconfig.refreshEnabled)return!1;let t=!1;for(let e of this.graphs){let i=0;for(let n of e.entities){const a=this._hass.states[n.entity].last_changed;if(this.stateMap.has(n.entity)&&a!=this.stateMap.get(n.entity)){if(this.pconfig.showCurrentValues){let t=e.chart.data.datasets[i];t.label=this.getFormattedLabelName(t.name,n.entity,t.unit)}t=!0}this.stateMap.set(n.entity,a),i++}}return t}buildEntityExclusionList(t){let e=[];if(t)for(let i of t){const t=this.matchWildcardPattern(i.entity);t&&e.push(t)}return e}buildGraphListFromConfig(t){const e=function(t,e){for(let i of e)if(i.test(t))return!0;return!1};for(let i of t){if(!i.entities)continue;let t={...i,entities:[]};for(let n of i.entities)if(n.entity.indexOf("*")>=0){const i=this.buildEntityExclusionList(n.exclude),a=this.matchWildcardPattern(n.entity);for(let o in this._hass.states)a&&a.test(o)&&!e(o,i)&&t.entities.push({...n,entity:o})}else t.entities.push(n);this.pconfig.graphConfig.push({graph:t,id:this.g_id++})}}}function P(t,e){let i=new Intl.DateTimeFormat(t,e).formatToParts(new Date);return i.map((t=>{switch(t.type){case"year":return"YYYY";case"month":return"MMM";case"day":return"D";case"hour":return i.findIndex((t=>"dayPeriod"==t.type))>=0?"h":"HH";case"minute":return"mm";case"second":return"ss";case"dayPeriod":return"a";default:return[".",",","/","-"].includes(t.value)||!function(t){return 1==t.length&&t[0].toLowerCase()==t[0].toUpperCase()}(t.value)?" ":t.value}})).join("")}var I=0;class O extends HTMLElement{instance=null;configSet=!1;set hass(t){this.configSet&&(this.configSet=!1,this.InitWithConfig(t)),this.instance&&(this.instance._this=this,this.instance._hass=t,this.instance.version=t.config.version.split(".").map(Number),this.instance.i18n.valid||this.instance.initLocalization(),this.instance.entitiesPopulated||this.instance.requestEntityCollection(),this.instance.contentValid||this.instance.iid||(this.instance.iid=setInterval(this.instance.updateContent.bind(this.instance),100)),this.instance.contentValid&&this.instance.handleChangedEntities()&&(this.instance.pconfig.showCurrentValues&&this.instance.updateHistory(),this.instance.pconfig.refreshEnabled&&(this.instance.cache[this.instance.cacheSize].valid=!1,this.instance.tid&&clearTimeout(this.instance.tid),this.instance.tid=setTimeout(this.instance.updateHistoryAutoRefresh.bind(this.instance),2e3))))}set panel(t){this.setConfig(t.config)}setConfig(t){this.config=t,this.configSet=!0}InitWithConfig(t){const e=this.config;if(this.instance||(this.instance=new L),this.instance._hass=t,this.instance.g_id=0,this.instance.pconfig.graphConfig=[],e.graphs&&this.instance.buildGraphListFromConfig(e.graphs),this.instance.firstDynamicId=this.instance.g_id,this.instance.pconfig.customStateColors={},e.stateColors)for(let t in e.stateColors)this.instance.pconfig.customStateColors[t]=y(e.stateColors[t]);this.instance.pconfig.entityOptions=e.entityOptions,this.instance.pconfig.labelAreaWidth=e.labelAreaWidth??65,this.instance.pconfig.labelsVisible=e.labelsVisible??!0,this.instance.pconfig.hideLegend=0==e.legendVisible||void 0,this.instance.pconfig.cursorMode=e.cursor?.mode??"auto",this.instance.pconfig.cursorTypes=e.cursor?.types??["timeline"],this.instance.pconfig.showTooltipColors[0]=e.tooltip?.showColorsLine??e.showTooltipColorsLine??!0,this.instance.pconfig.showTooltipColors[1]=e.tooltip?.showColorsTimeline??e.showTooltipColorsTimeline??!0,this.instance.pconfig.tooltipSize=e.tooltip?.size??e.tooltipSize??"auto",this.instance.pconfig.tooltipShowDuration=e.tooltip?.showDuration??e.tooltipShowDuration??!1,this.instance.pconfig.tooltipShowLabel=e.tooltip?.showLabel??!0,this.instance.pconfig.tooltipStateTextMode=e.tooltip?.stateTextMode??e.stateTextMode??"auto",this.instance.pconfig.colorSeed=e.stateColorSeed??137,this.instance.pconfig.stateTextMode=e.stateTextMode??"auto",this.instance.pconfig.decimation=e.decimation,this.instance.pconfig.roundingPrecision=e.rounding||2,this.instance.pconfig.defaultLineMode=e.lineMode,this.instance.pconfig.defaultLineWidth=e.lineWidth??2,this.instance.pconfig.showUnavailable=e.showUnavailable??!1,this.instance.pconfig.showCurrentValues=e.showCurrentValues??!0,this.instance.pconfig.axisAddMarginMin=void 0!==e.axisAddMarginMin&&e.axisAddMarginMin,this.instance.pconfig.axisAddMarginMax=void 0!==e.axisAddMarginMax&&e.axisAddMarginMax,this.instance.pconfig.recordedEntitiesOnly=e.recordedEntitiesOnly??!1,this.instance.pconfig.filterEntities=e.filterEntities,this.instance.pconfig.combineSameUnits=!0===e.combineSameUnits,this.instance.pconfig.defaultTimeRange=e.defaultTimeRange??"24",this.instance.pconfig.defaultTimeOffset=e.defaultTimeOffset??void 0,this.instance.pconfig.timeTickDensity=e.timeTicks?.density??e.timeTickDensity??"high",this.instance.pconfig.timeTickOverride=e.timeTicks?.densityOverride??void 0,this.instance.pconfig.timeTickShortDate="short"===e.timeTicks?.dateFormat,this.instance.pconfig.lineGraphHeight=1*(e.lineGraphHeight??250),this.instance.pconfig.barGraphHeight=1*(e.barGraphHeight??150),this.instance.pconfig.timelineBarHeight=1*(e.timelineBarHeight??24),this.instance.pconfig.timelineBarSpacing=1*(e.timelineBarSpacing??40),this.instance.pconfig.refreshEnabled=e.refresh?.automatic??!1,this.instance.pconfig.refreshInterval=e.refresh?.interval??void 0,this.instance.pconfig.exportSeparator=e.csv?.separator,this.instance.pconfig.exportTimeFormat=e.csv?.timeFormat,this.instance.pconfig.exportAttributes=e.csv?.exportAttributes,this.instance.pconfig.exportStatsPeriod=e.csv?.statisticsPeriod??"hour",this.instance.pconfig.exportNumberLocale=e.csv?.numberLocale,this.instance.statistics.enabled=e.statistics?.enabled??!0,this.instance.statistics.mode=e.statistics?.mode??"mean",this.instance.statistics.retention=e.statistics?.retention??void 0,this.instance.statistics.period=e.statistics?.period??"hour",this.instance.statistics.force=e.statistics?.force??void 0,this.instance.pconfig.closeButtonColor=y(e.uiColors?.closeButton??"#0000001f"),this.instance.pconfig.infoPanelConfig=e.infoPanel,this.instance.id=e.cardName??"default",this.instance.cid=I++,this.instance.contentValid=!1,this.instance.entitiesPopulated=!1;const i=e.header||"History explorer",n=y(e.uiColors?.buttons??getComputedStyle(document.body).getPropertyValue("--primary-color")+"1f"),a={hide:0,top:1,bottom:2,both:3},o=a[e.uiLayout?.toolbar]??1,r=a[e.uiLayout?.selector]??2;this.instance.ui.stickyTools=a[e.uiLayout?.sticky]??0,this.instance.ui.hideSelector=0===r;const s=!0===e.uiLayout?.invertZoom,l='style="color:var(--primary-text-color);background-color:var(--card-background-color)"',d=e.uiColors?.selector?`style="color:var(--primary-text-color);background-color:${e.uiColors.selector};border:1px solid black;"`:"";this.instance.ui.optionStyle=l,this.instance.ui.hideHeader="hide"===i,this.instance.ui.hideInterval="hide"===e.uiLayout?.interval;let h=`\n <ha-card id="maincard" header="${this.instance.ui.hideHeader?"":i}">\n ${this.instance.addUIHtml(1&o,1&r,n,l,d,s,0)}\n <div id='graphlist' class='card-content' style='margin-top:${1&this.instance.ui.stickyTools?"0px":"8px"};'>\n `,c=!0;for(let t of this.instance.pconfig.graphConfig){t.id>0&&c&&(h+="<br>"),void 0!==t.graph.title&&(h+=`<div style='text-align:center;'>${t.graph.title}</div>`);const e=this.instance.calcGraphHeight(t.graph.type,t.graph.entities.length,t.graph.options?.height);h+=`<div style='height:${e}px'>`,h+=`<canvas id="graph${t.id}" height="${e}px" style='touch-action:pan-y'></canvas>`,"bar"!=t.graph.type||this.instance.ui.hideInterval||(h+=this.instance.createIntervalSelectorHtml(t.id,e,this.instance.parseIntervalConfig(t.graph.options?.interval),l)),"line"!=t.graph.type&&"bar"!=t.graph.type||(h+=this.instance.createScaleLockIconHtml(t.id,e)),h+="</div>",c=!(!1===t.graph.options?.showTimeLabels)}h+=`\n </div>\n ${this.instance.addUIHtml(2&o,2&r,n,l,d,s,1)}\n ${2&(o|r)&&!(2&this.instance.ui.stickyTools)?"<br>":""}\n <datalist id="b6_${this.instance.cid}"></datalist>\n </ha-card>\n `,this.innerHTML=h,this.instance.ui.spinOverlay=document.createElement("div"),this.instance.ui.spinOverlay.style="position:fixed;display:block;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);z-index:2;backdrop-filter:blur(5px)",this.instance.ui.spinOverlay.innerHTML='<svg width="38" height="38" viewBox="0 0 38 38" stroke="#fff" style="position:fixed;left:calc(50% - 20px);top:calc(50% - 20px);"><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity="0.5" cx="18" cy="18" r="18"/><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite"/></path></g></g></svg>'}getCardSize(){return 3}static getStubConfig(){return{cardName:"historycard-"+Math.floor(99999999*Math.random()+1)}}}console.info("%c HISTORY-EXPLORER-CARD %c Version 1.0.54","color:white;background:blue;font-weight:bold","color:black;background:white;font-weight:bold"),customElements.define("history-explorer-card",O),window.customCards=window.customCards||[],window.customCards.push({type:"history-explorer-card",name:"History Explorer Card",preview:!1,description:"An interactive history viewer card"})})()})();