iruby-chartkick 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,47 @@
1
- /*! For license information please see bundle.js.LICENSE.txt */
2
- (()=>{var t={616:function(t){t.exports=function(){"use strict";function t(t){return"[object Array]"===Object.prototype.toString.call(t)}function e(t){return t instanceof Function}function n(t){return"[object Object]"===Object.prototype.toString.call(t)&&!e(t)&&t instanceof Object}function i(e,r){var o;for(o in r)"__proto__"!==o&&(n(r[o])||t(r[o])?(n(r[o])&&!n(e[o])&&(e[o]={}),t(r[o])&&!t(e[o])&&(e[o]=[]),i(e[o],r[o])):void 0!==r[o]&&(e[o]=r[o]))}function r(t,e){var n={};return i(n,t),i(n,e),n}var o=/^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i;function a(t){return""+t}function s(t){return parseFloat(t)}function l(t){var e,n,i,r;if("object"!=typeof t)if("number"==typeof t)t=new Date(1e3*t);else{if(e=(t=a(t)).match(o))return n=parseInt(e[1],10),i=parseInt(e[3],10)-1,r=parseInt(e[5],10),new Date(n,i,r);var s=t.replace(/ /,"T").replace(" ","").replace("UTC","Z");t=new Date(Date.parse(s)||t)}return t}function c(e){if(!t(e)){var n,i=[];for(n in e)e.hasOwnProperty(n)&&i.push([n,e[n]]);e=i}return e}function u(t,e,n,i,o,a,s,l){return function(c,u,d){var h=c.data,f=r({},t);return f=r(f,d||{}),(c.singleSeriesFormat||"legend"in u)&&e(f,u.legend,c.singleSeriesFormat),u.title&&n(f,u.title),"min"in u?i(f,u.min):function(t){var e,n,i;for(e=0;e<t.length;e++)for(i=t[e].data,n=0;n<i.length;n++)if(i[n][1]<0)return!0;return!1}(h)||i(f,0),u.max&&o(f,u.max),"stacked"in u&&a(f,u.stacked),u.colors&&(f.colors=u.colors),u.xtitle&&s(f,u.xtitle),u.ytitle&&l(f,u.ytitle),r(f,u.library||{})}}function d(t,e){return t[0].getTime()-e[0].getTime()}function h(t,e){return t[0]-e[0]}function f(t,e){return t-e}function g(t){return 0===t.getMilliseconds()&&0===t.getSeconds()}function p(t){return g(t)&&0===t.getMinutes()}function m(t){return p(t)&&0===t.getHours()}function b(t,e){return m(t)&&t.getDay()===e}function x(t){return m(t)&&1===t.getDate()}function y(t){return x(t)&&0===t.getMonth()}function v(t){return!isNaN(l(t))&&a(t).length>=6}function w(t){return"number"==typeof t}var _=["bytes","KB","MB","GB","TB","PB","EB"];function M(t,e,n,i){t=t||"",n.prefix&&(e<0&&(e*=-1,t+="-"),t+=n.prefix);var r=n.suffix||"",o=n.precision,s=n.round;if(n.byteScale){var l,c=i?n.byteScale:e;c>=0x1000000000000000?(e/=0x1000000000000000,l=6):c>=0x4000000000000?(e/=0x4000000000000,l=5):c>=1099511627776?(e/=1099511627776,l=4):c>=1073741824?(e/=1073741824,l=3):c>=1048576?(e/=1048576,l=2):c>=1024?(e/=1024,l=1):l=0,void 0===o&&void 0===s&&(e>=1023.5&&l<_.length-1&&(e=1,l+=1),o=e>=1e3?4:3),r=" "+_[l]}if(void 0!==o&&void 0!==s)throw Error("Use either round or precision, not both");if(!i&&(void 0!==o&&(e=e.toPrecision(o),n.zeros||(e=parseFloat(e))),void 0!==s))if(s<0){var u=Math.pow(10,-1*s);e=parseInt((1*e/u).toFixed(0))*u}else e=e.toFixed(s),n.zeros||(e=parseFloat(e));if(n.thousands||n.decimal){var d=(e=a(e)).split(".");e=d[0],n.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousands)),d.length>1&&(e+=(n.decimal||".")+d[1])}return t+e+r}function k(t,e,n){return n in e?e[n]:n in t.options?t.options[n]:null}var C={maintainAspectRatio:!1,animation:!1,plugins:{legend:{},tooltip:{displayColors:!1,callbacks:{}},title:{font:{size:20},color:"#333"}},interaction:{}},T={scales:{y:{ticks:{maxTicksLimit:4},title:{font:{size:16},color:"#333"},grid:{}},x:{grid:{drawOnChartArea:!1},title:{font:{size:16},color:"#333"},time:{},ticks:{}}}},S=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"],D=function(t,e,n){void 0!==e?(t.plugins.legend.display=!!e,e&&!0!==e&&(t.plugins.legend.position=e)):n&&(t.plugins.legend.display=!1)},P=function(t,e){t.plugins.title.display=!0,t.plugins.title.text=e},z=function(t,e){null!==e&&(t.scales.x.min=s(e))},O=function(t,e){t.scales.x.max=s(e)},A=function(t,e){t.scales.x.stacked=!!e,t.scales.y.stacked=!!e},E=function(t,e){t.scales.x.title.display=!0,t.scales.x.title.text=e},L=function(t,e){t.scales.y.title.display=!0,t.scales.y.title.text=e},R=function(t,e){var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?"rgba("+parseInt(n[1],16)+", "+parseInt(n[2],16)+", "+parseInt(n[3],16)+", "+e+")":t},F=function(t){return null!=t},I=function(e,n,i){var r={prefix:e.options.prefix,suffix:e.options.suffix,thousands:e.options.thousands,decimal:e.options.decimal,precision:e.options.precision,round:e.options.round,zeros:e.options.zeros};if(e.options.bytes){var o=e.data;"pie"===i&&(o=[{data:o}]);for(var a=0,s=0;s<o.length;s++)for(var l=o[s],c=0;c<l.data.length;c++)l.data[c][1]>a&&(a=l.data[c][1]);for(var u=1;a>=1024;)u*=1024,a/=1024;r.byteScale=u}if("pie"!==i){var d=n.scales.y;"bar"===i&&(d=n.scales.x),r.byteScale&&(d.ticks.stepSize||(d.ticks.stepSize=r.byteScale/2),d.ticks.maxTicksLimit||(d.ticks.maxTicksLimit=4)),d.ticks.callback||(d.ticks.callback=function(t){return M("",t,r,!0)})}if(!n.plugins.tooltip.callbacks.label)if("scatter"===i)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";return e&&(e+=": "),e+"("+t.label+", "+t.formattedValue+")"};else if("bubble"===i)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";e&&(e+=": ");var n=t.raw;return e+"("+n.x+", "+n.y+", "+n.v+")"};else if("pie"===i)n.plugins.tooltip.callbacks.label=function(e){var n=e.label;return t(n)?(n=n.slice())[0]+=": ":n+=": ",M(n,e.parsed,r)};else{var h="bar"===i?"x":"y";n.plugins.tooltip.callbacks.label=function(t){if(null!==t.parsed[h]){var e=t.dataset.label||"";return e&&(e+=": "),M(e,t.parsed[h],r)}}}},N=u(r(C,T),D,P,(function(t,e){null!==e&&(t.scales.y.min=s(e))}),(function(t,e){t.scales.y.max=s(e)}),A,E,L),H=function(e,n,i){var o,a=[],c=[],u=e.options.colors||S,d=!0,h=!0,v=!0,w=!0,_=!0,M=!0,C=e.data,T=0;if("bubble"===i)for(var D=0;D<C.length;D++)for(var P=C[D],z=0;z<P.data.length;z++)P.data[z][2]>T&&(T=P.data[z][2]);var O,A,E,L,I,N,H,B=[],W=[];if("bar"===i||"column"===i||"number"!==e.xtype&&"bubble"!==e.xtype){var U,V,j=[];for(O=0;O<C.length;O++)for(E=C[O],A=0;A<E.data.length;A++)L=E.data[A],B[I="datetime"==e.xtype?L[0].getTime():L[0]]||(B[I]=new Array(C.length)),B[I][O]=s(L[1]),-1===j.indexOf(I)&&j.push(I);for("datetime"!==e.xtype&&"number"!==e.xtype||j.sort(f),A=0;A<C.length;A++)W.push([]);for(V=0;V<j.length;V++)for(O=j[V],"datetime"===e.xtype?(U=new Date(s(O)),d=d&&m(U),o||(o=U.getDay()),h=h&&b(U,o),v=v&&x(U),w=w&&y(U),_=_&&p(U),M=M&&g(U)):U=O,c.push(U),A=0;A<C.length;A++)W[A].push(void 0===B[O][A]?null:B[O][A])}else for(var Y=0;Y<C.length;Y++){for(var q=C[Y],$=[],X=0;X<q.data.length;X++){var Q={x:s(q.data[X][0]),y:s(q.data[X][1])};"bubble"===i&&(Q.r=20*s(q.data[X][2])/T,Q.v=q.data[X][2]),$.push(Q)}W.push($)}for(O=0;O<C.length;O++){if(E=C[O],!e.options.colors||!e.singleSeriesFormat||"bar"!==i&&"column"!==i||E.color||!t(e.options.colors)||t(e.options.colors[0]))N=E.color||u[O],H="line"!==i?R(N,.5):N;else{N=u,H=[];for(var G=0;G<u.length;G++)H[G]=R(N[G],.5)}var K={label:E.name||"",data:W[O],fill:"area"===i,borderColor:N,backgroundColor:H,borderWidth:2},J="line"===i||"area"===i||"scatter"===i||"bubble"===i;J&&(K.pointBackgroundColor=N,K.pointHoverBackgroundColor=N,K.pointHitRadius=50),"bubble"===i&&(K.pointBackgroundColor=H,K.pointHoverBackgroundColor=H,K.pointHoverBorderWidth=2),E.stack&&(K.stack=E.stack),!1===k(e,E,"curve")?K.tension=0:J&&(K.tension=.4),!1===k(e,E,"points")&&(K.pointRadius=0,K.pointHoverRadius=0),K=r(K,e.options.dataset||{}),K=r(K,E.library||{}),K=r(K,E.dataset||{}),a.push(K)}var Z=e.options.xmin,tt=e.options.xmax;if("datetime"===e.xtype?(F(Z)&&(n.scales.x.ticks.min=l(Z).getTime()),F(tt)&&(n.scales.x.ticks.max=l(tt).getTime())):"number"===e.xtype&&(F(Z)&&(n.scales.x.ticks.min=Z),F(tt)&&(n.scales.x.ticks.max=tt)),"datetime"===e.xtype&&0===c.length&&(F(Z)&&c.push(l(Z)),F(tt)&&c.push(l(tt)),d=!1,h=!1,v=!1,w=!1,_=!1,M=!1),"datetime"===e.xtype&&c.length>0){var et=(F(Z)?l(Z):c[0]).getTime(),nt=(F(tt)?l(tt):c[0]).getTime();for(O=1;O<c.length;O++){var it=c[O].getTime();it<et&&(et=it),it>nt&&(nt=it)}var rt,ot=(nt-et)/864e5;if(!n.scales.x.time.unit&&(w||ot>3650?(n.scales.x.time.unit="year",rt=365):v||ot>300?(n.scales.x.time.unit="month",rt=30):d||ot>10?(n.scales.x.time.unit="day",rt=1):_||ot>.5?(n.scales.x.time.displayFormats={hour:"MMM d, h a"},n.scales.x.time.unit="hour",rt=1/24):M&&(n.scales.x.time.displayFormats={minute:"h:mm a"},n.scales.x.time.unit="minute",rt=1/24/60),rt&&ot>0)){var at=e.element.offsetWidth;if(at>0){var st=Math.ceil(ot/rt/(at/100));h&&1===rt&&(st=7*Math.ceil(st/7)),n.scales.x.time.stepSize=st}}n.scales.x.time.tooltipFormat||(d?n.scales.x.time.tooltipFormat="PP":_?n.scales.x.time.tooltipFormat="MMM d, h a":M&&(n.scales.x.time.tooltipFormat="h:mm a"))}return{labels:c,datasets:a}},B=function(t){this.name="chartjs",this.library=t};B.prototype.renderLineChart=function(t,e){var n={};!t.options.max&&function(t){var e,n,i;for(e=0;e<t.length;e++)for(i=t[e].data,n=0;n<i.length;n++)if(0!=i[n][1])return!1;return!0}(t.data)&&(n.max=1);var i=N(t,r(n,t.options));I(t,i,e);var o=H(t,i,e||"line");"number"===t.xtype?(i.scales.x.type=i.scales.x.type||"linear",i.scales.x.position=i.scales.x.position||"bottom"):i.scales.x.type="string"===t.xtype?"category":"time",this.drawChart(t,"line",o,i)},B.prototype.renderPieChart=function(t){var e=r({},C);t.options.donut&&(e.cutout="50%"),"legend"in t.options&&D(e,t.options.legend),t.options.title&&P(e,t.options.title),e=r(e,t.options.library||{}),I(t,e,"pie");for(var n=[],i=[],o=0;o<t.data.length;o++){var a=t.data[o];n.push(a[0]),i.push(a[1])}var s={data:i,backgroundColor:t.options.colors||S},l={labels:n,datasets:[s=r(s,t.options.dataset||{})]};this.drawChart(t,"pie",l,e)},B.prototype.renderColumnChart=function(t,e){var n;if("bar"===e){var i=r(C,T);i.indexAxis="y",i.scales.x.grid.drawOnChartArea=!0,i.scales.y.grid.drawOnChartArea=!1,delete i.scales.y.ticks.maxTicksLimit,n=u(i,D,P,z,O,A,E,L)(t,t.options)}else n=N(t,t.options);I(t,n,e);var o=H(t,n,"column");"bar"!==e&&function(t,e,n){var i=Math.ceil(t.element.offsetWidth/4/e.labels.length);i>25?i=25:i<10&&(i=10),n.scales.x.ticks.callback||(n.scales.x.ticks.callback=function(t){return(t=a(this.getLabelForValue(t))).length>i?t.substring(0,i-2)+"...":t})}(t,o,n),this.drawChart(t,"bar",o,n)},B.prototype.renderAreaChart=function(t){this.renderLineChart(t,"area")},B.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},B.prototype.renderScatterChart=function(t,e){e=e||"scatter";var n=N(t,t.options);I(t,n,e),"showLine"in n||(n.showLine=!1);var i=H(t,n,e);n.scales.x.type=n.scales.x.type||"linear",n.scales.x.position=n.scales.x.position||"bottom","mode"in n.interaction||(n.interaction.mode="nearest"),this.drawChart(t,e,i,n)},B.prototype.renderBubbleChart=function(t){this.renderScatterChart(t,"bubble")},B.prototype.destroy=function(t){t.chart&&t.chart.destroy()},B.prototype.drawChart=function(t,e,n,i){if(this.destroy(t),!t.destroyed){var r={type:e,data:n,options:i};t.options.code&&window.console.log("new Chart(ctx, "+JSON.stringify(r)+");"),t.element.innerHTML="<canvas></canvas>";var o=t.element.getElementsByTagName("CANVAS")[0];t.chart=new this.library(o,r)}};var W={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!1},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},area:{},series:{marker:{}}},time:{useUTC:!1}},U=function(t,e,n){void 0!==e?(t.legend.enabled=!!e,e&&!0!==e&&("top"===e||"bottom"===e?t.legend.verticalAlign=e:(t.legend.layout="vertical",t.legend.verticalAlign="middle",t.legend.align=e))):n&&(t.legend.enabled=!1)},V=function(t,e){t.title.text=e},j=u(W,U,V,(function(t,e){t.yAxis.min=e}),(function(t,e){t.yAxis.max=e}),(function(t,e){var n=e?!0===e?"normal":e:null;t.plotOptions.series.stacking=n,t.plotOptions.area.stacking=n,t.plotOptions.areaspline.stacking=n}),(function(t,e){t.xAxis.title.text=e}),(function(t,e){t.yAxis.title.text=e})),Y=function(t,e,n){var i={prefix:t.options.prefix,suffix:t.options.suffix,thousands:t.options.thousands,decimal:t.options.decimal,precision:t.options.precision,round:t.options.round,zeros:t.options.zeros};"pie"===n||e.yAxis.labels.formatter||(e.yAxis.labels.formatter=function(){return M("",this.value,i)}),e.tooltip.pointFormatter||e.tooltip.pointFormat||(e.tooltip.pointFormatter=function(){return'<span style="color:'+this.color+'">●</span> '+M(this.series.name+": <b>",this.y,i)+"</b><br/>"})},q=function(t){this.name="highcharts",this.library=t};q.prototype.renderLineChart=function(t,e){var n={};"areaspline"===(e=e||"spline")&&(n={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var i,r,o,a=j(t,t.options,n);"number"===t.xtype?a.xAxis.type=a.xAxis.type||"linear":a.xAxis.type="string"===t.xtype?"category":"datetime",a.chart.type||(a.chart.type=e),Y(t,a,e);var s=t.data;for(r=0;r<s.length;r++){if(s[r].name=s[r].name||"Value",i=s[r].data,"datetime"===t.xtype)for(o=0;o<i.length;o++)i[o][0]=i[o][0].getTime();s[r].marker={symbol:"circle"},!1===t.options.points&&(s[r].marker.enabled=!1)}this.drawChart(t,s,a)},q.prototype.renderScatterChart=function(t){var e=j(t,t.options,{});e.chart.type="scatter",this.drawChart(t,t.data,e)},q.prototype.renderPieChart=function(t){var e=r(W,{});t.options.colors&&(e.colors=t.options.colors),t.options.donut&&(e.plotOptions={pie:{innerSize:"50%"}}),"legend"in t.options&&U(e,t.options.legend),t.options.title&&V(e,t.options.title);var n=r(e,t.options.library||{});Y(t,n,"pie");var i=[{type:"pie",name:t.options.label||"Value",data:t.data}];this.drawChart(t,i,n)},q.prototype.renderColumnChart=function(t,e){e=e||"column";var n,i,r,o,a=t.data,s=j(t,t.options),l=[],c=[];for(s.chart.type=e,Y(t,s,e),n=0;n<a.length;n++)for(r=a[n],i=0;i<r.data.length;i++)l[(o=r.data[i])[0]]||(l[o[0]]=new Array(a.length),c.push(o[0])),l[o[0]][n]=o[1];"number"===t.xtype&&c.sort(f),s.xAxis.categories=c;var u,d=[];for(n=0;n<a.length;n++){for(o=[],i=0;i<c.length;i++)o.push(l[c[i]][n]||0);u={name:a[n].name||"Value",data:o},a[n].stack&&(u.stack=a[n].stack),d.push(u)}this.drawChart(t,d,s)},q.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},q.prototype.renderAreaChart=function(t){this.renderLineChart(t,"areaspline")},q.prototype.destroy=function(t){t.chart&&t.chart.destroy()},q.prototype.drawChart=function(t,e,n){this.destroy(t),t.destroyed||(n.chart.renderTo=t.element.id,n.series=e,t.options.code&&window.console.log("new Highcharts.Chart("+JSON.stringify(n)+");"),t.chart=new this.library.Chart(n))};var $={},X=[],Q={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}},G=function(t,e,n){var i;void 0!==e?(i=e?!0===e?"right":e:"none",t.legend.position=i):n&&(t.legend.position="none")},K=function(t,e){t.title=e,t.titleTextStyle={color:"#333",fontSize:"20px"}},J=function(t,e){t.hAxis.viewWindow.min=e},Z=function(t,e){t.hAxis.viewWindow.max=e},tt=function(t,e){t.isStacked=e||!1},et=function(t,e){t.hAxis.title=e,t.hAxis.titleTextStyle.italic=!1},nt=function(t,e){t.vAxis.title=e,t.vAxis.titleTextStyle.italic=!1},it=u(Q,G,K,(function(t,e){t.vAxis.viewWindow.min=e}),(function(t,e){t.vAxis.viewWindow.max=e}),tt,et,nt),rt=function(t){this.name="google",this.library=t};function ot(t,e){var n,i,r=[];if(i="number"===e?s:"datetime"===e?l:a,"bubble"===e)for(n=0;n<t.length;n++)r.push([s(t[n][0]),s(t[n][1]),s(t[n][2])]);else for(n=0;n<t.length;n++)r.push([i(t[n][0]),s(t[n][1])]);return"datetime"===e?r.sort(d):"number"===e&&r.sort(h),r}function at(t,e){var n,i,r;for(n=0;n<t.length;n++)for(r=c(t[n].data),i=0;i<r.length;i++)if(!e(r[i][0]))return!1;return!0}function st(e,n,i){var r,o=e.options,a=e.rawData;for(e.singleSeriesFormat=!t(a)||"object"!=typeof a[0]||t(a[0]),e.singleSeriesFormat&&(a=[{name:o.label,data:a}]),a=function(t){var e,n,i=[];for(e=0;e<t.length;e++){var r={};for(n in t[e])t[e].hasOwnProperty(n)&&(r[n]=t[e][n]);i.push(r)}return i}(a),r=0;r<a.length;r++)a[r].data=c(a[r].data);for(e.xtype=n||(o.discrete?"string":function(t,e,n){return ct(t)?!n.xmin&&!n.xmax||n.xmin&&!v(n.xmin)||n.xmax&&!v(n.xmax)?"number":"datetime":at(t,w)?"number":!e&&at(t,v)?"datetime":"string"}(a,i,o)),r=0;r<a.length;r++)a[r].data=ot(a[r].data,e.xtype);return a}function lt(t){var e,n=c(t.rawData);for(e=0;e<n.length;e++)n[e]=[a(n[e][0]),s(n[e][1])];return n}function ct(t,e){if("PieChart"===e||"GeoChart"===e||"Timeline"===e)return 0===t.length;for(var n=0;n<t.length;n++)if(t[n].data.length>0)return!1;return!0}function ut(t,e,n){if(t.addEventListener)return t.addEventListener(e,n,!1),n;var i=function(){return n.call(t,window.event)};return t.attachEvent("on"+e,i),i}function dt(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)}function ht(t,e){if(t===e)return!1;for(;e&&e!==t;)e=e.parentNode;return e===t}rt.prototype.renderLineChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={};!1===t.options.curve&&(n.curveType="none"),!1===t.options.points&&(n.pointSize=0);var i=it(t,t.options,n),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"LineChart",r,i)}))},rt.prototype.renderPieChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={chartArea:{top:"10%",height:"80%"},legend:{}};t.options.colors&&(n.colors=t.options.colors),t.options.donut&&(n.pieHole=.5),"legend"in t.options&&G(n,t.options.legend),t.options.title&&K(n,t.options.title);var i=r(r(Q,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number","Value"),o.addRows(t.data),e.drawChart(t,"PieChart",o,i)}))},rt.prototype.renderColumnChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=it(t,t.options),i=e.createDataTable(t.data,t.xtype);e.drawChart(t,"ColumnChart",i,n)}))},rt.prototype.renderBarChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=u(Q,G,K,J,Z,tt,et,nt)(t,t.options,{hAxis:{gridlines:{color:"#ccc"}}}),i=e.createDataTable(t.data,t.xtype);e.drawChart(t,"BarChart",i,n)}))},rt.prototype.renderAreaChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=it(t,t.options,{isStacked:!0,pointSize:0,areaOpacity:.5}),i=e.createDataTable(t.data,t.xtype);e.drawChart(t,"AreaChart",i,n)}))},rt.prototype.renderGeoChart=function(t){var e=this;this.waitForLoaded(t,"geochart",(function(){var n={legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}},i=r(r(Q,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number",t.options.label||"Value"),o.addRows(t.data),e.drawChart(t,"GeoChart",o,i)}))},rt.prototype.renderScatterChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n,i,r,o,a=it(t,t.options,{}),s=t.data,l=[];for(n=0;n<s.length;n++)for(s[n].name=s[n].name||"Value",o=s[n].data,i=0;i<o.length;i++){var c=new Array(s.length+1);c[0]=o[i][0],c[n+1]=o[i][1],l.push(c)}for((r=new e.library.visualization.DataTable).addColumn("number",""),n=0;n<s.length;n++)r.addColumn("number",s[n].name);r.addRows(l),e.drawChart(t,"ScatterChart",r,a)}))},rt.prototype.renderTimeline=function(t){var e=this;this.waitForLoaded(t,"timeline",(function(){var n={legend:"none"};t.options.colors&&(n.colors=t.options.colors);var i=r(r(Q,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn({type:"string",id:"Name"}),o.addColumn({type:"date",id:"Start"}),o.addColumn({type:"date",id:"End"}),o.addRows(t.data),t.element.style.lineHeight="normal",e.drawChart(t,"Timeline",o,i)}))},rt.prototype.destroy=function(t){t.chart&&t.chart.clearChart()},rt.prototype.drawChart=function(t,e,n,i){var r;this.destroy(t),t.destroyed||(t.options.code&&window.console.log("var data = new google.visualization.DataTable("+n.toJSON()+");\nvar chart = new google.visualization."+e+"(element);\nchart.draw(data, "+JSON.stringify(i)+");"),t.chart=new this.library.visualization[e](t.element),r=function(){t.chart.draw(n,i)},window.attachEvent?window.attachEvent("onresize",r):window.addEventListener&&window.addEventListener("resize",r,!0),r())},rt.prototype.waitForLoaded=function(t,e,n){var i=this;if(n||(n=e,e="corechart"),X.push({pack:e,callback:n}),$[e])this.runCallbacks();else{$[e]=!0;var r={packages:[e],callback:function(){i.runCallbacks()}},o=t.__config();o.language&&(r.language=o.language),"geochart"===e&&o.mapsApiKey&&(r.mapsApiKey=o.mapsApiKey),this.library.charts.load("current",r)}},rt.prototype.runCallbacks=function(){for(var t,e=0;e<X.length;e++)t=X[e],this.library.visualization&&("corechart"===t.pack&&this.library.visualization.LineChart||"timeline"===t.pack&&this.library.visualization.Timeline||"geochart"===t.pack&&this.library.visualization.GeoChart)&&(t.callback(),X.splice(e,1),e--)},rt.prototype.createDataTable=function(t,e){var n,i,r,o,l,c=[],u=[];for(n=0;n<t.length;n++)for(r=t[n],t[n].name=t[n].name||"Value",i=0;i<r.data.length;i++)o=r.data[i],c[l="datetime"===e?o[0].getTime():o[0]]||(c[l]=new Array(t.length),u.push(l)),c[l][n]=s(o[1]);var f,g=[],p=!0;for(i=0;i<u.length;i++)n=u[i],"datetime"===e?(f=new Date(s(n)),p=p&&m(f)):f="number"===e?s(n):n,g.push([f].concat(c[n]));if("datetime"===e)g.sort(d);else if("number"===e){for(g.sort(h),n=0;n<g.length;n++)g[n][0]=a(g[n][0]);e="string"}var b=new this.library.visualization.DataTable;for(e="datetime"===e&&p?"date":e,b.addColumn(e,""),n=0;n<t.length;n++)b.addColumn("number",t[n].name);return b.addRows(g),b};var ft=[],gt=0;function pt(){if(gt<4){var t=ft.shift();t&&(gt++,e=t[0],n=t[1],i=t[2],function(t,e,n){var i=window.jQuery||window.Zepto||window.$;if(i&&i.ajax)i.ajax({dataType:"json",url:t,success:e,error:n,complete:mt});else{var r=new XMLHttpRequest;r.open("GET",t,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){mt(),200===r.status?e(JSON.parse(r.responseText),r.statusText,r):n(r,"error",r.statusText)},r.send()}}(e,n,(function(t,e,n){var r="string"==typeof n?n:n.message;i(r)})),pt())}var e,n,i}function mt(){gt--,pt()}var bt={},xt=[];function yt(t,e){document.body.innerText?t.innerText=e:t.textContent=e}function vt(t,e,n){n||(e="Error Loading Chart: "+e),yt(t,e),t.style.color="#ff0000"}function wt(t){try{t.__render()}catch(e){throw vt(t.element,e.message),e}}function _t(t,e,n){if(n&&t.options.loading&&("string"==typeof e||"function"==typeof e)&&yt(t.element,t.options.loading),"string"==typeof e)i=e,r=function(e){t.rawData=e,wt(t)},o=function(e){vt(t.element,e)},ft.push([i,r,o]),pt();else if("function"==typeof e)try{e((function(e){t.rawData=e,wt(t)}),(function(e){vt(t.element,e,!0)}))}catch(e){vt(t.element,e,!0)}else t.rawData=e,wt(t);var i,r,o}function Mt(t){var n=new(function(t){if(t){if("Highcharts"===t.product)return q;if(t.charts)return rt;if(e(t))return B}throw new Error("Unknown adapter")}(t))(t);-1===xt.indexOf(n)&&xt.push(n)}function kt(t,n){if(ct(n.data,t)){var i=n.options.empty||n.options.messages&&n.options.messages.empty||"No data";yt(n.element,i)}else(function(t,n){var i,r,o,a;for((o="render"+t,a=n.options.adapter,"Chart"in window&&Mt(window.Chart),"Highcharts"in window&&Mt(window.Highcharts),window.google&&window.google.charts&&Mt(window.google),i=0);i<xt.length;i++)if(r=xt[i],(!a||a===r.name)&&e(r[o]))return n.adapter=r.name,n.__adapterObject=r,r[o](n);throw xt.length>0?new Error("No charting library found for "+t):new Error("No charting libraries found - be sure to include one before your charts")})(t,n),n.options.download&&!n.__downloadAttached&&"chartjs"===n.adapter&&function(t){var e=t.element,n=document.createElement("a"),i=t.options.download;!0===i?i={}:"string"==typeof i&&(i={filename:i}),n.download=i.filename||"chart.png",n.style.position="absolute",n.style.top="20px",n.style.right="20px",n.style.zIndex=1e3,n.style.lineHeight="20px",n.target="_blank";var r=document.createElement("img");r.alt="Download",r.style.border="none",r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==",n.appendChild(r),e.style.position="relative",t.__downloadAttached=!0,t.__enterEvent=ut(e,"mouseover",(function(r){var o=r.relatedTarget;o&&(o===this||ht(this,o))||!t.options.download||(n.href=t.toImage(i),e.appendChild(n))})),t.__leaveEvent=ut(e,"mouseout",(function(t){var e=t.relatedTarget;e&&(e===this||ht(this,e))||n.parentNode&&n.parentNode.removeChild(n)}))}(n)}var Ct=function(t,e,n){var i;if("string"==typeof t&&(i=t,!(t=document.getElementById(t))))throw new Error("No element with id "+i);this.element=t,this.options=r(Rt.options,n||{}),this.dataSource=e,Rt.charts[t.id]=this,_t(this,e,!0),this.options.refresh&&this.startRefresh()};Ct.prototype.getElement=function(){return this.element},Ct.prototype.getDataSource=function(){return this.dataSource},Ct.prototype.getData=function(){return this.data},Ct.prototype.getOptions=function(){return this.options},Ct.prototype.getChartObject=function(){return this.chart},Ct.prototype.getAdapter=function(){return this.adapter},Ct.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),_t(this,t,!0)},Ct.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()},Ct.prototype.redraw=function(){_t(this,this.rawData)},Ct.prototype.refreshData=function(){if("string"==typeof this.dataSource){var t=-1===this.dataSource.indexOf("?")?"?":"&";_t(this,this.dataSource+t+"_="+(new Date).getTime())}else"function"==typeof this.dataSource&&_t(this,this.dataSource)},Ct.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&"string"!=typeof this.dataSource&&"function"!=typeof this.dataSource)throw new Error("Data source must be a URL or callback for refresh");if(!this.intervalId){if(!e)throw new Error("No refresh interval");this.intervalId=setInterval((function(){t.refreshData()}),1e3*e)}},Ct.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},Ct.prototype.toImage=function(t){if("chartjs"===this.adapter){if(t&&t.background&&"transparent"!==t.background){var e=this.chart.canvas,n=this.chart.ctx,i=document.createElement("canvas"),r=i.getContext("2d");return i.width=n.canvas.width,i.height=n.canvas.height,r.fillStyle=t.background,r.fillRect(0,0,i.width,i.height),r.drawImage(e,0,0),i.toDataURL("image/png")}return this.chart.toBase64Image()}throw new Error("Feature only available for Chart.js")},Ct.prototype.destroy=function(){this.destroyed=!0,this.stopRefresh(),this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&dt(this.element,"mouseover",this.__enterEvent),this.__leaveEvent&&dt(this.element,"mouseout",this.__leaveEvent)},Ct.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=r(Rt.options,t),e&&(this.stopRefresh(),this.startRefresh())},Ct.prototype.__render=function(){this.data=this.__processData(),kt(this.__chartName(),this)},Ct.prototype.__config=function(){return bt};var Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this)},e.prototype.__chartName=function(){return"LineChart"},e}(Ct),St=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return lt(this)},e.prototype.__chartName=function(){return"PieChart"},e}(Ct),Dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,null,!0)},e.prototype.__chartName=function(){return"ColumnChart"},e}(Ct),Pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,null,!0)},e.prototype.__chartName=function(){return"BarChart"},e}(Ct),zt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this)},e.prototype.__chartName=function(){return"AreaChart"},e}(Ct),Ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return lt(this)},e.prototype.__chartName=function(){return"GeoChart"},e}(Ct),At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,"number")},e.prototype.__chartName=function(){return"ScatterChart"},e}(Ct),Et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,"bubble")},e.prototype.__chartName=function(){return"BubbleChart"},e}(Ct),Lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){var t,e=this.rawData;for(t=0;t<e.length;t++)e[t][1]=l(e[t][1]),e[t][2]=l(e[t][2]);return e},e.prototype.__chartName=function(){return"Timeline"},e}(Ct),Rt={LineChart:Tt,PieChart:St,ColumnChart:Dt,BarChart:Pt,AreaChart:zt,GeoChart:Ot,ScatterChart:At,BubbleChart:Et,Timeline:Lt,charts:{},configure:function(t){for(var e in t)t.hasOwnProperty(e)&&(bt[e]=t[e])},setDefaultOptions:function(t){Rt.options=t},eachChart:function(t){for(var e in Rt.charts)Rt.charts.hasOwnProperty(e)&&t(Rt.charts[e])},destroyAll:function(){for(var t in Rt.charts)Rt.charts.hasOwnProperty(t)&&(Rt.charts[t].destroy(),delete Rt.charts[t])},config:bt,options:{},adapters:xt,addAdapter:Mt,use:function(t){return Mt(t),Rt}};return"undefined"==typeof window||window.Chartkick||(window.Chartkick=Rt,document.addEventListener("turbolinks:before-render",(function(){Rt.destroyAll()})),setTimeout((function(){window.dispatchEvent(new Event("chartkick:load"))}),0)),Rt.default=Rt,Rt}()}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=n(616),e=n.n(t);const i="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function r(t,e,n){const r=n||(t=>Array.prototype.slice.call(t));let o=!1,a=[];return function(...n){a=r(n),o||(o=!0,i.call(window,(()=>{o=!1,t.apply(e,a)})))}}const o=t=>"start"===t?"left":"end"===t?"right":"center",a=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;function s(){}const l=function(){let t=0;return function(){return t++}}();function c(t){return null==t}function u(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function d(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const h=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function f(t,e){return h(t)?t:e}function g(t,e){return void 0===t?e:t}const p=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function m(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function b(t,e,n,i){let r,o,a;if(u(t))if(o=t.length,i)for(r=o-1;r>=0;r--)e.call(n,t[r],r);else for(r=0;r<o;r++)e.call(n,t[r],r);else if(d(t))for(a=Object.keys(t),o=a.length,r=0;r<o;r++)e.call(n,t[a[r]],a[r])}function x(t,e){let n,i,r,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(r=t[n],o=e[n],r.datasetIndex!==o.datasetIndex||r.index!==o.index)return!1;return!0}function y(t){if(u(t))return t.map(y);if(d(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let r=0;for(;r<i;++r)e[n[r]]=y(t[n[r]]);return e}return t}function v(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function w(t,e,n,i){if(!v(t))return;const r=e[t],o=n[t];d(r)&&d(o)?_(r,o,i):e[t]=y(o)}function _(t,e,n){const i=u(e)?e:[e],r=i.length;if(!d(t))return t;const o=(n=n||{}).merger||w;for(let a=0;a<r;++a){if(!d(e=i[a]))continue;const r=Object.keys(e);for(let i=0,a=r.length;i<a;++i)o(r[i],t,e,n)}return t}function M(t,e){return _(t,e,{merger:k})}function k(t,e,n){if(!v(t))return;const i=e[t],r=n[t];d(i)&&d(r)?M(i,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=y(r))}function C(t,e){const n=t.indexOf(".",e);return-1===n?t.length:n}function T(t,e){if(""===e)return t;let n=0,i=C(e,n);for(;t&&i>n;)t=t[e.substr(n,i-n)],n=i+1,i=C(e,n);return t}function S(t){return t.charAt(0).toUpperCase()+t.slice(1)}const D=t=>void 0!==t,P=t=>"function"==typeof t,z=Math.PI,O=2*z,A=O+z,E=Number.POSITIVE_INFINITY,L=z/180,R=z/2,F=z/4,I=2*z/3,N=Math.log10,H=Math.sign;function B(t){const e=Math.round(t);t=U(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(N(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function W(t){return!isNaN(parseFloat(t))&&isFinite(t)}function U(t,e,n){return Math.abs(t-e)<n}function V(t,e,n){let i,r,o;for(i=0,r=t.length;i<r;i++)o=t[i][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function j(t){return t*(z/180)}function Y(t){return t*(180/z)}function q(t){if(!h(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function $(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function X(t,e){return(t-e+A)%O-z}function Q(t){return(t%O+O)%O}function G(t,e,n,i){const r=Q(t),o=Q(e),a=Q(n),s=Q(o-r),l=Q(a-r),c=Q(r-o),u=Q(r-a);return r===o||r===a||i&&o===a||s>l&&c<u}function K(t,e,n){return Math.max(e,Math.min(n,t))}const J=t=>0===t||1===t,Z=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*O/n),tt=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*O/n)+1,et={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*R),easeOutSine:t=>Math.sin(t*R),easeInOutSine:t=>-.5*(Math.cos(z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>J(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>J(t)?t:Z(t,.075,.3),easeOutElastic:t=>J(t)?t:tt(t,.075,.3),easeInOutElastic(t){const e=.1125;return J(t)?t:t<.5?.5*Z(2*t,e,.45):.5+.5*tt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-et.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*et.easeInBounce(2*t):.5*et.easeOutBounce(2*t-1)+.5},nt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},it="0123456789ABCDEF",rt=t=>it[15&t],ot=t=>it[(240&t)>>4]+it[15&t],at=t=>(240&t)>>4==(15&t);function st(t){return t+.5|0}const lt=(t,e,n)=>Math.max(Math.min(t,n),e);function ct(t){return lt(st(2.55*t),0,255)}function ut(t){return lt(st(255*t),0,255)}function dt(t){return lt(st(t/2.55)/100,0,1)}function ht(t){return lt(st(100*t),0,100)}const ft=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,gt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function pt(t,e,n){const i=e*Math.min(n,1-n),r=(e,r=(e+t/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function mt(t,e,n){const i=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function bt(t,e,n){const i=pt(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function xt(t){const e=t.r/255,n=t.g/255,i=t.b/255,r=Math.max(e,n,i),o=Math.min(e,n,i),a=(r+o)/2;let s,l,c;return r!==o&&(c=r-o,l=a>.5?c/(2-r-o):c/(r+o),s=r===e?(n-i)/c+(n<i?6:0):r===n?(i-e)/c+2:(e-n)/c+4,s=60*s+.5),[0|s,l||0,a]}function yt(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(ut)}function vt(t,e,n){return yt(pt,t,e,n)}function wt(t){return(t%360+360)%360}const _t={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Mt={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let kt;function Ct(t,e,n){if(t){let i=xt(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,0===e?360:1)),i=vt(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function Tt(t,e){return t?Object.assign(e||{},t):t}function St(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=ut(t[3]))):(e=Tt(t,{r:0,g:0,b:0,a:1})).a=ut(e.a),e}function Dt(t){return"r"===t.charAt(0)?function(t){const e=ft.exec(t);let n,i,r,o=255;if(e){if(e[7]!==n){const t=+e[7];o=255&(e[8]?ct(t):255*t)}return n=+e[1],i=+e[3],r=+e[5],n=255&(e[2]?ct(n):n),i=255&(e[4]?ct(i):i),r=255&(e[6]?ct(r):r),{r:n,g:i,b:r,a:o}}}(t):function(t){const e=gt.exec(t);let n,i=255;if(!e)return;e[5]!==n&&(i=e[6]?ct(+e[5]):ut(+e[5]));const r=wt(+e[2]),o=+e[3]/100,a=+e[4]/100;return n="hwb"===e[1]?function(t,e,n){return yt(bt,t,e,n)}(r,o,a):"hsv"===e[1]?function(t,e,n){return yt(mt,t,e,n)}(r,o,a):vt(r,o,a),{r:n[0],g:n[1],b:n[2],a:i}}(t)}class Pt{constructor(t){if(t instanceof Pt)return t;const e=typeof t;let n;var i,r,o;"object"===e?n=St(t):"string"===e&&(o=(i=t).length,"#"===i[0]&&(4===o||5===o?r={r:255&17*nt[i[1]],g:255&17*nt[i[2]],b:255&17*nt[i[3]],a:5===o?17*nt[i[4]]:255}:7!==o&&9!==o||(r={r:nt[i[1]]<<4|nt[i[2]],g:nt[i[3]]<<4|nt[i[4]],b:nt[i[5]]<<4|nt[i[6]],a:9===o?nt[i[7]]<<4|nt[i[8]]:255})),n=r||function(t){kt||(kt=function(){const t={},e=Object.keys(Mt),n=Object.keys(_t);let i,r,o,a,s;for(i=0;i<e.length;i++){for(a=s=e[i],r=0;r<n.length;r++)o=n[r],s=s.replace(o,_t[o]);o=parseInt(Mt[a],16),t[s]=[o>>16&255,o>>8&255,255&o]}return t}(),kt.transparent=[0,0,0,0]);const e=kt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Dt(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Tt(this._rgb);return t&&(t.a=dt(t.a)),t}set rgb(t){this._rgb=St(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${dt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return at(t.r)&&at(t.g)&&at(t.b)&&at(t.a)}(t)?rt:ot,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=xt(t),n=e[0],i=ht(e[1]),r=ht(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${r}%, ${dt(t.a)})`:`hsl(${n}, ${i}%, ${r}%)`}(this._rgb):this._rgb}mix(t,e){const n=this;if(t){const i=n.rgb,r=t.rgb;let o;const a=e===o?.5:e,s=2*a-1,l=i.a-r.a,c=((s*l==-1?s:(s+l)/(1+s*l))+1)/2;o=1-c,i.r=255&c*i.r+o*r.r+.5,i.g=255&c*i.g+o*r.g+.5,i.b=255&c*i.b+o*r.b+.5,i.a=a*i.a+(1-a)*r.a,n.rgb=i}return n}clone(){return new Pt(this.rgb)}alpha(t){return this._rgb.a=ut(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=st(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ct(this._rgb,2,t),this}darken(t){return Ct(this._rgb,2,-t),this}saturate(t){return Ct(this._rgb,1,t),this}desaturate(t){return Ct(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=xt(t);n[0]=wt(n[0]+e),n=vt(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function zt(t){return new Pt(t)}const Ot=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function At(t){return Ot(t)?t:zt(t)}function Et(t){return Ot(t)?t:zt(t).saturate(.5).darken(.1).hexString()}const Lt=Object.create(null),Rt=Object.create(null);function Ft(t,e){if(!e)return t;const n=e.split(".");for(let e=0,i=n.length;e<i;++e){const i=n[e];t=t[i]||(t[i]=Object.create(null))}return t}function It(t,e,n){return"string"==typeof e?_(Ft(t,e),n):_(Ft(t,""),e)}var Nt=new class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Et(e.backgroundColor),this.hoverBorderColor=(t,e)=>Et(e.borderColor),this.hoverColor=(t,e)=>Et(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.describe(t)}set(t,e){return It(this,t,e)}get(t){return Ft(this,t)}describe(t,e){return It(Rt,t,e)}override(t,e){return It(Lt,t,e)}route(t,e,n,i){const r=Ft(this,t),o=Ft(this,n),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[i];return d(t)?Object.assign({},e,t):g(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Ht(t,e,n,i,r){let o=e[r];return o||(o=e[r]=t.measureText(r).width,n.push(r)),o>i&&(i=o),i}function Bt(t,e,n,i){let r=(i=i||{}).data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},o=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let a=0;const s=n.length;let l,c,d,h,f;for(l=0;l<s;l++)if(h=n[l],null!=h&&!0!==u(h))a=Ht(t,r,o,a,h);else if(u(h))for(c=0,d=h.length;c<d;c++)f=h[c],null==f||u(f)||(a=Ht(t,r,o,a,f));t.restore();const g=o.length/2;if(g>n.length){for(l=0;l<g;l++)delete r[o[l]];o.splice(0,g)}return a}function Wt(t,e,n){const i=t.currentDevicePixelRatio,r=0!==n?Math.max(n/2,.5):0;return Math.round((e-r)*i)/i+r}function Ut(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Vt(t,e,n,i){let r,o,a,s,l;const c=e.pointStyle,u=e.rotation,d=e.radius;let h=(u||0)*L;if(c&&"object"==typeof c&&(r=c.toString(),"[object HTMLImageElement]"===r||"[object HTMLCanvasElement]"===r))return t.save(),t.translate(n,i),t.rotate(h),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),c){default:t.arc(n,i,d,0,O),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(h)*d,i-Math.cos(h)*d),h+=I,t.lineTo(n+Math.sin(h)*d,i-Math.cos(h)*d),h+=I,t.lineTo(n+Math.sin(h)*d,i-Math.cos(h)*d),t.closePath();break;case"rectRounded":l=.516*d,s=d-l,o=Math.cos(h+F)*s,a=Math.sin(h+F)*s,t.arc(n-o,i-a,l,h-z,h-R),t.arc(n+a,i-o,l,h-R,h),t.arc(n+o,i+a,l,h,h+R),t.arc(n-a,i+o,l,h+R,h+z),t.closePath();break;case"rect":if(!u){s=Math.SQRT1_2*d,t.rect(n-s,i-s,2*s,2*s);break}h+=F;case"rectRot":o=Math.cos(h)*d,a=Math.sin(h)*d,t.moveTo(n-o,i-a),t.lineTo(n+a,i-o),t.lineTo(n+o,i+a),t.lineTo(n-a,i+o),t.closePath();break;case"crossRot":h+=F;case"cross":o=Math.cos(h)*d,a=Math.sin(h)*d,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a),t.moveTo(n+a,i-o),t.lineTo(n-a,i+o);break;case"star":o=Math.cos(h)*d,a=Math.sin(h)*d,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a),t.moveTo(n+a,i-o),t.lineTo(n-a,i+o),h+=F,o=Math.cos(h)*d,a=Math.sin(h)*d,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a),t.moveTo(n+a,i-o),t.lineTo(n-a,i+o);break;case"line":o=Math.cos(h)*d,a=Math.sin(h)*d,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(h)*d,i+Math.sin(h)*d)}t.fill(),e.borderWidth>0&&t.stroke()}}function jt(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Yt(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function qt(t){t.restore()}function $t(t,e,n,i,r){if(!e)return t.lineTo(n.x,n.y);if("middle"===r){const i=(e.x+n.x)/2;t.lineTo(i,e.y),t.lineTo(i,n.y)}else"after"===r!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function Xt(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Qt(t,e,n,i,r,o={}){const a=u(e)?e:[e],s=o.strokeWidth>0&&""!==o.strokeColor;let l,d;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),c(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<a.length;++l)d=a[l],s&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),c(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(d,n,i,o.maxWidth)),t.fillText(d,n,i,o.maxWidth),Gt(t,n,i,d,o),i+=r.lineHeight;t.restore()}function Gt(t,e,n,i,r){if(r.strikethrough||r.underline){const o=t.measureText(i),a=e-o.actualBoundingBoxLeft,s=e+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(a,u),t.lineTo(s,u),t.stroke()}}function Kt(t,e){const{x:n,y:i,w:r,h:o,radius:a}=e;t.arc(n+a.topLeft,i+a.topLeft,a.topLeft,-R,z,!0),t.lineTo(n,i+o-a.bottomLeft),t.arc(n+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,z,R,!0),t.lineTo(n+r-a.bottomRight,i+o),t.arc(n+r-a.bottomRight,i+o-a.bottomRight,a.bottomRight,R,0,!0),t.lineTo(n+r,i+a.topRight),t.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-R,!0),t.lineTo(n+a.topLeft,i)}const Jt=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Zt=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function te(t,e){const n=(""+t).match(Jt);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}function ee(t,e){const n={},i=d(e),r=i?Object.keys(e):e,o=d(t)?i?n=>g(t[n],t[e[n]]):e=>t[e]:()=>t;for(const t of r)n[t]=+o(t)||0;return n}function ne(t){return ee(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ie(t){return ee(t,["topLeft","topRight","bottomLeft","bottomRight"])}function re(t){const e=ne(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function oe(t,e){t=t||{},e=e||Nt.font;let n=g(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let i=g(t.style,e.style);i&&!(""+i).match(Zt)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const r={family:g(t.family,e.family),lineHeight:te(g(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:g(t.weight,e.weight),string:""};return r.string=function(t){return!t||c(t.size)||c(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function ae(t,e,n,i){let r,o,a,s=!0;for(r=0,o=t.length;r<o;++r)if(a=t[r],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),s=!1),void 0!==n&&u(a)&&(a=a[n%a.length],s=!1),void 0!==a))return i&&!s&&(i.cacheable=!1),a}function se(t,e,n){n=n||(n=>t[n]<e);let i,r=t.length-1,o=0;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const le=(t,e,n)=>se(t,n,(i=>t[i][e]<n)),ce=(t,e,n)=>se(t,n,(i=>t[i][e]>=n)),ue=["push","pop","shift","splice","unshift"];function de(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(ue.forEach((e=>{delete t[e]})),delete t._chartjs)}function he(t){const e=new Set;let n,i;for(n=0,i=t.length;n<i;++n)e.add(t[n]);return e.size===i?t:Array.from(e)}function fe(t,e=[""],n=t,i,r=(()=>t[0])){D(i)||(i=ke("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:i,_getTarget:r,override:r=>fe([r,...t],e,n,i)};return new Proxy(o,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,i)=>xe(n,i,(()=>function(t,e,n,i){let r;for(const o of e)if(r=ke(me(o,t),n),D(r))return be(t,r)?_e(n,i,t,r):r}(i,e,t,n))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Ce(t).includes(e),ownKeys:t=>Ce(t),set:(t,e,n)=>((t._storage||(t._storage=r()))[e]=n,delete t[e],delete t._keys,!0)})}function ge(t,e,n,i){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:pe(t,i),setContext:e=>ge(t,e,n,i),override:r=>ge(t.override(r),e,n,i)};return new Proxy(r,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>xe(t,e,(()=>function(t,e,n){const{_proxy:i,_context:r,_subProxy:o,_descriptors:a}=t;let s=i[e];return P(s)&&a.isScriptable(e)&&(s=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:a,_stack:s}=n;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);return s.add(t),e=e(o,a||i),s.delete(t),d(e)&&(e=_e(r._scopes,r,t,e)),e}(e,s,t,n)),u(s)&&s.length&&(s=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:a,_descriptors:s}=n;if(D(o.index)&&i(t))e=e[o.index%e.length];else if(d(e[0])){const n=e,i=r._scopes.filter((t=>t!==n));e=[];for(const l of n){const n=_e(i,r,t,l);e.push(ge(n,o,a&&a[t],s))}}return e}(e,s,t,a.isIndexable)),be(e,s)&&(s=ge(s,r,o&&o[e],a)),s}(t,e,n))),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,i)=>(t[n]=i,delete e[n],!0)})}function pe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:i,isScriptable:P(n)?n:()=>n,isIndexable:P(i)?i:()=>i}}const me=(t,e)=>t?t+S(e):e,be=(t,e)=>d(e)&&"adapters"!==t;function xe(t,e,n){let i=t[e];return D(i)||(i=n(),D(i)&&(t[e]=i)),i}function ye(t,e,n){return P(t)?t(e,n):t}const ve=(t,e)=>!0===t?e:"string"==typeof t?T(e,t):void 0;function we(t,e,n,i){for(const r of e){const e=ve(n,r);if(e){t.add(e);const r=ye(e._fallback,n,e);if(D(r)&&r!==n&&r!==i)return r}else if(!1===e&&D(i)&&n!==i)return null}return!1}function _e(t,e,n,i){const r=e._rootScopes,o=ye(e._fallback,n,i),a=[...t,...r],s=new Set;s.add(i);let l=Me(s,a,n,o||n);return null!==l&&(!D(o)||o===n||(l=Me(s,a,o,l),null!==l))&&fe(Array.from(s),[""],r,o,(()=>function(t,e,n){const i=t._getTarget();e in i||(i[e]={});const r=i[e];return u(r)&&d(n)?n:r}(e,n,i)))}function Me(t,e,n,i){for(;n;)n=we(t,e,n,i);return n}function ke(t,e){for(const n of e){if(!n)continue;const e=n[t];if(D(e))return e}}function Ce(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const Te=Number.EPSILON||1e-14,Se=(t,e)=>e<t.length&&!t[e].skip&&t[e],De=t=>"x"===t?"y":"x";function Pe(t,e,n,i){const r=t.skip?e:t,o=e,a=n.skip?e:n,s=$(o,r),l=$(a,o);let c=s/(s+l),u=l/(s+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:o.x-d*(a.x-r.x),y:o.y-d*(a.y-r.y)},next:{x:o.x+h*(a.x-r.x),y:o.y+h*(a.y-r.y)}}}function ze(t,e,n){return Math.max(Math.min(t,n),e)}function Oe(t,e,n,i,r){let o,a,s,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const n=De(e),i=t.length,r=Array(i).fill(0),o=Array(i);let a,s,l,c=Se(t,0);for(a=0;a<i;++a)if(s=l,l=c,c=Se(t,a+1),l){if(c){const t=c[e]-l[e];r[a]=0!==t?(c[n]-l[n])/t:0}o[a]=s?c?H(r[a-1])!==H(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}!function(t,e,n){const i=t.length;let r,o,a,s,l,c=Se(t,0);for(let u=0;u<i-1;++u)l=c,c=Se(t,u+1),l&&c&&(U(e[u],0,Te)?n[u]=n[u+1]=0:(r=n[u]/e[u],o=n[u+1]/e[u],s=Math.pow(r,2)+Math.pow(o,2),s<=9||(a=3/Math.sqrt(s),n[u]=r*a*e[u],n[u+1]=o*a*e[u])))}(t,r,o),function(t,e,n="x"){const i=De(n),r=t.length;let o,a,s,l=Se(t,0);for(let c=0;c<r;++c){if(a=s,s=l,l=Se(t,c+1),!s)continue;const r=s[n],u=s[i];a&&(o=(r-a[n])/3,s[`cp1${n}`]=r-o,s[`cp1${i}`]=u-o*e[c]),l&&(o=(l[n]-r)/3,s[`cp2${n}`]=r+o,s[`cp2${i}`]=u+o*e[c])}}(t,o,e)}(t,r);else{let n=i?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)s=t[o],l=Pe(n,s,t[Math.min(o+1,a-(i?0:1))%a],e.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,n=s}e.capBezierPoints&&function(t,e){let n,i,r,o,a,s=jt(t[0],e);for(n=0,i=t.length;n<i;++n)a=o,o=s,s=n<i-1&&jt(t[n+1],e),o&&(r=t[n],a&&(r.cp1x=ze(r.cp1x,e.left,e.right),r.cp1y=ze(r.cp1y,e.top,e.bottom)),s&&(r.cp2x=ze(r.cp2x,e.left,e.right),r.cp2y=ze(r.cp2y,e.top,e.bottom)))}(t,n)}function Ae(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Ee(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Le(t,e,n){let i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}const Re=t=>window.getComputedStyle(t,null),Fe=["top","right","bottom","left"];function Ie(t,e,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const o=Fe[r];i[o]=parseFloat(t[e+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function Ne(t,e){const{canvas:n,currentDevicePixelRatio:i}=e,r=Re(n),o="border-box"===r.boxSizing,a=Ie(r,"padding"),s=Ie(r,"border","width"),{x:l,y:c,box:u}=function(t,e){const n=t.native||t,i=n.touches,r=i&&i.length?i[0]:n,{offsetX:o,offsetY:a}=r;let s,l,c=!1;if(((t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot))(o,a,n.target))s=o,l=a;else{const t=e.getBoundingClientRect();s=r.clientX-t.left,l=r.clientY-t.top,c=!0}return{x:s,y:l,box:c}}(t,n),d=a.left+(u&&s.left),h=a.top+(u&&s.top);let{width:f,height:g}=e;return o&&(f-=a.width+s.width,g-=a.height+s.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/g*n.height/i)}}const He=t=>Math.round(10*t)/10;function Be(t,e,n){const i=e||1,r=Math.floor(t.height*i),o=Math.floor(t.width*i);t.height=r/i,t.width=o/i;const a=t.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==i||a.height!==r||a.width!==o)&&(t.currentDevicePixelRatio=i,a.height=r,a.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0)}const We=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ue(t,e){const n=function(t,e){return Re(t).getPropertyValue(e)}(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ve(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function je(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:"middle"===i?n<.5?t.y:e.y:"after"===i?n<1?t.y:e.y:n>0?e.y:t.y}}function Ye(t,e,n,i){const r={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=Ve(t,r,n),s=Ve(r,o,n),l=Ve(o,e,n),c=Ve(a,s,n),u=Ve(s,l,n);return Ve(c,u,n)}const qe=new Map;function $e(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let i=qe.get(n);return i||(i=new Intl.NumberFormat(t,e),qe.set(n,i)),i}(e,n).format(t)}function Xe(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Qe(t,e){let n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function Ge(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ke(t){return"angle"===t?{between:G,compare:X,normalize:Q}:{between:(t,e,n)=>t>=Math.min(e,n)&&t<=Math.max(n,e),compare:(t,e)=>t-e,normalize:t=>t}}function Je({start:t,end:e,count:n,loop:i,style:r}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n==0,style:r}}function Ze(t,e,n){if(!n)return[t];const{property:i,start:r,end:o}=n,a=e.length,{compare:s,between:l,normalize:c}=Ke(i),{start:u,end:d,loop:h,style:f}=function(t,e,n){const{property:i,start:r,end:o}=n,{between:a,normalize:s}=Ke(i),l=e.length;let c,u,{start:d,end:h,loop:f}=t;if(f){for(d+=l,h+=l,c=0,u=l;c<u&&a(s(e[d%l][i]),r,o);++c)d--,h--;d%=l,h%=l}return h<d&&(h+=l),{start:d,end:h,loop:f,style:t.style}}(t,e,n),g=[];let p,m,b,x=!1,y=null;for(let t=u,n=u;t<=d;++t)m=e[t%a],m.skip||(p=c(m[i]),p!==b&&(x=l(p,r,o),null===y&&(x||l(r,b,p)&&0!==s(r,b))&&(y=0===s(p,r)?t:n),null!==y&&(!x||0===s(o,p)||l(o,b,p))&&(g.push(Je({start:y,end:t,loop:h,count:a,style:f})),y=null),n=t,b=p));return null!==y&&g.push(Je({start:y,end:d,loop:h,count:a,style:f})),g}function tn(t,e){const n=[],i=t.segments;for(let r=0;r<i.length;r++){const o=Ze(i[r],t.points,e);o.length&&n.push(...o)}return n}function en(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function nn(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var rn=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const r=e.listeners[i],o=e.duration;r.forEach((i=>i({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)})))}_refresh(){const t=this;t._request||(t._running=!0,t._request=i.call(window,(()=>{t._update(),t._request=null,t._running&&t._refresh()})))}_update(t=Date.now()){const e=this;let n=0;e._charts.forEach(((i,r)=>{if(!i.running||!i.items.length)return;const o=i.items;let a,s=o.length-1,l=!1;for(;s>=0;--s)a=o[s],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),l=!0):(o[s]=o[o.length-1],o.pop());l&&(r.draw(),e._notify(r,i,t,"progress")),o.length||(i.running=!1,e._notify(r,i,t,"complete"),i.initial=!1),n+=o.length})),e._lastDate=t,0===n&&(e._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const on="transparent",an={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=At(t||on),r=i.valid&&At(e||on);return r&&r.valid?r.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class sn{constructor(t,e,n,i){const r=e[n];i=ae([t.to,i,r,t.from]);const o=ae([t.from,r,i]);this._active=!0,this._fn=t.fn||an[t.type||typeof o],this._easing=et[t.easing]||et.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){const i=this;if(i._active){i._notify(!1);const r=i._target[i._prop],o=n-i._start,a=i._duration-o;i._start=n,i._duration=Math.floor(Math.max(a,t.duration)),i._total+=o,i._loop=!!t.loop,i._to=ae([t.to,e,r,t.from]),i._from=ae([t.from,r,e])}}cancel(){const t=this;t._active&&(t.tick(Date.now()),t._active=!1,t._notify(!1))}tick(t){const e=this,n=t-e._start,i=e._duration,r=e._prop,o=e._from,a=e._loop,s=e._to;let l;if(e._active=o!==s&&(a||n<i),!e._active)return e._target[r]=s,void e._notify(!0);n<0?e._target[r]=o:(l=n/i%2,l=a&&l>1?2-l:l,l=e._easing(Math.min(1,Math.max(0,l))),e._target[r]=e._fn(o,s,l))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,n)=>{t.push({res:e,rej:n})}))}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}Nt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const ln=Object.keys(Nt.animation);Nt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Nt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Nt.describe("animations",{_fallback:"animation"}),Nt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class cn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!d(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const i=t[n];if(!d(i))return;const r={};for(const t of ln)r[t]=i[t];(u(i.properties)&&i.properties||[n]).forEach((t=>{t!==n&&e.has(t)||e.set(t,r)}))}))}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(n)return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;t.options=e}(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e<i.length;e++){const r=t[i[e]];r&&r.active()&&n.push(r.wait())}return Promise.all(n)}(t.options.$animations,n).then((()=>{t.options=n}),(()=>{})),r}_createAnimations(t,e){const n=this._properties,i=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let s;for(s=o.length-1;s>=0;--s){const l=o[s];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(t,e));continue}const c=e[l];let u=r[l];const d=n.get(l);if(u){if(d&&u.active()){u.update(d,c,a);continue}u.cancel()}d&&d.duration?(r[l]=u=new sn(d,t,l,c),i.push(u)):t[l]=c}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(rn.add(this._chart,n),!0):void 0}}function un(t,e){const n=t&&t.options||{},i=n.reverse,r=void 0===n.min?e:0,o=void 0===n.max?e:0;return{start:i?o:r,end:i?r:o}}function dn(t,e){const n=[],i=t._getSortedDatasetMetas(e);let r,o;for(r=0,o=i.length;r<o;++r)n.push(i[r].index);return n}function hn(t,e,n,i){const r=t.keys,o="single"===i.mode;let a,s,l,c;if(null!==e){for(a=0,s=r.length;a<s;++a){if(l=+r[a],l===n){if(i.all)continue;break}c=t.values[l],h(c)&&(o||0===e||H(e)===H(c))&&(e+=c)}return e}}function fn(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function gn(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function pn(t,e,n){for(const i of e.getMatchingVisibleMetas("bar").reverse()){const e=t[i.index];if(n&&e>0||!n&&e<0)return i.index}return null}function mn(t,e){const{chart:n,_cachedMeta:i}=t,r=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=i,l=o.axis,c=a.axis,u=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(o,a,i),d=e.length;let h;for(let t=0;t<d;++t){const n=e[t],{[l]:i,[c]:o}=n;h=(n._stacks||(n._stacks={}))[c]=gn(r,u,i),h[s]=o,h._top=pn(h,a,!0),h._bottom=pn(h,a,!1)}}function bn(t,e){const n=t.scales;return Object.keys(n).filter((t=>n[t].axis===e)).shift()}function xn(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n]}}}const yn=t=>"reset"===t||"none"===t,vn=(t,e)=>e?t:Object.assign({},t);class wn{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this,e=t._cachedMeta;t.configure(),t.linkScales(),e._stacked=fn(e.vScale,e),t.addElements()}updateIndex(t){this.index!==t&&xn(this._cachedMeta),this.index=t}linkScales(){const t=this,e=t.chart,n=t._cachedMeta,i=t.getDataset(),r=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,o=n.xAxisID=g(i.xAxisID,bn(e,"x")),a=n.yAxisID=g(i.yAxisID,bn(e,"y")),s=n.rAxisID=g(i.rAxisID,bn(e,"r")),l=n.indexAxis,c=n.iAxisID=r(l,o,a,s),u=n.vAxisID=r(l,a,o,s);n.xScale=t.getScaleForId(o),n.yScale=t.getScaleForId(a),n.rScale=t.getScaleForId(s),n.iScale=t.getScaleForId(c),n.vScale=t.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&de(this._data,this),t._stacked&&xn(t)}_dataCheck(){const t=this,e=t.getDataset(),n=e.data||(e.data=[]),i=t._data;if(d(n))t._data=function(t){const e=Object.keys(t),n=new Array(e.length);let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i],n[i]={x:o,y:t[o]};return n}(n);else if(i!==n){if(i){de(i,t);const e=t._cachedMeta;xn(e),e._parsed=[]}n&&Object.isExtensible(n)&&(o=t,(r=n)._chartjs?r._chartjs.listeners.push(o):(Object.defineProperty(r,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[o]}}),ue.forEach((t=>{const e="_onData"+S(t),n=r[t];Object.defineProperty(r,t,{configurable:!0,enumerable:!1,value(...t){const i=n.apply(this,t);return r._chartjs.listeners.forEach((n=>{"function"==typeof n[e]&&n[e](...t)})),i}})})))),t._syncList=[],t._data=n}var r,o}addElements(){const t=this,e=t._cachedMeta;t._dataCheck(),t.datasetElementType&&(e.dataset=new t.datasetElementType)}buildOrUpdateElements(t){const e=this,n=e._cachedMeta,i=e.getDataset();let r=!1;e._dataCheck();const o=n._stacked;n._stacked=fn(n.vScale,n),n.stack!==i.stack&&(r=!0,xn(n),n.stack=i.stack),e._resyncElements(t),(r||o!==n._stacked)&&mn(e,n._parsed)}configure(){const t=this,e=t.chart.config,n=e.datasetScopeKeys(t._type),i=e.getOptionScopes(t.getDataset(),n,!0);t.options=e.createResolver(i,t.getContext()),t._parsing=t.options.parsing}parse(t,e){const n=this,{_cachedMeta:i,_data:r}=n,{iScale:o,_stacked:a}=i,s=o.axis;let l,c,h,f=0===t&&e===r.length||i._sorted,g=t>0&&i._parsed[t-1];if(!1===n._parsing)i._parsed=r,i._sorted=!0,h=r;else{h=u(r[t])?n.parseArrayData(i,r,t,e):d(r[t])?n.parseObjectData(i,r,t,e):n.parsePrimitiveData(i,r,t,e);const o=()=>null===c[s]||g&&c[s]<g[s];for(l=0;l<e;++l)i._parsed[l+t]=c=h[l],f&&(o()&&(f=!1),g=c);i._sorted=f}a&&mn(n,h)}parsePrimitiveData(t,e,n,i){const{iScale:r,vScale:o}=t,a=r.axis,s=o.axis,l=r.getLabels(),c=r===o,u=new Array(i);let d,h,f;for(d=0,h=i;d<h;++d)f=d+n,u[d]={[a]:c||r.parse(l[f],f),[s]:o.parse(e[f],f)};return u}parseArrayData(t,e,n,i){const{xScale:r,yScale:o}=t,a=new Array(i);let s,l,c,u;for(s=0,l=i;s<l;++s)c=s+n,u=e[c],a[s]={x:r.parse(u[0],c),y:o.parse(u[1],c)};return a}parseObjectData(t,e,n,i){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(i);let c,u,d,h;for(c=0,u=i;c<u;++c)d=c+n,h=e[d],l[c]={x:r.parse(T(h,a),d),y:o.parse(T(h,s),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const i=this.chart,r=this._cachedMeta,o=e[t.axis];return hn({keys:dn(i,!0),values:e._stacks[t.axis]},o,r.index,{mode:n})}updateRangeFromParsed(t,e,n,i){const r=n[e.axis];let o=null===r?NaN:r;const a=i&&n._stacks[e.axis];i&&a&&(i.values=a,t.min=Math.min(t.min,o),t.max=Math.max(t.max,o),o=hn(i,r,this._cachedMeta.index,{all:!0})),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this,i=n._cachedMeta,r=i._parsed,o=i._sorted&&t===i.iScale,a=r.length,s=n._getOtherScale(t),l=e&&i._stacked&&{keys:dn(n.chart,!0),values:null},c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=function(t){const{min:e,max:n,minDefined:i,maxDefined:r}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}(s);let f,g,p,m;function b(){return p=r[f],g=p[t.axis],m=p[s.axis],!h(g)||u>m||d<m}for(f=0;f<a&&(b()||(n.updateRangeFromParsed(c,t,p,l),!o));++f);if(o)for(f=a-1;f>=0;--f)if(!b()){n.updateRangeFromParsed(c,t,p,l);break}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i][t.axis],h(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,i=e.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){const e=this,n=e._cachedMeta;e.configure(),e._cachedDataOpts={},e.update(t||"default"),n._clip=function(t){let e,n,i,r;return d(t)?(e=t.top,n=t.right,i=t.bottom,r=t.left):e=n=i=r=t,{top:e,right:n,bottom:i,left:r,disabled:!1===t}}(g(e.options.clip,function(t,e,n){if(!1===n)return!1;const i=un(t,n),r=un(e,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}(n.xScale,n.yScale,e.getMaxOverflow())))}update(t){}draw(){const t=this,e=t._ctx,n=t.chart,i=t._cachedMeta,r=i.data||[],o=n.chartArea,a=[],s=t._drawStart||0,l=t._drawCount||r.length-s;let c;for(i.dataset&&i.dataset.draw(e,o,s,l),c=s;c<s+l;++c){const t=r[c];t.hidden||(t.active?a.push(t):t.draw(e,o))}for(c=0;c<a.length;++c)a[c].draw(e,o)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const i=this,r=i.getDataset();let o;if(t>=0&&t<i._cachedMeta.data.length){const e=i._cachedMeta.data[t];o=e.$context||(e.$context=function(t,e,n){return Object.assign(Object.create(t),{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(i.getContext(),t,e)),o.parsed=i.getParsed(t),o.raw=r.data[t],o.index=o.dataIndex=t}else o=i.$context||(i.$context=function(t,e){return Object.assign(Object.create(t),{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(i.chart.getContext(),i.index)),o.dataset=r,o.index=o.datasetIndex=i.index;return o.active=!!e,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const i=this,r="active"===e,o=i._cachedDataOpts,a=t+"-"+e,s=o[a],l=i.enableOptionSharing&&D(n);if(s)return vn(s,l);const c=i.chart.config,u=c.datasetElementScopeKeys(i._type,t),d=r?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(i.getDataset(),u),f=Object.keys(Nt.elements[t]),g=c.resolveNamedOptions(h,f,(()=>i.getContext(n,r)),d);return g.$shared&&(g.$shared=l,o[a]=Object.freeze(vn(g,l))),g}_resolveAnimations(t,e,n){const i=this,r=i.chart,o=i._cachedDataOpts,a=`animation-${e}`,s=o[a];if(s)return s;let l;if(!1!==r.options.animation){const r=i.chart.config,o=r.datasetAnimationScopeKeys(i._type,e),a=r.getOptionScopes(i.getDataset(),o);l=r.createResolver(a,i.getContext(t,n,e))}const c=new cn(r,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||yn(t)||this.chart._animationsDisabled}updateElement(t,e,n,i){yn(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!yn(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const r=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this,n=e._data,i=e._cachedMeta.data;for(const[t,n,i]of e._syncList)e[t](n,i);e._syncList=[];const r=i.length,o=n.length,a=Math.min(o,r);a&&e.parse(0,a),o>r?e._insertElements(r,o-r,t):o<r&&e._removeElements(o,r-o)}_insertElements(t,e,n=!0){const i=this,r=i._cachedMeta,o=r.data,a=t+e;let s;const l=t=>{for(t.length+=e,s=t.length-1;s>=a;s--)t[s]=t[s-e]};for(l(o),s=t;s<a;++s)o[s]=new i.dataElementType;i._parsing&&l(r._parsed),i.parse(t,e),n&&i.updateElements(o,t,e,"reset")}updateElements(t,e,n,i){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,e);n._stacked&&xn(n,i)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,i]=t;this[e](n,i)}}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){this._sync(["_removeElements",t,e]),this._sync(["_insertElements",t,arguments.length-2])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function _n(t){const e=function(t){if(!t._cache.$bar){const e=t.getMatchingVisibleMetas("bar");let n=[];for(let i=0,r=e.length;i<r;i++)n=n.concat(e[i].controller.getAllParsedValues(t));t._cache.$bar=he(n.sort(((t,e)=>t-e)))}return t._cache.$bar}(t);let n,i,r,o,a=t._length;const s=()=>{32767!==r&&-32768!==r&&(D(o)&&(a=Math.min(a,Math.abs(r-o)||a)),o=r)};for(n=0,i=e.length;n<i;++n)r=t.getPixelForValue(e[n]),s();for(o=void 0,n=0,i=t.ticks.length;n<i;++n)r=t.getPixelForTick(n),s();return a}function Mn(t,e,n,i){return u(t)?function(t,e,n,i){const r=n.parse(t[0],i),o=n.parse(t[1],i),a=Math.min(r,o),s=Math.max(r,o);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:r,end:o,min:a,max:s}}(t,e,n,i):e[n.axis]=n.parse(t,i),e}function kn(t,e,n,i){const r=t.iScale,o=t.vScale,a=r.getLabels(),s=r===o,l=[];let c,u,d,h;for(c=n,u=n+i;c<u;++c)h=e[c],d={},d[r.axis]=s||r.parse(a[c],c),l.push(Mn(h,d,o,c));return l}function Cn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Tn(t,e,n,i){let r=e.borderSkipped;const o={};if(!r)return void(t.borderSkipped=o);const{start:a,end:s,reverse:l,top:c,bottom:u}=function(t){let e,n,i,r,o;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(r="end",o="start"):(r="start",o="end"),{start:n,end:i,reverse:e,top:r,bottom:o}}(t);"middle"===r&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?r=c:(n._bottom||0)===i?r=u:(o[Sn(u,a,s,l)]=!0,r=c)),o[Sn(r,a,s,l)]=!0,t.borderSkipped=o}function Sn(t,e,n,i){var r,o,a;return i?(a=n,t=Dn(t=(r=t)===(o=e)?a:r===a?o:r,n,e)):t=Dn(t,e,n),t}function Dn(t,e,n){return"start"===t?e:"end"===t?n:t}wn.defaults={},wn.prototype.datasetElementType=null,wn.prototype.dataElementType=null;class Pn extends wn{parsePrimitiveData(t,e,n,i){return kn(t,e,n,i)}parseArrayData(t,e,n,i){return kn(t,e,n,i)}parseObjectData(t,e,n,i){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===r.axis?a:s,c="x"===o.axis?a:s,u=[];let d,h,f,g;for(d=n,h=n+i;d<h;++d)g=e[d],f={},f[r.axis]=r.parse(T(g,l),d),u.push(Mn(T(g,c),f,o,d));return u}updateRangeFromParsed(t,e,n,i){super.updateRangeFromParsed(t,e,n,i);const r=n._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:i}=e,r=this.getParsed(t),o=r._custom,a=Cn(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(r[i.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:a}}initialize(){const t=this;t.enableOptionSharing=!0,super.initialize(),t._cachedMeta.stack=t.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,i){const r=this,o="reset"===i,{index:a,_cachedMeta:{vScale:s}}=r,l=s.getBasePixel(),u=s.isHorizontal(),d=r._getRuler(),h=r.resolveDataElementOptions(e,i),f=r.getSharedOptions(h),g=r.includeOptions(i,f);r.updateSharedOptions(f,i,h);for(let h=e;h<e+n;h++){const e=r.getParsed(h),n=o||c(e[s.axis])?{base:l,head:l}:r._calculateBarValuePixels(h),p=r._calculateBarIndexPixels(h,d),m=(e._stacks||{})[s.axis],b={horizontal:u,base:n.base,enableBorderRadius:!m||Cn(e._custom)||a===m._top||a===m._bottom,x:u?n.head:p.center,y:u?p.center:n.head,height:u?p.size:Math.abs(n.size),width:u?Math.abs(n.size):p.size};g&&(b.options=f||r.resolveDataElementOptions(h,t[h].active?"active":i)),Tn(b,b.options||t[h].options,m,a),r.updateElement(t[h],h,b,i)}}_getStacks(t,e){const n=this._cachedMeta.iScale,i=n.getMatchingVisibleMetas(this._type),r=n.options.stacked,o=i.length,a=[];let s,l;for(s=0;s<o;++s)if(l=i[s],l.controller.options.grouped){if(void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(c(t)||isNaN(t))continue}if((!1===r||-1===a.indexOf(l.stack)||void 0===r&&void 0===l.stack)&&a.push(l.stack),l.index===t)break}return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const i=this._getStacks(t,n),r=void 0!==e?i.indexOf(e):-1;return-1===r?i.length-1:r}_getRuler(){const t=this,e=t.options,n=t._cachedMeta,i=n.iScale,r=[];let o,a;for(o=0,a=n.data.length;o<a;++o)r.push(i.getPixelForValue(t.getParsed(o)[i.axis],o));const s=e.barThickness;return{min:s||_n(i),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:t._getStackCount(),scale:i,grouped:e.grouped,ratio:s?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(t){const e=this,{_cachedMeta:{vScale:n,_stacked:i},options:{base:r,minBarLength:o}}=e,a=r||0,s=e.getParsed(t),l=s._custom,u=Cn(l);let d,h,f=s[n.axis],g=0,p=i?e.applyStack(n,s,i):f;p!==f&&(g=p-f,p=f),u&&(f=l.barStart,p=l.barEnd-l.barStart,0!==f&&H(f)!==H(l.barEnd)&&(g=0),g+=f);const m=c(r)||u?g:r;let b=n.getPixelForValue(m);if(d=e.chart.getDataVisibility(t)?n.getPixelForValue(g+p):b,h=d-b,Math.abs(h)<o&&(h=function(t,e,n){return 0!==t?H(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}(h,n,a)*o,f===a&&(b-=h/2),d=b+h),b===n.getPixelForValue(a)){const t=H(h)*n.getLineWidthForValue(a)/2;b+=t,h-=t}return{size:h,base:b,head:d,center:d+h/2}}_calculateBarIndexPixels(t,e){const n=this,i=e.scale,r=n.options,o=r.skipNull,a=g(r.maxBarThickness,1/0);let s,l;if(e.grouped){const i=o?n._getStackCount(t):e.stackCount,u="flex"===r.barThickness?function(t,e,n,i){const r=e.pixels,o=r[t];let a=t>0?r[t-1]:null,s=t<r.length-1?r[t+1]:null;const l=n.categoryPercentage;null===a&&(a=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/i,ratio:n.barPercentage,start:c}}(t,e,r,i):function(t,e,n,i){const r=n.barThickness;let o,a;return c(r)?(o=e.min*n.categoryPercentage,a=n.barPercentage):(o=r*i,a=1),{chunk:o/i,ratio:a,start:e.pixels[t]-o/2}}(t,e,r,i),d=n._getStackIndex(n.index,n._cachedMeta.stack,o?t:void 0);s=u.start+u.chunk*d+u.chunk/2,l=Math.min(a,u.chunk*u.ratio)}else s=i.getPixelForValue(n.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this,e=t._cachedMeta,n=e.vScale,i=e.data,r=i.length;let o=0;for(;o<r;++o)null!==t.getParsed(o)[n.axis]&&i[o].draw(t._ctx)}}Pn.id="bar",Pn.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Pn.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class zn extends wn{initialize(){this.enableOptionSharing=!0,super.initialize()}parseObjectData(t,e,n,i){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=[];let c,u,d;for(c=n,u=n+i;c<u;++c)d=e[c],l.push({x:r.parse(T(d,a),c),y:o.parse(T(d,s),c),_custom:d&&d.r&&+d.r});return l}getMaxOverflow(){const{data:t,_parsed:e}=this._cachedMeta;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size()/2,e[i]._custom);return n>0&&n}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:i}=e,r=this.getParsed(t),o=n.getLabelForValue(r.x),a=i.getLabelForValue(r.y),s=r._custom;return{label:e.label,value:"("+o+", "+a+(s?", "+s:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const r=this,o="reset"===i,{iScale:a,vScale:s}=r._cachedMeta,l=r.resolveDataElementOptions(e,i),c=r.getSharedOptions(l),u=r.includeOptions(i,c),d=a.axis,h=s.axis;for(let l=e;l<e+n;l++){const e=t[l],n=!o&&r.getParsed(l),c={},f=c[d]=o?a.getPixelForDecimal(.5):a.getPixelForValue(n[d]),g=c[h]=o?s.getBasePixel():s.getPixelForValue(n[h]);c.skip=isNaN(f)||isNaN(g),u&&(c.options=r.resolveDataElementOptions(l,e.active?"active":i),o&&(c.options.radius=0)),r.updateElement(e,l,c,i)}r.updateSharedOptions(c,i,l)}resolveDataElementOptions(t,e){const n=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const r=i.radius;return"active"!==e&&(i.radius=0),i.radius+=g(n&&n._custom,r),i}}zn.id="bubble",zn.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},zn.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class On extends wn{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;let r,o;for(r=t,o=t+e;r<o;++r)i._parsed[r]=+n[r]}_getRotation(){return j(this.options.rotation-90)}_getCircumference(){return j(this.options.circumference)}_getRotationExtents(){let t=O,e=-O;const n=this;for(let i=0;i<n.chart.data.datasets.length;++i)if(n.chart.isDatasetVisible(i)){const r=n.chart.getDatasetMeta(i).controller,o=r._getRotation(),a=r._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this,n=e.chart,{chartArea:i}=n,r=e._cachedMeta,o=r.data,a=e.getMaxBorderWidth()+e.getMaxOffset(o)+e.options.spacing,s=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min((u=s,"string"==typeof(c=e.options.cutout)&&c.endsWith("%")?parseFloat(c)/100:c/u),1);var c,u;const d=e._getRingWeight(e.index),{circumference:h,rotation:f}=e._getRotationExtents(),{ratioX:g,ratioY:m,offsetX:b,offsetY:x}=function(t,e,n){let i=1,r=1,o=0,a=0;if(e<O){const s=t,l=s+e,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),h=Math.sin(l),f=(t,e,i)=>G(t,s,l,!0)?1:Math.max(e,e*n,i,i*n),g=(t,e,i)=>G(t,s,l,!0)?-1:Math.min(e,e*n,i,i*n),p=f(0,c,d),m=f(R,u,h),b=g(z,c,d),x=g(z+R,u,h);i=(p-b)/2,r=(m-x)/2,o=-(p+b)/2,a=-(m+x)/2}return{ratioX:i,ratioY:r,offsetX:o,offsetY:a}}(f,h,l),y=(i.width-a)/g,v=(i.height-a)/m,w=Math.max(Math.min(y,v)/2,0),_=p(e.options.radius,w),M=(_-Math.max(_*l,0))/e._getVisibleDatasetWeightTotal();e.offsetX=b*_,e.offsetY=x*_,r.total=e.calculateTotal(),e.outerRadius=_-M*e._getRingWeightOffset(e.index),e.innerRadius=Math.max(e.outerRadius-M*d,0),e.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this,i=n.options,r=n._cachedMeta,o=n._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===r._parsed[t]||r.data[t].hidden?0:n.calculateCircumference(r._parsed[t]*o/O)}updateElements(t,e,n,i){const r=this,o="reset"===i,a=r.chart,s=a.chartArea,l=a.options.animation,c=(s.left+s.right)/2,u=(s.top+s.bottom)/2,d=o&&l.animateScale,h=d?0:r.innerRadius,f=d?0:r.outerRadius,g=r.resolveDataElementOptions(e,i),p=r.getSharedOptions(g),m=r.includeOptions(i,p);let b,x=r._getRotation();for(b=0;b<e;++b)x+=r._circumference(b,o);for(b=e;b<e+n;++b){const e=r._circumference(b,o),n=t[b],a={x:c+r.offsetX,y:u+r.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:f,innerRadius:h};m&&(a.options=p||r.resolveDataElementOptions(b,n.active?"active":i)),x+=e,r.updateElement(n,b,a,i)}r.updateSharedOptions(p,i,g)}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,i=0;for(n=0;n<e.length;n++){const r=t._parsed[n];null===r||isNaN(r)||!this.chart.getDataVisibility(n)||e[n].hidden||(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?O*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=$e(e._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){const e=this;let n=0;const i=e.chart;let r,o,a,s,l;if(!t)for(r=0,o=i.data.datasets.length;r<o;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,s=a.controller,s!==e&&s.configure();break}if(!t)return 0;for(r=0,o=t.length;r<o;++r)l=s.resolveDataElementOptions(r),"inner"!==l.borderAlign&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let e=0;for(let n=0,i=t.length;n<i;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(g(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}On.id="doughnut",On.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},On.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},On.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,i)=>{const r=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const n=": "+t.formattedValue;return u(e)?(e=e.slice(),e[0]+=n):e+=n,e}}}}};class An extends wn{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this,n=e._cachedMeta,{dataset:i,data:r=[],_dataset:o}=n,a=e.chart._animationsDisabled;let{start:s,count:l}=function(t,e,n){const i=e.length;let r=0,o=i;if(t._sorted){const{iScale:a,_parsed:s}=t,l=a.axis,{min:c,max:u,minDefined:d,maxDefined:h}=a.getUserBounds();d&&(r=K(Math.min(le(s,a.axis,c).lo,n?i:le(e,l,a.getPixelForValue(c)).lo),0,i-1)),o=h?K(Math.max(le(s,a.axis,u).hi+1,n?0:le(e,l,a.getPixelForValue(u)).hi+1),r,i)-r:i-r}return{start:r,count:o}}(n,r,a);e._drawStart=s,e._drawCount=l,function(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=r,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),o}(n)&&(s=0,l=r.length),i._datasetIndex=e.index,i._decimated=!!o._decimated,i.points=r;const c=e.resolveDatasetElementOptions(t);e.options.showLine||(c.borderWidth=0),c.segment=e.options.segment,e.updateElement(i,void 0,{animated:!a,options:c},t),e.updateElements(r,s,l,t)}updateElements(t,e,n,i){const r=this,o="reset"===i,{iScale:a,vScale:s,_stacked:l}=r._cachedMeta,u=r.resolveDataElementOptions(e,i),d=r.getSharedOptions(u),h=r.includeOptions(i,d),f=a.axis,g=s.axis,p=r.options.spanGaps,m=W(p)?p:Number.POSITIVE_INFINITY,b=r.chart._animationsDisabled||o||"none"===i;let x=e>0&&r.getParsed(e-1);for(let u=e;u<e+n;++u){const e=t[u],n=r.getParsed(u),p=b?e:{},y=c(n[g]),v=p[f]=a.getPixelForValue(n[f],u),w=p[g]=o||y?s.getBasePixel():s.getPixelForValue(l?r.applyStack(s,n,l):n[g],u);p.skip=isNaN(v)||isNaN(w)||y,p.stop=u>0&&n[f]-x[f]>m,p.parsed=n,h&&(p.options=d||r.resolveDataElementOptions(u,e.active?"active":i)),b||r.updateElement(e,u,p,i),x=n}r.updateSharedOptions(d,i,u)}getMaxOverflow(){const t=this,e=t._cachedMeta,n=e.dataset,i=n.options&&n.options.borderWidth||0,r=e.data||[];if(!r.length)return i;const o=r[0].size(t.resolveDataElementOptions(0)),a=r[r.length-1].size(t.resolveDataElementOptions(r.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}An.id="line",An.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},An.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class En extends wn{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=$e(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:r}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this,e=t.chart,n=e.chartArea,i=e.options,r=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(r/2,0),a=(o-Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0))/e.getVisibleDatasetCount();t.outerRadius=o-a*t.index,t.innerRadius=t.outerRadius-a}updateElements(t,e,n,i){const r=this,o="reset"===i,a=r.chart,s=r.getDataset(),l=a.options.animation,c=r._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*z;let f,g=h;const p=360/r.countVisibleElements();for(f=0;f<e;++f)g+=r._computeAngle(f,i,p);for(f=e;f<e+n;f++){const e=t[f];let n=g,m=g+r._computeAngle(f,i,p),b=a.getDataVisibility(f)?c.getDistanceFromCenterForValue(s.data[f]):0;g=m,o&&(l.animateScale&&(b=0),l.animateRotate&&(n=m=h));const x={x:u,y:d,innerRadius:0,outerRadius:b,startAngle:n,endAngle:m,options:r.resolveDataElementOptions(f,e.active?"active":i)};r.updateElement(e,f,x,i)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let n=0;return e.data.forEach(((e,i)=>{!isNaN(t.data[i])&&this.chart.getDataVisibility(i)&&n++})),n}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?j(this.resolveDataElementOptions(t,e).angle||n):0}}En.id="polarArea",En.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},En.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,i)=>{const r=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Ln extends On{}Ln.id="pie",Ln.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Rn extends wn{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}update(t){const e=this,n=e._cachedMeta,i=n.dataset,r=n.data||[],o=n.iScale.getLabels();if(i.points=r,"resize"!==t){const n=e.resolveDatasetElementOptions(t);e.options.showLine||(n.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===r.length,options:n};e.updateElement(i,void 0,a,t)}e.updateElements(r,0,r.length,t)}updateElements(t,e,n,i){const r=this,o=r.getDataset(),a=r._cachedMeta.rScale,s="reset"===i;for(let l=e;l<e+n;l++){const e=t[l],n=r.resolveDataElementOptions(l,e.active?"active":i),c=a.getPointPositionForValue(l,o.data[l]),u=s?a.xCenter:c.x,d=s?a.yCenter:c.y,h={x:u,y:d,angle:c.angle,skip:isNaN(u)||isNaN(d),options:n};r.updateElement(e,l,h,i)}}}Rn.id="radar",Rn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Rn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Fn extends An{}Fn.id="scatter",Fn.defaults={showLine:!1,fill:!1},Fn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var In=Object.freeze({__proto__:null,BarController:Pn,BubbleController:zn,DoughnutController:On,LineController:An,PolarAreaController:En,PieController:Ln,RadarController:Rn,ScatterController:Fn});function Nn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Hn{constructor(t){this.options=t||{}}formats(){return Nn()}parse(t,e){return Nn()}format(t,e){return Nn()}add(t,e,n){return Nn()}diff(t,e,n){return Nn()}startOf(t,e,n){return Nn()}endOf(t,e){return Nn()}}Hn.override=function(t){Object.assign(Hn.prototype,t)};var Bn={_date:Hn};function Wn(t,e){return"native"in t?{x:t.x,y:t.y}:Ne(t,e)}function Un(t,e,n,i){const{controller:r,data:o,_sorted:a}=t,s=r._cachedMeta.iScale;if(s&&e===s.axis&&a&&o.length){const t=s._reversePixels?ce:le;if(!i)return t(o,e,n);if(r._sharedOptions){const i=o[0],r="function"==typeof i.getRange&&i.getRange(e);if(r){const i=t(o,e,n-r),a=t(o,e,n+r);return{lo:i.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Vn(t,e,n,i,r){const o=t.getSortedVisibleDatasetMetas(),a=n[e];for(let t=0,n=o.length;t<n;++t){const{index:n,data:s}=o[t],{lo:l,hi:c}=Un(o[t],e,a,r);for(let t=l;t<=c;++t){const e=s[t];e.skip||i(e,n,t)}}}function jn(t,e,n,i){const r=[];return jt(e,t.chartArea,t._minPadding)?(Vn(t,n,e,(function(t,n,o){t.inRange(e.x,e.y,i)&&r.push({element:t,datasetIndex:n,index:o})}),!0),r):r}function Yn(t,e,n,i,r){const o=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){const r=e?Math.abs(t.x-i.x):0,o=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}(n);let a=Number.POSITIVE_INFINITY,s=[];return jt(e,t.chartArea,t._minPadding)?(Vn(t,n,e,(function(n,l,c){if(i&&!n.inRange(e.x,e.y,r))return;const u=n.getCenterPoint(r);if(!jt(u,t.chartArea,t._minPadding)&&!n.inRange(e.x,e.y,r))return;const d=o(e,u);d<a?(s=[{element:n,datasetIndex:l,index:c}],a=d):d===a&&s.push({element:n,datasetIndex:l,index:c})})),s):s}function qn(t,e,n,i){const r=Wn(e,t),o=[],a=n.axis,s="x"===a?"inXRange":"inYRange";let l=!1;return function(t,e){const n=t.getSortedVisibleDatasetMetas();let i,r,o;for(let t=0,a=n.length;t<a;++t){({index:i,data:r}=n[t]);for(let t=0,n=r.length;t<n;++t)o=r[t],o.skip||e(o,i,t)}}(t,((t,e,n)=>{t[s](r[a],i)&&o.push({element:t,datasetIndex:e,index:n}),t.inRange(r.x,r.y,i)&&(l=!0)})),n.intersect&&!l?[]:o}var $n={modes:{index(t,e,n,i){const r=Wn(e,t),o=n.axis||"x",a=n.intersect?jn(t,r,o,i):Yn(t,r,o,!1,i),s=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,n=t.data[e];n&&!n.skip&&s.push({element:n,datasetIndex:t.index,index:e})})),s):[]},dataset(t,e,n,i){const r=Wn(e,t),o=n.axis||"xy";let a=n.intersect?jn(t,r,o,i):Yn(t,r,o,!1,i);if(a.length>0){const e=a[0].datasetIndex,n=t.getDatasetMeta(e).data;a=[];for(let t=0;t<n.length;++t)a.push({element:n[t],datasetIndex:e,index:t})}return a},point:(t,e,n,i)=>jn(t,Wn(e,t),n.axis||"xy",i),nearest:(t,e,n,i)=>Yn(t,Wn(e,t),n.axis||"xy",n.intersect,i),x:(t,e,n,i)=>(n.axis="x",qn(t,e,n,i)),y:(t,e,n,i)=>(n.axis="y",qn(t,e,n,i))}};const Xn=["left","top","right","bottom"];function Qn(t,e){return t.filter((t=>t.pos===e))}function Gn(t,e){return t.filter((t=>-1===Xn.indexOf(t.pos)&&t.box.axis===e))}function Kn(t,e){return t.sort(((t,n)=>{const i=e?n:t,r=e?t:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight}))}function Jn(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Zn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function ti(t,e,n,i){const{pos:r,box:o}=n,a=t.maxPadding;if(!d(r)){n.size&&(t[r]-=n.size);const e=i[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?o.height:o.width),n.size=e.size/e.count,t[r]+=n.size}o.getPadding&&Zn(a,o.getPadding());const s=Math.max(0,e.outerWidth-Jn(a,t,"left","right")),l=Math.max(0,e.outerHeight-Jn(a,t,"top","bottom")),c=s!==t.w,u=l!==t.h;return t.w=s,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function ei(t,e){const n=e.maxPadding;return function(t){const i={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{i[t]=Math.max(e[t],n[t])})),i}(t?["left","right"]:["top","bottom"])}function ni(t,e,n,i){const r=[];let o,a,s,l,c,u;for(o=0,a=t.length,c=0;o<a;++o){s=t[o],l=s.box,l.update(s.width||e.w,s.height||e.h,ei(s.horizontal,e));const{same:a,other:d}=ti(e,n,s,i);c|=a&&r.length,u=u||d,l.fullSize||r.push(s)}return c&&ni(r,e,n,i)||u}function ii(t,e,n,i,r){t.top=n,t.left=e,t.right=e+i,t.bottom=n+r,t.width=i,t.height=r}function ri(t,e,n,i){const r=n.padding;let{x:o,y:a}=e;for(const s of t){const t=s.box,l=i[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const i=e.w*c,o=l.size||t.height;D(l.start)&&(a=l.start),t.fullSize?ii(t,r.left,a,n.outerWidth-r.right-r.left,o):ii(t,e.left+l.placed,a,i,o),l.start=a,l.placed+=i,a=t.bottom}else{const i=e.h*c,a=l.size||t.width;D(l.start)&&(o=l.start),t.fullSize?ii(t,o,r.top,a,n.outerHeight-r.bottom-r.top):ii(t,o,e.top+l.placed,a,i),l.start=o,l.placed+=i,o=t.right}}e.x=o,e.y=a}Nt.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});var oi={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const r=re(t.options.layout.padding),o=Math.max(e-r.width,0),a=Math.max(n-r.height,0),s=function(t){const e=function(t){const e=[];let n,i,r,o,a,s;for(n=0,i=(t||[]).length;n<i;++n)r=t[n],({position:o,options:{stack:a,stackWeight:s=1}}=r),e.push({index:n,box:r,pos:o,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&o+a,stackWeight:s});return e}(t),n=Kn(e.filter((t=>t.box.fullSize)),!0),i=Kn(Qn(e,"left"),!0),r=Kn(Qn(e,"right")),o=Kn(Qn(e,"top"),!0),a=Kn(Qn(e,"bottom")),s=Gn(e,"x"),l=Gn(e,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:r.concat(l).concat(a).concat(s),chartArea:Qn(e,"chartArea"),vertical:i.concat(r).concat(l),horizontal:o.concat(a).concat(s)}}(t.boxes),l=s.vertical,c=s.horizontal;b(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const u=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},r);Zn(h,re(i));const f=Object.assign({maxPadding:h,w:o,h:a,x:r.left,y:r.top},r),g=function(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:i,stackWeight:r}=n;if(!t||!Xn.includes(i))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}(t),{vBoxMaxWidth:i,hBoxMaxHeight:r}=e;let o,a,s;for(o=0,a=t.length;o<a;++o){s=t[o];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*i:a&&e.availableWidth,s.height=r):(s.width=i,s.height=c?c*r:a&&e.availableHeight)}return n}(l.concat(c),d);ni(s.fullSize,f,d,g),ni(l,f,d,g),ni(c,f,d,g)&&ni(l,f,d,g),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(f),ri(s.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,ri(s.rightAndBottom,f,d,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},b(s.chartArea,(e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(f.w,f.h)}))}};class ai{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}}class si extends ai{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}}const li={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ci=t=>null===t||""===t,ui=!!We&&{passive:!0};function di(t,e,n){t.canvas.removeEventListener(e,n,ui)}function hi(t,e,n){const i=t.canvas,r=i&&Ee(i)||i,o=new MutationObserver((t=>{const e=Ee(r);t.forEach((t=>{for(let i=0;i<t.addedNodes.length;i++){const o=t.addedNodes[i];o!==r&&o!==e||n(t.target)}}))}));return o.observe(document,{childList:!0,subtree:!0}),o}function fi(t,e,n){const i=t.canvas,r=i&&Ee(i);if(!r)return;const o=new MutationObserver((t=>{t.forEach((t=>{for(let e=0;e<t.removedNodes.length;e++)if(t.removedNodes[e]===i){n();break}}))}));return o.observe(r,{childList:!0}),o}const gi=new Map;let pi=0;function mi(){const t=window.devicePixelRatio;t!==pi&&(pi=t,gi.forEach(((e,n)=>{n.currentDevicePixelRatio!==t&&e()})))}function bi(t,e,n){const i=t.canvas,o=i&&Ee(i);if(!o)return;const a=r(((t,e)=>{const i=o.clientWidth;n(t,e),i<o.clientWidth&&n()}),window),s=new ResizeObserver((t=>{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||a(n,i)}));return s.observe(o),function(t,e){gi.size||window.addEventListener("resize",mi),gi.set(t,e)}(t,a),s}function xi(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){gi.delete(t),gi.size||window.removeEventListener("resize",mi)}(t)}function yi(t,e,n){const i=t.canvas,o=r((e=>{null!==t.ctx&&n(function(t,e){const n=li[t.type]||t.type,{x:i,y:r}=Ne(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==r?r:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,n){t.addEventListener(e,n,ui)}(i,e,o),o}class vi extends ai{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t.$chartjs={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ci(r)){const e=Ue(t,"width");void 0!==e&&(t.width=e)}if(ci(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ue(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const n=e.$chartjs.initial;["height","width"].forEach((t=>{const i=n[t];c(i)?e.removeAttribute(t):e.setAttribute(t,i)}));const i=n.style||{};return Object.keys(i).forEach((t=>{e.style[t]=i[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),r={attach:hi,detach:fi,resize:bi}[e]||yi;i[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];i&&(({attach:xi,detach:xi,resize:xi}[e]||di)(t,e,i),n[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return function(t,e,n,i){const r=Re(t),o=Ie(r,"margin"),a=Le(r.maxWidth,t,"clientWidth")||E,s=Le(r.maxHeight,t,"clientHeight")||E,l=function(t,e,n){let i,r;if(void 0===e||void 0===n){const o=Ee(t);if(o){const t=o.getBoundingClientRect(),a=Re(o),s=Ie(a,"border","width"),l=Ie(a,"padding");e=t.width-l.width-s.width,n=t.height-l.height-s.height,i=Le(a.maxWidth,o,"clientWidth"),r=Le(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:i||E,maxHeight:r||E}}(t,e,n);let{width:c,height:u}=l;if("content-box"===r.boxSizing){const t=Ie(r,"border","width"),e=Ie(r,"padding");c-=e.width+t.width,u-=e.height+t.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?Math.floor(c/i):u-o.height),c=He(Math.min(c,a,l.maxWidth)),u=He(Math.min(u,s,l.maxHeight)),c&&!u&&(u=He(c/2)),{width:c,height:u}}(t,e,n,i)}isAttached(t){const e=Ee(t);return!(!e||!e.isConnected)}}class wi{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return W(this.x)&&W(this.y)}getProps(t,e){const n=this,i=this.$animations;if(!e||!i)return n;const r={};return t.forEach((t=>{r[t]=i[t]&&i[t].active()?i[t]._to:n[t]})),r}}wi.defaults={},wi.defaultRoutes=void 0;const _i={values:t=>u(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let r,o=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),o=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}(t,n)}const a=N(Math.abs(o)),s=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),$e(t,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=t/Math.pow(10,Math.floor(N(t)));return 1===i||2===i||5===i?_i.numeric.call(this,t,e,n):""}};var Mi={formatters:_i};function ki(t,e,n,i,r){const o=g(i,0),a=Math.min(g(r,t.length),t.length);let s,l,c,u=0;for(n=Math.ceil(n),r&&(s=r-i,n=s/Math.floor(s/n)),c=o;c<0;)u++,c=Math.round(o+u*n);for(l=Math.max(o,0);l<a;l++)l===c&&(e.push(t[l]),u++,c=Math.round(o+u*n))}Nt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Mi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Nt.route("scale.ticks","color","","color"),Nt.route("scale.grid","color","","borderColor"),Nt.route("scale.grid","borderColor","","borderColor"),Nt.route("scale.title","color","","color"),Nt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Nt.describe("scales",{_fallback:"scale"}),Nt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ci=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n;function Ti(t,e){const n=[],i=t.length/e,r=t.length;let o=0;for(;o<r;o+=i)n.push(t[Math.floor(o)]);return n}function Si(t,e,n){const i=t.ticks.length,r=Math.min(e,i-1),o=t._startPixel,a=t._endPixel,s=1e-6;let l,c=t.getPixelForTick(r);if(!(n&&(l=1===i?Math.max(c-o,a-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(r-1))/2,c+=r<e?l:-l,c<o-s||c>a+s)))return c}function Di(t){return t.drawTicks?t.tickLength:0}function Pi(t,e){if(!t.display)return 0;const n=oe(t.font,e),i=re(t.padding);return(u(t.text)?t.text.length:1)*n.lineHeight+i.height}function zi(t,e,n){let i=o(t);return(n&&"right"!==e||!n&&"right"===e)&&(i=(t=>"left"===t?"right":"right"===t?"left":t)(i)),i}class Oi extends wi{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){const e=this;e.options=t.setContext(e.getContext()),e.axis=t.axis,e._userMin=e.parse(t.min),e._userMax=e.parse(t.max),e._suggestedMin=e.parse(t.suggestedMin),e._suggestedMax=e.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=f(t,Number.POSITIVE_INFINITY),e=f(e,Number.NEGATIVE_INFINITY),n=f(n,Number.POSITIVE_INFINITY),i=f(i,Number.NEGATIVE_INFINITY),{min:f(t,n),max:f(e,i),minDefined:h(t),maxDefined:h(e)}}getMinMax(t){const e=this;let n,{min:i,max:r,minDefined:o,maxDefined:a}=e.getUserBounds();if(o&&a)return{min:i,max:r};const s=e.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)n=s[l].controller.getMinMax(e,t),o||(i=Math.min(i,n.min)),a||(r=Math.max(r,n.max));return{min:f(i,f(r,i)),max:f(r,f(i,r))}}getPadding(){const t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){m(this.options.beforeUpdate,[this])}update(t,e,n){const i=this,r=i.options.ticks,o=r.sampleSize;i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),i.ticks=null,i._labelSizes=null,i._gridLineItems=null,i._labelItems=null,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i._maxLength=i.isHorizontal()?i.width+n.left+n.right:i.height+n.top+n.bottom,i._dataLimitsCached||(i.beforeDataLimits(),i.determineDataLimits(),i.afterDataLimits(),i._range=function(t,e){const{min:n,max:i}=t;return{min:n-Math.abs(p(e,n)),max:i+p(e,i)}}(i,i.options.grace),i._dataLimitsCached=!0),i.beforeBuildTicks(),i.ticks=i.buildTicks()||[],i.afterBuildTicks();const a=o<i.ticks.length;i._convertTicksToLabels(a?Ti(i.ticks,o):i.ticks),i.configure(),i.beforeCalculateLabelRotation(),i.calculateLabelRotation(),i.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(i.ticks=function(t,e){const n=t.options.ticks,i=n.maxTicksLimit||function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(i,r))}(t),r=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}(e):[],o=r.length,a=r[0],s=r[o-1],l=[];if(o>i)return function(t,e,n,i){let r,o=0,a=n[0];for(i=Math.ceil(i),r=0;r<t.length;r++)r===a&&(e.push(t[r]),o++,a=n[o*i])}(e,l,r,o/i),l;const u=function(t,e,n){const i=function(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}(t),r=e.length/n;if(!i)return Math.max(r,1);const o=function(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i==0&&(e.push(i),e.push(t/i));return n===(0|n)&&e.push(n),e.sort(((t,e)=>t-e)).pop(),e}(i);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>r)return e}return Math.max(r,1)}(r,e,i);if(o>0){let t,n;const i=o>1?Math.round((s-a)/(o-1)):null;for(ki(e,l,u,c(i)?0:a-i,a),t=0,n=o-1;t<n;t++)ki(e,l,u,r[t],r[t+1]);return ki(e,l,u,s,c(i)?e.length:s+i),l}return ki(e,l,u),l}(i,i.ticks),i._labelSizes=null),a&&i._convertTicksToLabels(i.ticks),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate()}configure(){const t=this;let e,n,i=t.options.reverse;t.isHorizontal()?(e=t.left,n=t.right):(e=t.top,n=t.bottom,i=!i),t._startPixel=e,t._endPixel=n,t._reversePixels=i,t._length=n-e,t._alignToPixels=t.options.alignToPixels}afterUpdate(){m(this.options.afterUpdate,[this])}beforeSetDimensions(){m(this.options.beforeSetDimensions,[this])}setDimensions(){const 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(){m(this.options.afterSetDimensions,[this])}_callHooks(t){const e=this;e.chart.notifyPlugins(t,e.getContext()),m(e.options[t],[e])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){m(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this,n=e.options.ticks;let i,r,o;for(i=0,r=t.length;i<r;i++)o=t[i],o.label=m(n.callback,[o.value,i,t],e)}afterTickToLabelConversion(){m(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){m(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this,e=t.options,n=e.ticks,i=t.ticks.length,r=n.minRotation||0,o=n.maxRotation;let a,s,l,c=r;if(!t._isVisible()||!n.display||r>=o||i<=1||!t.isHorizontal())return void(t.labelRotation=r);const u=t._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=K(t.chart.width-d,0,t.maxWidth);a=e.offset?t.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(e.offset?.5:1)),s=t.maxHeight-Di(e.grid)-n.padding-Pi(e.title,t.chart.options.font),l=Math.sqrt(d*d+h*h),c=Y(Math.min(Math.asin(K((u.highest.height+6)/a,-1,1)),Math.asin(K(s/l,-1,1))-Math.asin(K(h/l,-1,1)))),c=Math.max(r,Math.min(o,c))),t.labelRotation=c}afterCalculateLabelRotation(){m(this.options.afterCalculateLabelRotation,[this])}beforeFit(){m(this.options.beforeFit,[this])}fit(){const t=this,e={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:o}}=t,a=t._isVisible(),s=t.isHorizontal();if(a){const a=Pi(r,n.options.font);if(s?(e.width=t.maxWidth,e.height=Di(o)+a):(e.height=t.maxHeight,e.width=Di(o)+a),i.display&&t.ticks.length){const{first:n,last:r,widest:o,highest:a}=t._getLabelSizes(),l=2*i.padding,c=j(t.labelRotation),u=Math.cos(c),d=Math.sin(c);if(s){const n=i.mirror?0:d*o.width+u*a.height;e.height=Math.min(t.maxHeight,e.height+n+l)}else{const n=i.mirror?0:u*o.width+d*a.height;e.width=Math.min(t.maxWidth,e.width+n+l)}t._calculatePadding(n,r,d,u)}}t._handleMargins(),s?(t.width=t._length=n.width-t._margins.left-t._margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t._margins.top-t._margins.bottom)}_calculatePadding(t,e,n,i){const r=this,{ticks:{align:o,padding:a},position:s}=r.options,l=0!==r.labelRotation,c="top"!==s&&"x"===r.axis;if(r.isHorizontal()){const s=r.getPixelForTick(0)-r.left,u=r.right-r.getPixelForTick(r.ticks.length-1);let d=0,h=0;l?c?(d=i*t.width,h=n*e.height):(d=n*t.height,h=i*e.width):"start"===o?h=e.width:"end"===o?d=t.width:(d=t.width/2,h=e.width/2),r.paddingLeft=Math.max((d-s+a)*r.width/(r.width-s),0),r.paddingRight=Math.max((h-u+a)*r.width/(r.width-u),0)}else{let n=e.height/2,i=t.height/2;"start"===o?(n=0,i=t.height):"end"===o&&(n=e.height,i=0),r.paddingTop=n+a,r.paddingBottom=i+a}}_handleMargins(){const t=this;t._margins&&(t._margins.left=Math.max(t.paddingLeft,t._margins.left),t._margins.top=Math.max(t.paddingTop,t._margins.top),t._margins.right=Math.max(t.paddingRight,t._margins.right),t._margins.bottom=Math.max(t.paddingBottom,t._margins.bottom))}afterFit(){m(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){const e=this;let n,i;for(e.beforeTickToLabelConversion(),e.generateTickLabels(t),n=0,i=t.length;n<i;n++)c(t[n].label)&&(t.splice(n,1),i--,n--);e.afterTickToLabelConversion()}_getLabelSizes(){const t=this;let e=t._labelSizes;if(!e){const n=t.options.ticks.sampleSize;let i=t.ticks;n<i.length&&(i=Ti(i,n)),t._labelSizes=e=t._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:i}=this,r=[],o=[];let a,s,l,d,h,f,g,p,m,x,y,v=0,w=0;for(a=0;a<e;++a){if(d=t[a].label,h=this._resolveTickFontOptions(a),n.font=f=h.string,g=i[f]=i[f]||{data:{},gc:[]},p=h.lineHeight,m=x=0,c(d)||u(d)){if(u(d))for(s=0,l=d.length;s<l;++s)y=d[s],c(y)||u(y)||(m=Ht(n,g.data,g.gc,m,y),x+=p)}else m=Ht(n,g.data,g.gc,m,d),x=p;r.push(m),o.push(x),v=Math.max(m,v),w=Math.max(x,w)}!function(t,e){b(t,(t=>{const n=t.gc,i=n.length/2;let r;if(i>e){for(r=0;r<i;++r)delete t.data[n[r]];n.splice(0,i)}}))}(i,e);const _=r.indexOf(v),M=o.indexOf(w),k=t=>({width:r[t]||0,height:o[t]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(M),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){const e=this;e._reversePixels&&(t=1-t);const n=e._startPixel+t*e._length;return K(e._alignToPixels?Wt(e.chart,n,0):n,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this,n=e.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=function(t,e,n){return Object.assign(Object.create(t),{tick:n,index:e,type:"tick"})}(e.getContext(),t,i))}return e.$context||(e.$context=(i=e.chart.getContext(),r=e,Object.assign(Object.create(i),{scale:r,type:"scale"})));var i,r}_tickSize(){const t=this,e=t.options.ticks,n=j(t.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),o=t._getLabelSizes(),a=e.autoSkipPadding||0,s=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return t.isHorizontal()?l*i>s*r?s/i:l/r:l*r<s*i?l/i:s/r}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this,n=e.axis,i=e.chart,r=e.options,{grid:o,position:a}=r,s=o.offset,l=e.isHorizontal(),c=e.ticks.length+(s?1:0),u=Di(o),h=[],f=o.setContext(e.getContext()),p=f.drawBorder?f.borderWidth:0,m=p/2,b=function(t){return Wt(i,t,p)};let x,y,v,w,_,M,k,C,T,S,D,P;if("top"===a)x=b(e.bottom),M=e.bottom-u,C=x-m,S=b(t.top)+m,P=t.bottom;else if("bottom"===a)x=b(e.top),S=t.top,P=b(t.bottom)-m,M=x+m,C=e.top+u;else if("left"===a)x=b(e.right),_=e.right-u,k=x-m,T=b(t.left)+m,D=t.right;else if("right"===a)x=b(e.left),T=t.left,D=b(t.right)-m,_=x+m,k=e.left+u;else if("x"===n){if("center"===a)x=b((t.top+t.bottom)/2+.5);else if(d(a)){const t=Object.keys(a)[0],n=a[t];x=b(e.chart.scales[t].getPixelForValue(n))}S=t.top,P=t.bottom,M=x+m,C=M+u}else if("y"===n){if("center"===a)x=b((t.left+t.right)/2);else if(d(a)){const t=Object.keys(a)[0],n=a[t];x=b(e.chart.scales[t].getPixelForValue(n))}_=x-m,k=_-u,T=t.left,D=t.right}const z=g(r.ticks.maxTicksLimit,c),O=Math.max(1,Math.ceil(c/z));for(y=0;y<c;y+=O){const t=o.setContext(e.getContext(y)),n=t.lineWidth,r=t.color,a=o.borderDash||[],c=t.borderDashOffset,u=t.tickWidth,d=t.tickColor,f=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=Si(e,y,s),void 0!==v&&(w=Wt(i,v,n),l?_=k=T=D=w:M=C=S=P=w,h.push({tx1:_,ty1:M,tx2:k,ty2:C,x1:T,y1:S,x2:D,y2:P,width:n,color:r,borderDash:a,borderDashOffset:c,tickWidth:u,tickColor:d,tickBorderDash:f,tickBorderDashOffset:g}))}return e._ticksLength=c,e._borderValue=x,h}_computeLabelItems(t){const e=this,n=e.axis,i=e.options,{position:r,ticks:o}=i,a=e.isHorizontal(),s=e.ticks,{align:l,crossAlign:c,padding:h,mirror:f}=o,g=Di(i.grid),p=g+h,m=f?-h:p,b=-j(e.labelRotation),x=[];let y,v,w,_,M,k,C,T,S,D,P,z,O="middle";if("top"===r)k=e.bottom-m,C=e._getXAxisLabelAlignment();else if("bottom"===r)k=e.top+m,C=e._getXAxisLabelAlignment();else if("left"===r){const t=e._getYAxisLabelAlignment(g);C=t.textAlign,M=t.x}else if("right"===r){const t=e._getYAxisLabelAlignment(g);C=t.textAlign,M=t.x}else if("x"===n){if("center"===r)k=(t.top+t.bottom)/2+p;else if(d(r)){const t=Object.keys(r)[0],n=r[t];k=e.chart.scales[t].getPixelForValue(n)+p}C=e._getXAxisLabelAlignment()}else if("y"===n){if("center"===r)M=(t.left+t.right)/2-p;else if(d(r)){const t=Object.keys(r)[0],n=r[t];M=e.chart.scales[t].getPixelForValue(n)}C=e._getYAxisLabelAlignment(g).textAlign}"y"===n&&("start"===l?O="top":"end"===l&&(O="bottom"));const A=e._getLabelSizes();for(y=0,v=s.length;y<v;++y){w=s[y],_=w.label;const t=o.setContext(e.getContext(y));T=e.getPixelForTick(y)+o.labelOffset,S=e._resolveTickFontOptions(y),D=S.lineHeight,P=u(_)?_.length:1;const n=P/2,i=t.color,l=t.textStrokeColor,d=t.textStrokeWidth;let h;if(a?(M=T,z="top"===r?"near"===c||0!==b?-P*D+D/2:"center"===c?-A.highest.height/2-n*D+D:-A.highest.height+D/2:"near"===c||0!==b?D/2:"center"===c?A.highest.height/2-n*D:A.highest.height-P*D,f&&(z*=-1)):(k=T,z=(1-P)*D/2),t.showLabelBackdrop){const e=re(t.backdropPadding),n=A.heights[y],i=A.widths[y];let r=k+z-e.top,o=M-e.left;switch(O){case"middle":r-=n/2;break;case"bottom":r-=n}switch(C){case"center":o-=i/2;break;case"right":o-=i}h={left:o,top:r,width:i+e.width,height:n+e.height,color:t.backdropColor}}x.push({rotation:b,label:_,font:S,color:i,strokeColor:l,strokeWidth:d,textOffset:z,textAlign:C,textBaseline:O,translation:[M,k],backdrop:h})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-j(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align&&(n="right"),n}_getYAxisLabelAlignment(t){const e=this,{position:n,ticks:{crossAlign:i,mirror:r,padding:o}}=e.options,a=t+o,s=e._getLabelSizes().widest.width;let l,c;return"left"===n?r?(c=e.right+o,"near"===i?l="left":"center"===i?(l="center",c+=s/2):(l="right",c+=s)):(c=e.right-a,"near"===i?l="right":"center"===i?(l="center",c-=s/2):(l="left",c=e.left)):"right"===n?r?(c=e.left+o,"near"===i?l="right":"center"===i?(l="center",c-=s/2):(l="left",c-=s)):(c=e.left+a,"near"===i?l="left":"center"===i?(l="center",c+=s/2):(l="right",c=e.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){const t=this;if(t.options.ticks.mirror)return;const e=t.chart,n=t.options.position;return"left"===n||"right"===n?{top:0,left:t.left,bottom:e.height,right:t.right}:"top"===n||"bottom"===n?{top:t.top,left:0,bottom:t.bottom,right:e.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:i,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,i,r,o),t.restore())}getLineWidthForValue(t){const e=this,n=e.options.grid;if(!e._isVisible()||!n.display)return 0;const i=e.ticks.findIndex((e=>e.value===t));return i>=0?n.setContext(e.getContext(i)).lineWidth:0}drawGrid(t){const e=this,n=e.options.grid,i=e.ctx,r=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));let o,a;const s=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(n.display)for(o=0,a=r.length;o<a;++o){const t=r[o];n.drawOnChartArea&&s({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),n.drawTicks&&s({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const t=this,{chart:e,ctx:n,options:{grid:i}}=t,r=i.setContext(t.getContext()),o=i.drawBorder?r.borderWidth:0;if(!o)return;const a=i.setContext(t.getContext(0)).lineWidth,s=t._borderValue;let l,c,u,d;t.isHorizontal()?(l=Wt(e,t.left,o)-o/2,c=Wt(e,t.right,a)+a/2,u=d=s):(u=Wt(e,t.top,o)-o/2,d=Wt(e,t.bottom,a)+a/2,l=c=s),n.save(),n.lineWidth=r.borderWidth,n.strokeStyle=r.borderColor,n.beginPath(),n.moveTo(l,u),n.lineTo(c,d),n.stroke(),n.restore()}drawLabels(t){const e=this;if(!e.options.ticks.display)return;const n=e.ctx,i=e._computeLabelArea();i&&Yt(n,i);const r=e._labelItems||(e._labelItems=e._computeLabelItems(t));let o,a;for(o=0,a=r.length;o<a;++o){const t=r[o],e=t.font,i=t.label;t.backdrop&&(n.fillStyle=t.backdrop.color,n.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),Qt(n,i,0,t.textOffset,e,t)}i&&qt(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:i}}=this;if(!n.display)return;const r=oe(n.font),o=re(n.padding),s=n.align;let l=r.lineHeight/2;"bottom"===e||"center"===e||d(e)?(l+=o.bottom,u(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=o.top;const{titleX:c,titleY:h,maxWidth:f,rotation:g}=function(t,e,n,i){const{top:r,left:o,bottom:s,right:l,chart:c}=t,{chartArea:u,scales:h}=c;let f,g,p,m=0;const b=s-r,x=l-o;if(t.isHorizontal()){if(g=a(i,o,l),d(n)){const t=Object.keys(n)[0],i=n[t];p=h[t].getPixelForValue(i)+b-e}else p="center"===n?(u.bottom+u.top)/2+b-e:Ci(t,n,e);f=l-o}else{if(d(n)){const t=Object.keys(n)[0],i=n[t];g=h[t].getPixelForValue(i)-x+e}else g="center"===n?(u.left+u.right)/2-x+e:Ci(t,n,e);p=a(i,s,r),m="left"===n?-R:R}return{titleX:g,titleY:p,maxWidth:f,rotation:m}}(this,l,e,s);Qt(t,n.text,0,0,r,{color:n.color,maxWidth:f,rotation:g,textAlign:zi(s,e,i),textBaseline:"middle",translation:[c,h]})}draw(t){const e=this;e._isVisible()&&(e.drawBackground(),e.drawGrid(t),e.drawBorder(),e.drawTitle(),e.drawLabels(t))}_layers(){const t=this,e=t.options,n=e.ticks&&e.ticks.z||0,i=g(e.grid&&e.grid.z,-1);return t._isVisible()&&t.draw===Oi.prototype.draw?[{z:i,draw(e){t.drawBackground(),t.drawGrid(e),t.drawTitle()}},{z:i+1,draw(){t.drawBorder()}},{z:n,draw(e){t.drawLabels(e)}}]:[{z:n,draw(e){t.draw(e)}}]}getMatchingVisibleMetas(t){const e=this,n=e.chart.getSortedVisibleDatasetMetas(),i=e.axis+"AxisID",r=[];let o,a;for(o=0,a=n.length;o<a;++o){const a=n[o];a[i]!==e.id||t&&a.type!==t||r.push(a)}return r}_resolveTickFontOptions(t){return oe(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this,e=t._resolveTickFontOptions(0).lineHeight;return(t.isHorizontal()?t.width:t.height)/e}}class Ai{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=this,n=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(n)&&(i=e.register(n));const r=e.items,o=t.id,a=e.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in r||(r[o]=t,function(t,e,n){const i=_(Object.create(null),[n?Nt.get(n):{},Nt.get(e),t.defaults]);Nt.set(e,i),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((n=>{const i=n.split("."),r=i.pop(),o=[t].concat(i).join("."),a=e[n].split("."),s=a.pop(),l=a.join(".");Nt.route(o,r,l,s)}))}(e,t.defaultRoutes),t.descriptors&&Nt.describe(e,t.descriptors)}(t,a,i),e.override&&Nt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in Nt[i]&&(delete Nt[i][n],this.override&&delete Lt[n])}}var Ei=new class{constructor(){this.controllers=new Ai(wn,"datasets",!0),this.elements=new Ai(wi,"elements"),this.plugins=new Ai(Object,"plugins"),this.scales=new Ai(Oi,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){const i=this;[...e].forEach((e=>{const r=n||i._getRegistryForType(e);n||r.isForType(e)||r===i.plugins&&e.id?i._exec(t,r,e):b(e,(e=>{const r=n||i._getRegistryForType(e);i._exec(t,r,e)}))}))}_exec(t,e,n){const i=S(t);m(n["before"+i],[],n),e[t](n),m(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const i=e.get(t);if(void 0===i)throw new Error('"'+t+'" is not a registered '+n+".");return i}};class Li{constructor(){this._init=[]}notify(t,e,n,i){const r=this;"beforeInit"===e&&(r._init=r._createDescriptors(t,!0),r._notify(r._init,t,"install"));const o=i?r._descriptors(t).filter(i):r._descriptors(t),a=r._notify(o,t,e,n);return"destroy"===e&&(r._notify(o,t,"stop"),r._notify(r._init,t,"uninstall")),a}_notify(t,e,n,i){i=i||{};for(const r of t){const t=r.plugin;if(!1===m(t[n],[e,i,r.options],t)&&i.cancelable)return!1}return!0}invalidate(){c(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=g(n.options&&n.options.plugins,{}),r=function(t){const e=[],n=Object.keys(Ei.plugins.items);for(let t=0;t<n.length;t++)e.push(Ei.getPlugin(n[t]));const i=t.plugins||[];for(let t=0;t<i.length;t++){const n=i[t];-1===e.indexOf(n)&&e.push(n)}return e}(n);return!1!==i||e?function(t,e,n,i){const r=[],o=t.getContext();for(let a=0;a<e.length;a++){const s=e[a],l=Ri(n[s.id],i);null!==l&&r.push({plugin:s,options:Fi(t.config,s,l,o)})}return r}(t,r,i,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,i=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function Ri(t,e){return e||!1!==t?!0===t?{}:t:null}function Fi(t,e,n,i){const r=t.pluginScopeKeys(e),o=t.getOptionScopes(n,r);return t.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ii(t,e){const n=Nt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Ni(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(n=e.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||t.charAt(0).toLowerCase();var n}function Hi(t){const e=t.options||(t.options={});e.plugins=g(e.plugins,{}),e.scales=function(t,e){const n=Lt[t.type]||{scales:{}},i=e.scales||{},r=Ii(t.type,e),o=Object.create(null),a=Object.create(null);return Object.keys(i).forEach((t=>{const e=i[t],s=Ni(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(s,r),c=n.scales||{};o[s]=o[s]||t,a[t]=M(Object.create(null),[{axis:s},e,c[s],c[l]])})),t.data.datasets.forEach((n=>{const r=n.type||t.type,s=n.indexAxis||Ii(r,e),l=(Lt[r]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,s),r=n[e+"AxisID"]||o[e]||e;a[r]=a[r]||Object.create(null),M(a[r],[{axis:e},i[r],l[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];M(e,[Nt.scales[e.type],Nt.scale])})),a}(t,e)}function Bi(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Wi=new Map,Ui=new Set;function Vi(t,e){let n=Wi.get(t);return n||(n=e(),Wi.set(t,n),Ui.add(n)),n}const ji=(t,e,n)=>{const i=T(e,n);void 0!==i&&t.add(i)};class Yi{constructor(t){this._config=function(t){return(t=t||{}).data=Bi(t.data),Hi(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Bi(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Hi(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Vi(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Vi(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Vi(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Vi(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:r}=this,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;const s=new Set;e.forEach((e=>{t&&(s.add(t),e.forEach((e=>ji(s,t,e)))),e.forEach((t=>ji(s,i,t))),e.forEach((t=>ji(s,Lt[r]||{},t))),e.forEach((t=>ji(s,Nt,t))),e.forEach((t=>ji(s,Rt,t)))}));const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),Ui.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Lt[e]||{},Nt.datasets[e]||{},{type:e},Nt,Rt]}resolveNamedOptions(t,e,n,i=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=qi(this._resolverCache,t,i);let s=o;(function(t,e){const{isScriptable:n,isIndexable:i}=pe(t);for(const r of e)if(n(r)&&P(t[r])||i(r)&&u(t[r]))return!0;return!1})(o,e)&&(r.$shared=!1,s=ge(o,n=P(n)?n():n,this.createResolver(t,n,a)));for(const t of e)r[t]=s[t];return r}createResolver(t,e,n=[""],i){const{resolver:r}=qi(this._resolverCache,t,n);return d(e)?ge(r,e,void 0,i):r}}function qi(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const r=n.join();let o=i.get(r);return o||(o={resolver:fe(e,n),subPrefixes:n.filter((t=>!t.toLowerCase().includes("hover")))},i.set(r,o)),o}const $i=["top","bottom","left","right","chartArea"];function Xi(t,e){return"top"===t||"bottom"===t||-1===$i.indexOf(t)&&"x"===e}function Qi(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function Gi(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),m(n&&n.onComplete,[t],e)}function Ki(t){const e=t.chart,n=e.options.animation;m(n&&n.onProgress,[t],e)}function Ji(t){return Ae()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Zi={},tr=t=>{const e=Ji(t);return Object.values(Zi).filter((t=>t.canvas===e)).pop()};class er{constructor(t,e){const n=this,i=this.config=new Yi(e),r=Ji(t),o=tr(r);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas can be reused.");const a=i.createResolver(i.chartOptionScopes(),n.getContext());this.platform=new(i.platform||function(t){return!Ae()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?si:vi}(r));const s=n.platform.acquireContext(r,a.aspectRatio),c=s&&s.canvas,u=c&&c.height,d=c&&c.width;this.id=l(),this.ctx=s,this.canvas=c,this.width=d,this.height=u,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Li,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(){return e?(clearTimeout(n),n=setTimeout(t,e)):t(),e}}((()=>this.update("resize")),a.resizeDelay||0),Zi[n.id]=n,s&&c?(rn.listen(n,"complete",Gi),rn.listen(n,"progress",Ki),n._initialize(),n.attached&&n.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:r}=this;return c(t)?e&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){const t=this;return t.notifyPlugins("beforeInit"),t.options.responsive?t.resize():Be(t,t.options.devicePixelRatio),t.bindEvents(),t.notifyPlugins("afterInit"),t}clear(){return Ut(this.canvas,this.ctx),this}stop(){return rn.stop(this),this}resize(t,e){rn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this,i=n.options,r=n.canvas,o=i.maintainAspectRatio&&n.aspectRatio,a=n.platform.getMaximumSize(r,t,e,o),s=i.devicePixelRatio||n.platform.getDevicePixelRatio();n.width=a.width,n.height=a.height,n._aspectRatio=n.aspectRatio,Be(n,s,!0)&&(n.notifyPlugins("resize",{size:a}),m(i.onResize,[n,a],n),n.attached&&n._doResize()&&n.render())}ensureScalesHaveIDs(){b(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this,e=t.options,n=e.scales,i=t.scales,r=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let o=[];n&&(o=o.concat(Object.keys(n).map((t=>{const e=n[t],i=Ni(t,e),r="r"===i,o="x"===i;return{options:e,dposition:r?"chartArea":o?"bottom":"left",dtype:r?"radialLinear":o?"category":"linear"}})))),b(o,(n=>{const o=n.options,a=o.id,s=Ni(a,o),l=g(o.type,n.dtype);void 0!==o.position&&Xi(o.position,s)===Xi(n.dposition)||(o.position=n.dposition),r[a]=!0;let c=null;a in i&&i[a].type===l?c=i[a]:(c=new(Ei.getScale(l))({id:a,type:l,ctx:t.ctx,chart:t}),i[c.id]=c),c.init(o,e)})),b(r,((t,e)=>{t||delete i[e]})),b(i,(e=>{oi.configure(t,e,e.options),oi.addBox(t,e)}))}_updateMetasets(){const t=this,e=t._metasets,n=t.data.datasets.length,i=e.length;if(e.sort(((t,e)=>t.index-e.index)),i>n){for(let e=n;e<i;++e)t._destroyDatasetMeta(e);e.splice(n,i-n)}t._sortedMetasets=e.slice(0).sort(Qi("order","index"))}_removeUnreferencedMetasets(){const t=this,{_metasets:e,data:{datasets:n}}=t;e.length>n.length&&delete t._stacks,e.forEach(((e,i)=>{0===n.filter((t=>t===e._dataset)).length&&t._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=this,e=[],n=t.data.datasets;let i,r;for(t._removeUnreferencedMetasets(),i=0,r=n.length;i<r;i++){const r=n[i];let o=t.getDatasetMeta(i);const a=r.type||t.config.type;if(o.type&&o.type!==a&&(t._destroyDatasetMeta(i),o=t.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||Ii(a,t.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=t.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const n=Ei.getController(a),{datasetElementType:r,dataElementType:s}=Nt.datasets[a];Object.assign(n.prototype,{dataElementType:Ei.getElement(s),datasetElementType:r&&Ei.getElement(r)}),o.controller=new n(t,i),e.push(o.controller)}}return t._updateMetasets(),e}_resetElements(){const t=this;b(t.data.datasets,((e,n)=>{t.getDatasetMeta(n).controller.reset()}),t)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this,n=e.config;n.update(),e._options=n.createResolver(n.chartOptionScopes(),e.getContext()),b(e.scales,(t=>{oi.removeBox(e,t)}));const i=e._animationsDisabled=!e.options.animation;if(e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),((t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0})(new Set(Object.keys(e._listeners)),new Set(e.options.events))&&!!this._responsiveListeners===e.options.responsive||(e.unbindEvents(),e.bindEvents()),e._plugins.invalidate(),!1===e.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=e.buildOrUpdateControllers();e.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,n=e.data.datasets.length;t<n;t++){const{controller:n}=e.getDatasetMeta(t),a=!i&&-1===r.indexOf(n);n.buildOrUpdateElements(a),o=Math.max(+n.getMaxOverflow(),o)}e._minPadding=o,e._updateLayout(o),i||b(r,(t=>{t.reset()})),e._updateDatasets(t),e.notifyPlugins("afterUpdate",{mode:t}),e._layers.sort(Qi("z","_idx")),e._lastEvent&&e._eventHandler(e._lastEvent,!0),e.render()}_updateLayout(t){const e=this;if(!1===e.notifyPlugins("beforeLayout",{cancelable:!0}))return;oi.update(e,e.width,e.height,t);const n=e.chartArea,i=n.width<=0||n.height<=0;e._layers=[],b(e.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),e._layers.push(...t._layers()))}),e),e._layers.forEach(((t,e)=>{t._idx=e})),e.notifyPlugins("afterLayout")}_updateDatasets(t){const e=this,n="function"==typeof t;if(!1!==e.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let i=0,r=e.data.datasets.length;i<r;++i)e._updateDataset(i,n?t({datasetIndex:i}):t);e.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this,i=n.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};!1!==n.notifyPlugins("beforeDatasetUpdate",r)&&(i.controller._update(e),r.cancelable=!1,n.notifyPlugins("afterDatasetUpdate",r))}render(){const t=this;!1!==t.notifyPlugins("beforeRender",{cancelable:!0})&&(rn.has(t)?t.attached&&!rn.running(t)&&rn.start(t):(t.draw(),Gi({chart:t})))}draw(){const t=this;let e;if(t._resizeBeforeDraw){const{width:e,height:n}=t._resizeBeforeDraw;t._resize(e,n),t._resizeBeforeDraw=null}if(t.clear(),t.width<=0||t.height<=0)return;if(!1===t.notifyPlugins("beforeDraw",{cancelable:!0}))return;const n=t._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(t.chartArea);for(t._drawDatasets();e<n.length;++e)n[e].draw(t.chartArea);t.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let i,r;for(i=0,r=e.length;i<r;++i){const r=e[i];t&&!r.visible||n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){const t=this;if(!1===t.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=t.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)t._drawDataset(e[n]);t.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this,n=e.ctx,i=t._clip,r=!i.disabled,o=e.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==e.notifyPlugins("beforeDatasetDraw",a)&&(r&&Yt(n,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?e.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?e.height:o.bottom+i.bottom}),t.controller.draw(),r&&qt(n),a.cancelable=!1,e.notifyPlugins("afterDatasetDraw",a))}getElementsAtEventForMode(t,e,n,i){const r=$n.modes[e];return"function"==typeof r?r(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter((t=>t&&t._dataset===e)).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context={chart:this,type:"chart"})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const i=this,r=n?"show":"hide",o=i.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,r);D(e)?(o.data[e].hidden=!n,i.update()):(i.setDatasetVisibility(t,n),a.update(o,{visible:n}),i.update((e=>e.datasetIndex===t?r:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this,n=e._metasets&&e._metasets[t];n&&n.controller&&(n.controller._destroy(),delete e._metasets[t])}destroy(){const t=this,{canvas:e,ctx:n}=t;let i,r;for(t.stop(),rn.remove(t),i=0,r=t.data.datasets.length;i<r;++i)t._destroyDatasetMeta(i);t.config.clearCache(),e&&(t.unbindEvents(),Ut(e,n),t.platform.releaseContext(n),t.canvas=null,t.ctx=null),t.notifyPlugins("destroy"),delete Zi[t.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this,e=t._listeners,n=t.platform,i=function(e,n,i){e.offsetX=n,e.offsetY=i,t._eventHandler(e)};b(t.options.events,(r=>((i,r)=>{n.addEventListener(t,i,r),e[i]=r})(r,i)))}bindResponsiveEvents(){const t=this;t._responsiveListeners||(t._responsiveListeners={});const e=t._responsiveListeners,n=t.platform,i=(i,r)=>{n.addEventListener(t,i,r),e[i]=r},r=(i,r)=>{e[i]&&(n.removeEventListener(t,i,r),delete e[i])},o=(e,n)=>{t.canvas&&t.resize(e,n)};let a;const s=()=>{r("attach",s),t.attached=!0,t.resize(),i("resize",o),i("detach",a)};a=()=>{t.attached=!1,r("resize",o),i("attach",s)},n.isAttached(t.canvas)?s():a()}unbindEvents(){const t=this;b(t._listeners,((e,n)=>{t.platform.removeEventListener(t,n,e)})),t._listeners={},b(t._responsiveListeners,((e,n)=>{t.platform.removeEventListener(t,n,e)})),t._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let r,o,a,s;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),a=0,s=t.length;a<s;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this,n=e._active||[],i=t.map((({datasetIndex:t,index:n})=>{const i=e.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[n],index:n}}));!x(i,n)&&(e._active=i,e._updateHoverStyles(i,n))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const i=this,r=i.options.hover,o=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),a=o(e,t),s=n?t:o(t,e);a.length&&i.updateHoverStyle(a,r.mode,!1),s.length&&r.mode&&i.updateHoverStyle(s,r.mode,!0)}_eventHandler(t,e){const n=this,i={event:t,replay:e,cancelable:!0},r=e=>(e.options.events||this.options.events).includes(t.type);if(!1===n.notifyPlugins("beforeEvent",i,r))return;const o=n._handleEvent(t,e);return i.cancelable=!1,n.notifyPlugins("afterEvent",i,r),(o||i.changed)&&n.render(),n}_handleEvent(t,e){const n=this,{_active:i=[],options:r}=n,o=r.hover,a=e;let s=[],l=!1,c=null;return"mouseout"!==t.type&&(s=n.getElementsAtEventForMode(t,o.mode,o,a),c="click"===t.type?n._lastEvent:t),n._lastEvent=null,jt(t,n.chartArea,n._minPadding)&&(m(r.onHover,[t,s,n],n),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||m(r.onClick,[t,s,n],n)),l=!x(s,i),(l||e)&&(n._active=s,n._updateHoverStyles(s,i,e)),n._lastEvent=c,l}}const nr=()=>b(er.instances,(t=>t._plugins.invalidate())),ir=!0;function rr(t,e,n){const{startAngle:i,pixelMargin:r,x:o,y:a,outerRadius:s,innerRadius:l}=e;let c=r/s;t.beginPath(),t.arc(o,a,s,i-c,n+c),l>r?(c=r/l,t.arc(o,a,l,n+c,i-c,!0)):t.arc(o,a,r,n+R,i-R),t.closePath(),t.clip()}function or(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function ar(t,e,n,i,r){const{x:o,y:a,startAngle:s,pixelMargin:l,innerRadius:c}=e,u=Math.max(e.outerRadius+i+n-l,0),d=c>0?c+i+n+l:0;let h=0;const f=r-s;if(i){const t=((c>0?c-i:0)+(u>0?u-i:0))/2;h=(f-(0!==t?f*t/(t+i):f))/2}const g=(f-Math.max(.001,f*u-n/z)/u)/2,p=s+g+h,m=r-g-h,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=function(t,e,n,i){const r=ee(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(n-e)/2,a=Math.min(o,i*e/2),s=t=>{const e=(n-Math.min(o,t))*i/2;return K(t,0,Math.min(o,e))};return{outerStart:s(r.outerStart),outerEnd:s(r.outerEnd),innerStart:K(r.innerStart,0,a),innerEnd:K(r.innerEnd,0,a)}}(e,d,u,m-p),w=u-b,_=u-x,M=p+b/w,k=m-x/_,C=d+y,T=d+v,S=p+y/C,D=m-v/T;if(t.beginPath(),t.arc(o,a,u,M,k),x>0){const e=or(_,k,o,a);t.arc(e.x,e.y,x,k,m+R)}const P=or(T,m,o,a);if(t.lineTo(P.x,P.y),v>0){const e=or(T,D,o,a);t.arc(e.x,e.y,v,m+R,D+Math.PI)}if(t.arc(o,a,d,m-v/d,p+y/d,!0),y>0){const e=or(C,S,o,a);t.arc(e.x,e.y,y,S+Math.PI,p-R)}const O=or(w,p,o,a);if(t.lineTo(O.x,O.y),b>0){const e=or(w,M,o,a);t.arc(e.x,e.y,b,p-R,M)}t.closePath()}Object.defineProperties(er,{defaults:{enumerable:ir,value:Nt},instances:{enumerable:ir,value:Zi},overrides:{enumerable:ir,value:Lt},registry:{enumerable:ir,value:Ei},version:{enumerable:ir,value:"3.5.1"},getChart:{enumerable:ir,value:tr},register:{enumerable:ir,value:(...t)=>{Ei.add(...t),nr()}},unregister:{enumerable:ir,value:(...t)=>{Ei.remove(...t),nr()}}});class sr extends wi{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.getProps(["x","y"],n),{angle:r,distance:o}=function(t,e){const n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*z&&(o+=O),{angle:o,distance:r}}(i,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=this.options.spacing/2;return(u>=O||G(r,a,s))&&o>=l+d&&o<=c+d}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:s,spacing:l}=this.options,c=(i+r)/2,u=(o+a+l+s)/2;return{x:e+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const e=this,{options:n,circumference:i}=e,r=(n.offset||0)/2,o=(n.spacing||0)/2;if(e.pixelMargin="inner"===n.borderAlign?.33:0,e.fullCircles=i>O?Math.floor(i/O):0,0===i||e.innerRadius<0||e.outerRadius<0)return;t.save();let a=0;if(r){a=r/2;const n=(e.startAngle+e.endAngle)/2;t.translate(Math.cos(n)*a,Math.sin(n)*a),e.circumference>=z&&(a=r)}t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor;const s=function(t,e,n,i){const{fullCircles:r,startAngle:o,circumference:a}=e;let s=e.endAngle;if(r){ar(t,e,n,i,o+O);for(let e=0;e<r;++e)t.fill();isNaN(a)||(s=o+a%O,a%O==0&&(s+=O))}return ar(t,e,n,i,s),t.fill(),s}(t,e,a,o);(function(t,e,n,i,r){const{options:o}=e,a="inner"===o.borderAlign;o.borderWidth&&(a?(t.lineWidth=2*o.borderWidth,t.lineJoin="round"):(t.lineWidth=o.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,n){const{x:i,y:r,startAngle:o,pixelMargin:a,fullCircles:s}=e,l=Math.max(e.outerRadius-a,0),c=e.innerRadius+a;let u;for(n&&rr(t,e,o+O),t.beginPath(),t.arc(i,r,c,o+O,o,!0),u=0;u<s;++u)t.stroke();for(t.beginPath(),t.arc(i,r,l,o,o+O),u=0;u<s;++u)t.stroke()}(t,e,a),a&&rr(t,e,r),ar(t,e,n,i,r),t.stroke())})(t,e,a,o,s),t.restore()}}function lr(t,e,n=e){t.lineCap=g(n.borderCapStyle,e.borderCapStyle),t.setLineDash(g(n.borderDash,e.borderDash)),t.lineDashOffset=g(n.borderDashOffset,e.borderDashOffset),t.lineJoin=g(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=g(n.borderWidth,e.borderWidth),t.strokeStyle=g(n.borderColor,e.borderColor)}function cr(t,e,n){t.lineTo(n.x,n.y)}function ur(t,e,n={}){const i=t.length,{start:r=0,end:o=i-1}=n,{start:a,end:s}=e,l=Math.max(r,a),c=Math.min(o,s),u=r<a&&o<a||r>s&&o>s;return{count:i,start:l,loop:e.loop,ilen:c<l&&!u?i+c-l:c-l}}function dr(t,e,n,i){const{points:r,options:o}=e,{count:a,start:s,loop:l,ilen:c}=ur(r,n,i),u=function(t){return t.stepped?$t:t.tension||"monotone"===t.cubicInterpolationMode?Xt:cr}(o);let d,h,f,{move:g=!0,reverse:p}=i||{};for(d=0;d<=c;++d)h=r[(s+(p?c-d:d))%a],h.skip||(g?(t.moveTo(h.x,h.y),g=!1):u(t,f,h,p,o.stepped),f=h);return l&&(h=r[(s+(p?c:0))%a],u(t,f,h,p,o.stepped)),!!l}function hr(t,e,n,i){const r=e.points,{count:o,start:a,ilen:s}=ur(r,n,i),{move:l=!0,reverse:c}=i||{};let u,d,h,f,g,p,m=0,b=0;const x=t=>(a+(c?s-t:t))%o,y=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=r[x(0)],t.moveTo(d.x,d.y)),u=0;u<=s;++u){if(d=r[x(u)],d.skip)continue;const e=d.x,n=d.y,i=0|e;i===h?(n<f?f=n:n>g&&(g=n),m=(b*m+e)/++b):(y(),t.lineTo(e,n),h=i,b=0,f=g=n),p=n}y()}function fr(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n?dr:hr}sr.id="arc",sr.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},sr.defaultRoutes={backgroundColor:"backgroundColor"};const gr="function"==typeof Path2D;class pr extends wi{constructor(t){super(),this.animated=!0,this.options=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this,i=n.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!n._pointsUpdated){const r=i.spanGaps?n._loop:n._fullLoop;Oe(n._points,i,t,r,e),n._pointsUpdated=!0}}set points(t){const e=this;e._points=t,delete e._segments,delete e._path,e._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const n=t.points,i=t.options.spanGaps,r=n.length;if(!r)return[];const o=!!t._loop,{start:a,end:s}=function(t,e,n,i){let r=0,o=e-1;if(n&&!i)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,n&&(o+=r);o>r&&t[o%e].skip;)o--;return o%=e,{start:r,end:o}}(n,r,o,i);return function(t,e,n,i){return i&&i.setContext&&n?function(t,e,n,i){const r=en(t.options),o=n.length,a=[];let s=e[0].start,l=s;for(const c of e){let e,u=r,d=n[s%o];for(l=s+1;l<=c.end;l++){const r=n[l%o];e=en(i.setContext({type:"segment",p0:d,p1:r,p0DataIndex:(l-1)%o,p1DataIndex:l%o,datasetIndex:t._datasetIndex})),nn(e,u)&&(a.push({start:s,end:l-1,loop:c.loop,style:u}),u=e,s=l-1),d=r,u=e}s<l-1&&(a.push({start:s,end:l-1,loop:c.loop,style:e}),s=l-1)}return a}(t,e,n,i):e}(t,!0===i?[{start:a,end:s,loop:o}]:function(t,e,n,i){const r=t.length,o=[];let a,s=e,l=t[e];for(a=e+1;a<=n;++a){const n=t[a%r];n.skip||n.stop?l.skip||(i=!1,o.push({start:e%r,end:(a-1)%r,loop:i}),e=s=n.stop?a:null):(s=a,l.skip&&(e=a)),l=n}return null!==s&&o.push({start:e%r,end:s%r,loop:i}),o}(n,a,s<a?s+r:s,!!t._fullLoop&&0===a&&s===r-1),n,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this,i=n.options,r=t[e],o=n.points,a=tn(n,{property:e,start:r,end:r});if(!a.length)return;const s=[],l=function(t){return t.stepped?je:t.tension||"monotone"===t.cubicInterpolationMode?Ye:Ve}(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:n,end:u}=a[c],d=o[n],h=o[u];if(d===h){s.push(d);continue}const f=l(d,h,Math.abs((r-d[e])/(h[e]-d[e])),i.stepped);f[e]=t[e],s.push(f)}return 1===s.length?s[0]:s}pathSegment(t,e,n){return fr(this)(t,this,e,n)}path(t,e,n){const i=this,r=i.segments,o=fr(i);let a=i._loop;e=e||0,n=n||i.points.length-e;for(const s of r)a&=o(t,i,s,{start:e,end:e+n-1});return!!a}draw(t,e,n,i){const r=this,o=r.options||{};(r.points||[]).length&&o.borderWidth&&(t.save(),function(t,e,n,i){gr&&1===e.segments.length?function(t,e,n,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,i)&&r.closePath()),lr(t,e.options),t.stroke(r)}(t,e,n,i):function(t,e,n,i){const{segments:r,options:o}=e,a=fr(e);for(const s of r)lr(t,o,s.style),t.beginPath(),a(t,e,s,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}(t,r,n,i),t.restore(),r.animated&&(r._pointsUpdated=!1,r._path=void 0))}}function mr(t,e,n,i){const r=t.options,{[n]:o}=t.getProps([n],i);return Math.abs(e-o)<r.radius+r.hitRadius}pr.id="line",pr.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},pr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},pr.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class br extends wi{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,e){return mr(this,t,"x",e)}inYRange(t,e){return mr(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const n=this,i=n.options;n.skip||i.radius<.1||!jt(n,e,n.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Vt(t,i,n.x,n.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function xr(t,e){const{x:n,y:i,base:r,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let s,l,c,u,d;return t.horizontal?(d=a/2,s=Math.min(n,r),l=Math.max(n,r),c=i-d,u=i+d):(d=o/2,s=n-d,l=n+d,c=Math.min(i,r),u=Math.max(i,r)),{left:s,top:c,right:l,bottom:u}}function yr(t,e,n,i){return t?0:K(e,n,i)}function vr(t,e,n,i){const r=null===e,o=null===n,a=t&&!(r&&o)&&xr(t,i);return a&&(r||e>=a.left&&e<=a.right)&&(o||n>=a.top&&n<=a.bottom)}function wr(t,e){t.rect(e.x,e.y,e.w,e.h)}function _r(t,e,n={}){const i=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-i,a=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+i,y:t.y+r,w:t.w+o,h:t.h+a,radius:t.radius}}br.id="point",br.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},br.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Mr extends wi{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const e=this.options,{inner:n,outer:i}=function(t){const e=xr(t),n=e.right-e.left,i=e.bottom-e.top,r=function(t,e,n){const i=t.options.borderWidth,r=t.borderSkipped,o=ne(i);return{t:yr(r.top,o.top,0,n),r:yr(r.right,o.right,0,e),b:yr(r.bottom,o.bottom,0,n),l:yr(r.left,o.left,0,e)}}(t,n/2,i/2),o=function(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,o=ie(r),a=Math.min(e,n),s=t.borderSkipped,l=i||d(r);return{topLeft:yr(!l||s.top||s.left,o.topLeft,0,a),topRight:yr(!l||s.top||s.right,o.topRight,0,a),bottomLeft:yr(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:yr(!l||s.bottom||s.right,o.bottomRight,0,a)}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:o},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,o.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(r.b,r.r))}}}}(this),r=(o=i.radius).topLeft||o.topRight||o.bottomLeft||o.bottomRight?Kt:wr;var o;t.save(),i.w===n.w&&i.h===n.h||(t.beginPath(),r(t,_r(i,.33,n)),t.clip(),r(t,_r(n,-.33,i)),t.fillStyle=e.borderColor,t.fill("evenodd")),t.beginPath(),r(t,_r(n,.33,i)),t.fillStyle=e.backgroundColor,t.fill(),t.restore()}inRange(t,e,n){return vr(this,t,e,n)}inXRange(t,e){return vr(this,t,null,e)}inYRange(t,e){return vr(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+i)/2:e,y:r?n:(n+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}Mr.id="bar",Mr.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},Mr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var kr=Object.freeze({__proto__:null,ArcElement:sr,LineElement:pr,PointElement:br,BarElement:Mr});function Cr(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function Tr(t){t.data.datasets.forEach((t=>{Cr(t)}))}var Sr={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled)return void Tr(t);const i=t.width;t.data.datasets.forEach(((e,r)=>{const{_data:o,indexAxis:a}=e,s=t.getDatasetMeta(r),l=o||e.data;if("y"===ae([a,t.options.indexAxis]))return;if("line"!==s.type)return;const u=t.scales[s.xAxisID];if("linear"!==u.type&&"time"!==u.type)return;if(t.options.parsing)return;let d,{start:h,count:f}=function(t,e){const n=e.length;let i,r=0;const{iScale:o}=t,{min:a,max:s,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=K(le(e,o.axis,a).lo,0,n-1)),i=c?K(le(e,o.axis,s).hi+1,r,n)-r:n-r,{start:r,count:i}}(s,l);if(f<=(n.threshold||4*i))Cr(e);else{switch(c(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),n.algorithm){case"lttb":d=function(t,e,n,i,r){const o=r.samples||i;if(o>=n)return t.slice(e,e+n);const a=[],s=(n-2)/(o-2);let l=0;const c=e+n-1;let u,d,h,f,g,p=e;for(a[l++]=t[p],u=0;u<o-2;u++){let i,r=0,o=0;const c=Math.floor((u+1)*s)+1+e,m=Math.min(Math.floor((u+2)*s)+1,n)+e,b=m-c;for(i=c;i<m;i++)r+=t[i].x,o+=t[i].y;r/=b,o/=b;const x=Math.floor(u*s)+1+e,y=Math.min(Math.floor((u+1)*s)+1,n)+e,{x:v,y:w}=t[p];for(h=f=-1,i=x;i<y;i++)f=.5*Math.abs((v-r)*(t[i].y-w)-(v-t[i].x)*(o-w)),f>h&&(h=f,d=t[i],g=i);a[l++]=d,p=g}return a[l++]=t[c],a}(l,h,f,i,n);break;case"min-max":d=function(t,e,n,i){let r,o,a,s,l,u,d,h,f,g,p=0,m=0;const b=[],x=e+n-1,y=t[e].x,v=t[x].x-y;for(r=e;r<e+n;++r){o=t[r],a=(o.x-y)/v*i,s=o.y;const e=0|a;if(e===l)s<f?(f=s,u=r):s>g&&(g=s,d=r),p=(m*p+o.x)/++m;else{const n=r-1;if(!c(u)&&!c(d)){const e=Math.min(u,d),i=Math.max(u,d);e!==h&&e!==n&&b.push({...t[e],x:p}),i!==h&&i!==n&&b.push({...t[i],x:p})}r>0&&n!==h&&b.push(t[n]),b.push(o),l=e,m=0,f=g=s,u=d=h=r}}return b}(l,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}e._decimated=d}}))},destroy(t){Tr(t)}};function Dr(t,e,n){const i=function(t){const e=t.options,n=e.fill;let i=g(n&&n.target,n);return void 0===i&&(i=!!e.backgroundColor),!1!==i&&null!==i&&(!0===i?"origin":i)}(t);if(d(i))return!isNaN(i.value)&&i;let r=parseFloat(i);return h(r)&&Math.floor(r)===r?("-"!==i[0]&&"+"!==i[0]||(r=e+r),!(r===e||r<0||r>=n)&&r):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}class Pr{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:i,y:r,radius:o}=this;return e=e||{start:0,end:O},t.arc(i,r,o,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:i}=this,r=t.angle;return{x:e+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}}function zr(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}const Or=t=>"line"===t.type&&!t.hidden;function Ar(t,e,n){const i=[];for(let r=0;r<n.length;r++){const o=n[r],{first:a,last:s,point:l}=Er(o,e,"x");if(!(!l||a&&s))if(a)i.unshift(l);else if(t.push(l),!s)break}t.push(...i)}function Er(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const r=i[n],o=t.segments,a=t.points;let s=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],i=a[e.start][n],c=a[e.end][n];if(r>=i&&r<=c){s=r===i,l=r===c;break}}return{first:s,last:l,point:i}}function Lr(t,e){let n=[],i=!1;return u(t)?(i=!0,n=t):n=function(t,e){const{x:n=null,y:i=null}=t||{},r=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=zr(t,e,r);const a=r[t],s=r[e];null!==i?(o.push({x:a.x,y:i}),o.push({x:s.x,y:i})):null!==n&&(o.push({x:n,y:a.y}),o.push({x:n,y:s.y}))})),o}(t,e),n.length?new pr({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Rr(t,e,n){let i=t[e].fill;const r=[e];let o;if(!n)return i;for(;!1!==i&&-1===r.indexOf(i);){if(!h(i))return i;if(o=t[i],!o)return!1;if(o.visible)return i;r.push(i),i=o.fill}return!1}function Fr(t,e,n){t.beginPath(),e.path(t),t.lineTo(e.last().x,n),t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Ir(t,e,n,i){if(i)return;let r=e[t],o=n[t];return"angle"===t&&(r=Q(r),o=Q(o)),{property:t,start:r,end:o}}function Nr(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function Hr(t,e,n){const{top:i,bottom:r}=e.chart.chartArea,{property:o,start:a,end:s}=n||{};"x"===o&&(t.beginPath(),t.rect(a,i,s-a,r-i),t.clip())}function Br(t,e,n,i){const r=e.interpolate(n,i);r&&t.lineTo(r.x,r.y)}function Wr(t,e){const{line:n,target:i,property:r,color:o,scale:a}=e,s=function(t,e,n){const i=t.segments,r=t.points,o=e.points,a=[];for(const t of i){let{start:i,end:s}=t;s=zr(i,s,r);const l=Ir(n,r[i],r[s],t.loop);if(!e.segments){a.push({source:t,target:l,start:r[i],end:r[s]});continue}const c=tn(e,l);for(const e of c){const i=Ir(n,o[e.start],o[e.end],e.loop),s=Ze(t,r,i);for(const t of s)a.push({source:t,target:e,start:{[n]:Nr(l,i,"start",Math.max)},end:{[n]:Nr(l,i,"end",Math.min)}})}}return a}(n,i,r);for(const{source:e,target:l,start:c,end:u}of s){const{style:{backgroundColor:s=o}={}}=e,d=!0!==i;t.save(),t.fillStyle=s,Hr(t,a,d&&Ir(r,c,u)),t.beginPath();const h=!!n.pathSegment(t,e);let f;if(d){h?t.closePath():Br(t,i,u,r);const e=!!i.pathSegment(t,l,{move:h,reverse:!0});f=h&&e,f||Br(t,i,c,r)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function Ur(t,e,n){const i=function(t){const{chart:e,fill:n,line:i}=t;if(h(n))return function(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}(e,n);if("stack"===n)return function(t){const{chart:e,scale:n,index:i,line:r}=t,o=[],a=r.segments,s=r.points,l=function(t,e){const n=[],i=t.getSortedVisibleDatasetMetas();for(let t=0;t<i.length;t++){const r=i[t];if(r.index===e)break;Or(r)&&n.unshift(r.dataset)}return n}(e,i);l.push(Lr({x:null,y:n.bottom},r));for(let t=0;t<a.length;t++){const e=a[t];for(let t=e.start;t<=e.end;t++)Ar(o,s[t],l)}return new pr({points:o,options:{}})}(t);if("shape"===n)return!0;const r=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:n}=t,i=e.options,r=e.getLabels().length,o=[],a=i.reverse?e.max:e.min,s=i.reverse?e.min:e.max;let l,c,u;if(u="start"===n?a:"end"===n?s:d(n)?n.value:e.getBaseValue(),i.grid.circular)return c=e.getPointPositionForValue(0,a),new Pr({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(u)});for(l=0;l<r;++l)o.push(e.getPointPositionForValue(l,u));return o}(t):function(t){const{scale:e={},fill:n}=t;let i,r=null;return"start"===n?r=e.bottom:"end"===n?r=e.top:d(n)?r=e.getPixelForValue(n.value):e.getBasePixel&&(r=e.getBasePixel()),h(r)?(i=e.isHorizontal(),{x:i?r:null,y:i?null:r}):null}(t)}(t);return r instanceof Pr?r:Lr(r,i)}(e),{line:r,scale:o,axis:a}=e,s=r.options,l=s.fill,c=s.backgroundColor,{above:u=c,below:f=c}=l||{};i&&r.points.length&&(Yt(t,n),function(t,e){const{line:n,target:i,above:r,below:o,area:a,scale:s}=e,l=n._loop?"angle":e.axis;t.save(),"x"===l&&o!==r&&(Fr(t,i,a.top),Wr(t,{line:n,target:i,color:r,scale:s,property:l}),t.restore(),t.save(),Fr(t,i,a.bottom)),Wr(t,{line:n,target:i,color:o,scale:s,property:l}),t.restore()}(t,{line:r,target:i,above:u,below:f,area:n,scale:o,axis:a}),qt(t))}var Vr={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,r=[];let o,a,s,l;for(a=0;a<i;++a)o=t.getDatasetMeta(a),s=o.dataset,l=null,s&&s.options&&s instanceof pr&&(l={visible:t.isDatasetVisible(a),index:a,fill:Dr(s,a,i),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:s}),o.$filler=l,r.push(l);for(a=0;a<i;++a)l=r[a],l&&!1!==l.fill&&(l.fill=Rr(r,a,n.propagate))},beforeDraw(t,e,n){const i="beforeDraw"===n.drawTime,r=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=r.length-1;e>=0;--e){const n=r[e].$filler;n&&(n.line.updateControlPoints(o,n.axis),i&&Ur(t.ctx,n,o))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=t.getSortedVisibleDatasetMetas();for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;n&&Ur(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;i&&!1!==i.fill&&"beforeDatasetDraw"===n.drawTime&&Ur(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const jr=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}};class Yr extends wi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){const i=this;i.maxWidth=t,i.maxHeight=e,i._margins=n,i.setDimensions(),i.buildLabels(),i.fit()}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=t._margins.left,t.right=t.width):(t.height=t.maxHeight,t.top=t._margins.top,t.bottom=t.height)}buildLabels(){const t=this,e=t.options.labels||{};let n=m(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((n=>e.filter(n,t.chart.data)))),e.sort&&(n=n.sort(((n,i)=>e.sort(n,i,t.chart.data)))),t.options.reverse&&n.reverse(),t.legendItems=n}fit(){const t=this,{options:e,ctx:n}=t;if(!e.display)return void(t.width=t.height=0);const i=e.labels,r=oe(i.font),o=r.size,a=t._computeTitleHeight(),{boxWidth:s,itemHeight:l}=jr(i,o);let c,u;n.font=r.string,t.isHorizontal()?(c=t.maxWidth,u=t._fitRows(a,o,s,l)+10):(u=t.maxHeight,c=t._fitCols(a,o,s,l)+10),t.width=Math.min(c,e.maxWidth||t.maxWidth),t.height=Math.min(u,e.maxHeight||t.maxHeight)}_fitRows(t,e,n,i){const r=this,{ctx:o,maxWidth:a,options:{labels:{padding:s}}}=r,l=r.legendHitBoxes=[],c=r.lineWidths=[0],u=i+s;let d=t;o.textAlign="left",o.textBaseline="middle";let h=-1,f=-u;return r.legendItems.forEach(((t,r)=>{const g=n+e/2+o.measureText(t.text).width;(0===r||c[c.length-1]+g+2*s>a)&&(d+=u,c[c.length-(r>0?0:1)]=0,f+=u,h++),l[r]={left:0,top:f,row:h,width:g,height:i},c[c.length-1]+=g+s})),d}_fitCols(t,e,n,i){const r=this,{ctx:o,maxHeight:a,options:{labels:{padding:s}}}=r,l=r.legendHitBoxes=[],c=r.columnSizes=[],u=a-t;let d=s,h=0,f=0,g=0,p=0;return r.legendItems.forEach(((t,r)=>{const a=n+e/2+o.measureText(t.text).width;r>0&&f+i+2*s>u&&(d+=h+s,c.push({width:h,height:f}),g+=h+s,p++,h=f=0),l[r]={left:g,top:f,col:p,width:a,height:i},h=Math.max(h,a),f+=i+s})),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){const t=this;if(!t.options.display)return;const e=t._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:o}}=t,s=Xe(o,t.left,t.width);if(this.isHorizontal()){let o=0,l=a(i,t.left+r,t.right-t.lineWidths[o]);for(const c of n)o!==c.row&&(o=c.row,l=a(i,t.left+r,t.right-t.lineWidths[o])),c.top+=t.top+e+r,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+r}else{let o=0,l=a(i,t.top+e+r,t.bottom-t.columnSizes[o].height);for(const c of n)c.col!==o&&(o=c.col,l=a(i,t.top+e+r,t.bottom-t.columnSizes[o].height)),c.top=l,c.left+=t.left+r,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){const t=this;if(t.options.display){const e=t.ctx;Yt(e,t),t._draw(),qt(e)}}_draw(){const t=this,{options:e,columnSizes:n,lineWidths:i,ctx:r}=t,{align:o,labels:s}=e,l=Nt.color,c=Xe(e.rtl,t.left,t.width),u=oe(s.font),{color:d,padding:h}=s,f=u.size,p=f/2;let m;t.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=u.string;const{boxWidth:b,boxHeight:x,itemHeight:y}=jr(s,f),v=t.isHorizontal(),w=this._computeTitleHeight();m=v?{x:a(o,t.left+h,t.right-i[0]),y:t.top+h+w,line:0}:{x:t.left+h,y:a(o,t.top+w+h,t.bottom-n[0].height),line:0},Qe(t.ctx,e.textDirection);const _=y+h;t.legendItems.forEach(((M,k)=>{r.strokeStyle=M.fontColor||d,r.fillStyle=M.fontColor||d;const C=r.measureText(M.text).width,T=c.textAlign(M.textAlign||(M.textAlign=s.textAlign)),S=b+p+C;let D=m.x,P=m.y;c.setWidth(t.width),v?k>0&&D+S+h>t.right&&(P=m.y+=_,m.line++,D=m.x=a(o,t.left+h,t.right-i[m.line])):k>0&&P+_>t.bottom&&(D=m.x=D+n[m.line].width+h,m.line++,P=m.y=a(o,t.top+w+h,t.bottom-n[m.line].height)),function(t,e,n){if(isNaN(b)||b<=0||isNaN(x)||x<0)return;r.save();const i=g(n.lineWidth,1);if(r.fillStyle=g(n.fillStyle,l),r.lineCap=g(n.lineCap,"butt"),r.lineDashOffset=g(n.lineDashOffset,0),r.lineJoin=g(n.lineJoin,"miter"),r.lineWidth=i,r.strokeStyle=g(n.strokeStyle,l),r.setLineDash(g(n.lineDash,[])),s.usePointStyle){const o={radius:b*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},a=c.xPlus(t,b/2);Vt(r,o,a,e+p)}else{const o=e+Math.max((f-x)/2,0),a=c.leftForLtr(t,b),s=ie(n.borderRadius);r.beginPath(),Object.values(s).some((t=>0!==t))?Kt(r,{x:a,y:o,w:b,h:x,radius:s}):r.rect(a,o,b,x),r.fill(),0!==i&&r.stroke()}r.restore()}(c.x(D),P,M),D=((t,e,n,i)=>t===(i?"left":"right")?n:"center"===t?(e+n)/2:e)(T,D+b+p,v?D+S:t.right,e.rtl),function(t,e,n){Qt(r,n.text,t,e+y/2,u,{strikethrough:n.hidden,textAlign:c.textAlign(n.textAlign)})}(c.x(D),P,M),v?m.x+=S+h:m.y+=_})),Ge(t.ctx,e.textDirection)}drawTitle(){const t=this,e=t.options,n=e.title,i=oe(n.font),r=re(n.padding);if(!n.display)return;const s=Xe(e.rtl,t.left,t.width),l=t.ctx,c=n.position,u=i.size/2,d=r.top+u;let h,f=t.left,g=t.width;if(this.isHorizontal())g=Math.max(...t.lineWidths),h=t.top+d,f=a(e.align,f,t.right-g);else{const n=t.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=d+a(e.align,t.top,t.bottom-n-e.labels.padding-t._computeTitleHeight())}const p=a(c,f,f+g);l.textAlign=s.textAlign(o(c)),l.textBaseline="middle",l.strokeStyle=n.color,l.fillStyle=n.color,l.font=i.string,Qt(l,n.text,p,h,i)}_computeTitleHeight(){const t=this.options.title,e=oe(t.font),n=re(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){const n=this;let i,r,o;if(t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom)for(o=n.legendHitBoxes,i=0;i<o.length;++i)if(r=o[i],t>=r.left&&t<=r.left+r.width&&e>=r.top&&e<=r.top+r.height)return n.legendItems[i];return null}handleEvent(t){const e=this,n=e.options;if(!function(t,e){return!("mousemove"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,n))return;const i=e._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const a=e._hoveredItem,s=(o=i,null!==(r=a)&&null!==o&&r.datasetIndex===o.datasetIndex&&r.index===o.index);a&&!s&&m(n.onLeave,[t,a,e],e),e._hoveredItem=i,i&&!s&&m(n.onHover,[t,i,e],e)}else i&&m(n.onClick,[t,i,e],e);var r,o}}var qr={id:"legend",_element:Yr,start(t,e,n){const i=t.legend=new Yr({ctx:t.ctx,options:n,chart:t});oi.configure(t,i,n),oi.addBox(t,i)},stop(t){oi.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;oi.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),e.hidden=!0):(r.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:o}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(n?0:void 0),s=re(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:r||a.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class $r extends wi{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this,i=n.options;if(n.left=0,n.top=0,!i.display)return void(n.width=n.height=n.right=n.bottom=0);n.width=n.right=t,n.height=n.bottom=e;const r=u(i.text)?i.text.length:1;n._padding=re(i.padding);const o=r*oe(i.font).lineHeight+n._padding.height;n.isHorizontal()?n.height=o:n.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:n,bottom:i,right:r,options:o}=this,s=o.align;let l,c,u,d=0;return this.isHorizontal()?(c=a(s,n,r),u=e+t,l=r-n):("left"===o.position?(c=n+t,u=a(s,i,e),d=-.5*z):(c=r-t,u=a(s,e,i),d=.5*z),l=i-e),{titleX:c,titleY:u,maxWidth:l,rotation:d}}draw(){const t=this,e=t.ctx,n=t.options;if(!n.display)return;const i=oe(n.font),r=i.lineHeight/2+t._padding.top,{titleX:a,titleY:s,maxWidth:l,rotation:c}=t._drawArgs(r);Qt(e,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:o(n.align),textBaseline:"middle",translation:[a,s]})}}var Xr={id:"title",_element:$r,start(t,e,n){!function(t,e){const n=new $r({ctx:t.ctx,options:e,chart:t});oi.configure(t,n,e),oi.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;oi.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;oi.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qr=new WeakMap;var Gr={id:"subtitle",start(t,e,n){const i=new $r({ctx:t.ctx,options:n,chart:t});oi.configure(t,i,n),oi.addBox(t,i),Qr.set(t,i)},stop(t){oi.removeBox(t,Qr.get(t)),Qr.delete(t)},beforeUpdate(t,e,n){const i=Qr.get(t);oi.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Kr={average(t){if(!t.length)return!1;let e,n,i=0,r=0,o=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();i+=t.x,r+=t.y,++o}}return{x:i/o,y:r/o}},nearest(t,e){if(!t.length)return!1;let n,i,r,o=e.x,a=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){const i=t[n].element;if(i&&i.hasValue()){const t=$(e,i.getCenterPoint());t<s&&(s=t,r=i)}}if(r){const t=r.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function Jr(t,e){return e&&(u(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Zr(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function to(t,e){const{element:n,datasetIndex:i,index:r}=e,o=t.getDatasetMeta(i).controller,{label:a,value:s}=o.getLabelAndValue(r);return{chart:t,label:a,parsed:o.getParsed(r),raw:t.data.datasets[i].data[r],formattedValue:s,dataset:o.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function eo(t,e){const n=t._chart.ctx,{body:i,footer:r,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=oe(e.bodyFont),c=oe(e.titleFont),u=oe(e.footerFont),d=o.length,h=r.length,f=i.length,g=re(e.padding);let p=g.height,m=0,x=i.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);x+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x&&(p+=f*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(x-f)*l.lineHeight+(x-1)*e.bodySpacing),h&&(p+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let y=0;const v=function(t){m=Math.max(m,n.measureText(t).width+y)};return n.save(),n.font=c.string,b(t.title,v),n.font=l.string,b(t.beforeBody.concat(t.afterBody),v),y=e.displayColors?a+2:0,b(i,(t=>{b(t.before,v),b(t.lines,v),b(t.after,v)})),y=0,n.font=u.string,b(t.footer,v),n.restore(),m+=g.width,{width:m,height:p}}function no(t,e,n,i){const{x:r,width:o}=n,{width:a,chartArea:{left:s,right:l}}=t;let c="center";return"center"===i?c=r<=(s+l)/2?"left":"right":r<=o/2?c="left":r>=a-o/2&&(c="right"),function(t,e,n,i){const{x:r,width:o}=i,a=n.caretSize+n.caretPadding;return"left"===t&&r+o+a>e.width||"right"===t&&r-o-a<0||void 0}(c,t,e,n)&&(c="center"),c}function io(t,e,n){const i=e.yAlign||function(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}(t,n);return{xAlign:e.xAlign||no(t,e,n,i),yAlign:i}}function ro(t,e,n,i){const{caretSize:r,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=n,c=r+o,u=a+o;let d=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,s);const h=function(t,e,n){let{y:i,height:r}=t;return"top"===e?i+=n:i-="bottom"===e?r+n:r/2,i}(e,l,c);return"center"===l?"left"===s?d+=c:"right"===s&&(d-=c):"left"===s?d-=u:"right"===s&&(d+=u),{x:K(d,0,i.width-e.width),y:K(h,0,i.height-e.height)}}function oo(t,e,n){const i=re(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function ao(t){return Jr([],Zr(t))}function so(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}class lo extends wi{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this,e=t._cachedAnimations;if(e)return e;const n=t._chart,i=t.options.setContext(t.getContext()),r=i.enabled&&n.options.animation&&i.animations,o=new cn(t._chart,r);return r._cacheable&&(t._cachedAnimations=Object.freeze(o)),o}getContext(){const t=this;return t.$context||(t.$context=(e=t._chart.getContext(),n=t,i=t._tooltipItems,Object.assign(Object.create(e),{tooltip:n,tooltipItems:i,type:"tooltip"})));var e,n,i}getTitle(t,e){const n=this,{callbacks:i}=e,r=i.beforeTitle.apply(n,[t]),o=i.title.apply(n,[t]),a=i.afterTitle.apply(n,[t]);let s=[];return s=Jr(s,Zr(r)),s=Jr(s,Zr(o)),s=Jr(s,Zr(a)),s}getBeforeBody(t,e){return ao(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const n=this,{callbacks:i}=e,r=[];return b(t,(t=>{const e={before:[],lines:[],after:[]},o=so(i,t);Jr(e.before,Zr(o.beforeLabel.call(n,t))),Jr(e.lines,o.label.call(n,t)),Jr(e.after,Zr(o.afterLabel.call(n,t))),r.push(e)})),r}getAfterBody(t,e){return ao(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const n=this,{callbacks:i}=e,r=i.beforeFooter.apply(n,[t]),o=i.footer.apply(n,[t]),a=i.afterFooter.apply(n,[t]);let s=[];return s=Jr(s,Zr(r)),s=Jr(s,Zr(o)),s=Jr(s,Zr(a)),s}_createItems(t){const e=this,n=e._active,i=e._chart.data,r=[],o=[],a=[];let s,l,c=[];for(s=0,l=n.length;s<l;++s)c.push(to(e._chart,n[s]));return t.filter&&(c=c.filter(((e,n,r)=>t.filter(e,n,r,i)))),t.itemSort&&(c=c.sort(((e,n)=>t.itemSort(e,n,i)))),b(c,(n=>{const i=so(t.callbacks,n);r.push(i.labelColor.call(e,n)),o.push(i.labelPointStyle.call(e,n)),a.push(i.labelTextColor.call(e,n))})),e.labelColors=r,e.labelPointStyles=o,e.labelTextColors=a,e.dataPoints=c,c}update(t,e){const n=this,i=n.options.setContext(n.getContext()),r=n._active;let o,a=[];if(r.length){const t=Kr[i.position].call(n,r,n._eventPosition);a=n._createItems(i),n.title=n.getTitle(a,i),n.beforeBody=n.getBeforeBody(a,i),n.body=n.getBody(a,i),n.afterBody=n.getAfterBody(a,i),n.footer=n.getFooter(a,i);const e=n._size=eo(n,i),s=Object.assign({},t,e),l=io(n._chart,i,s),c=ro(i,s,l,n._chart);n.xAlign=l.xAlign,n.yAlign=l.yAlign,o={opacity:1,x:c.x,y:c.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==n.opacity&&(o={opacity:0});n._tooltipItems=a,n.$context=void 0,o&&n._resolveAnimations().update(n,o),t&&i.external&&i.external.call(n,{chart:n._chart,tooltip:n,replay:e})}drawCaret(t,e,n,i){const r=this.getCaretPosition(t,n,i);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:r}=this,{cornerRadius:o,caretSize:a}=n,{x:s,y:l}=t,{width:c,height:u}=e;let d,h,f,g,p,m;return"center"===r?(p=l+u/2,"left"===i?(d=s,h=d-a,g=p+a,m=p-a):(d=s+c,h=d+a,g=p-a,m=p+a),f=d):(h="left"===i?s+o+a:"right"===i?s+c-o-a:this.caretX,"top"===r?(g=l,p=g-a,d=h-a,f=h+a):(g=l+u,p=g+a,d=h+a,f=h-a),m=g),{x1:d,x2:h,x3:f,y1:g,y2:p,y3:m}}drawTitle(t,e,n){const i=this,r=i.title,o=r.length;let a,s,l;if(o){const c=Xe(n.rtl,i.x,i.width);for(t.x=oo(i,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",a=oe(n.titleFont),s=n.titleSpacing,e.fillStyle=n.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(r[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===o&&(t.y+=n.titleMarginBottom-s)}}_drawColorBox(t,e,n,i,r){const o=this,a=o.labelColors[n],s=o.labelPointStyles[n],{boxHeight:l,boxWidth:c}=r,u=oe(r.bodyFont),d=oo(o,"left",r),h=i.x(d),f=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+f;if(r.usePointStyle){const e={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},n=i.leftForLtr(h,c)+c/2,o=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Vt(t,e,n,o),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Vt(t,e,n,o)}else{t.lineWidth=a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const e=i.leftForLtr(h,c),n=i.leftForLtr(i.xPlus(h,1),c-2),o=ie(a.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Kt(t,{x:e,y:g,w:c,h:l,radius:o}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Kt(t,{x:n,y:g+1,w:c-2,h:l-2,radius:o}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,g,c,l),t.strokeRect(e,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(n,g+1,c-2,l-2))}t.fillStyle=o.labelTextColors[n]}drawBody(t,e,n){const i=this,{body:r}=i,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c}=n,u=oe(n.bodyFont);let d=u.lineHeight,h=0;const f=Xe(n.rtl,i.x,i.width),g=function(n){e.fillText(n,f.x(t.x+h),t.y+d/2),t.y+=d+o},p=f.textAlign(a);let m,x,y,v,w,_,M;for(e.textAlign=a,e.textBaseline="middle",e.font=u.string,t.x=oo(i,p,n),e.fillStyle=n.bodyColor,b(i.beforeBody,g),h=s&&"right"!==p?"center"===a?c/2+1:c+2:0,v=0,_=r.length;v<_;++v){for(m=r[v],x=i.labelTextColors[v],e.fillStyle=x,b(m.before,g),y=m.lines,s&&y.length&&(i._drawColorBox(e,t,v,f,n),d=Math.max(u.lineHeight,l)),w=0,M=y.length;w<M;++w)g(y[w]),d=u.lineHeight;b(m.after,g)}h=0,d=u.lineHeight,b(i.afterBody,g),t.y-=o}drawFooter(t,e,n){const i=this,r=i.footer,o=r.length;let a,s;if(o){const l=Xe(n.rtl,i.x,i.width);for(t.x=oo(i,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",a=oe(n.footerFont),e.fillStyle=n.footerColor,e.font=a.string,s=0;s<o;++s)e.fillText(r[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing}}drawBackground(t,e,n,i){const{xAlign:r,yAlign:o}=this,{x:a,y:s}=t,{width:l,height:c}=n,u=i.cornerRadius;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(a+u,s),"top"===o&&this.drawCaret(t,e,n,i),e.lineTo(a+l-u,s),e.quadraticCurveTo(a+l,s,a+l,s+u),"center"===o&&"right"===r&&this.drawCaret(t,e,n,i),e.lineTo(a+l,s+c-u),e.quadraticCurveTo(a+l,s+c,a+l-u,s+c),"bottom"===o&&this.drawCaret(t,e,n,i),e.lineTo(a+u,s+c),e.quadraticCurveTo(a,s+c,a,s+c-u),"center"===o&&"left"===r&&this.drawCaret(t,e,n,i),e.lineTo(a,s+u),e.quadraticCurveTo(a,s,a+u,s),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this,n=e._chart,i=e.$animations,r=i&&i.x,o=i&&i.y;if(r||o){const i=Kr[t.position].call(e,e._active,e._eventPosition);if(!i)return;const a=e._size=eo(e,t),s=Object.assign({},i,e._size),l=io(n,t,s),c=ro(t,s,l,n);r._to===c.x&&o._to===c.y||(e.xAlign=l.xAlign,e.yAlign=l.yAlign,e.width=a.width,e.height=a.height,e.caretX=i.x,e.caretY=i.y,e._resolveAnimations().update(e,c))}}draw(t){const e=this,n=e.options.setContext(e.getContext());let i=e.opacity;if(!i)return;e._updateAnimationTarget(n);const r={width:e.width,height:e.height},o={x:e.x,y:e.y};i=Math.abs(i)<.001?0:i;const a=re(n.padding),s=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=i,e.drawBackground(o,t,r,n),Qe(t,n.textDirection),o.y+=a.top,e.drawTitle(o,t,n),e.drawBody(o,t,n),e.drawFooter(o,t,n),Ge(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this,i=n._active,r=t.map((({datasetIndex:t,index:e})=>{const i=n._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),o=!x(i,r),a=n._positionChanged(r,e);(o||a)&&(n._active=r,n._eventPosition=e,n.update(!0))}handleEvent(t,e){const n=this,i=n.options,r=n._active||[];let o=!1,a=[];"mouseout"!==t.type&&(a=n._chart.getElementsAtEventForMode(t,i.mode,i,e),i.reverse&&a.reverse());const s=n._positionChanged(a,t);return o=e||!x(a,r)||s,o&&(n._active=a,(i.enabled||i.external)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0,e))),o}_positionChanged(t,e){const{caretX:n,caretY:i,options:r}=this,o=Kr[r.position].call(this,t,e);return!1!==o&&(n!==o.x||i!==o.y)}}lo.positioners=Kr;var co={id:"tooltip",_element:lo,positioners:Kr,afterInit(t,e,n){n&&(t.tooltip=new lo({_chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip,n={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",n)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n))},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:s,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:s,beforeBody:s,beforeLabel:s,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return c(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:s,afterBody:s,beforeFooter:s,footer:s,afterFooter:s}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},uo=Object.freeze({__proto__:null,Decimation:Sr,Filler:Vr,Legend:qr,SubTitle:Gr,Title:Xr,Tooltip:co});class ho extends Oi{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(t,e){if(c(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:K(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:function(t,e,n){const i=t.indexOf(e);return-1===i?((t,e,n)=>"string"==typeof e?t.push(e)-1:isNaN(e)?null:n)(t,e,n):i!==t.lastIndexOf(e)?n:i}(n,t,g(e,t)),n.length-1)}determineDataLimits(){const t=this,{minDefined:e,maxDefined:n}=t.getUserBounds();let{min:i,max:r}=t.getMinMax(!0);"ticks"===t.options.bounds&&(e||(i=0),n||(r=t.getLabels().length-1)),t.min=i,t.max=r}buildTicks(){const t=this,e=t.min,n=t.max,i=t.options.offset,r=[];let o=t.getLabels();o=0===e&&n===o.length-1?o:o.slice(e,n+1),t._valueRange=Math.max(o.length-(i?0:1),1),t._startValue=t.min-(i?.5:0);for(let t=e;t<=n;t++)r.push({value:t});return r}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){const t=this;super.configure(),t.isHorizontal()||(t._reversePixels=!t._reversePixels)}getPixelForValue(t){const e=this;return"number"!=typeof t&&(t=e.parse(t)),null===t?NaN:e.getPixelForDecimal((t-e._startValue)/e._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){const e=this;return Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange)}getBasePixel(){return this.bottom}}function fo(t,e,{horizontal:n,minRotation:i}){const r=j(i),o=(n?Math.sin(r):Math.cos(r))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}ho.id="category",ho.defaults={ticks:{callback:ho.prototype.getLabelForValue}};class go extends Oi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return c(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const t=this,{beginAtZero:e}=t.options,{minDefined:n,maxDefined:i}=t.getUserBounds();let{min:r,max:o}=t;const a=t=>r=n?r:t,s=t=>o=i?o:t;if(e){const t=H(r),e=H(o);t<0&&e<0?s(0):t>0&&e>0&&a(0)}if(r===o){let t=1;(o>=Number.MAX_SAFE_INTEGER||r<=Number.MIN_SAFE_INTEGER)&&(t=Math.abs(.05*o)),s(o+t),e||a(r-t)}t.min=r,t.max=o}getTickLimit(){const t=this,e=t.options.ticks;let n,{maxTicksLimit:i,stepSize:r}=e;return r?n=Math.ceil(t.max/r)-Math.floor(t.min/r)+1:(n=t.computeTickLimit(),i=i||11),i&&(n=Math.min(i,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this,e=t.options,n=e.ticks;let i=t.getTickLimit();i=Math.max(2,i);const r=function(t,e){const n=[],{bounds:i,step:r,min:o,max:a,precision:s,count:l,maxTicks:u,maxDigits:d,includeBounds:h}=t,f=r||1,g=u-1,{min:p,max:m}=e,b=!c(o),x=!c(a),y=!c(l),v=(m-p)/(d+1);let w,_,M,k,C=B((m-p)/g/f)*f;if(C<1e-14&&!b&&!x)return[{value:p},{value:m}];k=Math.ceil(m/C)-Math.floor(p/C),k>g&&(C=B(k*C/g/f)*f),c(s)||(w=Math.pow(10,s),C=Math.ceil(C*w)/w),"ticks"===i?(_=Math.floor(p/C)*C,M=Math.ceil(m/C)*C):(_=p,M=m),b&&x&&r&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((a-o)/r,C/1e3)?(k=Math.round(Math.min((a-o)/C,u)),C=(a-o)/k,_=o,M=a):y?(_=b?o:_,M=x?a:M,k=l-1,C=(M-_)/k):(k=(M-_)/C,k=U(k,Math.round(k),C/1e3)?Math.round(k):Math.ceil(k));const T=Math.max(q(C),q(_));w=Math.pow(10,c(s)?T:s),_=Math.round(_*w)/w,M=Math.round(M*w)/w;let S=0;for(b&&(h&&_!==o?(n.push({value:o}),_<o&&S++,U(Math.round((_+S*C)*w)/w,o,fo(o,v,t))&&S++):_<o&&S++);S<k;++S)n.push({value:Math.round((_+S*C)*w)/w});return x&&h&&M!==a?U(n[n.length-1].value,a,fo(a,v,t))?n[n.length-1].value=a:n.push({value:a}):x&&M!==a||n.push({value:M}),n}({maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:t._maxDigits(),horizontal:t.isHorizontal(),minRotation:n.minRotation||0,includeBounds:!1!==n.includeBounds},t._range||t);return"ticks"===e.bounds&&V(r,t,"value"),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),r}configure(){const t=this,e=t.ticks;let n=t.min,i=t.max;if(super.configure(),t.options.offset&&e.length){const t=(i-n)/Math.max(e.length-1,1)/2;n-=t,i+=t}t._startValue=n,t._endValue=i,t._valueRange=i-n}getLabelForValue(t){return $e(t,this.chart.options.locale)}}class po extends go{determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!0);t.min=h(e)?e:0,t.max=h(n)?n:1,t.handleTickRangeOptions()}computeTickLimit(){const t=this,e=t.isHorizontal(),n=e?t.width:t.height,i=j(t.options.ticks.minRotation),r=(e?Math.sin(i):Math.cos(i))||.001,o=t._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/r))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function mo(t){return 1==t/Math.pow(10,Math.floor(N(t)))}po.id="linear",po.defaults={ticks:{callback:Mi.formatters.numeric}};class bo extends Oi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=go.prototype.parse.apply(this,[t,e]);if(0!==n)return h(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!0);t.min=h(e)?Math.max(0,e):null,t.max=h(n)?Math.max(0,n):null,t.options.beginAtZero&&(t._zero=!0),t.handleTickRangeOptions()}handleTickRangeOptions(){const t=this,{minDefined:e,maxDefined:n}=t.getUserBounds();let i=t.min,r=t.max;const o=t=>i=e?i:t,a=t=>r=n?r:t,s=(t,e)=>Math.pow(10,Math.floor(N(t))+e);i===r&&(i<=0?(o(1),a(10)):(o(s(i,-1)),a(s(r,1)))),i<=0&&o(s(r,-1)),r<=0&&a(s(i,1)),t._zero&&t.min!==t._suggestedMin&&i===s(t.min,0)&&o(s(i,-1)),t.min=i,t.max=r}buildTicks(){const t=this,e=t.options,n=function(t,e){const n=Math.floor(N(e.max)),i=Math.ceil(e.max/Math.pow(10,n)),r=[];let o=f(t.min,Math.pow(10,Math.floor(N(e.min)))),a=Math.floor(N(o)),s=Math.floor(o/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{r.push({value:o,major:mo(o)}),++s,10===s&&(s=1,++a,l=a>=0?1:l),o=Math.round(s*Math.pow(10,a)*l)/l}while(a<n||a===n&&s<i);const c=f(t.max,o);return r.push({value:c,major:mo(o)}),r}({min:t._userMin,max:t._userMax},t);return"ticks"===e.bounds&&V(n,t,"value"),e.reverse?(n.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n}getLabelForValue(t){return void 0===t?"0":$e(t,this.chart.options.locale)}configure(){const t=this,e=t.min;super.configure(),t._startValue=N(e),t._valueRange=N(t.max)-N(e)}getPixelForValue(t){const e=this;return void 0!==t&&0!==t||(t=e.min),null===t||isNaN(t)?NaN:e.getPixelForDecimal(t===e.min?0:(N(t)-e._startValue)/e._valueRange)}getValueForPixel(t){const e=this,n=e.getDecimalForPixel(t);return Math.pow(10,e._startValue+n*e._valueRange)}}function xo(t){const e=t.ticks;if(e.display&&t.display){const t=re(e.backdropPadding);return g(e.font&&e.font.size,Nt.font.size)+t.height}return 0}function yo(t,e,n,i,r){return t===i||t===r?{start:e-n/2,end:e+n/2}:t<i||t>r?{start:e-n,end:e}:{start:e,end:e+n}}function vo(t){return 0===t||180===t?"center":t<180?"left":"right"}function wo(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}function _o(t,e,n,i){const{ctx:r}=t;if(n)r.arc(t.xCenter,t.yCenter,e,0,O);else{let n=t.getPointPosition(0,e);r.moveTo(n.x,n.y);for(let o=1;o<i;o++)n=t.getPointPosition(o,e),r.lineTo(n.x,n.y)}}function Mo(t){return W(t)?t:0}bo.id="logarithmic",bo.defaults={ticks:{callback:Mi.formatters.logarithmic,major:{enabled:!0}}};class ko extends go{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=xo(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2}determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!1);t.min=h(e)&&!isNaN(e)?e:0,t.max=h(n)&&!isNaN(n)?n:0,t.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xo(this.options))}generateTickLabels(t){const e=this;go.prototype.generateTickLabels.call(e,t),e._pointLabels=e.getLabels().map(((t,n)=>{const i=m(e.options.pointLabels.callback,[t,n],e);return i||0===i?i:""}))}fit(){const t=this,e=t.options;e.display&&e.pointLabels.display?function(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},n={},i=[],r=[],o=t.getLabels().length;for(let c=0;c<o;c++){const o=t.options.pointLabels.setContext(t.getPointLabelContext(c));r[c]=o.padding;const d=t.getPointPosition(c,t.drawingArea+r[c]),h=oe(o.font),f=(a=t.ctx,s=h,l=u(l=t._pointLabels[c])?l:[l],{w:Bt(a,s.string,l),h:l.length*s.lineHeight});i[c]=f;const g=t.getIndexAngle(c),p=Y(g),m=yo(p,d.x,f.w,0,180),b=yo(p,d.y,f.h,90,270);m.start<e.l&&(e.l=m.start,n.l=g),m.end>e.r&&(e.r=m.end,n.r=g),b.start<e.t&&(e.t=b.start,n.t=g),b.end>e.b&&(e.b=b.end,n.b=g)}var a,s,l;t._setReductions(t.drawingArea,e,n),t._pointLabelItems=function(t,e,n){const i=[],r=t.getLabels().length,o=t.options,a=xo(o),s=t.getDistanceFromCenterForValue(o.ticks.reverse?t.min:t.max);for(let o=0;o<r;o++){const r=0===o?a/2:0,d=t.getPointPosition(o,s+r+n[o]),h=Y(t.getIndexAngle(o)),f=e[o],g=wo(d.y,f.h,h),p=vo(h),m=(l=d.x,c=f.w,"right"===(u=p)?l-=c:"center"===u&&(l-=c/2),l);i.push({x:d.x,y:g,textAlign:p,left:m,top:g,right:m+f.w,bottom:g+f.h})}var l,c,u;return i}(t,i,r)}(t):t.setCenterPoint(0,0,0,0)}_setReductions(t,e,n){const i=this;let r=e.l/Math.sin(n.l),o=Math.max(e.r-i.width,0)/Math.sin(n.r),a=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);r=Mo(r),o=Mo(o),a=Mo(a),s=Mo(s),i.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(r+o)/2),Math.floor(t-(a+s)/2))),i.setCenterPoint(r,o,a,s)}setCenterPoint(t,e,n,i){const r=this,o=r.width-e-r.drawingArea,a=t+r.drawingArea,s=n+r.drawingArea,l=r.height-r.paddingTop-i-r.drawingArea;r.xCenter=Math.floor((a+o)/2+r.left),r.yCenter=Math.floor((s+l)/2+r.top+r.paddingTop)}getIndexAngle(t){return Q(t*(O/this.getLabels().length)+j(this.options.startAngle||0))}getDistanceFromCenterForValue(t){const e=this;if(c(t))return NaN;const n=e.drawingArea/(e.max-e.min);return e.options.reverse?(e.max-t)*n:(t-e.min)*n}getValueForDistanceFromCenter(t){if(c(t))return NaN;const e=this,n=t/(e.drawingArea/(e.max-e.min));return e.options.reverse?e.max-n:e.min+n}getPointLabelContext(t){const e=this,n=e._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return function(t,e,n){return Object.assign(Object.create(t),{label:n,index:e,type:"pointLabel"})}(e.getContext(),t,i)}}getPointPosition(t,e){const n=this,i=n.getIndexAngle(t)-R;return{x:Math.cos(i)*e+n.xCenter,y:Math.sin(i)*e+n.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:i,bottom:r}=this._pointLabelItems[t];return{left:e,top:n,right:i,bottom:r}}drawBackground(){const t=this,{backgroundColor:e,grid:{circular:n}}=t.options;if(e){const i=t.ctx;i.save(),i.beginPath(),_o(t,t.getDistanceFromCenterForValue(t._endValue),n,t.getLabels().length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const t=this,e=t.ctx,n=t.options,{angleLines:i,grid:r}=n,o=t.getLabels().length;let a,s,l;if(n.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let r=e-1;r>=0;r--){const e=i.setContext(t.getPointLabelContext(r)),o=oe(e.font),{x:a,y:s,textAlign:l,left:u,top:d,right:h,bottom:f}=t._pointLabelItems[r],{backdropColor:g}=e;if(!c(g)){const t=re(e.backdropPadding);n.fillStyle=g,n.fillRect(u-t.left,d-t.top,h-u+t.width,f-d+t.height)}Qt(n,t._pointLabels[r],a,s+o.lineHeight/2,o,{color:e.color,textAlign:l,textBaseline:"middle"})}}(t,o),r.display&&t.ticks.forEach(((e,n)=>{if(0!==n){s=t.getDistanceFromCenterForValue(e.value);const i=r.setContext(t.getContext(n-1));!function(t,e,n,i){const r=t.ctx,o=e.circular,{color:a,lineWidth:s}=e;!o&&!i||!a||!s||n<0||(r.save(),r.strokeStyle=a,r.lineWidth=s,r.setLineDash(e.borderDash),r.lineDashOffset=e.borderDashOffset,r.beginPath(),_o(t,n,o,i),r.closePath(),r.stroke(),r.restore())}(t,i,s,o)}})),i.display){for(e.save(),a=t.getLabels().length-1;a>=0;a--){const r=i.setContext(t.getPointLabelContext(a)),{color:o,lineWidth:c}=r;c&&o&&(e.lineWidth=c,e.strokeStyle=o,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),l=t.getPointPosition(a,s),e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const t=this,e=t.ctx,n=t.options,i=n.ticks;if(!i.display)return;const r=t.getIndexAngle(0);let o,a;e.save(),e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",t.ticks.forEach(((r,s)=>{if(0===s&&!n.reverse)return;const l=i.setContext(t.getContext(s)),c=oe(l.font);if(o=t.getDistanceFromCenterForValue(t.ticks[s].value),l.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=l.backdropColor;const t=re(l.backdropPadding);e.fillRect(-a/2-t.left,-o-c.size/2-t.top,a+t.width,c.size+t.height)}Qt(e,r.label,0,-o,c,{color:l.color})})),e.restore()}drawTitle(){}}ko.id="radialLinear",ko.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},ko.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},ko.descriptors={angleLines:{_fallback:"grid"}};const Co={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},To=Object.keys(Co);function So(t,e){return t-e}function Do(t,e){if(c(e))return null;const n=t._adapter,{parser:i,round:r,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof i&&(a=i(a)),h(a)||(a="string"==typeof i?n.parse(a,i):n.parse(a)),null===a?null:(r&&(a="week"!==r||!W(o)&&!0!==o?n.startOf(a,r):n.startOf(a,"isoWeek",o)),+a)}function Po(t,e,n,i){const r=To.length;for(let o=To.indexOf(t);o<r-1;++o){const t=Co[To[o]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((n-e)/(r*t.size))<=i)return To[o]}return To[r-1]}function zo(t,e,n){if(n){if(n.length){const{lo:i,hi:r}=se(n,e);t[n[i]>=e?n[i]:n[r]]=!0}}else t[e]=!0}function Oo(t,e,n){const i=[],r={},o=e.length;let a,s;for(a=0;a<o;++a)s=e[a],r[s]=a,i.push({value:s,major:!1});return 0!==o&&n?function(t,e,n,i){const r=t._adapter,o=+r.startOf(e[0].value,i),a=e[e.length-1].value;let s,l;for(s=o;s<=a;s=+r.add(s,1,i))l=n[s],l>=0&&(e[l].major=!0);return e}(t,i,r,n):i}class Ao extends Oi{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const n=t.time||(t.time={}),i=this._adapter=new Bn._date(t.adapters.date);M(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Do(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this,e=t.options,n=t._adapter,i=e.time.unit||"day";let{min:r,max:o,minDefined:a,maxDefined:s}=t.getUserBounds();function l(t){a||isNaN(t.min)||(r=Math.min(r,t.min)),s||isNaN(t.max)||(o=Math.max(o,t.max))}a&&s||(l(t._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||l(t.getMinMax(!1))),r=h(r)&&!isNaN(r)?r:+n.startOf(Date.now(),i),o=h(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,t.min=Math.min(r,o-1),t.max=Math.max(r+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this,e=t.options,n=e.time,i=e.ticks,r="labels"===i.source?t.getLabelTimestamps():t._generate();"ticks"===e.bounds&&r.length&&(t.min=t._userMin||r[0],t.max=t._userMax||r[r.length-1]);const o=t.min,a=function(t,e,n){let i=0,r=t.length;for(;i<r&&t[i]<e;)i++;for(;r>i&&t[r-1]>n;)r--;return i>0||r<t.length?t.slice(i,r):t}(r,o,t.max);return t._unit=n.unit||(i.autoSkip?Po(n.minUnit,t.min,t.max,t._getLabelCapacity(o)):function(t,e,n,i,r){for(let o=To.length-1;o>=To.indexOf(n);o--){const n=To[o];if(Co[n].common&&t._adapter.diff(r,i,n)>=e-1)return n}return To[n?To.indexOf(n):0]}(t,a.length,n.minUnit,t.min,t.max)),t._majorUnit=i.major.enabled&&"year"!==t._unit?function(t){for(let e=To.indexOf(t)+1,n=To.length;e<n;++e)if(Co[To[e]].common)return To[e]}(t._unit):void 0,t.initOffsets(r),e.reverse&&a.reverse(),Oo(t,a,t._majorUnit)}initOffsets(t){const e=this;let n,i,r=0,o=0;e.options.offset&&t.length&&(n=e.getDecimalForValue(t[0]),r=1===t.length?1-n:(e.getDecimalForValue(t[1])-n)/2,i=e.getDecimalForValue(t[t.length-1]),o=1===t.length?i:(i-e.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;r=K(r,0,a),o=K(o,0,a),e._offsets={start:r,end:o,factor:1/(r+1+o)}}_generate(){const t=this,e=t._adapter,n=t.min,i=t.max,r=t.options,o=r.time,a=o.unit||Po(o.minUnit,n,i,t._getLabelCapacity(n)),s=g(o.stepSize,1),l="week"===a&&o.isoWeekday,c=W(l)||!0===l,u={};let d,h,f=n;if(c&&(f=+e.startOf(f,"isoWeek",l)),f=+e.startOf(f,c?"day":a),e.diff(i,n,a)>1e5*s)throw new Error(n+" and "+i+" are too far apart with stepSize of "+s+" "+a);const p="data"===r.ticks.source&&t.getDataTimestamps();for(d=f,h=0;d<i;d=+e.add(d,s,a),h++)zo(u,d,p);return d!==i&&"ticks"!==r.bounds&&1!==h||zo(u,d,p),Object.keys(u).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,i){const r=this,o=r.options,a=o.time.displayFormats,s=r._unit,l=r._majorUnit,c=s&&a[s],u=l&&a[l],d=n[e],h=l&&u&&d&&d.major,f=r._adapter.format(t,i||(h?u:c)),g=o.ticks.callback;return g?m(g,[f,e,n],r):f}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e<n;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){const e=this;return null===t?NaN:(t-e.min)/(e.max-e.min)}getPixelForValue(t){const e=this,n=e._offsets,i=e.getDecimalForValue(t);return e.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const e=this,n=e._offsets,i=e.getDecimalForPixel(t)/n.factor-n.end;return e.min+i*(e.max-e.min)}_getLabelSize(t){const e=this,n=e.options.ticks,i=e.ctx.measureText(t).width,r=j(e.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(r),a=Math.sin(r),s=e._resolveTickFontOptions(0).size;return{w:i*o+s*a,h:i*a+s*o}}_getLabelCapacity(t){const e=this,n=e.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,o=e._tickFormatFunction(t,0,Oo(e,[t],e._majorUnit),r),a=e._getLabelSize(o),s=Math.floor(e.isHorizontal()?e.width/a.w:e.height/a.h)-1;return s>0?s:1}getDataTimestamps(){const t=this;let e,n,i=t._cache.data||[];if(i.length)return i;const r=t.getMatchingVisibleMetas();if(t._normalized&&r.length)return t._cache.data=r[0].controller.getAllParsedValues(t);for(e=0,n=r.length;e<n;++e)i=i.concat(r[e].controller.getAllParsedValues(t));return t._cache.data=t.normalize(i)}getLabelTimestamps(){const t=this,e=t._cache.labels||[];let n,i;if(e.length)return e;const r=t.getLabels();for(n=0,i=r.length;n<i;++n)e.push(Do(t,r[n]));return t._cache.labels=t._normalized?e:t.normalize(e)}normalize(t){return he(t.sort(So))}}function Eo(t,e,n){let i,r,o,a,s=0,l=t.length-1;n?(e>=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=le(t,"pos",e)),({pos:i,time:o}=t[s]),({pos:r,time:a}=t[l])):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=le(t,"time",e)),({time:i,pos:o}=t[s]),({time:r,pos:a}=t[l]));const c=r-i;return c?o+(a-o)*(e-i)/c:o}Ao.id="time",Ao.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Lo extends Ao{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this,e=t._getTimestampsForTable(),n=t._table=t.buildLookupTable(e);t._minPos=Eo(n,t.min),t._tableRange=Eo(n,t.max)-t._minPos,super.initOffsets(e)}buildLookupTable(t){const{min:e,max:n}=this,i=[],r=[];let o,a,s,l,c;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=n&&i.push(l);if(i.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],s=i[o-1],l=i[o],Math.round((c+s)/2)!==l&&r.push({time:l,pos:o/(a-1)});return r}_getTimestampsForTable(){const t=this;let e=t._cache.all||[];if(e.length)return e;const n=t.getDataTimestamps(),i=t.getLabelTimestamps();return e=n.length&&i.length?t.normalize(n.concat(i)):n.length?n:i,e=t._cache.all=e,e}getDecimalForValue(t){return(Eo(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this,n=e._offsets,i=e.getDecimalForPixel(t)/n.factor-n.end;return Eo(e._table,i*e._tableRange+e._minPos,!0)}}Lo.id="timeseries",Lo.defaults=Ao.defaults;const Ro=[In,kr,uo,Object.freeze({__proto__:null,CategoryScale:ho,LinearScale:po,LogarithmicScale:bo,RadialLinearScale:ko,TimeScale:Ao,TimeSeriesScale:Lo})];er.register(...Ro);const Fo=er;function Io(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function No(t){Io(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}var Ho={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Bo(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,i=t.formats[n]||t.formats[t.defaultWidth];return i}}var Wo,Uo={date:Bo({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Bo({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Bo({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Vo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function jo(t){return function(e,n){var i,r=n||{};if("formatting"===(r.context?String(r.context):"standalone")&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,a=r.width?String(r.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{var s=t.defaultWidth,l=r.width?String(r.width):t.defaultWidth;i=t.values[l]||t.values[s]}return i[t.argumentCallback?t.argumentCallback(e):e]}}function Yo(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.width,r=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;var a,s=o[0],l=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?$o(l,(function(t){return t.test(s)})):qo(l,(function(t){return t.test(s)}));a=t.valueCallback?t.valueCallback(c):c,a=n.valueCallback?n.valueCallback(a):a;var u=e.slice(s.length);return{value:a,rest:u}}}function qo(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function $o(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}const Xo={code:"en-US",formatDistance:function(t,e,n){var i,r=Ho[t];return i="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:Uo,formatRelative:function(t,e,n,i){return Vo[t]},localize:{ordinalNumber:function(t,e){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:jo({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:jo({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:jo({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:jo({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:jo({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Wo={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(Wo.matchPattern);if(!n)return null;var i=n[0],r=t.match(Wo.parsePattern);if(!r)return null;var o=Wo.valueCallback?Wo.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;var a=t.slice(i.length);return{value:o,rest:a}}),era:Yo({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Yo({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Yo({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Yo({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Yo({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Qo(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Go(t,e){Io(2,arguments);var n=No(t).getTime(),i=Qo(e);return new Date(n+i)}function Ko(t,e){Io(2,arguments);var n=Qo(e);return Go(t,-n)}function Jo(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e=e||{})Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Zo(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}}function ta(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}}var ea={p:ta,P:function(t,e){var n,i=t.match(/(P+)(p+)?/),r=i[1],o=i[2];if(!o)return Zo(t,e);switch(r){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",Zo(r,e)).replace("{{time}}",ta(o,e))}};const na=ea;function ia(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var ra=["D","DD"],oa=["YY","YYYY"];function aa(t){return-1!==ra.indexOf(t)}function sa(t){return-1!==oa.indexOf(t)}function la(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}function ca(t,e){Io(1,arguments);var n=e||{},i=n.locale,r=i&&i.options&&i.options.weekStartsOn,o=null==r?0:Qo(r),a=null==n.weekStartsOn?o:Qo(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=No(t),l=s.getUTCDay(),c=(l<a?7:0)+l-a;return s.setUTCDate(s.getUTCDate()-c),s.setUTCHours(0,0,0,0),s}function ua(t,e){Io(1,arguments);var n=No(t,e),i=n.getUTCFullYear(),r=e||{},o=r.locale,a=o&&o.options&&o.options.firstWeekContainsDate,s=null==a?1:Qo(a),l=null==r.firstWeekContainsDate?s:Qo(r.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(i+1,0,l),c.setUTCHours(0,0,0,0);var u=ca(c,e),d=new Date(0);d.setUTCFullYear(i,0,l),d.setUTCHours(0,0,0,0);var h=ca(d,e);return n.getTime()>=u.getTime()?i+1:n.getTime()>=h.getTime()?i:i-1}function da(t,e,n){Io(2,arguments);var i=n||{},r=i.locale,o=r&&r.options&&r.options.weekStartsOn,a=null==o?0:Qo(o),s=null==i.weekStartsOn?a:Qo(i.weekStartsOn);if(!(s>=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var l=No(t),c=Qo(e),u=l.getUTCDay(),d=c%7,h=(d+7)%7,f=(h<s?7:0)+c-u;return l.setUTCDate(l.getUTCDate()+f),l}function ha(t){Io(1,arguments);var e=1,n=No(t),i=n.getUTCDay(),r=(i<e?7:0)+i-e;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function fa(t){Io(1,arguments);var e=No(t),n=e.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(n+1,0,4),i.setUTCHours(0,0,0,0);var r=ha(i),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=ha(o);return e.getTime()>=r.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function ga(t){Io(1,arguments);var e=fa(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var i=ha(n);return i}var pa=6048e5;function ma(t){Io(1,arguments);var e=No(t),n=ha(e).getTime()-ga(e).getTime();return Math.round(n/pa)+1}function ba(t,e){Io(1,arguments);var n=e||{},i=n.locale,r=i&&i.options&&i.options.firstWeekContainsDate,o=null==r?1:Qo(r),a=null==n.firstWeekContainsDate?o:Qo(n.firstWeekContainsDate),s=ua(t,e),l=new Date(0);l.setUTCFullYear(s,0,a),l.setUTCHours(0,0,0,0);var c=ca(l,e);return c}var xa=6048e5;function ya(t,e){Io(1,arguments);var n=No(t),i=ca(n,e).getTime()-ba(n,e).getTime();return Math.round(i/xa)+1}var va=/^(1[0-2]|0?\d)/,wa=/^(3[0-1]|[0-2]?\d)/,_a=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Ma=/^(5[0-3]|[0-4]?\d)/,ka=/^(2[0-3]|[0-1]?\d)/,Ca=/^(2[0-4]|[0-1]?\d)/,Ta=/^(1[0-1]|0?\d)/,Sa=/^(1[0-2]|0?\d)/,Da=/^[0-5]?\d/,Pa=/^[0-5]?\d/,za=/^\d/,Oa=/^\d{1,2}/,Aa=/^\d{1,3}/,Ea=/^\d{1,4}/,La=/^-?\d+/,Ra=/^-?\d/,Fa=/^-?\d{1,2}/,Ia=/^-?\d{1,3}/,Na=/^-?\d{1,4}/,Ha=/^([+-])(\d{2})(\d{2})?|Z/,Ba=/^([+-])(\d{2})(\d{2})|Z/,Wa=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Ua=/^([+-])(\d{2}):(\d{2})|Z/,Va=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ja(t,e,n){var i=e.match(t);if(!i)return null;var r=parseInt(i[0],10);return{value:n?n(r):r,rest:e.slice(i[0].length)}}function Ya(t,e){var n=e.match(t);return n?"Z"===n[0]?{value:0,rest:e.slice(1)}:{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:e.slice(n[0].length)}:null}function qa(t,e){return ja(La,t,e)}function $a(t,e,n){switch(t){case 1:return ja(za,e,n);case 2:return ja(Oa,e,n);case 3:return ja(Aa,e,n);case 4:return ja(Ea,e,n);default:return ja(new RegExp("^\\d{1,"+t+"}"),e,n)}}function Xa(t,e,n){switch(t){case 1:return ja(Ra,e,n);case 2:return ja(Fa,e,n);case 3:return ja(Ia,e,n);case 4:return ja(Na,e,n);default:return ja(new RegExp("^-?\\d{1,"+t+"}"),e,n)}}function Qa(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Ga(t,e){var n,i=e>0,r=i?e:1-e;if(r<=50)n=t||100;else{var o=r+50;n=t+100*Math.floor(o/100)-(t>=o%100?100:0)}return i?n:1-n}var Ka=[31,28,31,30,31,30,31,31,30,31,30,31],Ja=[31,29,31,30,31,30,31,31,30,31,30,31];function Za(t){return t%400==0||t%4==0&&t%100!=0}const ts={G:{priority:140,parse:function(t,e,n,i){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}},set:function(t,e,n,i){return e.era=n,t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,n,i){var r=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return $a(4,t,r);case"yo":return n.ordinalNumber(t,{unit:"year",valueCallback:r});default:return $a(e.length,t,r)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,i){var r=t.getUTCFullYear();if(n.isTwoDigitYear){var o=Ga(n.year,r);return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t}var a="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,n,i){var r=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return $a(4,t,r);case"Yo":return n.ordinalNumber(t,{unit:"year",valueCallback:r});default:return $a(e.length,t,r)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,i){var r=ua(t,i);if(n.isTwoDigitYear){var o=Ga(n.year,r);return t.setUTCFullYear(o,0,i.firstWeekContainsDate),t.setUTCHours(0,0,0,0),ca(t,i)}var a="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(a,0,i.firstWeekContainsDate),t.setUTCHours(0,0,0,0),ca(t,i)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,n,i){return Xa("R"===e?4:e.length,t)},set:function(t,e,n,i){var r=new Date(0);return r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0),ha(r)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,n,i){return Xa("u"===e?4:e.length,t)},set:function(t,e,n,i){return t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,n,i){switch(e){case"Q":case"QQ":return $a(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,i){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,n,i){switch(e){case"q":case"qq":return $a(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,i){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,n,i){var r=function(t){return t-1};switch(e){case"M":return ja(va,t,r);case"MM":return $a(2,t,r);case"Mo":return n.ordinalNumber(t,{unit:"month",valueCallback:r});case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,i){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,n,i){var r=function(t){return t-1};switch(e){case"L":return ja(va,t,r);case"LL":return $a(2,t,r);case"Lo":return n.ordinalNumber(t,{unit:"month",valueCallback:r});case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,i){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,n,i){switch(e){case"w":return ja(Ma,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,i){return ca(function(t,e,n){Io(2,arguments);var i=No(t),r=Qo(e),o=ya(i,n)-r;return i.setUTCDate(i.getUTCDate()-7*o),i}(t,n,i),i)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,n,i){switch(e){case"I":return ja(Ma,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,i){return ha(function(t,e){Io(2,arguments);var n=No(t),i=Qo(e),r=ma(n)-i;return n.setUTCDate(n.getUTCDate()-7*r),n}(t,n,i),i)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,n,i){switch(e){case"d":return ja(wa,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return $a(e.length,t)}},validate:function(t,e,n){var i=Za(t.getUTCFullYear()),r=t.getUTCMonth();return i?e>=1&&e<=Ja[r]:e>=1&&e<=Ka[r]},set:function(t,e,n,i){return t.setUTCDate(n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,n,i){switch(e){case"D":case"DD":return ja(_a,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return $a(e.length,t)}},validate:function(t,e,n){return Za(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,n,i){return t.setUTCMonth(0,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,n,i){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,i){return(t=da(t,n,i)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,n,i){var r=function(t){var e=7*Math.floor((t-1)/7);return(t+i.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return $a(e.length,t,r);case"eo":return n.ordinalNumber(t,{unit:"day",valueCallback:r});case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,i){return(t=da(t,n,i)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,n,i){var r=function(t){var e=7*Math.floor((t-1)/7);return(t+i.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return $a(e.length,t,r);case"co":return n.ordinalNumber(t,{unit:"day",valueCallback:r});case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,i){return(t=da(t,n,i)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,n,i){var r=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return $a(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return n.day(t,{width:"abbreviated",context:"formatting",valueCallback:r})||n.day(t,{width:"short",context:"formatting",valueCallback:r})||n.day(t,{width:"narrow",context:"formatting",valueCallback:r});case"iiiii":return n.day(t,{width:"narrow",context:"formatting",valueCallback:r});case"iiiiii":return n.day(t,{width:"short",context:"formatting",valueCallback:r})||n.day(t,{width:"narrow",context:"formatting",valueCallback:r});default:return n.day(t,{width:"wide",context:"formatting",valueCallback:r})||n.day(t,{width:"abbreviated",context:"formatting",valueCallback:r})||n.day(t,{width:"short",context:"formatting",valueCallback:r})||n.day(t,{width:"narrow",context:"formatting",valueCallback:r})}},validate:function(t,e,n){return e>=1&&e<=7},set:function(t,e,n,i){return t=function(t,e){Io(2,arguments);var n=Qo(e);n%7==0&&(n-=7);var i=1,r=No(t),o=r.getUTCDay(),a=((n%7+7)%7<i?7:0)+n-o;return r.setUTCDate(r.getUTCDate()+a),r}(t,n,i),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(t,e,n,i){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,i){return t.setUTCHours(Qa(n),0,0,0),t},incompatibleTokens:["b","B","H","K","k","t","T"]},b:{priority:80,parse:function(t,e,n,i){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,i){return t.setUTCHours(Qa(n),0,0,0),t},incompatibleTokens:["a","B","H","K","k","t","T"]},B:{priority:80,parse:function(t,e,n,i){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,i){return t.setUTCHours(Qa(n),0,0,0),t},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(t,e,n,i){switch(e){case"h":return ja(Sa,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=12},set:function(t,e,n,i){var r=t.getUTCHours()>=12;return r&&n<12?t.setUTCHours(n+12,0,0,0):r||12!==n?t.setUTCHours(n,0,0,0):t.setUTCHours(0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,n,i){switch(e){case"H":return ja(ka,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=23},set:function(t,e,n,i){return t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,n,i){switch(e){case"K":return ja(Ta,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,i){return t.getUTCHours()>=12&&n<12?t.setUTCHours(n+12,0,0,0):t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,n,i){switch(e){case"k":return ja(Ca,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=24},set:function(t,e,n,i){var r=n<=24?n%24:n;return t.setUTCHours(r,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,n,i){switch(e){case"m":return ja(Da,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,i){return t.setUTCMinutes(n,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,n,i){switch(e){case"s":return ja(Pa,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,i){return t.setUTCSeconds(n,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,n,i){return $a(e.length,t,(function(t){return Math.floor(t*Math.pow(10,3-e.length))}))},set:function(t,e,n,i){return t.setUTCMilliseconds(n),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,n,i){switch(e){case"X":return Ya(Ha,t);case"XX":return Ya(Ba,t);case"XXXX":return Ya(Wa,t);case"XXXXX":return Ya(Va,t);default:return Ya(Ua,t)}},set:function(t,e,n,i){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,n,i){switch(e){case"x":return Ya(Ha,t);case"xx":return Ya(Ba,t);case"xxxx":return Ya(Wa,t);case"xxxxx":return Ya(Va,t);default:return Ya(Ua,t)}},set:function(t,e,n,i){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,n,i){return qa(t)},set:function(t,e,n,i){return[new Date(1e3*n),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,n,i){return qa(t)},set:function(t,e,n,i){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}};var es=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ns=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,is=/^'([^]*?)'?$/,rs=/''/g,os=/\S/,as=/[a-zA-Z]/;function ss(t,e){if(e.timestampIsSet)return t;var n=new Date(0);return n.setFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),n.setHours(t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),n}function ls(t){return t.match(is)[1].replace(rs,"'")}var cs=36e5,us={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ds=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,hs=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,fs=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gs(t){var e,n={},i=t.split(us.dateTimeDelimiter);if(i.length>2)return n;if(/:/.test(i[0])?(n.date=null,e=i[0]):(n.date=i[0],e=i[1],us.timeZoneDelimiter.test(n.date)&&(n.date=t.split(us.timeZoneDelimiter)[0],e=t.substr(n.date.length,t.length))),e){var r=us.timezone.exec(e);r?(n.time=e.replace(r[1],""),n.timezone=r[1]):n.time=e}return n}function ps(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),i=t.match(n);if(!i)return{year:null};var r=i[1]&&parseInt(i[1]),o=i[2]&&parseInt(i[2]);return{year:null==o?r:100*o,restDateString:t.slice((i[1]||i[2]).length)}}function ms(t,e){if(null===e)return null;var n=t.match(ds);if(!n)return null;var i=!!n[4],r=bs(n[1]),o=bs(n[2])-1,a=bs(n[3]),s=bs(n[4]),l=bs(n[5])-1;if(i)return function(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}(0,s,l)?function(t,e,n){var i=new Date(0);i.setUTCFullYear(t,0,4);var r=7*(e-1)+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}(e,s,l):new Date(NaN);var c=new Date(0);return function(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(ws[e]||(_s(t)?29:28))}(e,o,a)&&function(t,e){return e>=1&&e<=(_s(t)?366:365)}(e,r)?(c.setUTCFullYear(e,o,Math.max(r,a)),c):new Date(NaN)}function bs(t){return t?parseInt(t):1}function xs(t){var e=t.match(hs);if(!e)return null;var n=ys(e[1]),i=ys(e[2]),r=ys(e[3]);return function(t,e,n){return 24===t?0===e&&0===n:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}(n,i,r)?n*cs+6e4*i+1e3*r:NaN}function ys(t){return t&&parseFloat(t.replace(",","."))||0}function vs(t){if("Z"===t)return 0;var e=t.match(fs);if(!e)return 0;var n="+"===e[1]?-1:1,i=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,r)?n*(i*cs+6e4*r):NaN}var ws=[31,null,31,30,31,30,31,31,30,31,30,31];function _s(t){return t%400==0||t%4==0&&t%100}function Ms(t){return Io(1,arguments),t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function ks(t){if(Io(1,arguments),!Ms(t)&&"number"!=typeof t)return!1;var e=No(t);return!isNaN(Number(e))}function Cs(t,e){for(var n=t<0?"-":"",i=Math.abs(t).toString();i.length<e;)i="0"+i;return n+i}const Ts=function(t,e){var n=t.getUTCFullYear(),i=n>0?n:1-n;return Cs("yy"===e?i%100:i,e.length)},Ss=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):Cs(n+1,2)},Ds=function(t,e){return Cs(t.getUTCDate(),e.length)},Ps=function(t,e){return Cs(t.getUTCHours()%12||12,e.length)},zs=function(t,e){return Cs(t.getUTCHours(),e.length)},Os=function(t,e){return Cs(t.getUTCMinutes(),e.length)},As=function(t,e){return Cs(t.getUTCSeconds(),e.length)},Es=function(t,e){var n=e.length,i=t.getUTCMilliseconds();return Cs(Math.floor(i*Math.pow(10,n-3)),e.length)};var Ls=864e5;function Rs(t,e){var n=t>0?"-":"+",i=Math.abs(t),r=Math.floor(i/60),o=i%60;if(0===o)return n+String(r);var a=e||"";return n+String(r)+a+Cs(o,2)}function Fs(t,e){return t%60==0?(t>0?"-":"+")+Cs(Math.abs(t)/60,2):Is(t,e)}function Is(t,e){var n=e||"",i=t>0?"-":"+",r=Math.abs(t);return i+Cs(Math.floor(r/60),2)+n+Cs(r%60,2)}const Ns={G:function(t,e,n){var i=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var i=t.getUTCFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Ts(t,e)},Y:function(t,e,n,i){var r=ua(t,i),o=r>0?r:1-r;return"YY"===e?Cs(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):Cs(o,e.length)},R:function(t,e){return Cs(fa(t),e.length)},u:function(t,e){return Cs(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return Cs(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return Cs(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){var i=t.getUTCMonth();switch(e){case"M":case"MM":return Ss(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){var i=t.getUTCMonth();switch(e){case"L":return String(i+1);case"LL":return Cs(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){var r=ya(t,i);return"wo"===e?n.ordinalNumber(r,{unit:"week"}):Cs(r,e.length)},I:function(t,e,n){var i=ma(t);return"Io"===e?n.ordinalNumber(i,{unit:"week"}):Cs(i,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):Ds(t,e)},D:function(t,e,n){var i=function(t){Io(1,arguments);var e=No(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var i=e.getTime(),r=n-i;return Math.floor(r/Ls)+1}(t);return"Do"===e?n.ordinalNumber(i,{unit:"dayOfYear"}):Cs(i,e.length)},E:function(t,e,n){var i=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){var r=t.getUTCDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return Cs(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){var r=t.getUTCDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return Cs(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){var i=t.getUTCDay(),r=0===i?7:i;switch(e){case"i":return String(r);case"ii":return Cs(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){var i=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){var i,r=t.getUTCHours();switch(i=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){var i,r=t.getUTCHours();switch(i=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var i=t.getUTCHours()%12;return 0===i&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Ps(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):zs(t,e)},K:function(t,e,n){var i=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(i,{unit:"hour"}):Cs(i,e.length)},k:function(t,e,n){var i=t.getUTCHours();return 0===i&&(i=24),"ko"===e?n.ordinalNumber(i,{unit:"hour"}):Cs(i,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Os(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):As(t,e)},S:function(t,e){return Es(t,e)},X:function(t,e,n,i){var r=(i._originalDate||t).getTimezoneOffset();if(0===r)return"Z";switch(e){case"X":return Fs(r);case"XXXX":case"XX":return Is(r);default:return Is(r,":")}},x:function(t,e,n,i){var r=(i._originalDate||t).getTimezoneOffset();switch(e){case"x":return Fs(r);case"xxxx":case"xx":return Is(r);default:return Is(r,":")}},O:function(t,e,n,i){var r=(i._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Rs(r,":");default:return"GMT"+Is(r,":")}},z:function(t,e,n,i){var r=(i._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Rs(r,":");default:return"GMT"+Is(r,":")}},t:function(t,e,n,i){var r=i._originalDate||t;return Cs(Math.floor(r.getTime()/1e3),e.length)},T:function(t,e,n,i){return Cs((i._originalDate||t).getTime(),e.length)}};var Hs=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bs=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ws=/^'([^]*?)'?$/,Us=/''/g,Vs=/[a-zA-Z]/;function js(t){return t.match(Ws)[1].replace(Us,"'")}var Ys=36e5;function qs(t,e){Io(2,arguments);var n=No(t),i=Qo(e);return isNaN(i)?new Date(NaN):i?(n.setDate(n.getDate()+i),n):n}function $s(t,e){Io(2,arguments);var n=No(t),i=Qo(e);if(isNaN(i))return new Date(NaN);if(!i)return n;var r=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+i+1,0);var a=o.getDate();return r>=a?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}function Xs(t,e){return Io(2,arguments),No(t).getTime()-No(e).getTime()}var Qs={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}};function Gs(t){return t?Qs[t]:Qs.trunc}Math.pow(10,8);var Ks=36e5;function Js(t){Io(1,arguments);var e=No(t);return e.setHours(0,0,0,0),e}var Zs=864e5;function tl(t,e){Io(2,arguments);var n=Js(t),i=Js(e),r=n.getTime()-ia(n),o=i.getTime()-ia(i);return Math.round((r-o)/Zs)}function el(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function nl(t,e){Io(2,arguments);var n=No(t),i=No(e),r=el(n,i),o=Math.abs(tl(n,i));n.setDate(n.getDate()-r*o);var a=Number(el(n,i)===-r),s=r*(o-a);return 0===s?0:s}function il(t,e){Io(2,arguments);var n=No(t),i=No(e),r=n.getFullYear()-i.getFullYear(),o=n.getMonth()-i.getMonth();return 12*r+o}function rl(t,e){Io(2,arguments);var n=No(t),i=No(e),r=n.getTime()-i.getTime();return r<0?-1:r>0?1:r}function ol(t){Io(1,arguments);var e=No(t);return e.setHours(23,59,59,999),e}function al(t){Io(1,arguments);var e=No(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function sl(t){Io(1,arguments);var e=No(t);return ol(e).getTime()===al(e).getTime()}function ll(t,e){Io(2,arguments);var n,i=No(t),r=No(e),o=rl(i,r),a=Math.abs(il(i,r));if(a<1)n=0;else{1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*a);var s=rl(i,r)===-o;sl(No(t))&&1===a&&1===rl(t,r)&&(s=!1),n=o*(a-Number(s))}return 0===n?0:n}function cl(t,e){Io(2,arguments);var n=No(t),i=No(e);return n.getFullYear()-i.getFullYear()}function ul(t,e){Io(1,arguments);var n=e||{},i=n.locale,r=i&&i.options&&i.options.weekStartsOn,o=null==r?0:Qo(r),a=null==n.weekStartsOn?o:Qo(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=No(t),l=s.getDay(),c=(l<a?7:0)+l-a;return s.setDate(s.getDate()-c),s.setHours(0,0,0,0),s}const dl={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Bn._date.override({_id:"date-fns",formats:function(){return dl},parse:function(t,e){if(null==t)return null;const n=typeof t;return"number"===n||t instanceof Date?t=No(t):"string"===n&&(t="string"==typeof e?function(t,e,n,i){Io(3,arguments);var r=String(t),o=String(e),a=i||{},s=a.locale||Xo;if(!s.match)throw new RangeError("locale must contain match property");var l=s.options&&s.options.firstWeekContainsDate,c=null==l?1:Qo(l),u=null==a.firstWeekContainsDate?c:Qo(a.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=s.options&&s.options.weekStartsOn,h=null==d?0:Qo(d),f=null==a.weekStartsOn?h:Qo(a.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===o)return""===r?No(n):new Date(NaN);var g,p={firstWeekContainsDate:u,weekStartsOn:f,locale:s},m=[{priority:10,subPriority:-1,set:ss,index:0}],b=o.match(ns).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,na[e])(t,s.formatLong,p):t})).join("").match(es),x=[];for(g=0;g<b.length;g++){var y=b[g];!a.useAdditionalWeekYearTokens&&sa(y)&&la(y,o,t),!a.useAdditionalDayOfYearTokens&&aa(y)&&la(y,o,t);var v=y[0],w=ts[v];if(w){var _=w.incompatibleTokens;if(Array.isArray(_)){for(var M=void 0,k=0;k<x.length;k++){var C=x[k].token;if(-1!==_.indexOf(C)||C===v){M=x[k];break}}if(M)throw new RangeError("The format string mustn't contain `".concat(M.fullToken,"` and `").concat(y,"` at the same time"))}else if("*"===w.incompatibleTokens&&x.length)throw new RangeError("The format string mustn't contain `".concat(y,"` and any other token at the same time"));x.push({token:v,fullToken:y});var T=w.parse(r,y,s.match,p);if(!T)return new Date(NaN);m.push({priority:w.priority,subPriority:w.subPriority||0,set:w.set,validate:w.validate,value:T.value,index:m.length}),r=T.rest}else{if(v.match(as))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");if("''"===y?y="'":"'"===v&&(y=ls(y)),0!==r.indexOf(y))return new Date(NaN);r=r.slice(y.length)}}if(r.length>0&&os.test(r))return new Date(NaN);var S=m.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){return m.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),D=No(n);if(isNaN(D))return new Date(NaN);var P=Ko(D,ia(D)),z={};for(g=0;g<S.length;g++){var O=S[g];if(O.validate&&!O.validate(P,O.value,p))return new Date(NaN);var A=O.set(P,z,O.value,p);A[0]?(P=A[0],Jo(z,A[1])):P=A}return P}(t,e,new Date,this.options):function(t,e){Io(1,arguments);var n=e||{},i=null==n.additionalDigits?2:Qo(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var r,o=gs(t);if(o.date){var a=ps(o.date,i);r=ms(a.restDateString,a.year)}if(isNaN(r)||!r)return new Date(NaN);var s,l=r.getTime(),c=0;if(o.time&&(c=xs(o.time),isNaN(c)||null===c))return new Date(NaN);if(!o.timezone){var u=new Date(l+c),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return s=vs(o.timezone),isNaN(s)?new Date(NaN):new Date(l+c+s)}(t,this.options)),ks(t)?t.getTime():null},format:function(t,e){return function(t,e,n){Io(2,arguments);var i=String(e),r=n||{},o=r.locale||Xo,a=o.options&&o.options.firstWeekContainsDate,s=null==a?1:Qo(a),l=null==r.firstWeekContainsDate?s:Qo(r.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=o.options&&o.options.weekStartsOn,u=null==c?0:Qo(c),d=null==r.weekStartsOn?u:Qo(r.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var h=No(t);if(!ks(h))throw new RangeError("Invalid time value");var f=ia(h),g=Ko(h,f),p={firstWeekContainsDate:l,weekStartsOn:d,locale:o,_originalDate:h};return i.match(Bs).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,na[e])(t,o.formatLong,p):t})).join("").match(Hs).map((function(n){if("''"===n)return"'";var i=n[0];if("'"===i)return js(n);var a=Ns[i];if(a)return!r.useAdditionalWeekYearTokens&&sa(n)&&la(n,e,t),!r.useAdditionalDayOfYearTokens&&aa(n)&&la(n,e,t),a(g,n,o.localize,p);if(i.match(Vs))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return n})).join("")}(t,e,this.options)},add:function(t,e,n){switch(n){case"millisecond":return Go(t,e);case"second":return function(t,e){Io(2,arguments);var n=Qo(e);return Go(t,1e3*n)}(t,e);case"minute":return function(t,e){Io(2,arguments);var n=Qo(e);return Go(t,6e4*n)}(t,e);case"hour":return function(t,e){Io(2,arguments);var n=Qo(e);return Go(t,n*Ys)}(t,e);case"day":return qs(t,e);case"week":return function(t,e){Io(2,arguments);var n=Qo(e);return qs(t,7*n)}(t,e);case"month":return $s(t,e);case"quarter":return function(t,e){Io(2,arguments);var n=Qo(e);return $s(t,3*n)}(t,e);case"year":return function(t,e){Io(2,arguments);var n=Qo(e);return $s(t,12*n)}(t,e);default:return t}},diff:function(t,e,n){switch(n){case"millisecond":return Xs(t,e);case"second":return function(t,e,n){Io(2,arguments);var i=Xs(t,e)/1e3;return Gs(null==n?void 0:n.roundingMethod)(i)}(t,e);case"minute":return function(t,e,n){Io(2,arguments);var i=Xs(t,e)/6e4;return Gs(null==n?void 0:n.roundingMethod)(i)}(t,e);case"hour":return function(t,e,n){Io(2,arguments);var i=Xs(t,e)/Ks;return Gs(null==n?void 0:n.roundingMethod)(i)}(t,e);case"day":return nl(t,e);case"week":return function(t,e,n){Io(2,arguments);var i=nl(t,e)/7;return Gs(null==n?void 0:n.roundingMethod)(i)}(t,e);case"month":return ll(t,e);case"quarter":return function(t,e,n){Io(2,arguments);var i=ll(t,e)/3;return Gs(null==n?void 0:n.roundingMethod)(i)}(t,e);case"year":return function(t,e){Io(2,arguments);var n=No(t),i=No(e),r=rl(n,i),o=Math.abs(cl(n,i));n.setFullYear(1584),i.setFullYear(1584);var a=rl(n,i)===-r,s=r*(o-Number(a));return 0===s?0:s}(t,e);default:return 0}},startOf:function(t,e,n){switch(e){case"second":return function(t){Io(1,arguments);var e=No(t);return e.setMilliseconds(0),e}(t);case"minute":return function(t){Io(1,arguments);var e=No(t);return e.setSeconds(0,0),e}(t);case"hour":return function(t){Io(1,arguments);var e=No(t);return e.setMinutes(0,0,0),e}(t);case"day":return Js(t);case"week":return ul(t);case"isoWeek":return ul(t,{weekStartsOn:+n});case"month":return function(t){Io(1,arguments);var e=No(t);return e.setDate(1),e.setHours(0,0,0,0),e}(t);case"quarter":return function(t){Io(1,arguments);var e=No(t),n=e.getMonth(),i=n-n%3;return e.setMonth(i,1),e.setHours(0,0,0,0),e}(t);case"year":return function(t){Io(1,arguments);var e=No(t),n=new Date(0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t);default:return t}},endOf:function(t,e){switch(e){case"second":return function(t){Io(1,arguments);var e=No(t);return e.setMilliseconds(999),e}(t);case"minute":return function(t){Io(1,arguments);var e=No(t);return e.setSeconds(59,999),e}(t);case"hour":return function(t){Io(1,arguments);var e=No(t);return e.setMinutes(59,59,999),e}(t);case"day":return ol(t);case"week":return function(t,e){Io(1,arguments);var n=e||{},i=n.locale,r=i&&i.options&&i.options.weekStartsOn,o=null==r?0:Qo(r),a=null==n.weekStartsOn?o:Qo(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=No(t),l=s.getDay(),c=6+(l<a?-7:0)-(l-a);return s.setDate(s.getDate()+c),s.setHours(23,59,59,999),s}(t);case"month":return al(t);case"quarter":return function(t){Io(1,arguments);var e=No(t),n=e.getMonth(),i=n-n%3+3;return e.setMonth(i,0),e.setHours(23,59,59,999),e}(t);case"year":return function(t){Io(1,arguments);var e=No(t),n=e.getFullYear();return e.setFullYear(n+1,0,0),e.setHours(23,59,59,999),e}(t);default:return t}}}),e().use(Fo)})()})();
1
+ (()=>{function jt(e){return Object.prototype.toString.call(e)==="[object Array]"}function os(e){return e instanceof Function}function Ln(e){return Object.prototype.toString.call(e)==="[object Object]"&&!os(e)&&e instanceof Object}function ss(e,t){for(var n in t)n!=="__proto__"&&(Ln(t[n])||jt(t[n])?(Ln(t[n])&&!Ln(e[n])&&(e[n]={}),jt(t[n])&&!jt(e[n])&&(e[n]=[]),ss(e[n],t[n])):t[n]!==void 0&&(e[n]=t[n]))}function $(e,t){var n={};return ss(n,e),ss(n,t),n}var sc=/^(\d\d\d\d)(?:-)?(\d\d)(?:-)?(\d\d)$/i;function rc(e){for(var t=0;t<e.length;t++)for(var n=e[t].data,i=0;i<n.length;i++)if(n[i][1]<0)return!0;return!1}function Rt(e){return""+e}function wt(e){return parseFloat(e)}function _t(e){if(e instanceof Date)return e;if(typeof e=="number")return new Date(e*1e3);var t=Rt(e),n=t.match(sc);if(n){var i=parseInt(n[1],10),s=parseInt(n[2],10)-1,r=parseInt(n[3],10);return new Date(i,s,r)}else{var o=t.replace(/ /,"T").replace(" ","").replace("UTC","Z");return new Date(Date.parse(o)||t)}}function as(e){if(jt(e))return e;var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push([n,e[n]]);return t}function Je(e,t,n,i,s,r,o,a){return function(l,c,u){var f=l.data,d=$({},e);return d=$(d,u||{}),(l.singleSeriesFormat||"legend"in c)&&t(d,c.legend,l.singleSeriesFormat),c.title&&n(d,c.title),"min"in c?i(d,c.min):rc(f)||i(d,0),c.max&&s(d,c.max),"stacked"in c&&r(d,c.stacked),c.colors&&(d.colors=c.colors),c.xtitle&&o(d,c.xtitle),c.ytitle&&a(d,c.ytitle),d=$(d,c.library||{}),d}}function oc(e,t){return e[0].getTime()-t[0].getTime()}function ls(e,t){return e[0]-t[0]}function oo(e,t){return e-t}function Me(e,t){for(var n=0;n<e.length;n++)if(!t(e[n]))return!1;return!0}function ac(e){return e==="day"||e==="week"||e==="month"||e==="year"}function ao(e,t){if(t===void 0&&(t=!1),e.length===0)return null;var n=Me(e,function(c){return c.getMilliseconds()===0&&c.getSeconds()===0});if(!n)return null;var i=Me(e,function(c){return c.getMinutes()===0});if(!i)return"minute";var s=Me(e,function(c){return c.getHours()===0});if(!s)return"hour";if(t)return"day";var r=Me(e,function(c){return c.getDate()===1});if(!r){var o=e[0].getDay(),a=Me(e,function(c){return c.getDay()===o});return a?"week":"day"}var l=Me(e,function(c){return c.getMonth()===0});return l?"year":"month"}function ns(e){return!isNaN(_t(e))&&Rt(e).length>=6}function lc(e){return typeof e=="number"}var eo=["bytes","KB","MB","GB","TB","PB","EB"];function bt(e,t,n,i){e=e||"",n.prefix&&(t<0&&(t=t*-1,e+="-"),e+=n.prefix);var s=n.suffix||"",r=n.precision,o=n.round;if(n.byteScale){var a=t>=0;a||(t*=-1);var l=i?n.byteScale:t,c;l>=1152921504606847e3?(t/=1152921504606847e3,c=6):l>=0x4000000000000?(t/=0x4000000000000,c=5):l>=1099511627776?(t/=1099511627776,c=4):l>=1073741824?(t/=1073741824,c=3):l>=1048576?(t/=1048576,c=2):l>=1024?(t/=1024,c=1):c=0,r===void 0&&o===void 0&&(t>=1023.5&&c<eo.length-1&&(t=1,c+=1),r=t>=1e3?4:3),s=" "+eo[c],a||(t*=-1)}if(r!==void 0&&o!==void 0)throw Error("Use either round or precision, not both");if(!i&&(r!==void 0&&(t=t.toPrecision(r),n.zeros||(t=parseFloat(t))),o!==void 0))if(o<0){var u=Math.pow(10,-1*o);t=parseInt((1*t/u).toFixed(0))*u}else t=t.toFixed(o),n.zeros||(t=parseFloat(t));if(n.thousands||n.decimal){t=Rt(t);var f=t.split(".");t=f[0],n.thousands&&(t=t.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousands)),f.length>1&&(t+=(n.decimal||".")+f[1])}return e+t+s}function no(e,t,n){return n in t?t[n]:n in e.options?e.options[n]:null}var cs={maintainAspectRatio:!1,animation:!1,plugins:{legend:{},tooltip:{displayColors:!1,callbacks:{}},title:{font:{size:20},color:"#333"}},interaction:{}},lo={scales:{y:{ticks:{maxTicksLimit:4},title:{font:{size:16},color:"#333"},grid:{}},x:{grid:{drawOnChartArea:!1},title:{font:{size:16},color:"#333"},time:{},ticks:{}}}},co=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"];function us(e,t,n){t!==void 0?(e.plugins.legend.display=!!t,t&&t!==!0&&(e.plugins.legend.position=t)):n&&(e.plugins.legend.display=!1)}function fs(e,t){e.plugins.title.display=!0,e.plugins.title.text=t}function cc(e,t){t!==null&&(e.scales.y.min=wt(t))}function uc(e,t){e.scales.y.max=wt(t)}function fc(e,t){t!==null&&(e.scales.x.min=wt(t))}function dc(e,t){e.scales.x.max=wt(t)}function uo(e,t){e.scales.x.stacked=!!t,e.scales.y.stacked=!!t}function fo(e,t){e.scales.x.title.display=!0,e.scales.x.title.text=t}function ho(e,t){e.scales.y.title.display=!0,e.scales.y.title.text=t}function io(e,t){var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?"rgba("+parseInt(n[1],16)+", "+parseInt(n[2],16)+", "+parseInt(n[3],16)+", "+t+")":e}function qt(e){return e!=null}function hc(e,t,n){var i=Math.ceil(e.element.offsetWidth/4/t.labels.length);i>25?i=25:i<10&&(i=10),n.scales.x.ticks.callback||(n.scales.x.ticks.callback=function(s){return s=Rt(this.getLabelForValue(s)),s.length>i?s.substring(0,i-2)+"...":s})}function pc(e){for(var t=1,n=gc(e);n>=1024;)t*=1024,n/=1024;return t}function Fn(e,t,n){var i={thousands:e.options.thousands,decimal:e.options.decimal},s=$({prefix:e.options.prefix,suffix:e.options.suffix,precision:e.options.precision,round:e.options.round,zeros:e.options.zeros},i);if(e.options.bytes){var r=e.data;n==="pie"&&(r=[{data:r}]),s.byteScale=pc(r)}if(n!=="pie"){var o=t.scales.y;n==="bar"&&(o=t.scales.x),s.byteScale&&(o.ticks.stepSize||(o.ticks.stepSize=s.byteScale/2),o.ticks.maxTicksLimit||(o.ticks.maxTicksLimit=4)),o.ticks.callback||(o.ticks.callback=function(l){return bt("",l,s,!0)}),(n==="scatter"||n==="bubble")&&!t.scales.x.ticks.callback&&(t.scales.x.ticks.callback=function(l){return bt("",l,i,!0)})}if(!t.plugins.tooltip.callbacks.label)if(n==="scatter")t.plugins.tooltip.callbacks.label=function(l){var c=l.dataset.label||"";c&&(c+=": ");var u=l.parsed;return c+"("+bt("",u.x,i)+", "+bt("",u.y,s)+")"};else if(n==="bubble")t.plugins.tooltip.callbacks.label=function(l){var c=l.dataset.label||"";c&&(c+=": ");var u=l.raw;return c+"("+bt("",u.x,i)+", "+bt("",u.y,s)+", "+bt("",u.v,i)+")"};else if(n==="pie")t.plugins.tooltip.callbacks.label=function(l){return bt("",l.parsed,s)};else{var a=n==="bar"?"x":"y";t.plugins.tooltip.callbacks.label=function(l){if(l.parsed[a]!==null){var c=l.dataset.label||"";return c&&(c+=": "),bt(c,l.parsed[a],s)}}}(n==="line"||n==="area")&&e.xtype==="number"&&(t.scales.x.ticks.callback||(t.scales.x.ticks.callback=function(l){return Rt(l)}),t.plugins.tooltip.callbacks.title||(t.plugins.tooltip.callbacks.title=function(l){return Rt(l[0].parsed.x)}))}function gc(e){for(var t=0,n=0;n<e.length;n++)for(var i=e[n].data,s=0;s<i.length;s++){var r=Math.abs(i[s][1]);r>t&&(t=r)}return t}function mc(e){for(var t=0,n=0;n<e.length;n++)for(var i=e[n].data,s=0;s<i.length;s++){var r=i[s][2];r>t&&(t=r)}return t}var ds=Je($(cs,lo),us,fs,cc,uc,uo,fo,ho);function bc(e){for(var t=e.data,n={},i=[],s=[],r=[],o=0;o<t.length;o++)for(var a=t[o].data,l=0;l<a.length;l++){var c=a[l],u=e.xtype==="datetime"?c[0].getTime():c[0];n[u]||(n[u]=new Array(t.length),i.push(u)),n[u][o]=c[1]}(e.xtype==="datetime"||e.xtype==="number")&&i.sort(oo);for(var f=0;f<t.length;f++)r.push([]);for(var d=0;d<i.length;d++){var h=i[d],p=e.xtype==="datetime"?new Date(h):h;s.push(p);for(var g=n[h],m=0;m<t.length;m++){var b=g[m];r[m].push(b===void 0?null:b)}}return{labels:s,values:r}}function xc(e){for(var t=e.data,n=[],i=mc(t),s=0;s<t.length;s++){for(var r=t[s].data,o=[],a=0;a<r.length;a++){var l=r[a];o.push({x:l[0],y:l[1],r:l[2]*20/i,v:l[2]})}n.push(o)}return{labels:[],values:n}}function yc(e){for(var t=e.data,n=[],i=0;i<t.length;i++){var s=t[i].data;s.sort(ls);for(var r=[],o=0;o<s.length;o++){var a=s[o];r.push({x:a[0],y:a[1]})}n.push(r)}return{labels:[],values:n}}function vc(e,t){return t==="bubble"?xc(e):e.xtype==="number"&&t!=="bar"&&t!=="column"?yc(e):bc(e)}function hs(e,t,n){for(var i=vc(e,n),s=i.labels,r=i.values,o=e.data,a=[],l=e.options.colors||co,c=0;c<o.length;c++){var u=o[c],f=void 0,d=void 0;if(e.options.colors&&e.singleSeriesFormat&&(n==="bar"||n==="column")&&!u.color&&jt(e.options.colors)&&!jt(e.options.colors[0])){f=l,d=[];for(var h=0;h<l.length;h++)d[h]=io(f[h],.5)}else f=u.color||l[c],d=n!=="line"?io(f,.5):f;var p={label:u.name||"",data:r[c],fill:n==="area",borderColor:f,backgroundColor:d,borderWidth:2},g=n==="line"||n==="area"||n==="scatter"||n==="bubble";g&&(p.pointBackgroundColor=f,p.pointHoverBackgroundColor=f,p.pointHitRadius=50),n==="bubble"&&(p.pointBackgroundColor=d,p.pointHoverBackgroundColor=d,p.pointHoverBorderWidth=2),u.stack&&(p.stack=u.stack);var m=no(e,u,"curve");m===!1?p.tension=0:g&&(p.tension=.4);var b=no(e,u,"points");b===!1&&(p.pointRadius=0,p.pointHoverRadius=0),p=$(p,e.options.dataset||{}),p=$(p,u.library||{}),p=$(p,u.dataset||{}),a.push(p)}var x=e.options.xmin,y=e.options.xmax;if(e.xtype==="datetime"?(qt(x)&&(t.scales.x.min=_t(x).getTime()),qt(y)&&(t.scales.x.max=_t(y).getTime())):e.xtype==="number"&&(qt(x)&&(t.scales.x.min=x),qt(y)&&(t.scales.x.max=y)),e.xtype==="datetime"){var w=ao(s);if(s.length===0&&(qt(x)&&s.push(_t(x)),qt(y)&&s.push(_t(y))),s.length>0){for(var v=(qt(x)?_t(x):s[0]).getTime(),k=(qt(y)?_t(y):s[0]).getTime(),S=1;S<s.length;S++){var D=s[S].getTime();D<v&&(v=D),D>k&&(k=D)}var C=(k-v)/(86400*1e3);if(!t.scales.x.time.unit){var T;if(w==="year"||C>365*10?(t.scales.x.time.unit="year",T=365):w==="month"||C>30*10?(t.scales.x.time.unit="month",T=30):w==="week"||w==="day"||C>10?(t.scales.x.time.unit="day",T=1):w==="hour"||C>.5?(t.scales.x.time.displayFormats={hour:"MMM d, h a"},t.scales.x.time.unit="hour",T=1/24):w==="minute"&&(t.scales.x.time.displayFormats={minute:"h:mm a"},t.scales.x.time.unit="minute",T=1/24/60),T&&C>0){var P=e.element.offsetWidth;if(P>0){var I=Math.ceil(C/T/(P/100));w==="week"&&T===1&&(I=Math.ceil(I/7)*7),t.scales.x.ticks.stepSize=I}}}t.scales.x.time.tooltipFormat||(w==="year"?t.scales.x.time.tooltipFormat="yyyy":w==="month"?t.scales.x.time.tooltipFormat="MMM yyyy":w==="week"||w==="day"?t.scales.x.time.tooltipFormat="PP":w==="hour"?t.scales.x.time.tooltipFormat="MMM d, h a":w==="minute"&&(t.scales.x.time.tooltipFormat="h:mm a"))}}return{labels:s,datasets:a}}var Mt=function(t){this.name="chartjs",this.library=t};Mt.prototype.renderLineChart=function(t,n){n||(n="line");var i={},s=ds(t,$(i,t.options));Fn(t,s,n);var r=hs(t,s,n);t.xtype==="number"?(s.scales.x.type=s.scales.x.type||"linear",s.scales.x.position=s.scales.x.position||"bottom"):s.scales.x.type=t.xtype==="string"?"category":"time",this.drawChart(t,"line",r,s)};Mt.prototype.renderPieChart=function(t){var n=$({},cs);t.options.donut&&(n.cutout="50%"),"legend"in t.options&&us(n,t.options.legend),t.options.title&&fs(n,t.options.title),n=$(n,t.options.library||{}),Fn(t,n,"pie");for(var i=[],s=[],r=0;r<t.data.length;r++){var o=t.data[r];i.push(o[0]),s.push(o[1])}var a={data:s,backgroundColor:t.options.colors||co};a=$(a,t.options.dataset||{});var l={labels:i,datasets:[a]};this.drawChart(t,"pie",l,n)};Mt.prototype.renderColumnChart=function(t,n){var i;if(n==="bar"){var s=$(cs,lo);s.indexAxis="y",s.scales.x.grid.drawOnChartArea=!0,s.scales.y.grid.drawOnChartArea=!1,delete s.scales.y.ticks.maxTicksLimit,i=Je(s,us,fs,fc,dc,uo,fo,ho)(t,t.options)}else i=ds(t,t.options);Fn(t,i,n);var r=hs(t,i,"column");n!=="bar"&&hc(t,r,i),"mode"in i.interaction||(i.interaction.mode="index"),this.drawChart(t,"bar",r,i)};Mt.prototype.renderAreaChart=function(t){this.renderLineChart(t,"area")};Mt.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")};Mt.prototype.renderScatterChart=function(t,n){n=n||"scatter";var i=ds(t,t.options);Fn(t,i,n),"showLine"in i||(i.showLine=!1);var s=hs(t,i,n);i.scales.x.type=i.scales.x.type||"linear",i.scales.x.position=i.scales.x.position||"bottom","mode"in i.interaction||(i.interaction.mode="nearest"),this.drawChart(t,n,s,i)};Mt.prototype.renderBubbleChart=function(t){this.renderScatterChart(t,"bubble")};Mt.prototype.destroy=function(t){t.chart&&t.chart.destroy()};Mt.prototype.drawChart=function(t,n,i,s){if(this.destroy(t),!t.destroyed){var r={type:n,data:i,options:s};t.options.code&&window.console.log("new Chart(ctx, "+JSON.stringify(r)+");"),t.element.innerHTML="<canvas></canvas>";var o=t.element.getElementsByTagName("CANVAS")[0];t.chart=new this.library(o,r)}};var po={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!1},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},area:{},series:{marker:{}}},time:{useUTC:!1}};function go(e,t,n){t!==void 0?(e.legend.enabled=!!t,t&&t!==!0&&(t==="top"||t==="bottom"?e.legend.verticalAlign=t:(e.legend.layout="vertical",e.legend.verticalAlign="middle",e.legend.align=t))):n&&(e.legend.enabled=!1)}function mo(e,t){e.title.text=t}function _c(e,t){e.yAxis.min=t}function wc(e,t){e.yAxis.max=t}function Mc(e,t){var n=t?t===!0?"normal":t:null;e.plotOptions.series.stacking=n,e.plotOptions.area.stacking=n,e.plotOptions.areaspline.stacking=n}function kc(e,t){e.xAxis.title.text=t}function Sc(e,t){e.yAxis.title.text=t}var ps=Je(po,go,mo,_c,wc,Mc,kc,Sc);function gs(e,t,n){var i={prefix:e.options.prefix,suffix:e.options.suffix,thousands:e.options.thousands,decimal:e.options.decimal,precision:e.options.precision,round:e.options.round,zeros:e.options.zeros};n!=="pie"&&!jt(t.yAxis)&&!t.yAxis.labels.formatter&&(t.yAxis.labels.formatter=function(){return bt("",this.value,i)}),!t.tooltip.pointFormatter&&!t.tooltip.pointFormat&&(t.tooltip.pointFormatter=function(){return'<span style="color:'+this.color+'">\u25CF</span> '+bt(this.series.name+": <b>",this.y,i)+"</b><br/>"})}var Ft=function(t){this.name="highcharts",this.library=t};Ft.prototype.renderLineChart=function(t,n){n=n||"spline";var i={};n==="areaspline"&&(i={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),t.options.curve===!1&&(n==="areaspline"?n="area":n==="spline"&&(n="line"));var s=ps(t,t.options,i);t.xtype==="number"?s.xAxis.type=s.xAxis.type||"linear":s.xAxis.type=t.xtype==="string"?"category":"datetime",s.chart.type||(s.chart.type=n),gs(t,s,n);for(var r=t.data,o=0;o<r.length;o++){r[o].name=r[o].name||"Value";var a=r[o].data;if(t.xtype==="datetime")for(var l=0;l<a.length;l++)a[l][0]=a[l][0].getTime();else t.xtype==="number"&&a.sort(ls);r[o].marker={symbol:"circle"},t.options.points===!1&&(r[o].marker.enabled=!1)}this.drawChart(t,r,s)};Ft.prototype.renderScatterChart=function(t){var n=ps(t,t.options,{});n.chart.type="scatter",this.drawChart(t,t.data,n)};Ft.prototype.renderPieChart=function(t){var n=$(po,{});t.options.colors&&(n.colors=t.options.colors),t.options.donut&&(n.plotOptions={pie:{innerSize:"50%"}}),"legend"in t.options&&go(n,t.options.legend),t.options.title&&mo(n,t.options.title);var i=$(n,t.options.library||{});gs(t,i,"pie");var s=[{type:"pie",name:t.options.label||"Value",data:t.data}];this.drawChart(t,s,i)};Ft.prototype.renderColumnChart=function(t,n){n=n||"column";var i=t.data,s=ps(t,t.options),r=[],o=[];s.chart.type=n,gs(t,s,n);for(var a=0;a<i.length;a++)for(var l=i[a],c=0;c<l.data.length;c++){var u=l.data[c];r[u[0]]||(r[u[0]]=new Array(i.length),o.push(u[0])),r[u[0]][a]=u[1]}t.xtype==="number"&&o.sort(oo),s.xAxis.categories=o;for(var f=[],d=0;d<i.length;d++){for(var h=[],p=0;p<o.length;p++)h.push(r[o[p]][d]||0);var g={name:i[d].name||"Value",data:h};i[d].stack&&(g.stack=i[d].stack),f.push(g)}this.drawChart(t,f,s)};Ft.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")};Ft.prototype.renderAreaChart=function(t){this.renderLineChart(t,"areaspline")};Ft.prototype.destroy=function(t){t.chart&&t.chart.destroy()};Ft.prototype.drawChart=function(t,n,i){this.destroy(t),!t.destroyed&&(i.chart.renderTo=t.element.id,i.series=n,t.options.code&&window.console.log("new Highcharts.Chart("+JSON.stringify(i)+");"),t.chart=new this.library.Chart(i))};var so={},En=[],tn={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}};function ms(e,t,n){if(t!==void 0){var i;t?t===!0?i="right":i=t:i="none",e.legend.position=i}else n&&(e.legend.position="none")}function bs(e,t){e.title=t,e.titleTextStyle={color:"#333",fontSize:"20px"}}function Dc(e,t){e.vAxis.viewWindow.min=t}function Cc(e,t){e.vAxis.viewWindow.max=t}function Oc(e,t){e.hAxis.viewWindow.min=t}function Tc(e,t){e.hAxis.viewWindow.max=t}function bo(e,t){e.isStacked=t||!1}function xo(e,t){e.hAxis.title=t,e.hAxis.titleTextStyle.italic=!1}function yo(e,t){e.vAxis.title=t,e.vAxis.titleTextStyle.italic=!1}var Wn=Je(tn,ms,bs,Dc,Cc,bo,xo,yo);function Pc(e){window.attachEvent?window.attachEvent("onresize",e):window.addEventListener&&window.addEventListener("resize",e,!0),e()}var lt=function(t){this.name="google",this.library=t};lt.prototype.renderLineChart=function(t){var n=this;this.waitForLoaded(t,function(){var i={};t.options.curve===!1&&(i.curveType="none"),t.options.points===!1&&(i.pointSize=0);var s=Wn(t,t.options,i),r=n.createDataTable(t.data,t.xtype);n.drawChart(t,"LineChart",r,s)})};lt.prototype.renderPieChart=function(t){var n=this;this.waitForLoaded(t,function(){var i={chartArea:{top:"10%",height:"80%"},legend:{}};t.options.colors&&(i.colors=t.options.colors),t.options.donut&&(i.pieHole=.5),"legend"in t.options&&ms(i,t.options.legend),t.options.title&&bs(i,t.options.title);var s=$($(tn,i),t.options.library||{}),r=new n.library.visualization.DataTable;r.addColumn("string",""),r.addColumn("number","Value"),r.addRows(t.data),n.drawChart(t,"PieChart",r,s)})};lt.prototype.renderColumnChart=function(t){var n=this;this.waitForLoaded(t,function(){var i=Wn(t,t.options),s=n.createDataTable(t.data,t.xtype);n.drawChart(t,"ColumnChart",s,i)})};lt.prototype.renderBarChart=function(t){var n=this;this.waitForLoaded(t,function(){var i={hAxis:{gridlines:{color:"#ccc"}}},s=Je(tn,ms,bs,Oc,Tc,bo,xo,yo)(t,t.options,i),r=n.createDataTable(t.data,t.xtype);n.drawChart(t,"BarChart",r,s)})};lt.prototype.renderAreaChart=function(t){var n=this;this.waitForLoaded(t,function(){var i={isStacked:!0,pointSize:0,areaOpacity:.5},s=Wn(t,t.options,i),r=n.createDataTable(t.data,t.xtype);n.drawChart(t,"AreaChart",r,s)})};lt.prototype.renderGeoChart=function(t){var n=this;this.waitForLoaded(t,"geochart",function(){var i={legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}},s=$($(tn,i),t.options.library||{}),r=new n.library.visualization.DataTable;r.addColumn("string",""),r.addColumn("number",t.options.label||"Value"),r.addRows(t.data),n.drawChart(t,"GeoChart",r,s)})};lt.prototype.renderScatterChart=function(t){var n=this;this.waitForLoaded(t,function(){for(var i={},s=Wn(t,t.options,i),r=t.data,o=[],a=0;a<r.length;a++){r[a].name=r[a].name||"Value";for(var l=r[a].data,c=0;c<l.length;c++){var u=new Array(r.length+1);u[0]=l[c][0],u[a+1]=l[c][1],o.push(u)}}var f=new n.library.visualization.DataTable;f.addColumn("number","");for(var d=0;d<r.length;d++)f.addColumn("number",r[d].name);f.addRows(o),n.drawChart(t,"ScatterChart",f,s)})};lt.prototype.renderTimeline=function(t){var n=this;this.waitForLoaded(t,"timeline",function(){var i={legend:"none"};t.options.colors&&(i.colors=t.options.colors);var s=$($(tn,i),t.options.library||{}),r=new n.library.visualization.DataTable;r.addColumn({type:"string",id:"Name"}),r.addColumn({type:"date",id:"Start"}),r.addColumn({type:"date",id:"End"}),r.addRows(t.data),t.element.style.lineHeight="normal",n.drawChart(t,"Timeline",r,s)})};lt.prototype.destroy=function(t){t.chart&&t.chart.clearChart()};lt.prototype.drawChart=function(t,n,i,s){this.destroy(t),!t.destroyed&&(t.options.code&&window.console.log("var data = new google.visualization.DataTable("+i.toJSON()+`);
2
+ var chart = new google.visualization.`+n+`(element);
3
+ chart.draw(data, `+JSON.stringify(s)+");"),t.chart=new this.library.visualization[n](t.element),Pc(function(){t.chart.draw(i,s)}))};lt.prototype.waitForLoaded=function(t,n,i){var s=this;if(i||(i=n,n="corechart"),En.push({pack:n,callback:i}),so[n])this.runCallbacks();else{so[n]=!0;var r={packages:[n],callback:function(){s.runCallbacks()}},o=t.__config();o.language&&(r.language=o.language),n==="geochart"&&o.mapsApiKey&&(r.mapsApiKey=o.mapsApiKey),this.library.charts.load("current",r)}};lt.prototype.runCallbacks=function(){for(var t=0;t<En.length;t++){var n=En[t],i=this.library.visualization&&(n.pack==="corechart"&&this.library.visualization.LineChart||n.pack==="timeline"&&this.library.visualization.Timeline||n.pack==="geochart"&&this.library.visualization.GeoChart);i&&(n.callback(),En.splice(t,1),t--)}};lt.prototype.createDataTable=function(t,n){for(var i=[],s=[],r=0;r<t.length;r++){var o=t[r];t[r].name=t[r].name||"Value";for(var a=0;a<o.data.length;a++){var l=o.data[a],c=n==="datetime"?l[0].getTime():l[0];i[c]||(i[c]=new Array(t.length),s.push(c)),i[c][r]=l[1]}}for(var u=[],f=[],d=0;d<s.length;d++){var h=s[d],p=void 0;n==="datetime"?(p=new Date(h),f.push(p)):p=h,u.push([p].concat(i[h]))}var g=!0;if(n==="datetime"){u.sort(oc);var m=ao(f,!0);g=ac(m)}else if(n==="number"){u.sort(ls);for(var b=0;b<u.length;b++)u[b][0]=Rt(u[b][0]);n="string"}var x=new this.library.visualization.DataTable;n=n==="datetime"&&g?"date":n,x.addColumn(n,"");for(var y=0;y<t.length;y++)x.addColumn("number",t[y].name);return x.addRows(u),x};var ae=[];function Ac(e){if(e){if(e.product==="Highcharts")return Ft;if(e.charts)return lt;if(os(e))return Mt}throw new Error("Unknown adapter")}function Ke(e){for(var t=Ac(e),n=0;n<ae.length;n++)if(ae[n].library===e)return;ae.push(new t(e))}function Ic(){"Chart"in window&&Ke(window.Chart),"Highcharts"in window&&Ke(window.Highcharts),window.google&&window.google.charts&&Ke(window.google)}function Lc(e,t){var n="render"+e,i=t.options.adapter;Ic();for(var s=0;s<ae.length;s++){var r=ae[s];if((!i||i===r.name)&&os(r[n]))return t.adapter=r.name,t.__adapterObject=r,r[n](t)}throw ae.length>0?new Error("No charting library found for "+e):new Error("No charting libraries found - be sure to include one before your charts")}var W={charts:{},configure:function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(W.config[t]=e[t])},setDefaultOptions:function(e){W.options=e},eachChart:function(e){for(var t in W.charts)Object.prototype.hasOwnProperty.call(W.charts,t)&&e(W.charts[t])},destroyAll:function(){for(var e in W.charts)Object.prototype.hasOwnProperty.call(W.charts,e)&&(W.charts[e].destroy(),delete W.charts[e])},config:{},options:{},adapters:ae,addAdapter:Ke,use:function(e){return Ke(e),W}};function Ec(e){for(var t=[],n=0;n<e.length;n++)t.push([wt(e[n][0]),wt(e[n][1]),wt(e[n][2])]);return t}function Rc(e,t){if(t==="bubble")return Ec(e);var n;t==="number"?n=wt:t==="datetime"?n=_t:n=Rt;for(var i=[],s=0;s<e.length;s++)i.push([n(e[s][0]),wt(e[s][1])]);return i}function Fc(e,t,n){return _o(e)?(n.xmin||n.xmax)&&(!n.xmin||ns(n.xmin))&&(!n.xmax||ns(n.xmax))?"datetime":"number":ro(e,lc)?"number":!t&&ro(e,ns)?"datetime":"string"}function ro(e,t){for(var n=0;n<e.length;n++)for(var i=as(e[n].data),s=0;s<i.length;s++)if(!t(i[s][0]))return!1;return!0}function Wc(e){for(var t=[],n=0;n<e.length;n++){var i={};for(var s in e[n])Object.prototype.hasOwnProperty.call(e[n],s)&&(i[s]=e[n][s]);t.push(i)}return t}function ke(e,t,n){var i=e.options,s=e.rawData;e.singleSeriesFormat=!jt(s)||!Ln(s[0]),e.singleSeriesFormat&&(s=[{name:i.label,data:s}]),s=Wc(s);for(var r=0;r<s.length;r++)s[r].data=as(s[r].data);e.xtype=t||(i.discrete?"string":Fc(s,n,i));for(var o=0;o<s.length;o++)s[o].data=Rc(s[o].data,e.xtype);return s}function vo(e){for(var t=as(e.rawData),n=0;n<t.length;n++)t[n]=[Rt(t[n][0]),wt(t[n][1])];return t}function _o(e,t){if(t==="PieChart"||t==="GeoChart"||t==="Timeline")return e.length===0;for(var n=0;n<e.length;n++)if(e[n].data.length>0)return!1;return!0}function Nc(e){var t=e.options.download;t===!0?t={}:typeof t=="string"&&(t={filename:t});var n=document.createElement("a");n.download=t.filename||"chart.png",n.style.position="absolute",n.style.top="20px",n.style.right="20px",n.style.zIndex=1e3,n.style.lineHeight="20px",n.target="_blank";var i=document.createElement("img"),s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path fill="#CCCCCC" d="M344 240h-56L287.1 152c0-13.25-10.75-24-24-24h-16C234.7 128 223.1 138.8 223.1 152L224 240h-56c-9.531 0-18.16 5.656-22 14.38C142.2 263.1 143.9 273.3 150.4 280.3l88.75 96C243.7 381.2 250.1 384 256.8 384c7.781-.3125 13.25-2.875 17.75-7.844l87.25-96c6.406-7.031 8.031-17.19 4.188-25.88S353.5 240 344 240zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"/></svg>';i.src="data:image/svg+xml;utf8,"+encodeURIComponent(s),i.alt="Download",i.style.width="20px",i.style.height="20px",i.style.border="none",n.appendChild(i);var r=e.element;r.style.position="relative",e.__downloadAttached=!0,e.__enterEvent=r.addEventListener("mouseover",function(o){var a=o.relatedTarget;(!a||a!==this&&!this.contains(a))&&e.options.download&&(n.href=e.toImage(t),r.appendChild(n))}),e.__leaveEvent=r.addEventListener("mouseout",function(o){var a=o.relatedTarget;(!a||a!==this&&!this.contains(a))&&n.parentNode&&n.parentNode.removeChild(n)})}var wo=[],rs=0,zc=4;function Bc(e,t,n){wo.push([e,t,n]),xs()}function xs(){if(rs<zc){var e=wo.shift();e&&(rs++,Yc(e[0],e[1],e[2]),xs())}}function Hc(){rs--,xs()}function Yc(e,t,n){var i=new XMLHttpRequest;i.open("GET",e,!0),i.setRequestHeader("Content-Type","application/json"),i.onload=function(){Hc(),i.status===200?t(JSON.parse(i.responseText)):n(i.statusText)},i.send()}function ys(e,t){e.textContent=t}function Rn(e,t,n){n||(t="Error Loading Chart: "+t),ys(e,t),e.style.color="#ff0000"}function is(e){try{e.__render()}catch(t){throw Rn(e.element,t.message),t}}function Ze(e,t,n){if(n&&e.options.loading&&(typeof t=="string"||typeof t=="function")&&ys(e.element,e.options.loading),typeof t=="string")Bc(t,function(i){e.rawData=i,is(e)},function(i){Rn(e.element,i)});else if(typeof t=="function")try{t(function(i){e.rawData=i,is(e)},function(i){Rn(e.element,i,!0)})}catch(i){Rn(e.element,i,!0)}else e.rawData=t,is(e)}function Uc(e,t){if(_o(t.data,e)){var n=t.options.empty||t.options.messages&&t.options.messages.empty||"No data";ys(t.element,n)}else Lc(e,t),t.options.download&&!t.__downloadAttached&&t.adapter==="chartjs"&&Nc(t)}function Vc(e){if(typeof e=="string"){var t=e;if(e=document.getElementById(e),!e)throw new Error("No element with id "+t)}return e}var Y=function(t,n,i){this.element=Vc(t),this.options=$(W.options,i||{}),this.dataSource=n,this.element.id&&(W.charts[this.element.id]=this),Ze(this,n,!0),this.options.refresh&&this.startRefresh()};Y.prototype.getElement=function(){return this.element};Y.prototype.getDataSource=function(){return this.dataSource};Y.prototype.getData=function(){return this.data};Y.prototype.getOptions=function(){return this.options};Y.prototype.getChartObject=function(){return this.chart};Y.prototype.getAdapter=function(){return this.adapter};Y.prototype.updateData=function(t,n){this.dataSource=t,n&&this.__updateOptions(n),Ze(this,t,!0)};Y.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()};Y.prototype.redraw=function(){Ze(this,this.rawData)};Y.prototype.refreshData=function(){if(typeof this.dataSource=="string"){var t=this.dataSource.indexOf("?")===-1?"?":"&",n=this.dataSource+t+"_="+new Date().getTime();Ze(this,n)}else typeof this.dataSource=="function"&&Ze(this,this.dataSource)};Y.prototype.startRefresh=function(){var t=this,n=this.options.refresh;if(n&&typeof this.dataSource!="string"&&typeof this.dataSource!="function")throw new Error("Data source must be a URL or callback for refresh");if(!this.intervalId)if(n)this.intervalId=setInterval(function(){t.refreshData()},n*1e3);else throw new Error("No refresh interval")};Y.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)};Y.prototype.toImage=function(t){if(this.adapter==="chartjs")if(t&&t.background&&t.background!=="transparent"){var n=this.chart.canvas,i=this.chart.ctx,s=document.createElement("canvas"),r=s.getContext("2d");return s.width=i.canvas.width,s.height=i.canvas.height,r.fillStyle=t.background,r.fillRect(0,0,s.width,s.height),r.drawImage(n,0,0),s.toDataURL("image/png")}else return this.chart.toBase64Image();else throw new Error("Feature only available for Chart.js")};Y.prototype.destroy=function(){this.destroyed=!0,this.stopRefresh(),this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&this.element.removeEventListener("mouseover",this.__enterEvent),this.__leaveEvent&&this.element.removeEventListener("mouseout",this.__leaveEvent)};Y.prototype.__updateOptions=function(t){var n=t.refresh&&t.refresh!==this.options.refresh;this.options=$(W.options,t),n&&(this.stopRefresh(),this.startRefresh())};Y.prototype.__render=function(){this.data=this.__processData(),Uc(this.__chartName(),this)};Y.prototype.__config=function(){return W.config};var qc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this)},t.prototype.__chartName=function(){return"LineChart"},t}(Y),jc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return vo(this)},t.prototype.__chartName=function(){return"PieChart"},t}(Y),Xc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this,null,!0)},t.prototype.__chartName=function(){return"ColumnChart"},t}(Y),$c=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this,null,!0)},t.prototype.__chartName=function(){return"BarChart"},t}(Y),Qc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this)},t.prototype.__chartName=function(){return"AreaChart"},t}(Y),Gc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return vo(this)},t.prototype.__chartName=function(){return"GeoChart"},t}(Y),Kc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this,"number")},t.prototype.__chartName=function(){return"ScatterChart"},t}(Y),Zc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){return ke(this,"bubble")},t.prototype.__chartName=function(){return"BubbleChart"},t}(Y),Jc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__processData=function(){for(var i=this.rawData,s=0;s<i.length;s++)i[s][1]=_t(i[s][1]),i[s][2]=_t(i[s][2]);return i},t.prototype.__chartName=function(){return"Timeline"},t}(Y);W.LineChart=qc;W.PieChart=jc;W.ColumnChart=Xc;W.BarChart=$c;W.AreaChart=Qc;W.GeoChart=Gc;W.ScatterChart=Kc;W.BubbleChart=Zc;W.Timeline=Jc;typeof window<"u"&&!window.Chartkick&&(window.Chartkick=W,document.addEventListener("turbolinks:before-render",function(){W.config.autoDestroy!==!1&&W.destroyAll()}),document.addEventListener("turbo:before-render",function(){W.config.autoDestroy!==!1&&W.destroyAll()}),setTimeout(function(){window.dispatchEvent(new Event("chartkick:load"))},0));W.default=W;function sn(e){return e+.5|0}var Xt=(e,t,n)=>Math.max(Math.min(e,n),t);function en(e){return Xt(sn(e*2.55),0,255)}function $t(e){return Xt(sn(e*255),0,255)}function Wt(e){return Xt(sn(e/2.55)/100,0,1)}function Mo(e){return Xt(sn(e*100),0,100)}var ht={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},_s=[..."0123456789ABCDEF"],tu=e=>_s[e&15],eu=e=>_s[(e&240)>>4]+_s[e&15],Nn=e=>(e&240)>>4===(e&15),nu=e=>Nn(e.r)&&Nn(e.g)&&Nn(e.b)&&Nn(e.a);function iu(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&ht[e[1]]*17,g:255&ht[e[2]]*17,b:255&ht[e[3]]*17,a:t===5?ht[e[4]]*17:255}:(t===7||t===9)&&(n={r:ht[e[1]]<<4|ht[e[2]],g:ht[e[3]]<<4|ht[e[4]],b:ht[e[5]]<<4|ht[e[6]],a:t===9?ht[e[7]]<<4|ht[e[8]]:255})),n}var su=(e,t)=>e<255?t(e):"";function ru(e){var t=nu(e)?tu:eu;return e?"#"+t(e.r)+t(e.g)+t(e.b)+su(e.a,t):void 0}var ou=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Co(e,t,n){let i=t*Math.min(n,1-n),s=(r,o=(r+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function au(e,t,n){let i=(s,r=(s+e/60)%6)=>n-n*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function lu(e,t,n){let i=Co(e,1,.5),s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function cu(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function ws(e){let n=e.r/255,i=e.g/255,s=e.b/255,r=Math.max(n,i,s),o=Math.min(n,i,s),a=(r+o)/2,l,c,u;return r!==o&&(u=r-o,c=a>.5?u/(2-r-o):u/(r+o),l=cu(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function Ms(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map($t)}function ks(e,t,n){return Ms(Co,e,t,n)}function uu(e,t,n){return Ms(lu,e,t,n)}function fu(e,t,n){return Ms(au,e,t,n)}function Oo(e){return(e%360+360)%360}function du(e){let t=ou.exec(e),n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?en(+t[5]):$t(+t[5]));let s=Oo(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=uu(s,r,o):t[1]==="hsv"?i=fu(s,r,o):i=ks(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function hu(e,t){var n=ws(e);n[0]=Oo(n[0]+t),n=ks(n),e.r=n[0],e.g=n[1],e.b=n[2]}function pu(e){if(!e)return;let t=ws(e),n=t[0],i=Mo(t[1]),s=Mo(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${Wt(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}var ko={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},So={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function gu(){let e={},t=Object.keys(So),n=Object.keys(ko),i,s,r,o,a;for(i=0;i<t.length;i++){for(o=a=t[i],s=0;s<n.length;s++)r=n[s],a=a.replace(r,ko[r]);r=parseInt(So[o],16),e[a]=[r>>16&255,r>>8&255,r&255]}return e}var zn;function mu(e){zn||(zn=gu(),zn.transparent=[0,0,0,0]);let t=zn[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var bu=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function xu(e){let t=bu.exec(e),n=255,i,s,r;if(t){if(t[7]!==i){let o=+t[7];n=t[8]?en(o):Xt(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?en(i):Xt(i,0,255)),s=255&(t[4]?en(s):Xt(s,0,255)),r=255&(t[6]?en(r):Xt(r,0,255)),{r:i,g:s,b:r,a:n}}}function yu(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Wt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var vs=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Se=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function vu(e,t,n){let i=Se(Wt(e.r)),s=Se(Wt(e.g)),r=Se(Wt(e.b));return{r:$t(vs(i+n*(Se(Wt(t.r))-i))),g:$t(vs(s+n*(Se(Wt(t.g))-s))),b:$t(vs(r+n*(Se(Wt(t.b))-r))),a:e.a+n*(t.a-e.a)}}function Bn(e,t,n){if(e){let i=ws(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=ks(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function To(e,t){return e&&Object.assign(t||{},e)}function Do(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=$t(e[3]))):(t=To(e,{r:0,g:0,b:0,a:1}),t.a=$t(t.a)),t}function _u(e){return e.charAt(0)==="r"?xu(e):du(e)}var nn=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,i;n==="object"?i=Do(t):n==="string"&&(i=iu(t)||mu(t)||_u(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=To(this._rgb);return t&&(t.a=Wt(t.a)),t}set rgb(t){this._rgb=Do(t)}rgbString(){return this._valid?yu(this._rgb):void 0}hexString(){return this._valid?ru(this._rgb):void 0}hslString(){return this._valid?pu(this._rgb):void 0}mix(t,n){if(t){let i=this.rgb,s=t.rgb,r,o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=vu(this._rgb,t._rgb,n)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=$t(t),this}clearer(t){let n=this._rgb;return n.a*=1-t,this}greyscale(){let t=this._rgb,n=sn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){let n=this._rgb;return n.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Bn(this._rgb,2,t),this}darken(t){return Bn(this._rgb,2,-t),this}saturate(t){return Bn(this._rgb,1,t),this}desaturate(t){return Bn(this._rgb,1,-t),this}rotate(t){return hu(this._rgb,t),this}};function Dt(){}var Bo=(()=>{let e=0;return()=>e++})();function F(e){return e===null||typeof e>"u"}function U(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function L(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Q(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ut(e,t){return Q(e)?e:t}function A(e,t){return typeof e>"u"?t:e}var Ho=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Os=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function H(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function z(e,t,n,i){let s,r,o;if(U(e))if(r=e.length,i)for(s=r-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;s<r;s++)t.call(n,e[s],s);else if(L(e))for(o=Object.keys(e),r=o.length,s=0;s<r;s++)t.call(n,e[o[s]],o[s])}function an(e,t){let n,i,s,r;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],r=t[n],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function Vn(e){if(U(e))return e.map(Vn);if(L(e)){let t=Object.create(null),n=Object.keys(e),i=n.length,s=0;for(;s<i;++s)t[n[s]]=Vn(e[n[s]]);return t}return e}function Yo(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function wu(e,t,n,i){if(!Yo(e))return;let s=t[e],r=n[e];L(s)&&L(r)?Ce(s,r,i):t[e]=Vn(r)}function Ce(e,t,n){let i=U(t)?t:[t],s=i.length;if(!L(e))return e;n=n||{};let r=n.merger||wu,o;for(let a=0;a<s;++a){if(o=i[a],!L(o))continue;let l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],e,o,n)}return e}function Te(e,t){return Ce(e,t,{merger:Mu})}function Mu(e,t,n){if(!Yo(e))return;let i=t[e],s=n[e];L(i)&&L(s)?Te(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Vn(s))}var Po={"":e=>e,x:e=>e.x,y:e=>e.y};function ku(e){let t=e.split("."),n=[],i="";for(let s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Su(e){let t=ku(e);return n=>{for(let i of t){if(i==="")break;n=n&&n[i]}return n}}function Bt(e,t){return(Po[t]||(Po[t]=Su(t)))(e)}function $n(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pe=e=>typeof e<"u",Nt=e=>typeof e=="function",Ts=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Uo(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var V=Math.PI,q=2*V,Du=q+V,qn=Number.POSITIVE_INFINITY,Cu=V/180,J=V/2,le=V/4,Ao=V*2/3,zt=Math.log10,xt=Math.sign;function Ae(e,t,n){return Math.abs(e-t)<n}function Ps(e){let t=Math.round(e);e=Ae(e,t,e/1e3)?t:e;let n=Math.pow(10,Math.floor(zt(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Vo(e){let t=[],n=Math.sqrt(e),i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,r)=>s-r).pop(),t}function fe(e){return!isNaN(parseFloat(e))&&isFinite(e)}function qo(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function As(e,t,n){let i,s,r;for(i=0,s=e.length;i<s;i++)r=e[i][n],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function pt(e){return e*(V/180)}function Qn(e){return e*(180/V)}function Is(e){if(!Q(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Ls(e,t){let n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*V&&(r+=q),{angle:r,distance:s}}function jn(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Ou(e,t){return(e-t+Du)%q-V}function ct(e){return(e%q+q)%q}function Ie(e,t,n,i){let s=ct(e),r=ct(t),o=ct(n),a=ct(r-s),l=ct(o-s),c=ct(s-r),u=ct(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function it(e,t,n){return Math.max(t,Math.min(n,e))}function jo(e){return it(e,-32768,32767)}function Ct(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Gn(e,t,n){n=n||(o=>e[o]<t);let i=e.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}var kt=(e,t,n,i)=>Gn(e,n,i?s=>{let r=e[s][t];return r<n||r===n&&e[s+1][t]===n}:s=>e[s][t]<n),Xo=(e,t,n)=>Gn(e,n,i=>e[i][t]>=n);function $o(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}var Qo=["push","pop","shift","splice","unshift"];function Go(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Qo.forEach(n=>{let i="_onData"+$n(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...r){let o=s.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Es(e,t){let n=e._chartjs;if(!n)return;let i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Qo.forEach(r=>{delete e[r]}),delete e._chartjs)}function Rs(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var Fs=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function Ws(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Fs.call(window,()=>{i=!1,e.apply(t,n)}))}}function Ko(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}var Kn=e=>e==="start"?"left":e==="end"?"right":"center",st=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,Zo=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function Ns(e,t,n){let i=t.length,s=0,r=i;if(e._sorted){let{iScale:o,_parsed:a}=e,l=o.axis,{min:c,max:u,minDefined:f,maxDefined:d}=o.getUserBounds();f&&(s=it(Math.min(kt(a,l,c).lo,n?i:kt(t,l,o.getPixelForValue(c)).lo),0,i-1)),d?r=it(Math.max(kt(a,o.axis,u,!0).hi+1,n?0:kt(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function zs(e){let{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;let r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}var Hn=e=>e===0||e===1,Io=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*q/n)),Lo=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*q/n)+1,De={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*J)+1,easeOutSine:e=>Math.sin(e*J),easeInOutSine:e=>-.5*(Math.cos(V*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Hn(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Hn(e)?e:Io(e,.075,.3),easeOutElastic:e=>Hn(e)?e:Lo(e,.075,.3),easeInOutElastic(e){return Hn(e)?e:e<.5?.5*Io(e*2,.1125,.45):.5+.5*Lo(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-De.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?De.easeInBounce(e*2)*.5:De.easeOutBounce(e*2-1)*.5+.5};function Bs(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Hs(e){return Bs(e)?e:new nn(e)}function Ss(e){return Bs(e)?e:new nn(e).saturate(.5).darken(.1).hexString()}var Tu=["x","y","borderWidth","radius","tension"],Pu=["color","borderColor","backgroundColor"];function Au(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Pu},numbers:{type:"number",properties:Tu}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Iu(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Eo=new Map;function Lu(e,t){t=t||{};let n=e+JSON.stringify(t),i=Eo.get(n);return i||(i=new Intl.NumberFormat(e,t),Eo.set(n,i)),i}function Le(e,t,n){return Lu(t,n).format(e)}var Jo={values(e){return U(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";let i=this.chart.options.locale,s,r=e;if(n.length>1){let c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=Eu(e,n)}let o=zt(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Le(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";let i=n[t].significand||e/Math.pow(10,Math.floor(zt(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?Jo.numeric.call(this,e,t,n):""}};function Eu(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var ln={formatters:Jo};function Ru(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ln.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}var Gt=Object.create(null),Zn=Object.create(null);function rn(e,t){if(!t)return e;let n=t.split(".");for(let i=0,s=n.length;i<s;++i){let r=n[i];e=e[r]||(e[r]=Object.create(null))}return e}function Ds(e,t,n){return typeof t=="string"?Ce(rn(e,t),n):Ce(rn(e,""),t)}var Cs=class{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Ss(s.backgroundColor),this.hoverBorderColor=(i,s)=>Ss(s.borderColor),this.hoverColor=(i,s)=>Ss(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Ds(this,t,n)}get(t){return rn(this,t)}describe(t,n){return Ds(Zn,t,n)}override(t,n){return Ds(Gt,t,n)}route(t,n,i,s){let r=rn(this,t),o=rn(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){let l=this[a],c=o[s];return L(l)?Object.assign({},c,l):A(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}},G=new Cs({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Au,Iu,Ru]);function Fu(e){return!e||F(e.size)||F(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function on(e,t,n,i,s){let r=t[s];return r||(r=t[s]=e.measureText(s).width,n.push(s)),r>i&&(i=r),i}function ta(e,t,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0,a=n.length,l,c,u,f,d;for(l=0;l<a;l++)if(f=n[l],f!=null&&!U(f))o=on(e,s,r,o,f);else if(U(f))for(c=0,u=f.length;c<u;c++)d=f[c],d!=null&&!U(d)&&(o=on(e,s,r,o,d));e.restore();let h=r.length/2;if(h>n.length){for(l=0;l<h;l++)delete s[r[l]];r.splice(0,h)}return o}function Kt(e,t,n){let i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function Ys(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Jn(e,t,n,i){Us(e,t,n,i,null)}function Us(e,t,n,i,s){let r,o,a,l,c,u,f,d,h=t.pointStyle,p=t.rotation,g=t.radius,m=(p||0)*Cu;if(h&&typeof h=="object"&&(r=h.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(m),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),h){default:s?e.ellipse(n,i,s/2,g,0,0,q):e.arc(n,i,g,0,q),e.closePath();break;case"triangle":u=s?s/2:g,e.moveTo(n+Math.sin(m)*u,i-Math.cos(m)*g),m+=Ao,e.lineTo(n+Math.sin(m)*u,i-Math.cos(m)*g),m+=Ao,e.lineTo(n+Math.sin(m)*u,i-Math.cos(m)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,o=Math.cos(m+le)*l,f=Math.cos(m+le)*(s?s/2-c:l),a=Math.sin(m+le)*l,d=Math.sin(m+le)*(s?s/2-c:l),e.arc(n-f,i-a,c,m-V,m-J),e.arc(n+d,i-o,c,m-J,m),e.arc(n+f,i+a,c,m,m+J),e.arc(n-d,i+o,c,m+J,m+V),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}m+=le;case"rectRot":f=Math.cos(m)*(s?s/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(s?s/2:g),e.moveTo(n-f,i-a),e.lineTo(n+d,i-o),e.lineTo(n+f,i+a),e.lineTo(n-d,i+o),e.closePath();break;case"crossRot":m+=le;case"cross":f=Math.cos(m)*(s?s/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(s?s/2:g),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+d,i-o),e.lineTo(n-d,i+o);break;case"star":f=Math.cos(m)*(s?s/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(s?s/2:g),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+d,i-o),e.lineTo(n-d,i+o),m+=le,f=Math.cos(m)*(s?s/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(s?s/2:g),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+d,i-o),e.lineTo(n-d,i+o);break;case"line":o=s?s/2:Math.cos(m)*g,a=Math.sin(m)*g,e.moveTo(n-o,i-a),e.lineTo(n+o,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(m)*(s?s/2:g),i+Math.sin(m)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function St(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function cn(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function un(e){e.restore()}function ea(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){let r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function na(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Wu(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),F(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Nu(e,t,n,i,s){if(s.strikethrough||s.underline){let r=e.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=n-r.actualBoundingBoxAscent,c=n+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(o,u),e.lineTo(a,u),e.stroke()}}function zu(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Zt(e,t,n,i,s,r={}){let o=U(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="",l,c;for(e.save(),e.font=s.string,Wu(e,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&zu(e,r.backdrop),a&&(r.strokeColor&&(e.strokeStyle=r.strokeColor),F(r.strokeWidth)||(e.lineWidth=r.strokeWidth),e.strokeText(c,n,i,r.maxWidth)),e.fillText(c,n,i,r.maxWidth),Nu(e,n,i,c,r),i+=Number(s.lineHeight);e.restore()}function Ee(e,t){let{x:n,y:i,w:s,h:r,radius:o}=t;e.arc(n+o.topLeft,i+o.topLeft,o.topLeft,1.5*V,V,!0),e.lineTo(n,i+r-o.bottomLeft),e.arc(n+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,V,J,!0),e.lineTo(n+s-o.bottomRight,i+r),e.arc(n+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,J,0,!0),e.lineTo(n+s,i+o.topRight),e.arc(n+s-o.topRight,i+o.topRight,o.topRight,0,-J,!0),e.lineTo(n+o.topLeft,i)}var Bu=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Hu=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Yu(e,t){let n=(""+e).match(Bu);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}var Uu=e=>+e||0;function ti(e,t){let n={},i=L(t),s=i?Object.keys(t):t,r=L(e)?i?o=>A(e[o],e[t[o]]):o=>e[o]:()=>e;for(let o of s)n[o]=Uu(r(o));return n}function Vs(e){return ti(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Jt(e){return ti(e,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(e){let t=Vs(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function nt(e,t){e=e||{},t=t||G.font;let n=A(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=A(e.style,t.style);i&&!(""+i).match(Hu)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let s={family:A(e.family,t.family),lineHeight:Yu(A(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:A(e.weight,t.weight),string:""};return s.string=Fu(s),s}function Re(e,t,n,i){let s=!0,r,o,a;for(r=0,o=e.length;r<o;++r)if(a=e[r],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),n!==void 0&&U(a)&&(a=a[n%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function ia(e,t,n){let{min:i,max:s}=e,r=Os(t,(s-i)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Ht(e,t){return Object.assign(Object.create(e),t)}function ei(e,t=[""],n,i,s=()=>e[0]){let r=n||e;typeof i>"u"&&(i=oa("_fallback",e));let o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>ei([a,...e],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return sa(a,l,()=>Ku(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Fo(a).includes(l)},ownKeys(a){return Fo(a)},set(a,l,c){let u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function ue(e,t,n,i){let s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:qs(e,i),setContext:r=>ue(e,r,n,i),override:r=>ue(e.override(r),t,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return sa(r,o,()=>qu(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function qs(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Nt(n)?n:()=>n,isIndexable:Nt(i)?i:()=>i}}var Vu=(e,t)=>e?e+$n(t):t,js=(e,t)=>L(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function sa(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let i=n();return e[t]=i,i}function qu(e,t,n){let{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=e,a=i[t];return Nt(a)&&o.isScriptable(t)&&(a=ju(t,a,e,n)),U(a)&&a.length&&(a=Xu(t,a,e,o.isIndexable)),js(t,a)&&(a=ue(a,s,r&&r[t],o)),a}function ju(e,t,n,i){let{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(r,o||i);return a.delete(e),js(e,l)&&(l=Xs(s._scopes,s,e,l)),l}function Xu(e,t,n,i){let{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(typeof r.index<"u"&&i(e))return t[r.index%t.length];if(L(t[0])){let l=t,c=s._scopes.filter(u=>u!==l);t=[];for(let u of l){let f=Xs(c,s,e,u);t.push(ue(f,r,o&&o[e],a))}}return t}function ra(e,t,n){return Nt(e)?e(t,n):e}var $u=(e,t)=>e===!0?t:typeof e=="string"?Bt(t,e):void 0;function Qu(e,t,n,i,s){for(let r of t){let o=$u(n,r);if(o){e.add(o);let a=ra(o._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(o===!1&&typeof i<"u"&&n!==i)return null}return!1}function Xs(e,t,n,i){let s=t._rootScopes,r=ra(t._fallback,n,i),o=[...e,...s],a=new Set;a.add(i);let l=Ro(a,o,n,r||n,i);return l===null||typeof r<"u"&&r!==n&&(l=Ro(a,o,r,l,i),l===null)?!1:ei(Array.from(a),[""],s,r,()=>Gu(t,n,i))}function Ro(e,t,n,i,s){for(;n;)n=Qu(e,t,n,i,s);return n}function Gu(e,t,n){let i=e._getTarget();t in i||(i[t]={});let s=i[t];return U(s)&&L(n)?n:s||{}}function Ku(e,t,n,i){let s;for(let r of t)if(s=oa(Vu(r,e),n),typeof s<"u")return js(e,s)?Xs(n,i,e,s):s}function oa(e,t){for(let n of t){if(!n)continue;let i=n[e];if(typeof i<"u")return i}}function Fo(e){let t=e._keys;return t||(t=e._keys=Zu(e._scopes)),t}function Zu(e){let t=new Set;for(let n of e)for(let i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function $s(e,t,n,i){let{iScale:s}=e,{key:r="r"}=this._parsing,o=new Array(i),a,l,c,u;for(a=0,l=i;a<l;++a)c=a+n,u=t[c],o[a]={r:s.parse(Bt(u,r),c)};return o}var Ju=Number.EPSILON||1e-14,Oe=(e,t)=>t<e.length&&!e[t].skip&&e[t],aa=e=>e==="x"?"y":"x";function tf(e,t,n,i){let s=e.skip?t:e,r=t,o=n.skip?t:n,a=jn(r,s),l=jn(o,r),c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;let f=i*c,d=i*u;return{previous:{x:r.x-f*(o.x-s.x),y:r.y-f*(o.y-s.y)},next:{x:r.x+d*(o.x-s.x),y:r.y+d*(o.y-s.y)}}}function ef(e,t,n){let i=e.length,s,r,o,a,l,c=Oe(e,0);for(let u=0;u<i-1;++u)if(l=c,c=Oe(e,u+1),!(!l||!c)){if(Ae(t[u],0,Ju)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],r=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),n[u]=s*o*t[u],n[u+1]=r*o*t[u])}}function nf(e,t,n="x"){let i=aa(n),s=e.length,r,o,a,l=Oe(e,0);for(let c=0;c<s;++c){if(o=a,a=l,l=Oe(e,c+1),!a)continue;let u=a[n],f=a[i];o&&(r=(u-o[n])/3,a[`cp1${n}`]=u-r,a[`cp1${i}`]=f-r*t[c]),l&&(r=(l[n]-u)/3,a[`cp2${n}`]=u+r,a[`cp2${i}`]=f+r*t[c])}}function sf(e,t="x"){let n=aa(t),i=e.length,s=Array(i).fill(0),r=Array(i),o,a,l,c=Oe(e,0);for(o=0;o<i;++o)if(a=l,l=c,c=Oe(e,o+1),!!l){if(c){let u=c[t]-l[t];s[o]=u!==0?(c[n]-l[n])/u:0}r[o]=a?c?xt(s[o-1])!==xt(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}ef(e,s,r),nf(e,r,t)}function Yn(e,t,n){return Math.max(Math.min(e,n),t)}function rf(e,t){let n,i,s,r,o,a=St(e[0],t);for(n=0,i=e.length;n<i;++n)o=r,r=a,a=n<i-1&&St(e[n+1],t),r&&(s=e[n],o&&(s.cp1x=Yn(s.cp1x,t.left,t.right),s.cp1y=Yn(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Yn(s.cp2x,t.left,t.right),s.cp2y=Yn(s.cp2y,t.top,t.bottom)))}function la(e,t,n,i,s){let r,o,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")sf(e,s);else{let c=i?e[e.length-1]:e[0];for(r=0,o=e.length;r<o;++r)a=e[r],l=tf(c,a,e[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&rf(e,n)}function ni(){return typeof window<"u"&&typeof document<"u"}function ii(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Xn(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}var si=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function of(e,t){return si(e).getPropertyValue(t)}var af=["top","right","bottom","left"];function ce(e,t,n){let i={};n=n?"-"+n:"";for(let s=0;s<4;s++){let r=af[s];i[r]=parseFloat(e[t+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var lf=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function cf(e,t){let n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:r}=i,o=!1,a,l;if(lf(s,r,e.target))a=s,l=r;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function te(e,t){if("native"in e)return e;let{canvas:n,currentDevicePixelRatio:i}=t,s=si(n),r=s.boxSizing==="border-box",o=ce(s,"padding"),a=ce(s,"border","width"),{x:l,y:c,box:u}=cf(e,n),f=o.left+(u&&a.left),d=o.top+(u&&a.top),{width:h,height:p}=t;return r&&(h-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-f)/h*n.width/i),y:Math.round((c-d)/p*n.height/i)}}function uf(e,t,n){let i,s;if(t===void 0||n===void 0){let r=e&&ii(e);if(!r)t=e.clientWidth,n=e.clientHeight;else{let o=r.getBoundingClientRect(),a=si(r),l=ce(a,"border","width"),c=ce(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,i=Xn(a.maxWidth,r,"clientWidth"),s=Xn(a.maxHeight,r,"clientHeight")}}return{width:t,height:n,maxWidth:i||qn,maxHeight:s||qn}}var Un=e=>Math.round(e*10)/10;function ca(e,t,n,i){let s=si(e),r=ce(s,"margin"),o=Xn(s.maxWidth,e,"clientWidth")||qn,a=Xn(s.maxHeight,e,"clientHeight")||qn,l=uf(e,t,n),{width:c,height:u}=l;if(s.boxSizing==="content-box"){let d=ce(s,"border","width"),h=ce(s,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=Un(Math.min(c,o,l.maxWidth)),u=Un(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Un(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Un(Math.floor(u*i))),{width:c,height:u}}function Qs(e,t,n){let i=t||1,s=Math.floor(e.height*i),r=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(e.currentDevicePixelRatio=i,o.height=s,o.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}var ua=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};ni()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function Gs(e,t){let n=of(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Qt(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function fa(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function da(e,t,n,i){let s={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=Qt(e,s,n),a=Qt(s,r,n),l=Qt(r,t,n),c=Qt(o,a,n),u=Qt(a,l,n);return Qt(c,u,n)}var ff=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},df=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function de(e,t,n){return e?ff(t,n):df()}function Ks(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Zs(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function ha(e){return e==="angle"?{between:Ie,compare:Ou,normalize:ct}:{between:Ct,compare:(t,n)=>t-n,normalize:t=>t}}function Wo({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function hf(e,t,n){let{property:i,start:s,end:r}=n,{between:o,normalize:a}=ha(i),l=t.length,{start:c,end:u,loop:f}=e,d,h;if(f){for(c+=l,u+=l,d=0,h=l;d<h&&o(a(t[c%l][i]),s,r);++d)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:e.style}}function Js(e,t,n){if(!n)return[e];let{property:i,start:s,end:r}=n,o=t.length,{compare:a,between:l,normalize:c}=ha(i),{start:u,end:f,loop:d,style:h}=hf(e,t,n),p=[],g=!1,m=null,b,x,y,w=()=>l(s,y,b)&&a(s,y)!==0,v=()=>a(r,b)===0||l(r,y,b),k=()=>g||w(),S=()=>!g||v();for(let D=u,C=u;D<=f;++D)x=t[D%o],!x.skip&&(b=c(x[i]),b!==y&&(g=l(b,s,r),m===null&&k()&&(m=a(b,s)===0?D:C),m!==null&&S()&&(p.push(Wo({start:m,end:D,loop:d,count:o,style:h})),m=null),C=D,y=b));return m!==null&&p.push(Wo({start:m,end:f,loop:d,count:o,style:h})),p}function tr(e,t){let n=[],i=e.segments;for(let s=0;s<i.length;s++){let r=Js(i[s],e.points,t);r.length&&n.push(...r)}return n}function pf(e,t,n,i){let s=0,r=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(r+=s);r>s&&e[r%t].skip;)r--;return r%=t,{start:s,end:r}}function gf(e,t,n,i){let s=e.length,r=[],o=t,a=e[t],l;for(l=t+1;l<=n;++l){let c=e[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function pa(e,t){let n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];let r=!!e._loop,{start:o,end:a}=pf(n,s,r,i);if(i===!0)return No(e,[{start:o,end:a,loop:r}],n,t);let l=a<o?a+s:a,c=!!e._fullLoop&&o===0&&a===s-1;return No(e,gf(n,o,l,c),n,t)}function No(e,t,n,i){return!i||!i.setContext||!n?t:mf(e,t,n,i)}function mf(e,t,n,i){let s=e._chart.getContext(),r=zo(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=n.length,c=[],u=r,f=t[0].start,d=f;function h(p,g,m,b){let x=a?-1:1;if(p!==g){for(p+=l;n[p%l].skip;)p-=x;for(;n[g%l].skip;)g+=x;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:b}),u=b,f=g%l)}}for(let p of t){f=a?f:p.start;let g=n[f%l],m;for(d=f+1;d<=p.end;d++){let b=n[d%l];m=zo(i.setContext(Ht(s,{type:"segment",p0:g,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),bf(m,u)&&h(f,d-1,p.loop,u),g=b,u=m}f<d-1&&h(f,d-1,p.loop,u)}return c}function zo(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function bf(e,t){if(!t)return!1;let n=[],i=function(s,r){return Bs(r)?(n.includes(r)||n.push(r),n.indexOf(r)):r};return JSON.stringify(e,i)!==JSON.stringify(t,i)}var ur=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){let r=n.listeners[s],o=n.duration;r.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Fs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let r=i.items,o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){let n=this._charts,i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){let n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){let n=this._charts.get(t);if(!n||!n.items.length)return;let i=n.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Yt=new ur,ga="transparent",xf={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let i=Hs(e||ga),s=i.valid&&Hs(t||ga);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}},fr=class{constructor(t,n,i,s){let r=n[i];s=Re([t.to,s,r,t.from]);let o=Re([t.from,r,s]);this._active=!0,this._fn=t.fn||xf[t.type||typeof o],this._easing=De[t.easing]||De.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);let s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Re([t.to,n,s,t.from]),this._from=Re([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to,l;if(this._active=r!==a&&(o||n<i),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=r;return}l=n/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){let n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}},pi=class{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!L(t))return;let n=Object.keys(G.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let r=t[s];if(!L(r))return;let o={};for(let a of n)o[a]=r[a];(U(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,n){let i=n.options,s=vf(t,i);if(!s)return[];let r=this._createAnimations(s,i);return i.$shared&&yf(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){let i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now(),l;for(l=o.length-1;l>=0;--l){let c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}let u=n[c],f=r[c],d=i.get(c);if(f)if(d&&f.active()){f.update(d,u,a);continue}else f.cancel();if(!d||!d.duration){t[c]=u;continue}r[c]=f=new fr(d,t,c,u),s.push(f)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}let i=this._createAnimations(t,n);if(i.length)return Yt.add(this._chart,i),!0}};function yf(e,t){let n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){let r=e[i[s]];r&&r.active()&&n.push(r.wait())}return Promise.all(n)}function vf(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function ma(e,t){let n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,r=n.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function _f(e,t,n){if(n===!1)return!1;let i=ma(e,n),s=ma(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function wf(e){let t,n,i,s;return L(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function gl(e,t){let n=[],i=e._getSortedDatasetMetas(t),s,r;for(s=0,r=i.length;s<r;++s)n.push(i[s].index);return n}function ba(e,t,n,i={}){let s=e.keys,r=i.mode==="single",o,a,l,c;if(t!==null){for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===n){if(i.all)continue;break}c=e.values[l],Q(c)&&(r||t===0||xt(t)===xt(c))&&(t+=c)}return t}}function Mf(e,t){let{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length),l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:e[u]};return a}function xa(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function kf(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Sf(e){let{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function Df(e,t,n){let i=e[t]||(e[t]={});return i[n]||(i[n]={})}function ya(e,t,n,i){for(let s of t.getMatchingVisibleMetas(i).reverse()){let r=e[s.index];if(n&&r>0||!n&&r<0)return s.index}return null}function va(e,t){let{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=kf(r,o,i),f=t.length,d;for(let h=0;h<f;++h){let p=t[h],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});d=b[c]=Df(s,u,g),d[a]=m,d._top=ya(d,o,!0,i.type),d._bottom=ya(d,o,!1,i.type);let x=d._visualValues||(d._visualValues={});x[a]=m}}function er(e,t){let n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function Cf(e,t){return Ht(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Of(e,t,n){return Ht(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function fn(e,t){let n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(let s of t){let r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}var nr=e=>e==="reset"||e==="none",_a=(e,t)=>t?e:Object.assign({},e),Tf=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:gl(n,!0),values:null},Pt=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=xa(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&fn(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(f,d,h,p)=>f==="x"?d:f==="r"?p:h,r=n.xAxisID=A(i.xAxisID,er(t,"x")),o=n.yAxisID=A(i.yAxisID,er(t,"y")),a=n.rAxisID=A(i.rAxisID,er(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Es(this._data,this),t._stacked&&fn(t)}_dataCheck(){let t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(L(n)){let s=this._cachedMeta;this._data=Mf(n,s)}else if(i!==n){if(i){Es(i,this);let s=this._cachedMeta;fn(s),s._parsed=[]}n&&Object.isExtensible(n)&&Go(n,this),this._syncList=[],this._data=n}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let n=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let r=n._stacked;n._stacked=xa(n.vScale,n),n.stack!==i.stack&&(s=!0,fn(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&va(this,n._parsed)}configure(){let t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){let{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis,l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,f,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{U(s[t])?d=this.parseArrayData(i,s,t,n):L(s[t])?d=this.parseObjectData(i,s,t,n):d=this.parsePrimitiveData(i,s,t,n);let h=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=f=d[u],l&&(h()&&(l=!1),c=f);i._sorted=l}o&&va(this,d)}parsePrimitiveData(t,n,i,s){let{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,f=new Array(s),d,h,p;for(d=0,h=s;d<h;++d)p=d+i,f[d]={[a]:u||r.parse(c[p],p),[l]:o.parse(n[p],p)};return f}parseArrayData(t,n,i,s){let{xScale:r,yScale:o}=t,a=new Array(s),l,c,u,f;for(l=0,c=s;l<c;++l)u=l+i,f=n[u],a[l]={x:r.parse(f[0],u),y:o.parse(f[1],u)};return a}parseObjectData(t,n,i,s){let{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),u,f,d,h;for(u=0,f=s;u<f;++u)d=u+i,h=n[d],c[u]={x:r.parse(Bt(h,a),d),y:o.parse(Bt(h,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){let s=this.chart,r=this._cachedMeta,o=n[t.axis],a={keys:gl(s,!0),values:n._stacks[t.axis]._visualValues};return ba(a,o,r.index,{mode:i})}updateRangeFromParsed(t,n,i,s){let r=i[n.axis],o=r===null?NaN:r,a=s&&i._stacks[n.axis];s&&a&&(s.values=a,o=ba(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){let i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=Tf(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Sf(a),d,h;function p(){h=s[d];let g=h[a.axis];return!Q(h[t.axis])||u>g||f<g}for(d=0;d<o&&!(!p()&&(this.updateRangeFromParsed(c,t,h,l),r));++d);if(r){for(d=o-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){let n=this._cachedMeta._parsed,i=[],s,r,o;for(s=0,r=n.length;s<r;++s)o=n[s][t.axis],Q(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){let n=this._cachedMeta,i=n.iScale,s=n.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){let n=this._cachedMeta;this.update(t||"default"),n._clip=wf(A(this.options.clip,_f(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],r=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){let f=s[u];f.hidden||(f.active&&c?o.push(f):f.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,n){let i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){let s=this.getDataset(),r;if(t>=0&&t<this._cachedMeta.data.length){let o=this._cachedMeta.data[t];r=o.$context||(o.$context=Of(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Cf(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!n,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){let s=n==="active",r=this._cachedDataOpts,o=t+"-"+n,a=r[o],l=this.enableOptionSharing&&Pe(i);if(a)return _a(a,l);let c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),u),h=Object.keys(G.elements[t]),p=()=>this.getContext(i,s,n),g=c.resolveNamedOptions(d,h,p,f);return g.$shared&&(g.$shared=l,r[o]=Object.freeze(_a(g,l))),g}_resolveAnimations(t,n,i){let s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){let u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),d=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(d,this.getContext(t,i,n))}let c=new pi(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||nr(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){let i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){nr(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!nr(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;let r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let n=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,n,i=!0){let s=this._cachedMeta,r=s.data,o=t+n,a,l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(r,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,n);i._stacked&&fn(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[n,i,s]=t;this[n](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};function Pf(e,t){if(!e._cache.$bar){let n=e.getMatchingVisibleMetas(t),i=[];for(let s=0,r=n.length;s<r;s++)i=i.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=Rs(i.sort((s,r)=>s-r))}return e._cache.$bar}function Af(e){let t=e.iScale,n=Pf(t,e.type),i=t._length,s,r,o,a,l=()=>{o===32767||o===-32768||(Pe(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s<r;++s)o=t.getPixelForValue(n[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function If(e,t,n,i){let s=n.barThickness,r,o;return F(s)?(r=t.min*n.categoryPercentage,o=n.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[e]-r/2}}function Lf(e,t,n,i){let s=t.pixels,r=s[e],o=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null,l=n.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);let c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:n.barPercentage,start:c}}function Ef(e,t,n,i){let s=n.parse(e[0],i),r=n.parse(e[1],i),o=Math.min(s,r),a=Math.max(s,r),l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function ml(e,t,n,i){return U(e)?Ef(e,t,n,i):t[n.axis]=n.parse(e,i),t}function wa(e,t,n,i){let s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[],c,u,f,d;for(c=n,u=n+i;c<u;++c)d=t[c],f={},f[s.axis]=a||s.parse(o[c],c),l.push(ml(d,f,r,c));return l}function ir(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Rf(e,t,n){return e!==0?xt(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Ff(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:n,end:i,reverse:t,top:s,bottom:r}}function Wf(e,t,n,i){let s=t.borderSkipped,r={};if(!s){e.borderSkipped=r;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:a,reverse:l,top:c,bottom:u}=Ff(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?s=c:(n._bottom||0)===i?s=u:(r[Ma(u,o,a,l)]=!0,s=c)),r[Ma(s,o,a,l)]=!0,e.borderSkipped=r}function Ma(e,t,n,i){return i?(e=Nf(e,t,n),e=ka(e,n,t)):e=ka(e,t,n),e}function Nf(e,t,n){return e===t?n:e===n?t:e}function ka(e,t,n){return e==="start"?t:e==="end"?n:e}function zf(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}var dr=class extends Pt{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,i,s){return wa(t,n,i,s)}parseArrayData(t,n,i,s){return wa(t,n,i,s)}parseObjectData(t,n,i,s){let{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,f=[],d,h,p,g;for(d=i,h=i+s;d<h;++d)g=n[d],p={},p[r.axis]=r.parse(Bt(g,c),d),f.push(ml(Bt(g,u),p,o,d));return f}updateRangeFromParsed(t,n,i,s){super.updateRangeFromParsed(t,n,i,s);let r=i._custom;r&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let n=this._cachedMeta,{iScale:i,vScale:s}=n,r=this.getParsed(t),o=r._custom,a=ir(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,s){let r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:d}=this._getSharedOptions(n,s);for(let h=n;h<n+i;h++){let p=this.getParsed(h),g=r||F(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),m=this._calculateBarIndexPixels(h,u),b=(p._stacks||{})[a.axis],x={horizontal:c,base:g.base,enableBorderRadius:!b||ir(p._custom)||o===b._top||o===b._bottom,x:c?g.head:m.center,y:c?m.center:g.head,height:c?m.size:Math.abs(g.size),width:c?Math.abs(g.size):m.size};d&&(x.options=f||this.resolveDataElementOptions(h,t[h].active?"active":s));let y=x.options||t[h].options;Wf(x,y,b,o),zf(x,y,u.ratio),this.updateElement(t[h],h,x,s)}}_getStacks(t,n){let{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[i.axis],c=u=>{let f=u._parsed.find(h=>h[i.axis]===l),d=f&&f[u.vScale.axis];if(F(d)||isNaN(d))return!0};for(let u of s)if(!(n!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){let s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){let t=this.options,n=this._cachedMeta,i=n.iScale,s=[],r,o;for(r=0,o=n.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));let a=t.barThickness;return{min:a||Af(n),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:n,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=ir(c),f=l[n.axis],d=0,h=i?this.applyStack(n,l,i):f,p,g;h!==f&&(d=h-f,h=f),u&&(f=c.barStart,h=c.barEnd-c.barStart,f!==0&&xt(f)!==xt(c.barEnd)&&(d=0),d+=f);let m=!F(r)&&!u?r:d,b=n.getPixelForValue(m);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(d+h):p=b,g=p-b,Math.abs(g)<o){g=Rf(g,n,a)*o,f===a&&(b-=g/2);let x=n.getPixelForDecimal(0),y=n.getPixelForDecimal(1),w=Math.min(x,y),v=Math.max(x,y);b=Math.max(Math.min(b,v),w),p=b+g,i&&!u&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){let x=xt(g)*n.getLineWidthForValue(a)/2;b+=x,g-=x}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(t,n){let i=n.scale,s=this.options,r=s.skipNull,o=A(s.maxBarThickness,1/0),a,l;if(n.grouped){let c=r?this._getStackCount(t):n.stackCount,u=s.barThickness==="flex"?Lf(t,n,s,c):If(t,n,s,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=u.start+u.chunk*f+u.chunk/2,l=Math.min(o,u.chunk*u.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){let t=this._cachedMeta,n=t.vScale,i=t.data,s=i.length,r=0;for(;r<s;++r)this.getParsed(r)[n.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}},hr=class extends Pt{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,s){let r=super.parsePrimitiveData(t,n,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,n,i,s){let r=super.parseArrayData(t,n,i,s);for(let o=0;o<r.length;o++){let a=n[i+o];r[o]._custom=A(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,n,i,s){let r=super.parseObjectData(t,n,i,s);for(let o=0;o<r.length;o++){let a=n[i+o];r[o]._custom=A(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){let t=this._cachedMeta.data,n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){let n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){let n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){let r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,f=a.axis;for(let d=n;d<n+i;d++){let h=t[d],p=!r&&this.getParsed(d),g={},m=g[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),b=g[f]=r?a.getBasePixel():a.getPixelForValue(p[f]);g.skip=isNaN(m)||isNaN(b),c&&(g.options=l||this.resolveDataElementOptions(d,h.active?"active":s),r&&(g.options.radius=0)),this.updateElement(h,d,g,s)}}resolveDataElementOptions(t,n){let i=this.getParsed(t),s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let r=s.radius;return n!=="active"&&(s.radius=0),s.radius+=A(i&&i._custom,r),s}};function Bf(e,t,n){let i=1,s=1,r=0,o=0;if(t<q){let a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),d=Math.sin(l),h=(y,w,v)=>Ie(y,a,l,!0)?1:Math.max(w,w*n,v,v*n),p=(y,w,v)=>Ie(y,a,l,!0)?-1:Math.min(w,w*n,v,v*n),g=h(0,c,f),m=h(J,u,d),b=p(V,c,f),x=p(V+J,u,d);i=(g-b)/2,s=(m-x)/2,r=-(g+b)/2,o=-(m+x)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var xn=class extends Pt{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let n=t.data;if(n.labels.length&&n.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{let l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){let i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(L(i[t])){let{key:l="value"}=this._parsing;r=c=>+Bt(i[c],l)}let o,a;for(o=t,a=t+n;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return pt(this.options.rotation-90)}_getCircumference(){return pt(this.options.circumference)}_getRotationExtents(){let t=q,n=-q;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){let s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),n=Math.max(n,r+o)}return{rotation:t,circumference:n-t}}update(t){let n=this.chart,{chartArea:i}=n,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(Ho(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:d,ratioY:h,offsetX:p,offsetY:g}=Bf(f,u,l),m=(i.width-o)/d,b=(i.height-o)/h,x=Math.max(Math.min(m,b)/2,0),y=Os(this.options.radius,x),w=Math.max(y*l,0),v=(y-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*y,this.offsetY=g*y,s.total=this.calculateTotal(),this.outerRadius=y-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,n){let i=this.options,s=this._cachedMeta,r=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/q)}updateElements(t,n,i,s){let r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,d=r&&c.animateScale,h=d?0:this.innerRadius,p=d?0:this.outerRadius,{sharedOptions:g,includeOptions:m}=this._getSharedOptions(n,s),b=this._getRotation(),x;for(x=0;x<n;++x)b+=this._circumference(x,r);for(x=n;x<n+i;++x){let y=this._circumference(x,r),w=t[x],v={x:u+this.offsetX,y:f+this.offsetY,startAngle:b,endAngle:b+y,circumference:y,outerRadius:p,innerRadius:h};m&&(v.options=g||this.resolveDataElementOptions(x,w.active?"active":s)),b+=y,this.updateElement(w,x,v,s)}}calculateTotal(){let t=this._cachedMeta,n=t.data,i=0,s;for(s=0;s<n.length;s++){let r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){let n=this._cachedMeta.total;return n>0&&!isNaN(t)?q*(Math.abs(t)/n):0}getLabelAndValue(t){let n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Le(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0,i=this.chart,s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,s=t.length;i<s;++i){let r=this.resolveDataElementOptions(i);n=Math.max(n,r.offset||0,r.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(A(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}},pr=class extends Pt{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled,{start:a,count:l}=Ns(n,s,o);this._drawStart=a,this._drawCount=l,zs(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){let r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s),d=o.axis,h=a.axis,{spanGaps:p,segment:g}=this.options,m=fe(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||s==="none",x=n+i,y=t.length,w=n>0&&this.getParsed(n-1);for(let v=0;v<y;++v){let k=t[v],S=b?k:{};if(v<n||v>=x){S.skip=!0;continue}let D=this.getParsed(v),C=F(D[h]),T=S[d]=o.getPixelForValue(D[d],v),P=S[h]=r||C?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,D,l):D[h],v);S.skip=isNaN(T)||isNaN(P)||C,S.stop=v>0&&Math.abs(D[d]-w[d])>m,g&&(S.parsed=D,S.raw=c.data[v]),f&&(S.options=u||this.resolveDataElementOptions(v,k.active?"active":s)),b||this.updateElement(k,v,S,s),w=D}}getMaxOverflow(){let t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},gi=class extends Pt{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let n=t.data;if(n.labels.length&&n.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{let l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Le(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return $s.bind(this)(t,n,i,s)}update(t){let n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){let t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{let r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<n.min&&(n.min=r),r>n.max&&(n.max=r))}),n}_updateRadius(){let t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){let r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,d=c.getIndexAngle(0)-.5*V,h=d,p,g=360/this.countVisibleElements();for(p=0;p<n;++p)h+=this._computeAngle(p,s,g);for(p=n;p<n+i;p++){let m=t[p],b=h,x=h+this._computeAngle(p,s,g),y=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;h=x,r&&(l.animateScale&&(y=0),l.animateRotate&&(b=x=d));let w={x:u,y:f,innerRadius:0,outerRadius:y,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,m.active?"active":s)};this.updateElement(m,p,w,s)}}countVisibleElements(){let t=this._cachedMeta,n=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?pt(this.resolveDataElementOptions(t,n).angle||i):0}},gr=class extends xn{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},mr=class extends Pt{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){let n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return $s.bind(this)(t,n,i,s)}update(t){let n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){let o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);let a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){let r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a<n+i;a++){let l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),f=o?r.xCenter:u.x,d=o?r.yCenter:u.y,h={x:f,y:d,angle:u.angle,skip:isNaN(f)||isNaN(d),options:c};this.updateElement(l,a,h,s)}}},br=class extends Pt{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){let n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){let n=this._cachedMeta,{data:i=[]}=n,s=this.chart._animationsDisabled,{start:r,count:o}=Ns(n,i,s);if(this._drawStart=r,this._drawCount=o,zs(n)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,s){let r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),f=this.getSharedOptions(u),d=this.includeOptions(s,f),h=o.axis,p=a.axis,{spanGaps:g,segment:m}=this.options,b=fe(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||s==="none",y=n>0&&this.getParsed(n-1);for(let w=n;w<n+i;++w){let v=t[w],k=this.getParsed(w),S=x?v:{},D=F(k[p]),C=S[h]=o.getPixelForValue(k[h],w),T=S[p]=r||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[p],w);S.skip=isNaN(C)||isNaN(T)||D,S.stop=w>0&&Math.abs(k[h]-y[h])>b,m&&(S.parsed=k,S.raw=c.data[w]),d&&(S.options=f||this.resolveDataElementOptions(w,v.active?"active":s)),x||this.updateElement(v,w,S,s),y=k}this.updateSharedOptions(f,s,u)}getMaxOverflow(){let t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;let r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}},Hf=Object.freeze({__proto__:null,BarController:dr,BubbleController:hr,DoughnutController:xn,LineController:pr,PieController:gr,PolarAreaController:gi,RadarController:mr,ScatterController:br});function he(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var xr=class e{static override(t){Object.assign(e.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return he()}parse(){return he()}format(){return he()}add(){return he()}diff(){return he()}startOf(){return he()}endOf(){return he()}},Nr={_date:xr};function Yf(e,t,n,i){let{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){let l=a._reversePixels?Xo:kt;if(i){if(s._sharedOptions){let c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){let f=l(r,t,n-u),d=l(r,t,n+u);return{lo:f.lo,hi:d.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function Mn(e,t,n,i,s){let r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a<l;++a){let{index:c,data:u}=r[a],{lo:f,hi:d}=Yf(r[a],t,o,s);for(let h=f;h<=d;++h){let p=u[h];p.skip||i(p,c,h)}}}function Uf(e){let t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){let r=t?Math.abs(i.x-s.x):0,o=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function sr(e,t,n,i,s){let r=[];return!s&&!e.isPointInArea(t)||Mn(e,n,t,function(a,l,c){!s&&!St(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Vf(e,t,n,i){let s=[];function r(o,a,l){let{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:f}=Ls(o,{x:t.x,y:t.y});Ie(f,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return Mn(e,n,t,r),s}function qf(e,t,n,i,s,r){let o=[],a=Uf(n),l=Number.POSITIVE_INFINITY;function c(u,f,d){let h=u.inRange(t.x,t.y,s);if(i&&!h)return;let p=u.getCenterPoint(s);if(!(!!r||e.isPointInArea(p))&&!h)return;let m=a(t,p);m<l?(o=[{element:u,datasetIndex:f,index:d}],l=m):m===l&&o.push({element:u,datasetIndex:f,index:d})}return Mn(e,n,t,c),o}function rr(e,t,n,i,s,r){return!r&&!e.isPointInArea(t)?[]:n==="r"&&!i?Vf(e,t,n,s):qf(e,t,n,i,s,r)}function Sa(e,t,n,i,s){let r=[],o=n==="x"?"inXRange":"inYRange",a=!1;return Mn(e,n,t,(l,c,u)=>{l[o]&&l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var jf={evaluateInteractionItems:Mn,modes:{index(e,t,n,i){let s=te(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?sr(e,s,r,i,o):rr(e,s,r,!1,i,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){let s=te(t,e),r=n.axis||"xy",o=n.includeInvisible||!1,a=n.intersect?sr(e,s,r,i,o):rr(e,s,r,!1,i,o);if(a.length>0){let l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,i){let s=te(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;return sr(e,s,r,i,o)},nearest(e,t,n,i){let s=te(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;return rr(e,s,r,n.intersect,i,o)},x(e,t,n,i){let s=te(t,e);return Sa(e,s,"x",n.intersect,i)},y(e,t,n,i){let s=te(t,e);return Sa(e,s,"y",n.intersect,i)}}},bl=["left","top","right","bottom"];function dn(e,t){return e.filter(n=>n.pos===t)}function Da(e,t){return e.filter(n=>bl.indexOf(n.pos)===-1&&n.box.axis===t)}function hn(e,t){return e.sort((n,i)=>{let s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function Xf(e){let t=[],n,i,s,r,o,a;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function $f(e){let t={};for(let n of e){let{stack:i,pos:s,stackWeight:r}=n;if(!i||!bl.includes(s))continue;let o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function Qf(e,t){let n=$f(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t,r,o,a;for(r=0,o=e.length;r<o;++r){a=e[r];let{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return n}function Gf(e){let t=Xf(e),n=hn(t.filter(c=>c.box.fullSize),!0),i=hn(dn(t,"left"),!0),s=hn(dn(t,"right")),r=hn(dn(t,"top"),!0),o=hn(dn(t,"bottom")),a=Da(t,"x"),l=Da(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:dn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function Ca(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function xl(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Kf(e,t,n,i){let{pos:s,box:r}=n,o=e.maxPadding;if(!L(s)){n.size&&(e[s]-=n.size);let f=i[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?r.height:r.width),n.size=f.size/f.count,e[s]+=n.size}r.getPadding&&xl(o,r.getPadding());let a=Math.max(0,t.outerWidth-Ca(o,e,"left","right")),l=Math.max(0,t.outerHeight-Ca(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Zf(e){let t=e.maxPadding;function n(i){let s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Jf(e,t){let n=t.maxPadding;function i(s){let r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function mn(e,t,n,i){let s=[],r,o,a,l,c,u;for(r=0,o=e.length,c=0;r<o;++r){a=e[r],l=a.box,l.update(a.width||t.w,a.height||t.h,Jf(a.horizontal,t));let{same:f,other:d}=Kf(t,n,a,i);c|=f&&s.length,u=u||d,l.fullSize||s.push(a)}return c&&mn(s,t,n,i)||u}function ri(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function Oa(e,t,n,i){let s=n.padding,{x:r,y:o}=t;for(let a of e){let l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){let f=t.w*u,d=c.size||l.height;Pe(c.start)&&(o=c.start),l.fullSize?ri(l,s.left,o,n.outerWidth-s.right-s.left,d):ri(l,t.left+c.placed,o,f,d),c.start=o,c.placed+=f,o=l.bottom}else{let f=t.h*u,d=c.size||l.width;Pe(c.start)&&(r=c.start),l.fullSize?ri(l,r,s.top,d,n.outerHeight-s.bottom-s.top):ri(l,r,t.top+c.placed,d,f),c.start=r,c.placed+=f,r=l.right}}t.x=r,t.y=o}var at={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;let s=rt(e.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(n-s.height,0),a=Gf(e.boxes),l=a.vertical,c=a.horizontal;z(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});let u=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},s);xl(d,rt(i));let h=Object.assign({maxPadding:d,w:r,h:o,x:s.left,y:s.top},s),p=Qf(l.concat(c),f);mn(a.fullSize,h,f,p),mn(l,h,f,p),mn(c,h,f,p)&&mn(l,h,f,p),Zf(h),Oa(a.leftAndTop,h,f,p),h.x+=h.w,h.y+=h.h,Oa(a.rightAndBottom,h,f,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},z(a.chartArea,g=>{let m=g.box;Object.assign(m,e.chartArea),m.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}},mi=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},yr=class extends mi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},di="$chartjs",td={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ta=e=>e===null||e==="";function ed(e,t){let n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[di]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ta(s)){let r=Gs(e,"width");r!==void 0&&(e.width=r)}if(Ta(i))if(e.style.height==="")e.height=e.width/(t||2);else{let r=Gs(e,"height");r!==void 0&&(e.height=r)}return e}var yl=ua?{passive:!0}:!1;function nd(e,t,n){e&&e.addEventListener(t,n,yl)}function id(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,yl)}function sd(e,t){let n=td[e.type]||e.type,{x:i,y:s}=te(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function bi(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function rd(e,t,n){let i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||bi(a.addedNodes,i),o=o&&!bi(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function od(e,t,n){let i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||bi(a.removedNodes,i),o=o&&!bi(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}var yn=new Map,Pa=0;function vl(){let e=window.devicePixelRatio;e!==Pa&&(Pa=e,yn.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function ad(e,t){yn.size||window.addEventListener("resize",vl),yn.set(e,t)}function ld(e){yn.delete(e),yn.size||window.removeEventListener("resize",vl)}function cd(e,t,n){let i=e.canvas,s=i&&ii(i);if(!s)return;let r=Ws((a,l)=>{let c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),o=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),ad(e,r),o}function or(e,t,n){n&&n.disconnect(),t==="resize"&&ld(e)}function ud(e,t,n){let i=e.canvas,s=Ws(r=>{e.ctx!==null&&n(sd(r,e))},e);return nd(i,t,s),s}var vr=class extends mi{acquireContext(t,n){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ed(t,n),i):null}releaseContext(t){let n=t.canvas;if(!n[di])return!1;let i=n[di].initial;["height","width"].forEach(r=>{let o=i[r];F(o)?n.removeAttribute(r):n.setAttribute(r,o)});let s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[di],!0}addEventListener(t,n,i){this.removeEventListener(t,n);let s=t.$proxies||(t.$proxies={}),o={attach:rd,detach:od,resize:cd}[n]||ud;s[n]=o(t,n,i)}removeEventListener(t,n){let i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:or,detach:or,resize:or}[n]||id)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return ca(t,n,i,s)}isAttached(t){let n=t&&ii(t);return!!(n&&n.isConnected)}};function fd(e){return!ni()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?yr:vr}var yt=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){let{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return fe(this.x)&&fe(this.y)}getProps(t,n){let i=this.$animations;if(!n||!i)return this;let s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}};function dd(e,t){let n=e.options.ticks,i=hd(e),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?gd(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return md(t,c,r,o/s),c;let u=pd(r,t,s);if(o>0){let f,d,h=o>1?Math.round((l-a)/(o-1)):null;for(oi(t,c,u,F(h)?0:a-h,a),f=0,d=o-1;f<d;f++)oi(t,c,u,r[f],r[f+1]);return oi(t,c,u,l,F(h)?t.length:l+h),c}return oi(t,c,u),c}function hd(e){let t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function pd(e,t,n){let i=bd(e),s=t.length/n;if(!i)return Math.max(s,1);let r=Vo(i);for(let o=0,a=r.length-1;o<a;o++){let l=r[o];if(l>s)return l}return Math.max(s,1)}function gd(e){let t=[],n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function md(e,t,n,i){let s=0,r=n[0],o;for(i=Math.ceil(i),o=0;o<e.length;o++)o===r&&(t.push(e[o]),s++,r=n[s*i])}function oi(e,t,n,i,s){let r=A(i,0),o=Math.min(A(s,e.length),e.length),a=0,l,c,u;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),u=r;u<0;)a++,u=Math.round(r+a*n);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(e[c]),a++,u=Math.round(r+a*n))}function bd(e){let t=e.length,n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}var xd=e=>e==="left"?"right":e==="right"?"left":e,Aa=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Ia=(e,t)=>Math.min(t||e,e);function La(e,t){let n=[],i=e.length/t,s=e.length,r=0;for(;r<s;r+=i)n.push(e[Math.floor(r)]);return n}function yd(e,t,n){let i=e.ticks.length,s=Math.min(t,i-1),r=e._startPixel,o=e._endPixel,a=1e-6,l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-r,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function vd(e,t){z(e,n=>{let i=n.gc,s=i.length/2,r;if(s>t){for(r=0;r<s;++r)delete n.data[i[r]];i.splice(0,s)}})}function pn(e){return e.drawTicks?e.tickLength:0}function Ea(e,t){if(!e.display)return 0;let n=nt(e.font,t),i=rt(e.padding);return(U(e.text)?e.text.length:1)*n.lineHeight+i.height}function _d(e,t){return Ht(e,{scale:t,type:"scale"})}function wd(e,t,n){return Ht(e,{tick:n,index:t,type:"tick"})}function Md(e,t,n){let i=Kn(e);return(n&&t!=="right"||!n&&t==="right")&&(i=xd(i)),i}function kd(e,t,n,i){let{top:s,left:r,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l,f=0,d,h,p,g=o-s,m=a-r;if(e.isHorizontal()){if(h=st(i,r,a),L(n)){let b=Object.keys(n)[0],x=n[b];p=u[b].getPixelForValue(x)+g-t}else n==="center"?p=(c.bottom+c.top)/2+g-t:p=Aa(e,n,t);d=a-r}else{if(L(n)){let b=Object.keys(n)[0],x=n[b];h=u[b].getPixelForValue(x)-m+t}else n==="center"?h=(c.left+c.right)/2-m+t:h=Aa(e,n,t);p=st(i,o,s),f=n==="left"?-J:J}return{titleX:h,titleY:p,maxWidth:d,rotation:f}}var ge=class e extends yt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=ut(t,Number.POSITIVE_INFINITY),n=ut(n,Number.NEGATIVE_INFINITY),i=ut(i,Number.POSITIVE_INFINITY),s=ut(s,Number.NEGATIVE_INFINITY),{min:ut(t,i),max:ut(n,s),minDefined:Q(t),maxDefined:Q(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:n,max:i};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,o.min)),r||(i=Math.max(i,o.max));return n=r&&n>i?i:n,i=s&&n>i?n:i,{min:ut(n,ut(i,n)),max:ut(i,ut(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){H(this.options.beforeUpdate,[this])}update(t,n,i){let{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ia(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?La(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=dd(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){H(this.options.afterUpdate,[this])}beforeSetDimensions(){H(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){H(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),H(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){H(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let n=this.options.ticks,i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=H(n.callback,[r.value,i,t],this)}afterTickToLabelConversion(){H(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){H(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,n=t.ticks,i=Ia(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,r=n.maxRotation,o=s,a,l,c;if(!this._isVisible()||!n.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let u=this._getLabelSizes(),f=u.widest.width,d=u.highest.height,h=it(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/i:h/(i-1),f+6>a&&(a=h/(i-(t.offset?.5:1)),l=this.maxHeight-pn(t.grid)-n.padding-Ea(t.title,this.chart.options.font),c=Math.sqrt(f*f+d*d),o=Qn(Math.min(Math.asin(it((u.highest.height+6)/a,-1,1)),Math.asin(it(l/c,-1,1))-Math.asin(it(d/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let l=Ea(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=pn(r)+l):(t.height=this.maxHeight,t.width=pn(r)+l),i.display&&this.ticks.length){let{first:c,last:u,widest:f,highest:d}=this._getLabelSizes(),h=i.padding*2,p=pt(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){let b=i.mirror?0:m*f.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+b+h)}else{let b=i.mirror?0:g*f.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+b+h)}this._calculatePadding(c,u,m,g)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){let{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),d=0,h=0;l?c?(d=s*t.width,h=i*n.height):(d=i*t.height,h=s*n.width):r==="start"?h=n.width:r==="end"?d=t.width:r!=="inner"&&(d=t.width/2,h=n.width/2),this.paddingLeft=Math.max((d-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+o)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;r==="start"?(u=0,f=t.height):r==="end"&&(u=n.height,f=0),this.paddingTop=u+o,this.paddingBottom=f+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){H(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)F(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let n=this.options.ticks.sampleSize,i=this.ticks;n<i.length&&(i=La(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){let{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(n/Ia(n,i)),c=0,u=0,f,d,h,p,g,m,b,x,y,w,v;for(f=0;f<n;f+=l){if(p=t[f].label,g=this._resolveTickFontOptions(f),s.font=m=g.string,b=r[m]=r[m]||{data:{},gc:[]},x=g.lineHeight,y=w=0,!F(p)&&!U(p))y=on(s,b.data,b.gc,y,p),w=x;else if(U(p))for(d=0,h=p.length;d<h;++d)v=p[d],!F(v)&&!U(v)&&(y=on(s,b.data,b.gc,y,v),w+=x);o.push(y),a.push(w),c=Math.max(y,c),u=Math.max(w,u)}vd(r,n);let k=o.indexOf(c),S=a.indexOf(u),D=C=>({width:o[C]||0,height:a[C]||0});return{first:D(0),last:D(n-1),widest:D(k),highest:D(S),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let n=this._startPixel+t*this._length;return jo(this._alignToPixels?Kt(this.chart,n,0):n)}getDecimalForPixel(t){let n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){let n=this.ticks||[];if(t>=0&&t<n.length){let i=n[t];return i.$context||(i.$context=wd(this.getContext(),t,i))}return this.$context||(this.$context=_d(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,n=pt(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),d=pn(r),h=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(B){return Kt(i,B,g)},x,y,w,v,k,S,D,C,T,P,I,j;if(o==="top")x=b(this.bottom),S=this.bottom-d,C=x-m,P=b(t.top)+m,j=t.bottom;else if(o==="bottom")x=b(this.top),P=t.top,j=b(t.bottom)-m,S=x+m,C=this.top+d;else if(o==="left")x=b(this.right),k=this.right-d,D=x-m,T=b(t.left)+m,I=t.right;else if(o==="right")x=b(this.left),T=t.left,I=b(t.right)-m,k=x+m,D=this.left+d;else if(n==="x"){if(o==="center")x=b((t.top+t.bottom)/2+.5);else if(L(o)){let B=Object.keys(o)[0],E=o[B];x=b(this.chart.scales[B].getPixelForValue(E))}P=t.top,j=t.bottom,S=x+m,C=S+d}else if(n==="y"){if(o==="center")x=b((t.left+t.right)/2);else if(L(o)){let B=Object.keys(o)[0],E=o[B];x=b(this.chart.scales[B].getPixelForValue(E))}k=x-m,D=k-d,T=t.left,I=t.right}let ot=A(s.ticks.maxTicksLimit,f),R=Math.max(1,Math.ceil(f/ot));for(y=0;y<f;y+=R){let B=this.getContext(y),E=r.setContext(B),X=a.setContext(B),Z=E.lineWidth,_e=E.color,In=X.dash||[],we=X.dashOffset,Qe=E.tickWidth,re=E.tickColor,Ge=E.tickBorderDash||[],oe=E.tickBorderDashOffset;w=yd(this,y,l),w!==void 0&&(v=Kt(i,w,Z),c?k=D=T=I=v:S=C=P=j=v,h.push({tx1:k,ty1:S,tx2:D,ty2:C,x1:T,y1:P,x2:I,y2:j,width:Z,color:_e,borderDash:In,borderDashOffset:we,tickWidth:Qe,tickColor:re,tickBorderDash:Ge,tickBorderDashOffset:oe}))}return this._ticksLength=f,this._borderValue=x,h}_computeLabelItems(t){let n=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=r,d=pn(i.grid),h=d+u,p=f?-u:h,g=-pt(this.labelRotation),m=[],b,x,y,w,v,k,S,D,C,T,P,I,j="middle";if(s==="top")k=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")k=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){let R=this._getYAxisLabelAlignment(d);S=R.textAlign,v=R.x}else if(s==="right"){let R=this._getYAxisLabelAlignment(d);S=R.textAlign,v=R.x}else if(n==="x"){if(s==="center")k=(t.top+t.bottom)/2+h;else if(L(s)){let R=Object.keys(s)[0],B=s[R];k=this.chart.scales[R].getPixelForValue(B)+h}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")v=(t.left+t.right)/2-h;else if(L(s)){let R=Object.keys(s)[0],B=s[R];v=this.chart.scales[R].getPixelForValue(B)}S=this._getYAxisLabelAlignment(d).textAlign}n==="y"&&(l==="start"?j="top":l==="end"&&(j="bottom"));let ot=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){y=a[b],w=y.label;let R=r.setContext(this.getContext(b));D=this.getPixelForTick(b)+r.labelOffset,C=this._resolveTickFontOptions(b),T=C.lineHeight,P=U(w)?w.length:1;let B=P/2,E=R.color,X=R.textStrokeColor,Z=R.textStrokeWidth,_e=S;o?(v=D,S==="inner"&&(b===x-1?_e=this.options.reverse?"left":"right":b===0?_e=this.options.reverse?"right":"left":_e="center"),s==="top"?c==="near"||g!==0?I=-P*T+T/2:c==="center"?I=-ot.highest.height/2-B*T+T:I=-ot.highest.height+T/2:c==="near"||g!==0?I=T/2:c==="center"?I=ot.highest.height/2-B*T:I=ot.highest.height-P*T,f&&(I*=-1),g!==0&&!R.showLabelBackdrop&&(v+=T/2*Math.sin(g))):(k=D,I=(1-P)*T/2);let In;if(R.showLabelBackdrop){let we=rt(R.backdropPadding),Qe=ot.heights[b],re=ot.widths[b],Ge=I-we.top,oe=0-we.left;switch(j){case"middle":Ge-=Qe/2;break;case"bottom":Ge-=Qe;break}switch(S){case"center":oe-=re/2;break;case"right":oe-=re;break;case"inner":b===x-1?oe-=re:b>0&&(oe-=re/2);break}In={left:oe,top:Ge,width:re+we.width,height:Qe+we.height,color:R.backdropColor}}m.push({label:w,font:C,textOffset:I,options:{rotation:g,color:E,strokeColor:X,strokeWidth:Z,textAlign:_e,textBaseline:j,translation:[v,k],backdrop:In}})}return m}_getXAxisLabelAlignment(){let{position:t,ticks:n}=this.options;if(-pt(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width,c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:n},left:i,top:s,width:r,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){let n=this.options.grid;if(!this._isVisible()||!n.display)return 0;let s=this.ticks.findIndex(r=>r.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r,o,a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r<o;++r){let l=s[r];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:n,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,u,f,d;this.isHorizontal()?(c=Kt(t,this.left,o)-o/2,u=Kt(t,this.right,a)+a/2,f=d=l):(f=Kt(t,this.top,o)-o/2,d=Kt(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,d),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&cn(i,s);let r=this.getLabelItems(t);for(let o of r){let a=o.options,l=o.font,c=o.label,u=o.textOffset;Zt(i,c,0,u,l,a)}s&&un(i)}drawTitle(){let{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;let r=nt(i.font),o=rt(i.padding),a=i.align,l=r.lineHeight/2;n==="bottom"||n==="center"||L(n)?(l+=o.bottom,U(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;let{titleX:c,titleY:u,maxWidth:f,rotation:d}=kd(this,l,n,a);Zt(t,i.text,0,0,r,{color:i.color,maxWidth:f,rotation:d,textAlign:Md(a,n,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,i=A(t.grid&&t.grid.z,-1),s=A(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){let n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],r,o;for(r=0,o=n.length;r<o;++r){let a=n[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let n=this.options.ticks.setContext(this.getContext(t));return nt(n.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},We=class{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let n=Object.getPrototypeOf(t),i;Cd(n)&&(i=this.register(n));let s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Sd(t,o,i),this.override&&G.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){let n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in G[s]&&(delete G[s][i],this.override&&delete Gt[i])}};function Sd(e,t,n){let i=Ce(Object.create(null),[n?G.get(n):{},G.get(t),e.defaults]);G.set(t,i),e.defaultRoutes&&Dd(t,e.defaultRoutes),e.descriptors&&G.describe(t,e.descriptors)}function Dd(e,t){Object.keys(t).forEach(n=>{let i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");G.route(r,s,l,a)})}function Cd(e){return"id"in e&&"defaults"in e}var _r=class{constructor(){this.controllers=new We(Pt,"datasets",!0),this.elements=new We(yt,"elements"),this.plugins=new We(Object,"plugins"),this.scales=new We(ge,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(s=>{let r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):z(s,o=>{let a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){let s=$n(t);H(i["before"+s],[],i),n[t](i),H(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){let i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){let s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}},Tt=new _r,wr=class{constructor(){this._init=[]}notify(t,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,n,i);return n==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,i,s){s=s||{};for(let r of t){let o=r.plugin,a=o[i],l=[n,s,r.options];if(H(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){F(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){let i=t&&t.config,s=A(i.options&&i.options.plugins,{}),r=Od(i);return s===!1&&!n?[]:Pd(t,r,s,n)}_notifyStateChanges(t){let n=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};function Od(e){let t={},n=[],i=Object.keys(Tt.plugins.items);for(let r=0;r<i.length;r++)n.push(Tt.getPlugin(i[r]));let s=e.plugins||[];for(let r=0;r<s.length;r++){let o=s[r];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function Td(e,t){return!t&&e===!1?null:e===!0?{}:e}function Pd(e,{plugins:t,localIds:n},i,s){let r=[],o=e.getContext();for(let a of t){let l=a.id,c=Td(i[l],s);c!==null&&r.push({plugin:a,options:Ad(e.config,{plugin:a,local:n[l]},c,o)})}return r}function Ad(e,{plugin:t,local:n},i,s){let r=e.pluginScopeKeys(t),o=e.getOptionScopes(i,r);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Mr(e,t){let n=G.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Id(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Ld(e,t){return e===t?"_index_":"_value_"}function Ra(e){if(e==="x"||e==="y"||e==="r")return e}function Ed(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function kr(e,...t){if(Ra(e))return e;for(let n of t){let i=n.axis||Ed(n.position)||e.length>1&&Ra(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Fa(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Rd(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Fa(e,"x",n[0])||Fa(e,"y",n[0])}return{}}function Fd(e,t){let n=Gt[e.type]||{scales:{}},i=t.scales||{},s=Mr(e.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{let a=i[o];if(!L(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);let l=kr(o,a,Rd(o,e),G.scales[a.type]),c=Ld(l,s),u=n.scales||{};r[o]=Te(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{let a=o.type||e.type,l=o.indexAxis||Mr(a,t),u=(Gt[a]||{}).scales||{};Object.keys(u).forEach(f=>{let d=Id(f,l),h=o[d+"AxisID"]||d;r[h]=r[h]||Object.create(null),Te(r[h],[{axis:d},i[h],u[f]])})}),Object.keys(r).forEach(o=>{let a=r[o];Te(a,[G.scales[a.type],G.scale])}),r}function _l(e){let t=e.options||(e.options={});t.plugins=A(t.plugins,{}),t.scales=Fd(e,t)}function wl(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Wd(e){return e=e||{},e.data=wl(e.data),_l(e),e}var Wa=new Map,Ml=new Set;function ai(e,t){let n=Wa.get(e);return n||(n=t(),Wa.set(e,n),Ml.add(n)),n}var gn=(e,t,n)=>{let i=Bt(t,n);i!==void 0&&e.add(i)},Sr=class{constructor(t){this._config=Wd(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=wl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),_l(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ai(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return ai(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return ai(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){let n=t.id,i=this.type;return ai(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){let i=this._scopeCache,s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){let{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;let l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>gn(l,t,f))),u.forEach(f=>gn(l,s,f)),u.forEach(f=>gn(l,Gt[r]||{},f)),u.forEach(f=>gn(l,G,f)),u.forEach(f=>gn(l,Zn,f))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ml.has(n)&&o.set(n,c),c}chartOptionScopes(){let{options:t,type:n}=this;return[t,Gt[n]||{},G.datasets[n]||{},{type:n},G,Zn]}resolveNamedOptions(t,n,i,s=[""]){let r={$shared:!0},{resolver:o,subPrefixes:a}=Na(this._resolverCache,t,s),l=o;if(zd(o,n)){r.$shared=!1,i=Nt(i)?i():i;let c=this.createResolver(t,i,a);l=ue(o,i,c)}for(let c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){let{resolver:r}=Na(this._resolverCache,t,i);return L(n)?ue(r,n,void 0,s):r}};function Na(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let s=n.join(),r=i.get(s);return r||(r={resolver:ei(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}var Nd=e=>L(e)&&Object.getOwnPropertyNames(e).some(t=>Nt(e[t]));function zd(e,t){let{isScriptable:n,isIndexable:i}=qs(e);for(let s of t){let r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Nt(a)||Nd(a))||o&&U(a))return!0}return!1}var Bd="4.4.4",Hd=["top","bottom","left","right","chartArea"];function za(e,t){return e==="top"||e==="bottom"||Hd.indexOf(e)===-1&&t==="x"}function Ba(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Ha(e){let t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),H(n&&n.onComplete,[e],t)}function Yd(e){let t=e.chart,n=t.options.animation;H(n&&n.onProgress,[e],t)}function kl(e){return ni()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var hi={},Ya=e=>{let t=kl(e);return Object.values(hi).filter(n=>n.canvas===t).pop()};function Ud(e,t,n){let i=Object.keys(e);for(let s of i){let r=+s;if(r>=t){let o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function Vd(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function li(e,t,n){return e.options.clip?e[n]:t[n]}function qd(e,t){let{xScale:n,yScale:i}=e;return n&&i?{left:li(n,t,"left"),right:li(n,t,"right"),top:li(i,t,"top"),bottom:li(i,t,"bottom")}:t}var Ne=class{static defaults=G;static instances=hi;static overrides=Gt;static registry=Tt;static version=Bd;static getChart=Ya;static register(...t){Tt.add(...t),Ua()}static unregister(...t){Tt.remove(...t),Ua()}constructor(t,n){let i=this.config=new Sr(n),s=kl(t),r=Ya(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||fd(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Bo(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new wr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ko(f=>this.update(f),o.resizeDelay||0),this._dataChanges=[],hi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Yt.listen(this,"complete",Ha),Yt.listen(this,"progress",Yd),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return F(t)?n&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Tt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ys(this.canvas,this.ctx),this}stop(){return Yt.stop(this),this}resize(t,n){Yt.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){let i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Qs(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),H(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let n=this.options.scales||{};z(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){let t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{}),r=[];n&&(r=r.concat(Object.keys(n).map(o=>{let a=n[o],l=kr(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),z(r,o=>{let a=o.options,l=a.id,c=kr(l,a),u=A(a.type,o.dtype);(a.position===void 0||za(a.position,c)!==za(o.dposition))&&(a.position=o.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===u)f=i[l];else{let d=Tt.getScale(u);f=new d({id:l,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,t)}),z(s,(o,a)=>{o||delete i[a]}),z(i,o=>{at.configure(this,o,o.options),at.addBox(this,o)})}_updateMetasets(){let t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(Ba("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],n=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){let r=n[i],o=this.getDatasetMeta(i),a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||Mr(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{let l=Tt.getController(a),{datasetElementType:c,dataElementType:u}=G.datasets[a];Object.assign(l,{dataElementType:Tt.getElement(u),datasetElementType:c&&Tt.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){z(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let n=this.config;n.update();let i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){let{controller:f}=this.getDatasetMeta(c),d=!s&&r.indexOf(f)===-1;f.buildOrUpdateElements(d),o=Math.max(+f.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||z(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ba("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){z(this.scales,t=>{at.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ts(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:r}of n){let o=i==="_removeElements"?-r:r;Ud(t,s,o)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<n;r++)if(!Ts(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;at.update(this,this.width,this.height,t);let n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],z(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Nt(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Yt.has(this)?this.attached&&!Yt.running(this)&&Yt.start(this):(this.draw(),Ha({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let n=this._sortedMetasets,i=[],s,r;for(s=0,r=n.length;s<r;++s){let o=n[s];(!t||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let n=this.ctx,i=t._clip,s=!i.disabled,r=qd(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&cn(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&un(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return St(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){let r=jf.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){let n=this.data.datasets[t],i=this._metasets,s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ht(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let n=this.data.datasets[t];if(!n)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){let i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){let s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);Pe(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){let n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Yt.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ys(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete hi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,n=this.platform,i=(r,o)=>{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};z(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)},o,a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){z(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},z(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){let s=i?"set":"remove",r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];let c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let n=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{let a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!an(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){let s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){let i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;let r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){let{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=Uo(t),c=Vd(t,this._lastEvent,i,l);i&&(this._lastEvent=null,H(r.onHover,[t,a,this],this),l&&H(r.onClick,[t,a,this],this));let u=!an(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}};function Ua(){return z(Ne.instances,e=>e._plugins.invalidate())}function jd(e,t,n){let{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t,c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+J,i-J),e.closePath(),e.clip()}function Xd(e){return ti(e,["outerStart","outerEnd","innerStart","innerEnd"])}function $d(e,t,n,i){let s=Xd(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{let c=(n-Math.min(r,l))*i/2;return it(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:it(s.innerStart,0,o),innerEnd:it(s.innerEnd,0,o)}}function Fe(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function xi(e,t,n,i,s,r){let{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+i+n-c,0),d=u>0?u+i+n+c:0,h=0,p=s-l;if(i){let R=u>0?u-i:0,B=f>0?f-i:0,E=(R+B)/2,X=E!==0?p*E/(E+i):p;h=(p-X)/2}let g=Math.max(.001,p*f-n/V)/f,m=(p-g)/2,b=l+m+h,x=s-m-h,{outerStart:y,outerEnd:w,innerStart:v,innerEnd:k}=$d(t,d,f,x-b),S=f-y,D=f-w,C=b+y/S,T=x-w/D,P=d+v,I=d+k,j=b+v/P,ot=x-k/I;if(e.beginPath(),r){let R=(C+T)/2;if(e.arc(o,a,f,C,R),e.arc(o,a,f,R,T),w>0){let Z=Fe(D,T,o,a);e.arc(Z.x,Z.y,w,T,x+J)}let B=Fe(I,x,o,a);if(e.lineTo(B.x,B.y),k>0){let Z=Fe(I,ot,o,a);e.arc(Z.x,Z.y,k,x+J,ot+Math.PI)}let E=(x-k/d+(b+v/d))/2;if(e.arc(o,a,d,x-k/d,E,!0),e.arc(o,a,d,E,b+v/d,!0),v>0){let Z=Fe(P,j,o,a);e.arc(Z.x,Z.y,v,j+Math.PI,b-J)}let X=Fe(S,b,o,a);if(e.lineTo(X.x,X.y),y>0){let Z=Fe(S,C,o,a);e.arc(Z.x,Z.y,y,b-J,C)}}else{e.moveTo(o,a);let R=Math.cos(C)*f+o,B=Math.sin(C)*f+a;e.lineTo(R,B);let E=Math.cos(T)*f+o,X=Math.sin(T)*f+a;e.lineTo(E,X)}e.closePath()}function Qd(e,t,n,i,s){let{fullCircles:r,startAngle:o,circumference:a}=t,l=t.endAngle;if(r){xi(e,t,n,i,l,s);for(let c=0;c<r;++c)e.fill();isNaN(a)||(l=o+(a%q||q))}return xi(e,t,n,i,l,s),e.fill(),l}function Gd(e,t,n,i,s){let{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:d}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=d,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let p=t.endAngle;if(r){xi(e,t,n,i,p,s);for(let g=0;g<r;++g)e.stroke();isNaN(a)||(p=o+(a%q||q))}h&&jd(e,t,p),r||(xi(e,t,n,i,p,s),e.stroke())}var Dr=class extends yt{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,i){let s=this.getProps(["x","y"],i),{angle:r,distance:o}=Ls(s,{x:t,y:n}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,h=A(f,l-a),p=Ie(r,a,l)&&a!==l,g=h>=q||p,m=Ct(o,c+d,u+d);return g&&m}getCenterPoint(t){let{x:n,y:i,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(s+r)/2,f=(o+a+c+l)/2;return{x:n+Math.cos(u)*f,y:i+Math.sin(u)*f}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:n,circumference:i}=this,s=(n.offset||0)/4,r=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>q?Math.floor(i/q):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);let l=1-Math.sin(Math.min(V,i||0)),c=s*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,Qd(t,this,c,r,o),Gd(t,this,c,r,o),t.restore()}};function Sl(e,t,n=t){e.lineCap=A(n.borderCapStyle,t.borderCapStyle),e.setLineDash(A(n.borderDash,t.borderDash)),e.lineDashOffset=A(n.borderDashOffset,t.borderDashOffset),e.lineJoin=A(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=A(n.borderWidth,t.borderWidth),e.strokeStyle=A(n.borderColor,t.borderColor)}function Kd(e,t,n){e.lineTo(n.x,n.y)}function Zd(e){return e.stepped?ea:e.tension||e.cubicInterpolationMode==="monotone"?na:Kd}function Dl(e,t,n={}){let i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Jd(e,t,n,i){let{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Dl(s,n,i),u=Zd(r),{move:f=!0,reverse:d}=i||{},h,p,g;for(h=0;h<=c;++h)p=s[(a+(d?c-h:h))%o],!p.skip&&(f?(e.moveTo(p.x,p.y),f=!1):u(e,g,p,d,r.stepped),g=p);return l&&(p=s[(a+(d?c:0))%o],u(e,g,p,d,r.stepped)),!!l}function th(e,t,n,i){let s=t.points,{count:r,start:o,ilen:a}=Dl(s,n,i),{move:l=!0,reverse:c}=i||{},u=0,f=0,d,h,p,g,m,b,x=w=>(o+(c?a-w:w))%r,y=()=>{g!==m&&(e.lineTo(u,m),e.lineTo(u,g),e.lineTo(u,b))};for(l&&(h=s[x(0)],e.moveTo(h.x,h.y)),d=0;d<=a;++d){if(h=s[x(d)],h.skip)continue;let w=h.x,v=h.y,k=w|0;k===p?(v<g?g=v:v>m&&(m=v),u=(f*u+w)/++f):(y(),e.lineTo(w,v),p=k,f=0,g=m=v),b=v}y()}function Cr(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?th:Jd}function eh(e){return e.stepped?fa:e.tension||e.cubicInterpolationMode==="monotone"?da:Qt}function nh(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),Sl(e,t.options),e.stroke(s)}function ih(e,t,n,i){let{segments:s,options:r}=t,o=Cr(t);for(let a of s)Sl(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}var sh=typeof Path2D=="function";function rh(e,t,n,i){sh&&!t.options.segment?nh(e,t,n,i):ih(e,t,n,i)}var ze=class extends yt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;la(this._points,i,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=pa(this,this.options.segment))}first(){let t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){let t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){let i=this.options,s=t[n],r=this.points,o=tr(this,{property:n,start:s,end:s});if(!o.length)return;let a=[],l=eh(i),c,u;for(c=0,u=o.length;c<u;++c){let{start:f,end:d}=o[c],h=r[f],p=r[d];if(h===p){a.push(h);continue}let g=Math.abs((s-h[n])/(p[n]-h[n])),m=l(h,p,g,i.stepped);m[n]=t[n],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Cr(this)(t,this,n,i)}path(t,n,i){let s=this.segments,r=Cr(this),o=this._loop;n=n||0,i=i||this.points.length-n;for(let a of s)o&=r(t,this,a,{start:n,end:n+i-1});return!!o}draw(t,n,i,s){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),rh(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function Va(e,t,n,i){let s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)<s.radius+s.hitRadius}var Or=class extends yt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){let s=this.options,{x:r,y:o}=this.getProps(["x","y"],i);return Math.pow(t-r,2)+Math.pow(n-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return Va(this,t,"x",n)}inYRange(t,n){return Va(this,t,"y",n)}getCenterPoint(t){let{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);let i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){let i=this.options;this.skip||i.radius<.1||!St(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Jn(t,i,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};function Cl(e,t){let{x:n,y:i,base:s,width:r,height:o}=e.getProps(["x","y","base","width","height"],t),a,l,c,u,f;return e.horizontal?(f=o/2,a=Math.min(n,s),l=Math.max(n,s),c=i-f,u=i+f):(f=r/2,a=n-f,l=n+f,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function ee(e,t,n,i){return e?0:it(t,n,i)}function oh(e,t,n){let i=e.options.borderWidth,s=e.borderSkipped,r=Vs(i);return{t:ee(s.top,r.top,0,n),r:ee(s.right,r.right,0,t),b:ee(s.bottom,r.bottom,0,n),l:ee(s.left,r.left,0,t)}}function ah(e,t,n){let{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,r=Jt(s),o=Math.min(t,n),a=e.borderSkipped,l=i||L(s);return{topLeft:ee(!l||a.top||a.left,r.topLeft,0,o),topRight:ee(!l||a.top||a.right,r.topRight,0,o),bottomLeft:ee(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:ee(!l||a.bottom||a.right,r.bottomRight,0,o)}}function lh(e){let t=Cl(e),n=t.right-t.left,i=t.bottom-t.top,s=oh(e,n/2,i/2),r=ah(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function ar(e,t,n,i){let s=t===null,r=n===null,a=e&&!(s&&r)&&Cl(e,i);return a&&(s||Ct(t,a.left,a.right))&&(r||Ct(n,a.top,a.bottom))}function ch(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function uh(e,t){e.rect(t.x,t.y,t.w,t.h)}function lr(e,t,n={}){let i=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,r=(e.x+e.w!==n.x+n.w?t:0)-i,o=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+i,y:e.y+s,w:e.w+r,h:e.h+o,radius:e.radius}}var Tr=class extends yt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){let{inflateAmount:n,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=lh(this),a=ch(o.radius)?Ee:uh;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,lr(o,n,r)),t.clip(),a(t,lr(r,-n,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,lr(r,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,i){return ar(this,t,n,i)}inXRange(t,n){return ar(this,t,null,n)}inYRange(t,n){return ar(this,null,t,n)}getCenterPoint(t){let{x:n,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(n+s)/2:n,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}},fh=Object.freeze({__proto__:null,ArcElement:Dr,BarElement:Tr,LineElement:ze,PointElement:Or}),Pr=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],qa=Pr.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ol(e){return Pr[e%Pr.length]}function Tl(e){return qa[e%qa.length]}function dh(e,t){return e.borderColor=Ol(t),e.backgroundColor=Tl(t),++t}function hh(e,t){return e.backgroundColor=e.data.map(()=>Ol(t++)),t}function ph(e,t){return e.backgroundColor=e.data.map(()=>Tl(t++)),t}function gh(e){let t=0;return(n,i)=>{let s=e.getDatasetMeta(i).controller;s instanceof xn?t=hh(n,t):s instanceof gi?t=ph(n,t):s&&(t=dh(n,t))}}function ja(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function mh(e){return e&&(e.borderColor||e.backgroundColor)}var bh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;let{data:{datasets:i},options:s}=e.config,{elements:r}=s;if(!n.forceOverride&&(ja(i)||mh(s)||r&&ja(r)))return;let o=gh(e);i.forEach(o)}};function xh(e,t,n,i,s){let r=s.samples||i;if(r>=n)return e.slice(t,t+n);let o=[],a=(n-2)/(r-2),l=0,c=t+n-1,u=t,f,d,h,p,g;for(o[l++]=e[u],f=0;f<r-2;f++){let m=0,b=0,x,y=Math.floor((f+1)*a)+1+t,w=Math.min(Math.floor((f+2)*a)+1,n)+t,v=w-y;for(x=y;x<w;x++)m+=e[x].x,b+=e[x].y;m/=v,b/=v;let k=Math.floor(f*a)+1+t,S=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:D,y:C}=e[u];for(h=p=-1,x=k;x<S;x++)p=.5*Math.abs((D-m)*(e[x].y-C)-(D-e[x].x)*(b-C)),p>h&&(h=p,d=e[x],g=x);o[l++]=d,u=g}return o[l++]=e[c],o}function yh(e,t,n,i){let s=0,r=0,o,a,l,c,u,f,d,h,p,g,m=[],b=t+n-1,x=e[t].x,w=e[b].x-x;for(o=t;o<t+n;++o){a=e[o],l=(a.x-x)/w*i,c=a.y;let v=l|0;if(v===u)c<p?(p=c,f=o):c>g&&(g=c,d=o),s=(r*s+a.x)/++r;else{let k=o-1;if(!F(f)&&!F(d)){let S=Math.min(f,d),D=Math.max(f,d);S!==h&&S!==k&&m.push({...e[S],x:s}),D!==h&&D!==k&&m.push({...e[D],x:s})}o>0&&k!==h&&m.push(e[k]),m.push(a),u=v,r=0,p=g=c,f=d=h=o}}return m}function Pl(e){if(e._decimated){let t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Xa(e){e.data.datasets.forEach(t=>{Pl(t)})}function vh(e,t){let n=t.length,i=0,s,{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=it(kt(t,r.axis,o).lo,0,n-1)),c?s=it(kt(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var _h={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Xa(e);return}let i=e.width;e.data.datasets.forEach((s,r)=>{let{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Re([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:f,count:d}=vh(l,c),h=n.threshold||4*i;if(d<=h){Pl(s);return}F(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=xh(c,f,d,i,n);break;case"min-max":p=yh(c,f,d,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){Xa(e)}};function wh(e,t,n){let i=e.segments,s=e.points,r=t.points,o=[];for(let a of i){let{start:l,end:c}=a;c=zr(l,c,s);let u=Ar(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}let f=tr(t,u);for(let d of f){let h=Ar(n,r[d.start],r[d.end],d.loop),p=Js(a,s,h);for(let g of p)o.push({source:g,target:d,start:{[n]:$a(u,h,"start",Math.max)},end:{[n]:$a(u,h,"end",Math.min)}})}}return o}function Ar(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=ct(s),r=ct(r)),{property:e,start:s,end:r}}function Mh(e,t){let{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=zr(o,a,s);let l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function zr(e,t,n){for(;t>e;t--){let i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function $a(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Al(e,t){let n=[],i=!1;return U(e)?(i=!0,n=e):n=Mh(e,t),n.length?new ze({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Qa(e){return e&&e.fill!==!1}function kh(e,t,n){let s=e[t].fill,r=[t],o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Q(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function Sh(e,t,n){let i=Th(e);if(L(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Q(s)&&Math.floor(s)===s?Dh(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Dh(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function Ch(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:L(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Oh(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:L(e)?i=e.value:i=t.getBaseValue(),i}function Th(e){let t=e.options,n=t.fill,i=A(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Ph(e){let{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=Ah(t,n);a.push(Al({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){let c=r[l];for(let u=c.start;u<=c.end;u++)Ih(s,o[u],a)}return new ze({points:s,options:{}})}function Ah(e,t){let n=[],i=e.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){let r=i[s];if(r.index===t)break;r.hidden||n.unshift(r.dataset)}return n}function Ih(e,t,n){let i=[];for(let s=0;s<n.length;s++){let r=n[s],{first:o,last:a,point:l}=Lh(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(e.push(l),!a)break}}e.push(...i)}function Lh(e,t,n){let i=e.interpolate(t,n);if(!i)return{};let s=i[n],r=e.segments,o=e.points,a=!1,l=!1;for(let c=0;c<r.length;c++){let u=r[c],f=o[u.start][n],d=o[u.end][n];if(Ct(s,f,d)){a=s===f,l=s===d;break}}return{first:a,last:l,point:i}}var yi=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){let{x:s,y:r,radius:o}=this;return n=n||{start:0,end:q},t.arc(s,r,o,n.end,n.start,!0),!i.bounds}interpolate(t){let{x:n,y:i,radius:s}=this,r=t.angle;return{x:n+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}};function Eh(e){let{chart:t,fill:n,line:i}=e;if(Q(n))return Rh(t,n);if(n==="stack")return Ph(e);if(n==="shape")return!0;let s=Fh(e);return s instanceof yi?s:Al(s,i)}function Rh(e,t){let n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Fh(e){return(e.scale||{}).getPointPositionForValue?Nh(e):Wh(e)}function Wh(e){let{scale:t={},fill:n}=e,i=Ch(n,t);if(Q(i)){let s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Nh(e){let{scale:t,fill:n}=e,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=Oh(n,t,r),a=[];if(i.grid.circular){let l=t.getPointPositionForValue(0,r);return new yi({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function cr(e,t,n){let i=Eh(t),{line:s,scale:r,axis:o}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:f=c}=l||{};i&&s.points.length&&(cn(e,n),zh(e,{line:s,target:i,above:u,below:f,area:n,scale:r,axis:o}),un(e))}function zh(e,t){let{line:n,target:i,above:s,below:r,area:o,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&r!==s&&(Ga(e,i,o.top),Ka(e,{line:n,target:i,color:s,scale:a,property:l}),e.restore(),e.save(),Ga(e,i,o.bottom)),Ka(e,{line:n,target:i,color:r,scale:a,property:l}),e.restore()}function Ga(e,t,n){let{segments:i,points:s}=t,r=!0,o=!1;e.beginPath();for(let a of i){let{start:l,end:c}=a,u=s[l],f=s[zr(l,c,s)];r?(e.moveTo(u.x,u.y),r=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Ka(e,t){let{line:n,target:i,property:s,color:r,scale:o}=t,a=wh(n,i,s);for(let{source:l,target:c,start:u,end:f}of a){let{style:{backgroundColor:d=r}={}}=l,h=i!==!0;e.save(),e.fillStyle=d,Bh(e,o,h&&Ar(s,u,f)),e.beginPath();let p=!!n.pathSegment(e,l),g;if(h){p?e.closePath():Za(e,i,f,s);let m=!!i.pathSegment(e,c,{move:p,reverse:!0});g=p&&m,g||Za(e,i,u,s)}e.closePath(),e.fill(g?"evenodd":"nonzero"),e.restore()}}function Bh(e,t,n){let{top:i,bottom:s}=t.chart.chartArea,{property:r,start:o,end:a}=n||{};r==="x"&&(e.beginPath(),e.rect(o,i,a-o,s-i),e.clip())}function Za(e,t,n,i){let s=t.interpolate(n,i);s&&e.lineTo(s.x,s.y)}var Hh={id:"filler",afterDatasetsUpdate(e,t,n){let i=(e.data.datasets||[]).length,s=[],r,o,a,l;for(o=0;o<i;++o)r=e.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof ze&&(l={visible:e.isDatasetVisible(o),index:o,fill:Sh(a,o,i),chart:e,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=kh(s,o,n.propagate))},beforeDraw(e,t,n){let i=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),r=e.chartArea;for(let o=s.length-1;o>=0;--o){let a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&cr(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;let i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){let r=i[s].$filler;Qa(r)&&cr(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){let i=t.meta.$filler;!Qa(i)||n.drawTime!=="beforeDatasetDraw"||cr(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Ja=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},Yh=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,vi=class extends yt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},n=H(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){let{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,s=nt(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Ja(i,r),c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){let{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a,f=t;r.textAlign="left",r.textBaseline="middle";let d=-1,h=-u;return this.legendItems.forEach((p,g)=>{let m=i+n/2+r.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>o)&&(f+=u,c[c.length-(g>0?0:1)]=0,h+=u,d++),l[g]={left:0,top:h,row:d,width:m,height:s},c[c.length-1]+=m+a}),f}_fitCols(t,n,i,s){let{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t,f=a,d=0,h=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:x,itemHeight:y}=Uh(i,n,r,m,s);b>0&&h+y+2*a>u&&(f+=d+a,c.push({width:d,height:h}),p+=d+a,g++,d=h=0),l[b]={left:p,top:h,col:g,width:x,height:y},d=Math.max(d,x),h+=y+a}),f+=d,c.push({width:d,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=de(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=st(i,this.left+s,this.right-this.lineWidths[a]);for(let c of n)a!==c.row&&(a=c.row,l=st(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=st(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of n)c.col!==a&&(a=c.col,l=st(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;cn(t,this),this._draw(),un(t)}}_draw(){let{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=G.color,l=de(t.rtl,this.left,this.width),c=nt(o.font),{padding:u}=o,f=c.size,d=f/2,h;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:p,boxHeight:g,itemHeight:m}=Ja(o,f),b=function(k,S,D){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();let C=A(D.lineWidth,1);if(s.fillStyle=A(D.fillStyle,a),s.lineCap=A(D.lineCap,"butt"),s.lineDashOffset=A(D.lineDashOffset,0),s.lineJoin=A(D.lineJoin,"miter"),s.lineWidth=C,s.strokeStyle=A(D.strokeStyle,a),s.setLineDash(A(D.lineDash,[])),o.usePointStyle){let T={radius:g*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:C},P=l.xPlus(k,p/2),I=S+d;Us(s,T,P,I,o.pointStyleWidth&&p)}else{let T=S+Math.max((f-g)/2,0),P=l.leftForLtr(k,p),I=Jt(D.borderRadius);s.beginPath(),Object.values(I).some(j=>j!==0)?Ee(s,{x:P,y:T,w:p,h:g,radius:I}):s.rect(P,T,p,g),s.fill(),C!==0&&s.stroke()}s.restore()},x=function(k,S,D){Zt(s,D.text,k,S+m/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},y=this.isHorizontal(),w=this._computeTitleHeight();y?h={x:st(r,this.left+u,this.right-i[0]),y:this.top+u+w,line:0}:h={x:this.left+u,y:st(r,this.top+w+u,this.bottom-n[0].height),line:0},Ks(this.ctx,t.textDirection);let v=m+u;this.legendItems.forEach((k,S)=>{s.strokeStyle=k.fontColor,s.fillStyle=k.fontColor;let D=s.measureText(k.text).width,C=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),T=p+d+D,P=h.x,I=h.y;l.setWidth(this.width),y?S>0&&P+T+u>this.right&&(I=h.y+=v,h.line++,P=h.x=st(r,this.left+u,this.right-i[h.line])):S>0&&I+v>this.bottom&&(P=h.x=P+n[h.line].width+u,h.line++,I=h.y=st(r,this.top+w+u,this.bottom-n[h.line].height));let j=l.x(P);if(b(j,I,k),P=Zo(C,P+p+d,y?P+T:this.right,t.rtl),x(l.x(P),I,k),y)h.x+=T+u;else if(typeof k.text!="string"){let ot=c.lineHeight;h.y+=Il(k,ot)+u}else h.y+=v}),Zs(this.ctx,t.textDirection)}drawTitle(){let t=this.options,n=t.title,i=nt(n.font),s=rt(n.padding);if(!n.display)return;let r=de(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l,u,f=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),u=this.top+c,f=st(t.align,f,this.right-d);else{let p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);u=c+st(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}let h=st(a,f,f+d);o.textAlign=r.textAlign(Kn(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,Zt(o,n.text,h,u,i)}_computeTitleHeight(){let t=this.options.title,n=nt(t.font),i=rt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Ct(t,this.left,this.right)&&Ct(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Ct(t,s.left,s.left+s.width)&&Ct(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){let n=this.options;if(!jh(t.type,n))return;let i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,r=Yh(s,i);s&&!r&&H(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&H(n.onHover,[t,i,this],this)}else i&&H(n.onClick,[t,i,this],this)}};function Uh(e,t,n,i,s){let r=Vh(i,e,t,n),o=qh(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Vh(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+n.size/2+i.measureText(s).width}function qh(e,t,n){let i=e;return typeof t.text!="string"&&(i=Il(t,n)),i}function Il(e,t){let n=e.text?e.text.length:0;return t*n}function jh(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Xh={id:"legend",_element:vi,start(e,t,n){let i=e.legend=new vi({ctx:e.ctx,options:n,chart:e});at.configure(e,i,n),at.addBox(e,i)},stop(e){at.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let i=e.legend;at.configure(e,i,n),i.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(n?0:void 0),u=rt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},vn=class extends yt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;let s=U(i.text)?i.text.length:1;this._padding=rt(i.padding);let r=s*nt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align,l=0,c,u,f;return this.isHorizontal()?(u=st(a,i,r),f=n+t,c=r-i):(o.position==="left"?(u=i+t,f=st(a,s,n),l=V*-.5):(u=r-t,f=st(a,n,s),l=V*.5),c=s-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){let t=this.ctx,n=this.options;if(!n.display)return;let i=nt(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Zt(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Kn(n.align),textBaseline:"middle",translation:[o,a]})}};function $h(e,t){let n=new vn({ctx:e.ctx,options:t,chart:e});at.configure(e,n,t),at.addBox(e,n),e.titleBlock=n}var Qh={id:"title",_element:vn,start(e,t,n){$h(e,n)},stop(e){let t=e.titleBlock;at.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let i=e.titleBlock;at.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},ci=new WeakMap,Gh={id:"subtitle",start(e,t,n){let i=new vn({ctx:e.ctx,options:n,chart:e});at.configure(e,i,n),at.addBox(e,i),ci.set(e,i)},stop(e){at.removeBox(e,ci.get(e)),ci.delete(e)},beforeUpdate(e,t,n){let i=ci.get(e);at.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},bn={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,r=0;for(t=0,n=e.length;t<n;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;r<o;++r){let l=e[r].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),u=jn(t,c);u<s&&(s=u,a=l)}}if(a){let l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function Ot(e,t){return t&&(U(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ut(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
4
+ `)>-1?e.split(`
5
+ `):e}function Kh(e,t){let{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function tl(e,t){let n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=nt(t.bodyFont),c=nt(t.titleFont),u=nt(t.footerFont),f=r.length,d=s.length,h=i.length,p=rt(t.padding),g=p.height,m=0,b=i.reduce((w,v)=>w+v.before.length+v.lines.length+v.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,f&&(g+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),b){let w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=h*w+(b-h)*l.lineHeight+(b-1)*t.bodySpacing}d&&(g+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);let x=0,y=function(w){m=Math.max(m,n.measureText(w).width+x)};return n.save(),n.font=c.string,z(e.title,y),n.font=l.string,z(e.beforeBody.concat(e.afterBody),y),x=t.displayColors?o+2+t.boxPadding:0,z(i,w=>{z(w.before,y),z(w.lines,y),z(w.after,y)}),x=0,n.font=u.string,z(e.footer,y),n.restore(),m+=p.width,{width:m,height:g}}function Zh(e,t){let{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function Jh(e,t,n,i){let{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function tp(e,t,n,i){let{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e,c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Jh(c,e,t,n)&&(c="center"),c}function el(e,t,n){let i=n.yAlign||t.yAlign||Zh(e,n);return{xAlign:n.xAlign||t.xAlign||tp(e,t,n,i),yAlign:i}}function ep(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function np(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function nl(e,t,n,i){let{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:f,bottomLeft:d,bottomRight:h}=Jt(o),p=ep(t,a),g=np(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,d)+s:a==="right"&&(p+=Math.max(f,h)+s),{x:it(p,0,i.width-t.width),y:it(g,0,i.height-t.height)}}function ui(e,t,n){let i=rt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function il(e){return Ot([],Ut(e))}function ip(e,t,n){return Ht(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function sl(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var Ll={beforeTitle:Dt,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:Dt,beforeBody:Dt,beforeLabel:Dt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let n=e.formattedValue;return F(n)||(t+=n),t},labelColor(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Dt,afterBody:Dt,beforeFooter:Dt,footer:Dt,afterFooter:Dt};function ft(e,t,n,i){let s=e[t].call(n,i);return typeof s>"u"?Ll[t].call(n,i):s}var _i=class extends yt{static positioners=bn;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new pi(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=ip(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){let{callbacks:i}=n,s=ft(i,"beforeTitle",this,t),r=ft(i,"title",this,t),o=ft(i,"afterTitle",this,t),a=[];return a=Ot(a,Ut(s)),a=Ot(a,Ut(r)),a=Ot(a,Ut(o)),a}getBeforeBody(t,n){return il(ft(n.callbacks,"beforeBody",this,t))}getBody(t,n){let{callbacks:i}=n,s=[];return z(t,r=>{let o={before:[],lines:[],after:[]},a=sl(i,r);Ot(o.before,Ut(ft(a,"beforeLabel",this,r))),Ot(o.lines,ft(a,"label",this,r)),Ot(o.after,Ut(ft(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,n){return il(ft(n.callbacks,"afterBody",this,t))}getFooter(t,n){let{callbacks:i}=n,s=ft(i,"beforeFooter",this,t),r=ft(i,"footer",this,t),o=ft(i,"afterFooter",this,t),a=[];return a=Ot(a,Ut(s)),a=Ot(a,Ut(r)),a=Ot(a,Ut(o)),a}_createItems(t){let n=this._active,i=this.chart.data,s=[],r=[],o=[],a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(Kh(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,d)=>t.filter(u,f,d,i))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,i))),z(a,u=>{let f=sl(t.callbacks,u);s.push(ft(f,"labelColor",this,u)),r.push(ft(f,"labelPointStyle",this,u)),o.push(ft(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){let i=this.options.setContext(this.getContext()),s=this._active,r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{let a=bn[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);let l=this._size=tl(this,i),c=Object.assign({},a,l),u=el(this.chart,i,c),f=nl(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){let r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){let{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=Jt(a),{x:d,y:h}=t,{width:p,height:g}=n,m,b,x,y,w,v;return r==="center"?(w=h+g/2,s==="left"?(m=d,b=m-o,y=w+o,v=w-o):(m=d+p,b=m+o,y=w-o,v=w+o),x=m):(s==="left"?b=d+Math.max(l,u)+o:s==="right"?b=d+p-Math.max(c,f)-o:b=this.caretX,r==="top"?(y=h,w=y-o,m=b-o,x=b+o):(y=h+g,w=y+o,m=b+o,x=b-o),v=y),{x1:m,x2:b,x3:x,y1:y,y2:w,y3:v}}drawTitle(t,n,i){let s=this.title,r=s.length,o,a,l;if(r){let c=de(i.rtl,this.x,this.width);for(t.x=ui(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=nt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;l<r;++l)n.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,n,i,s,r){let o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=nt(r.bodyFont),f=ui(this,"left",r),d=s.x(f),h=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+h;if(r.usePointStyle){let g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(d,c)+c/2,b=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Jn(t,g,m,b),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Jn(t,g,m,b)}else{t.lineWidth=L(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;let g=s.leftForLtr(d,c),m=s.leftForLtr(s.xPlus(d,1),c-2),b=Jt(o.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Ee(t,{x:g,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ee(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){let{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,f=nt(i.bodyFont),d=f.lineHeight,h=0,p=de(i.rtl,this.x,this.width),g=function(D){n.fillText(D,p.x(t.x+h),t.y+d/2),t.y+=d+r},m=p.textAlign(o),b,x,y,w,v,k,S;for(n.textAlign=o,n.textBaseline="middle",n.font=f.string,t.x=ui(this,m,i),n.fillStyle=i.bodyColor,z(this.beforeBody,g),h=a&&m!=="right"?o==="center"?c/2+u:c+2+u:0,w=0,k=s.length;w<k;++w){for(b=s[w],x=this.labelTextColors[w],n.fillStyle=x,z(b.before,g),y=b.lines,a&&y.length&&(this._drawColorBox(n,t,w,p,i),d=Math.max(f.lineHeight,l)),v=0,S=y.length;v<S;++v)g(y[v]),d=f.lineHeight;z(b.after,g)}h=0,d=f.lineHeight,z(this.afterBody,g),t.y-=r}drawFooter(t,n,i){let s=this.footer,r=s.length,o,a;if(r){let l=de(i.rtl,this.x,this.width);for(t.x=ui(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",o=nt(i.footerFont),n.fillStyle=i.footerColor,n.font=o.string,a=0;a<r;++a)n.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){let{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:f,topRight:d,bottomLeft:h,bottomRight:p}=Jt(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+f,l),o==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-d,l),n.quadraticCurveTo(a+c,l,a+c,l+d),o==="center"&&r==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-p),n.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),o==="center"&&r==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){let n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){let o=bn[t.position].call(this,this._active,this._eventPosition);if(!o)return;let a=this._size=tl(this,t),l=Object.assign({},o,this._size),c=el(n,t,l),u=nl(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){let n=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(n);let s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let o=rt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,n),Ks(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),Zs(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){let i=this._active,s=t.map(({datasetIndex:a,index:l})=>{let c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!an(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!an(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){let r=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){let{caretX:i,caretY:s,options:r}=this,o=bn[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}},sp={id:"tooltip",_element:_i,positioners:bn,afterInit(e,t,n){n&&(e.tooltip=new _i({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ll},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},rp=Object.freeze({__proto__:null,Colors:bh,Decimation:_h,Filler:Hh,Legend:Xh,SubTitle:Gh,Title:Qh,Tooltip:sp}),op=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function ap(e,t,n,i){let s=e.indexOf(t);if(s===-1)return op(e,t,n,i);let r=e.lastIndexOf(t);return s!==r?n:s}var lp=(e,t)=>e===null?null:it(Math.round(e),0,t);function rl(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var Ir=class extends ge{static id="category";static defaults={ticks:{callback:rl}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let n=this._addedLabels;if(n.length){let i=this.getLabels();for(let{index:s,label:r}of n)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(F(t))return null;let i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:ap(i,t,A(n,t),this._addedLabels),lp(n,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,n=this.max,i=this.options.offset,s=[],r=this.getLabels();r=t===0&&n===r.length-1?r:r.slice(t,n+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=n;o++)s.push({value:o});return s}getLabelForValue(t){return rl.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};function cp(e,t){let n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:d}=e,h=r||1,p=u-1,{min:g,max:m}=t,b=!F(o),x=!F(a),y=!F(c),w=(m-g)/(f+1),v=Ps((m-g)/p/h)*h,k,S,D,C;if(v<1e-14&&!b&&!x)return[{value:g},{value:m}];C=Math.ceil(m/v)-Math.floor(g/v),C>p&&(v=Ps(C*v/p/h)*h),F(l)||(k=Math.pow(10,l),v=Math.ceil(v*k)/k),s==="ticks"?(S=Math.floor(g/v)*v,D=Math.ceil(m/v)*v):(S=g,D=m),b&&x&&r&&qo((a-o)/r,v/1e3)?(C=Math.round(Math.min((a-o)/v,u)),v=(a-o)/C,S=o,D=a):y?(S=b?o:S,D=x?a:D,C=c-1,v=(D-S)/C):(C=(D-S)/v,Ae(C,Math.round(C),v/1e3)?C=Math.round(C):C=Math.ceil(C));let T=Math.max(Is(v),Is(S));k=Math.pow(10,F(l)?T:l),S=Math.round(S*k)/k,D=Math.round(D*k)/k;let P=0;for(b&&(d&&S!==o?(n.push({value:o}),S<o&&P++,Ae(Math.round((S+P*v)*k)/k,o,ol(o,w,e))&&P++):S<o&&P++);P<C;++P){let I=Math.round((S+P*v)*k)/k;if(x&&I>a)break;n.push({value:I})}return x&&d&&D!==a?n.length&&Ae(n[n.length-1].value,a,ol(a,w,e))?n[n.length-1].value=a:n.push({value:a}):(!x||D===a)&&n.push({value:D}),n}function ol(e,t,{horizontal:n,minRotation:i}){let s=pt(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}var Be=class extends ge{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return F(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds(),{min:s,max:r}=this,o=l=>s=n?s:l,a=l=>r=i?r:l;if(t){let l=xt(s),c=xt(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,n=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=cp(s,r);return t.bounds==="ticks"&&As(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let t=this.ticks,n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return Le(t,this.chart.options.locale,this.options.ticks.format)}},Lr=class extends Be{static id="linear";static defaults={ticks:{callback:ln.formatters.numeric}};determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=Q(t)?t:0,this.max=Q(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),n=t?this.width:this.height,i=pt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},_n=e=>Math.floor(zt(e)),pe=(e,t)=>Math.pow(10,_n(e)+t);function al(e){return e/Math.pow(10,_n(e))===1}function ll(e,t,n){let i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function up(e,t){let n=t-e,i=_n(n);for(;ll(e,t,i)>10;)i++;for(;ll(e,t,i)<10;)i--;return Math.min(i,_n(e))}function fp(e,{min:t,max:n}){t=ut(e.min,t);let i=[],s=_n(t),r=up(t,n),o=r<0?Math.pow(10,Math.abs(r)):1,a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10,f=Math.floor((c-u)/Math.pow(10,r)),d=ut(e.min,Math.round((l+u+f*Math.pow(10,r))*o)/o);for(;d<n;)i.push({value:d,major:al(d),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(r++,f=2,o=r>=0?1:o),d=Math.round((l+u+f*Math.pow(10,r))*o)/o;let h=ut(e.max,d);return i.push({value:h,major:al(h),significand:f}),i}var Er=class extends ge{static id="logarithmic";static defaults={ticks:{callback:ln.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){let i=Be.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return Q(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=Q(t)?Math.max(0,t):null,this.max=Q(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Q(this._userMin)&&(this.min=t===pe(this.min,0)?pe(this.min,-1):pe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),i=this.min,s=this.max,r=a=>i=t?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(pe(i,-1)),o(pe(s,1)))),i<=0&&r(pe(s,-1)),s<=0&&o(pe(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,n={min:this._userMin,max:this._userMax},i=fp(n,this);return t.bounds==="ticks"&&As(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Le(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=zt(t),this._valueRange=zt(this.max)-zt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(zt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}};function Rr(e){let t=e.ticks;if(t.display&&e.display){let n=rt(t.backdropPadding);return A(t.font&&t.font.size,G.font.size)+n.height}return 0}function dp(e,t,n){return n=U(n)?n:[n],{w:ta(e,t.string,n),h:n.length*t.lineHeight}}function cl(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function hp(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?V/r:0;for(let l=0;l<r;l++){let c=o.setContext(e.getPointLabelContext(l));s[l]=c.padding;let u=e.getPointPosition(l,e.drawingArea+s[l],a),f=nt(c.font),d=dp(e.ctx,f,e._pointLabels[l]);i[l]=d;let h=ct(e.getIndexAngle(l)+a),p=Math.round(Qn(h)),g=cl(p,u.x,d.w,0,180),m=cl(p,u.y,d.h,90,270);pp(n,t,h,g,m)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=bp(e,i,s)}function pp(e,t,n,i,s){let r=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,e.l=Math.min(e.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function gp(e,t,n){let i=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=e.getPointPosition(t,i+s+o,r),c=Math.round(Qn(ct(l.angle+J))),u=vp(l.y,a.h,c),f=xp(c),d=yp(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:d,top:u,right:d+a.w,bottom:u+a.h}}function mp(e,t){if(!t)return!0;let{left:n,top:i,right:s,bottom:r}=e;return!(St({x:n,y:i},t)||St({x:n,y:r},t)||St({x:s,y:i},t)||St({x:s,y:r},t))}function bp(e,t,n){let i=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:Rr(r)/2,additionalAngle:o?V/s:0},c;for(let u=0;u<s;u++){l.padding=n[u],l.size=t[u];let f=gp(e,u,l);i.push(f),a==="auto"&&(f.visible=mp(f,c),f.visible&&(c=f))}return i}function xp(e){return e===0||e===180?"center":e<180?"left":"right"}function yp(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function vp(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function _p(e,t,n){let{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=t;if(!F(a)){let l=Jt(t.borderRadius),c=rt(t.backdropPadding);e.fillStyle=a;let u=i-c.left,f=s-c.top,d=r-i+c.width,h=o-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Ee(e,{x:u,y:f,w:d,h,radius:l}),e.fill()):e.fillRect(u,f,d,h)}}function wp(e,t){let{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){let r=e._pointLabelItems[s];if(!r.visible)continue;let o=i.setContext(e.getPointLabelContext(s));_p(n,o,r);let a=nt(o.font),{x:l,y:c,textAlign:u}=r;Zt(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function El(e,t,n,i){let{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,q);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=e.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function Mp(e,t,n,i,s){let r=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||n<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash),r.lineDashOffset=s.dashOffset,r.beginPath(),El(e,n,o,i),r.closePath(),r.stroke(),r.restore())}function kp(e,t,n){return Ht(e,{label:n,index:t,type:"pointLabel"})}var Fr=class extends Be{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ln.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=rt(Rr(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!1);this.min=Q(t)&&!isNaN(t)?t:0,this.max=Q(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Rr(this.options))}generateTickLabels(t){Be.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{let s=H(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?hp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){let n=q/(this._pointLabels.length||1),i=this.options.startAngle||0;return ct(t*n+pt(i))}getDistanceFromCenterForValue(t){if(F(t))return NaN;let n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(F(t))return NaN;let n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){let n=this._pointLabels||[];if(t>=0&&t<n.length){let i=n[t];return kp(this.getContext(),t,i)}}getPointPosition(t,n,i=0){let s=this.getIndexAngle(t)-J+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:n,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:r}}drawBackground(){let{backgroundColor:t,grid:{circular:n}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),El(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t=this.ctx,n=this.options,{angleLines:i,grid:s,border:r}=n,o=this._pointLabels.length,a,l,c;if(n.pointLabels.display&&wp(this,o),s.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);let d=this.getContext(f),h=s.setContext(d),p=r.setContext(d);Mp(this,h,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){let u=i.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:d}=u;!d||!f||(t.lineWidth=d,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;let s=this.getIndexAngle(0),r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;let c=i.setContext(this.getContext(l)),u=nt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let f=rt(c.backdropPadding);t.fillRect(-o/2-f.left,-r-u.size/2-f.top,o+f.width,u.size+f.height)}Zt(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}},wi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},dt=Object.keys(wi);function ul(e,t){return e-t}function fl(e,t){if(F(t))return null;let n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts,o=t;return typeof i=="function"&&(o=i(o)),Q(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(fe(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function dl(e,t,n,i){let s=dt.length;for(let r=dt.indexOf(e);r<s-1;++r){let o=wi[dt[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=i)return dt[r]}return dt[s-1]}function Sp(e,t,n,i,s){for(let r=dt.length-1;r>=dt.indexOf(n);r--){let o=dt[r];if(wi[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return dt[n?dt.indexOf(n):0]}function Dp(e){for(let t=dt.indexOf(e)+1,n=dt.length;t<n;++t)if(wi[dt[t]].common)return dt[t]}function hl(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:i,hi:s}=Gn(n,t),r=n[i]>=t?n[i]:n[s];e[r]=!0}}function Cp(e,t,n,i){let s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value,a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function pl(e,t,n){let i=[],s={},r=t.length,o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!n?i:Cp(e,i,s,n)}var wn=class extends ge{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){let i=t.time||(t.time={}),s=this._adapter=new Nr._date(t.adapters.date);s.init(n),Te(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:fl(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,n=this._adapter,i=t.time.unit||"day",{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Q(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),r=Q(r)&&!isNaN(r)?r:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){let t=this.getLabelTimestamps(),n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){let t=this.options,n=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let r=this.min,o=this.max,a=$o(s,r,o);return this._unit=n.unit||(i.autoSkip?dl(n.minUnit,this.min,this.max,this._getLabelCapacity(r)):Sp(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Dp(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),pl(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;n=it(n,0,o),i=it(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){let t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||dl(r.minUnit,n,i,this._getLabelCapacity(n)),a=A(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=fe(l)||l===!0,u={},f=n,d,h;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);let p=s.ticks.source==="data"&&this.getDataTimestamps();for(d=f,h=0;d<i;d=+t.add(d,a,o),h++)hl(u,d,p);return(d===i||s.bounds==="ticks"||h===1)&&hl(u,d,p),Object.keys(u).sort(ul).map(g=>+g)}getLabelForValue(t){let n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){let s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,s){let r=this.options,o=r.ticks.callback;if(o)return H(o,[t,n,i],this);let a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],d=i[n],h=c&&f&&d&&d.major;return this._adapter.format(t,s||(h?f:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let n=this.options.ticks,i=this.ctx.measureText(t).width,s=pt(this.isHorizontal()?n.maxRotation:n.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){let n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,r=this._tickFormatFunction(t,0,pl(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],n,i;if(t.length)return t;let s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(fl(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Rs(t.sort(ul))}};function fi(e,t,n){let i=0,s=e.length-1,r,o,a,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=kt(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=kt(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);let c=o-r;return c?a+(l-a)*(t-r)/c:a}var Wr=class extends wn{static id="timeseries";static defaults=wn.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=fi(n,this.min),this._tableRange=fi(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:n,max:i}=this,s=[],r=[],o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){let t=this.min,n=this.max,i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(fi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return fi(this._table,i*this._tableRange+this._minPos,!0)}},Op=Object.freeze({__proto__:null,CategoryScale:Ir,LinearScale:Lr,LogarithmicScale:Er,RadialLinearScale:Fr,TimeScale:wn,TimeSeriesScale:Wr}),Rl=[Hf,fh,rp,Op];Ne.register(...Rl);var Fl=Ne;function O(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function _(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function M(e){_(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function He(e,t){_(2,arguments);var n=M(e),i=O(t);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}function ne(e,t){_(2,arguments);var n=M(e),i=O(t);if(isNaN(i))return new Date(NaN);if(!i)return n;var s=n.getDate(),r=new Date(n.getTime());r.setMonth(n.getMonth()+i+1,0);var o=r.getDate();return s>=o?r:(n.setFullYear(r.getFullYear(),r.getMonth(),s),n)}function gt(e,t){_(2,arguments);var n=M(e).getTime(),i=O(t);return new Date(n+i)}var Tp=36e5;function Mi(e,t){_(2,arguments);var n=O(t);return gt(e,n*Tp)}function kn(e,t){_(1,arguments);var n=t||{},i=n.locale,s=i&&i.options&&i.options.weekStartsOn,r=s==null?0:O(s),o=n.weekStartsOn==null?r:O(n.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=M(e),l=a.getDay(),c=(l<o?7:0)+l-o;return a.setDate(a.getDate()-c),a.setHours(0,0,0,0),a}function ie(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function me(e){_(1,arguments);var t=M(e);return t.setHours(0,0,0,0),t}var Pp=864e5;function Br(e,t){_(2,arguments);var n=me(e),i=me(t),s=n.getTime()-ie(n),r=i.getTime()-ie(i);return Math.round((s-r)/Pp)}var Ap=6e4;function ki(e,t){_(2,arguments);var n=O(t);return gt(e,n*Ap)}function Si(e,t){_(2,arguments);var n=O(t),i=n*3;return ne(e,i)}function Di(e,t){_(2,arguments);var n=O(t);return gt(e,n*1e3)}function Ci(e,t){_(2,arguments);var n=O(t),i=n*7;return He(e,i)}function Oi(e,t){_(2,arguments);var n=O(t);return ne(e,n*12)}function se(e,t){_(2,arguments);var n=M(e),i=M(t),s=n.getTime()-i.getTime();return s<0?-1:s>0?1:s}var Ip=Math.pow(10,8)*24*60*60*1e3,Wl=6e4,Nl=36e5;var gb=-Ip;function Hr(e){return _(1,arguments),e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ye(e){if(_(1,arguments),!Hr(e)&&typeof e!="number")return!1;var t=M(e);return!isNaN(Number(t))}function Yr(e,t){_(2,arguments);var n=M(e),i=M(t),s=n.getFullYear()-i.getFullYear(),r=n.getMonth()-i.getMonth();return s*12+r}function Ur(e,t){_(2,arguments);var n=M(e),i=M(t);return n.getFullYear()-i.getFullYear()}function zl(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Ue(e,t){_(2,arguments);var n=M(e),i=M(t),s=zl(n,i),r=Math.abs(Br(n,i));n.setDate(n.getDate()-s*r);var o=+(zl(n,i)===-s),a=s*(r-o);return a===0?0:a}function At(e,t){return _(2,arguments),M(e).getTime()-M(t).getTime()}var Bl={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},Lp="trunc";function It(e){return e?Bl[e]:Bl[Lp]}function Ti(e,t,n){_(2,arguments);var i=At(e,t)/Nl;return It(n?.roundingMethod)(i)}function Pi(e,t,n){_(2,arguments);var i=At(e,t)/Wl;return It(n?.roundingMethod)(i)}function Ve(e){_(1,arguments);var t=M(e);return t.setHours(23,59,59,999),t}function qe(e){_(1,arguments);var t=M(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Vr(e){_(1,arguments);var t=M(e);return Ve(t).getTime()===qe(t).getTime()}function je(e,t){_(2,arguments);var n=M(e),i=M(t),s=se(n,i),r=Math.abs(Yr(n,i)),o;if(r<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-s*r);var a=se(n,i)===-s;Vr(M(e))&&r===1&&se(e,i)===1&&(a=!1),o=s*(r-Number(a))}return o===0?0:o}function Ai(e,t,n){_(2,arguments);var i=je(e,t)/3;return It(n?.roundingMethod)(i)}function Ii(e,t,n){_(2,arguments);var i=At(e,t)/1e3;return It(n?.roundingMethod)(i)}function Li(e,t,n){_(2,arguments);var i=Ue(e,t)/7;return It(n?.roundingMethod)(i)}function Ei(e,t){_(2,arguments);var n=M(e),i=M(t),s=se(n,i),r=Math.abs(Ur(n,i));n.setFullYear(1584),i.setFullYear(1584);var o=se(n,i)===-s,a=s*(r-Number(o));return a===0?0:a}function Ri(e){_(1,arguments);var t=M(e);return t.setSeconds(0,0),t}function Fi(e){_(1,arguments);var t=M(e),n=t.getMonth(),i=n-n%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function Wi(e){_(1,arguments);var t=M(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Ni(e){_(1,arguments);var t=M(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function zi(e){_(1,arguments);var t=M(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}function Bi(e){_(1,arguments);var t=M(e);return t.setMinutes(59,59,999),t}function Hi(e,t){_(1,arguments);var n=t||{},i=n.locale,s=i&&i.options&&i.options.weekStartsOn,r=s==null?0:O(s),o=n.weekStartsOn==null?r:O(n.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=M(e),l=a.getDay(),c=(l<o?-7:0)+6-(l-o);return a.setDate(a.getDate()+c),a.setHours(23,59,59,999),a}function Yi(e){_(1,arguments);var t=M(e);return t.setSeconds(59,999),t}function Ui(e){_(1,arguments);var t=M(e),n=t.getMonth(),i=n-n%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}function Vi(e){_(1,arguments);var t=M(e);return t.setMilliseconds(999),t}var Ep={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Rp=function(e,t,n){var i,s=Ep[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},Hl=Rp;function Sn(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,i=e.formats[n]||e.formats[e.defaultWidth];return i}}var Fp={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Wp={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Np={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zp={date:Sn({formats:Fp,defaultWidth:"full"}),time:Sn({formats:Wp,defaultWidth:"full"}),dateTime:Sn({formats:Np,defaultWidth:"full"})},Yl=zp;var Bp={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Hp=function(e,t,n,i){return Bp[e]},Ul=Hp;function be(e){return function(t,n){var i=n||{},s=i.context?String(i.context):"standalone",r;if(s==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var l=e.defaultWidth,c=i.width?String(i.width):e.defaultWidth;r=e.values[c]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return r[u]}}var Yp={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Up={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Vp={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},qp={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},jp={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Xp={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},$p=function(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Qp={ordinalNumber:$p,era:be({values:Yp,defaultWidth:"wide"}),quarter:be({values:Up,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:be({values:Vp,defaultWidth:"wide"}),day:be({values:qp,defaultWidth:"wide"}),dayPeriod:be({values:jp,defaultWidth:"wide",formattingValues:Xp,defaultFormattingWidth:"wide"})},Vl=Qp;function xe(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],r=t.match(s);if(!r)return null;var o=r[0],a=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Kp(a,function(f){return f.test(o)}):Gp(a,function(f){return f.test(o)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(o.length);return{value:c,rest:u}}}function Gp(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Kp(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function qr(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(e.matchPattern);if(!i)return null;var s=i[0],r=t.match(e.parsePattern);if(!r)return null;var o=e.valueCallback?e.valueCallback(r[0]):r[0];o=n.valueCallback?n.valueCallback(o):o;var a=t.slice(s.length);return{value:o,rest:a}}}var Zp=/^(\d+)(th|st|nd|rd)?/i,Jp=/\d+/i,tg={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},eg={any:[/^b/i,/^(a|c)/i]},ng={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ig={any:[/1/i,/2/i,/3/i,/4/i]},sg={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rg={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},og={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ag={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lg={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cg={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ug={ordinalNumber:qr({matchPattern:Zp,parsePattern:Jp,valueCallback:function(e){return parseInt(e,10)}}),era:xe({matchPatterns:tg,defaultMatchWidth:"wide",parsePatterns:eg,defaultParseWidth:"any"}),quarter:xe({matchPatterns:ng,defaultMatchWidth:"wide",parsePatterns:ig,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:xe({matchPatterns:sg,defaultMatchWidth:"wide",parsePatterns:rg,defaultParseWidth:"any"}),day:xe({matchPatterns:og,defaultMatchWidth:"wide",parsePatterns:ag,defaultParseWidth:"any"}),dayPeriod:xe({matchPatterns:lg,defaultMatchWidth:"any",parsePatterns:cg,defaultParseWidth:"any"})},ql=ug;var fg={code:"en-US",formatDistance:Hl,formatLong:Yl,formatRelative:Ul,localize:Vl,match:ql,options:{weekStartsOn:0,firstWeekContainsDate:1}},qi=fg;function Dn(e,t){_(2,arguments);var n=O(t);return gt(e,-n)}function N(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}var dg={y:function(e,t){var n=e.getUTCFullYear(),i=n>0?n:1-n;return N(t==="yy"?i%100:i,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):N(n+1,2)},d:function(e,t){return N(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(e,t){return N(e.getUTCHours()%12||12,t.length)},H:function(e,t){return N(e.getUTCHours(),t.length)},m:function(e,t){return N(e.getUTCMinutes(),t.length)},s:function(e,t){return N(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,i=e.getUTCMilliseconds(),s=Math.floor(i*Math.pow(10,n-3));return N(s,t.length)}},Vt=dg;var hg=864e5;function jr(e){_(1,arguments);var t=M(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),s=n-i;return Math.floor(s/hg)+1}function vt(e){_(1,arguments);var t=1,n=M(e),i=n.getUTCDay(),s=(i<t?7:0)+i-t;return n.setUTCDate(n.getUTCDate()-s),n.setUTCHours(0,0,0,0),n}function Cn(e){_(1,arguments);var t=M(e),n=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(n+1,0,4),i.setUTCHours(0,0,0,0);var s=vt(i),r=new Date(0);r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0);var o=vt(r);return t.getTime()>=s.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Xr(e){_(1,arguments);var t=Cn(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var i=vt(n);return i}var pg=6048e5;function On(e){_(1,arguments);var t=M(e),n=vt(t).getTime()-Xr(t).getTime();return Math.round(n/pg)+1}function mt(e,t){_(1,arguments);var n=t||{},i=n.locale,s=i&&i.options&&i.options.weekStartsOn,r=s==null?0:O(s),o=n.weekStartsOn==null?r:O(n.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=M(e),l=a.getUTCDay(),c=(l<o?7:0)+l-o;return a.setUTCDate(a.getUTCDate()-c),a.setUTCHours(0,0,0,0),a}function ye(e,t){_(1,arguments);var n=M(e,t),i=n.getUTCFullYear(),s=t||{},r=s.locale,o=r&&r.options&&r.options.firstWeekContainsDate,a=o==null?1:O(o),l=s.firstWeekContainsDate==null?a:O(s.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(i+1,0,l),c.setUTCHours(0,0,0,0);var u=mt(c,t),f=new Date(0);f.setUTCFullYear(i,0,l),f.setUTCHours(0,0,0,0);var d=mt(f,t);return n.getTime()>=u.getTime()?i+1:n.getTime()>=d.getTime()?i:i-1}function $r(e,t){_(1,arguments);var n=t||{},i=n.locale,s=i&&i.options&&i.options.firstWeekContainsDate,r=s==null?1:O(s),o=n.firstWeekContainsDate==null?r:O(n.firstWeekContainsDate),a=ye(e,t),l=new Date(0);l.setUTCFullYear(a,0,o),l.setUTCHours(0,0,0,0);var c=mt(l,t);return c}var gg=6048e5;function Tn(e,t){_(1,arguments);var n=M(e),i=mt(n,t).getTime()-$r(n,t).getTime();return Math.round(i/gg)+1}var Xe={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mg={G:function(e,t,n){var i=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){var i=e.getUTCFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Vt.y(e,t)},Y:function(e,t,n,i){var s=ye(e,i),r=s>0?s:1-s;if(t==="YY"){var o=r%100;return N(o,2)}return t==="Yo"?n.ordinalNumber(r,{unit:"year"}):N(r,t.length)},R:function(e,t){var n=Cn(e);return N(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return N(n,t.length)},Q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return N(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return N(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){var i=e.getUTCMonth();switch(t){case"M":case"MM":return Vt.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){var i=e.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return N(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){var s=Tn(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):N(s,t.length)},I:function(e,t,n){var i=On(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):N(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Vt.d(e,t)},D:function(e,t,n){var i=jr(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):N(i,t.length)},E:function(e,t,n){var i=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){var s=e.getUTCDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return N(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){var s=e.getUTCDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return N(r,t.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){var i=e.getUTCDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return N(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){var i=e.getUTCHours(),s=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){var i=e.getUTCHours(),s;switch(i===12?s=Xe.noon:i===0?s=Xe.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){var i=e.getUTCHours(),s;switch(i>=17?s=Xe.evening:i>=12?s=Xe.afternoon:i>=4?s=Xe.morning:s=Xe.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Vt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Vt.H(e,t)},K:function(e,t,n){var i=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):N(i,t.length)},k:function(e,t,n){var i=e.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):N(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Vt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Vt.s(e,t)},S:function(e,t){return Vt.S(e,t)},X:function(e,t,n,i){var s=i._originalDate||e,r=s.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Xl(r);case"XXXX":case"XX":return ve(r);case"XXXXX":case"XXX":default:return ve(r,":")}},x:function(e,t,n,i){var s=i._originalDate||e,r=s.getTimezoneOffset();switch(t){case"x":return Xl(r);case"xxxx":case"xx":return ve(r);case"xxxxx":case"xxx":default:return ve(r,":")}},O:function(e,t,n,i){var s=i._originalDate||e,r=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+jl(r,":");case"OOOO":default:return"GMT"+ve(r,":")}},z:function(e,t,n,i){var s=i._originalDate||e,r=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+jl(r,":");case"zzzz":default:return"GMT"+ve(r,":")}},t:function(e,t,n,i){var s=i._originalDate||e,r=Math.floor(s.getTime()/1e3);return N(r,t.length)},T:function(e,t,n,i){var s=i._originalDate||e,r=s.getTime();return N(r,t.length)}};function jl(e,t){var n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),r=i%60;if(r===0)return n+String(s);var o=t||"";return n+String(s)+o+N(r,2)}function Xl(e,t){if(e%60===0){var n=e>0?"-":"+";return n+N(Math.abs(e)/60,2)}return ve(e,t)}function ve(e,t){var n=t||"",i=e>0?"-":"+",s=Math.abs(e),r=N(Math.floor(s/60),2),o=N(s%60,2);return i+r+n+o}var $l=mg;function Ql(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Gl(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}function bg(e,t){var n=e.match(/(P+)(p+)?/),i=n[1],s=n[2];if(!s)return Ql(e,t);var r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Ql(i,t)).replace("{{time}}",Gl(s,t))}var xg={p:Gl,P:bg},ji=xg;var yg=["D","DD"],vg=["YY","YYYY"];function Xi(e){return yg.indexOf(e)!==-1}function $i(e){return vg.indexOf(e)!==-1}function $e(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var _g=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,wg=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mg=/^'([^]*?)'?$/,kg=/''/g,Sg=/[a-zA-Z]/;function Qi(e,t,n){_(2,arguments);var i=String(t),s=n||{},r=s.locale||qi,o=r.options&&r.options.firstWeekContainsDate,a=o==null?1:O(o),l=s.firstWeekContainsDate==null?a:O(s.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=r.options&&r.options.weekStartsOn,u=c==null?0:O(c),f=s.weekStartsOn==null?u:O(s.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!r.localize)throw new RangeError("locale must contain localize property");if(!r.formatLong)throw new RangeError("locale must contain formatLong property");var d=M(e);if(!Ye(d))throw new RangeError("Invalid time value");var h=ie(d),p=Dn(d,h),g={firstWeekContainsDate:l,weekStartsOn:f,locale:r,_originalDate:d},m=i.match(wg).map(function(b){var x=b[0];if(x==="p"||x==="P"){var y=ji[x];return y(b,r.formatLong,g)}return b}).join("").match(_g).map(function(b){if(b==="''")return"'";var x=b[0];if(x==="'")return Dg(b);var y=$l[x];if(y)return!s.useAdditionalWeekYearTokens&&$i(b)&&$e(b,t,e),!s.useAdditionalDayOfYearTokens&&Xi(b)&&$e(b,t,e),y(p,b,r.localize,g);if(x.match(Sg))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return b}).join("");return m}function Dg(e){return e.match(Mg)[1].replace(kg,"'")}function Qr(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");t=t||{};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Pn(e,t,n){_(2,arguments);var i=n||{},s=i.locale,r=s&&s.options&&s.options.weekStartsOn,o=r==null?0:O(r),a=i.weekStartsOn==null?o:O(i.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var l=M(e),c=O(t),u=l.getUTCDay(),f=c%7,d=(f+7)%7,h=(d<a?7:0)+c-u;return l.setUTCDate(l.getUTCDate()+h),l}function Gr(e,t){_(2,arguments);var n=O(t);n%7===0&&(n=n-7);var i=1,s=M(e),r=s.getUTCDay(),o=n%7,a=(o+7)%7,l=(a<i?7:0)+n-r;return s.setUTCDate(s.getUTCDate()+l),s}function Kr(e,t){_(2,arguments);var n=M(e),i=O(t),s=On(n)-i;return n.setUTCDate(n.getUTCDate()-s*7),n}function Zr(e,t,n){_(2,arguments);var i=M(e),s=O(t),r=Tn(i,n)-s;return i.setUTCDate(i.getUTCDate()-r*7),i}var Cg=36e5,Og=6e4,Tg=1e3,et={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Lt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function K(e,t,n){var i=t.match(e);if(!i)return null;var s=parseInt(i[0],10);return{value:n?n(s):s,rest:t.slice(i[0].length)}}function Et(e,t){var n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};var i=n[1]==="+"?1:-1,s=n[2]?parseInt(n[2],10):0,r=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:i*(s*Cg+r*Og+o*Tg),rest:t.slice(n[0].length)}}function Kl(e,t){return K(et.anyDigitsSigned,e,t)}function tt(e,t,n){switch(e){case 1:return K(et.singleDigit,t,n);case 2:return K(et.twoDigits,t,n);case 3:return K(et.threeDigits,t,n);case 4:return K(et.fourDigits,t,n);default:return K(new RegExp("^\\d{1,"+e+"}"),t,n)}}function Gi(e,t,n){switch(e){case 1:return K(et.singleDigitSigned,t,n);case 2:return K(et.twoDigitsSigned,t,n);case 3:return K(et.threeDigitsSigned,t,n);case 4:return K(et.fourDigitsSigned,t,n);default:return K(new RegExp("^-?\\d{1,"+e+"}"),t,n)}}function Jr(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Zl(e,t){var n=t>0,i=n?t:1-t,s;if(i<=50)s=e||100;else{var r=i+50,o=Math.floor(r/100)*100,a=e>=r%100;s=e+o-(a?100:0)}return n?s:1-s}var Pg=[31,28,31,30,31,30,31,31,30,31,30,31],Ag=[31,29,31,30,31,30,31,31,30,31,30,31];function Jl(e){return e%400===0||e%4===0&&e%100!==0}var Ig={G:{priority:140,parse:function(e,t,n,i){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});case"GGGG":default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}},set:function(e,t,n,i){return t.era=n,e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(e,t,n,i){var s=function(r){return{year:r,isTwoDigitYear:t==="yy"}};switch(t){case"y":return tt(4,e,s);case"yo":return n.ordinalNumber(e,{unit:"year",valueCallback:s});default:return tt(t.length,e,s)}},validate:function(e,t,n){return t.isTwoDigitYear||t.year>0},set:function(e,t,n,i){var s=e.getUTCFullYear();if(n.isTwoDigitYear){var r=Zl(n.year,s);return e.setUTCFullYear(r,0,1),e.setUTCHours(0,0,0,0),e}var o=!("era"in t)||t.era===1?n.year:1-n.year;return e.setUTCFullYear(o,0,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(e,t,n,i){var s=function(r){return{year:r,isTwoDigitYear:t==="YY"}};switch(t){case"Y":return tt(4,e,s);case"Yo":return n.ordinalNumber(e,{unit:"year",valueCallback:s});default:return tt(t.length,e,s)}},validate:function(e,t,n){return t.isTwoDigitYear||t.year>0},set:function(e,t,n,i){var s=ye(e,i);if(n.isTwoDigitYear){var r=Zl(n.year,s);return e.setUTCFullYear(r,0,i.firstWeekContainsDate),e.setUTCHours(0,0,0,0),mt(e,i)}var o=!("era"in t)||t.era===1?n.year:1-n.year;return e.setUTCFullYear(o,0,i.firstWeekContainsDate),e.setUTCHours(0,0,0,0),mt(e,i)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(e,t,n,i){return Gi(t==="R"?4:t.length,e)},set:function(e,t,n,i){var s=new Date(0);return s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0),vt(s)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(e,t,n,i){return Gi(t==="u"?4:t.length,e)},set:function(e,t,n,i){return e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(e,t,n,i){switch(t){case"Q":case"QQ":return tt(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=1&&t<=4},set:function(e,t,n,i){return e.setUTCMonth((n-1)*3,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(e,t,n,i){switch(t){case"q":case"qq":return tt(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,n){return t>=1&&t<=4},set:function(e,t,n,i){return e.setUTCMonth((n-1)*3,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(e,t,n,i){var s=function(r){return r-1};switch(t){case"M":return K(et.month,e,s);case"MM":return tt(2,e,s);case"Mo":return n.ordinalNumber(e,{unit:"month",valueCallback:s});case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=0&&t<=11},set:function(e,t,n,i){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(e,t,n,i){var s=function(r){return r-1};switch(t){case"L":return K(et.month,e,s);case"LL":return tt(2,e,s);case"Lo":return n.ordinalNumber(e,{unit:"month",valueCallback:s});case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,n){return t>=0&&t<=11},set:function(e,t,n,i){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(e,t,n,i){switch(t){case"w":return K(et.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return tt(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=53},set:function(e,t,n,i){return mt(Zr(e,n,i),i)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(e,t,n,i){switch(t){case"I":return K(et.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return tt(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=53},set:function(e,t,n,i){return vt(Kr(e,n,i),i)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(e,t,n,i){switch(t){case"d":return K(et.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return tt(t.length,e)}},validate:function(e,t,n){var i=e.getUTCFullYear(),s=Jl(i),r=e.getUTCMonth();return s?t>=1&&t<=Ag[r]:t>=1&&t<=Pg[r]},set:function(e,t,n,i){return e.setUTCDate(n),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(e,t,n,i){switch(t){case"D":case"DD":return K(et.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return tt(t.length,e)}},validate:function(e,t,n){var i=e.getUTCFullYear(),s=Jl(i);return s?t>=1&&t<=366:t>=1&&t<=365},set:function(e,t,n,i){return e.setUTCMonth(0,n),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(e,t,n,i){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=0&&t<=6},set:function(e,t,n,i){return e=Pn(e,n,i),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(e,t,n,i){var s=function(r){var o=Math.floor((r-1)/7)*7;return(r+i.weekStartsOn+6)%7+o};switch(t){case"e":case"ee":return tt(t.length,e,s);case"eo":return n.ordinalNumber(e,{unit:"day",valueCallback:s});case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=0&&t<=6},set:function(e,t,n,i){return e=Pn(e,n,i),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(e,t,n,i){var s=function(r){var o=Math.floor((r-1)/7)*7;return(r+i.weekStartsOn+6)%7+o};switch(t){case"c":case"cc":return tt(t.length,e,s);case"co":return n.ordinalNumber(e,{unit:"day",valueCallback:s});case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,n){return t>=0&&t<=6},set:function(e,t,n,i){return e=Pn(e,n,i),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(e,t,n,i){var s=function(r){return r===0?7:r};switch(t){case"i":case"ii":return tt(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return n.day(e,{width:"abbreviated",context:"formatting",valueCallback:s})||n.day(e,{width:"short",context:"formatting",valueCallback:s})||n.day(e,{width:"narrow",context:"formatting",valueCallback:s});case"iiiii":return n.day(e,{width:"narrow",context:"formatting",valueCallback:s});case"iiiiii":return n.day(e,{width:"short",context:"formatting",valueCallback:s})||n.day(e,{width:"narrow",context:"formatting",valueCallback:s});case"iiii":default:return n.day(e,{width:"wide",context:"formatting",valueCallback:s})||n.day(e,{width:"abbreviated",context:"formatting",valueCallback:s})||n.day(e,{width:"short",context:"formatting",valueCallback:s})||n.day(e,{width:"narrow",context:"formatting",valueCallback:s})}},validate:function(e,t,n){return t>=1&&t<=7},set:function(e,t,n,i){return e=Gr(e,n,i),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(e,t,n,i){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,n,i){return e.setUTCHours(Jr(n),0,0,0),e},incompatibleTokens:["b","B","H","K","k","t","T"]},b:{priority:80,parse:function(e,t,n,i){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,n,i){return e.setUTCHours(Jr(n),0,0,0),e},incompatibleTokens:["a","B","H","K","k","t","T"]},B:{priority:80,parse:function(e,t,n,i){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,n,i){return e.setUTCHours(Jr(n),0,0,0),e},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(e,t,n,i){switch(t){case"h":return K(et.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return tt(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=12},set:function(e,t,n,i){var s=e.getUTCHours()>=12;return s&&n<12?e.setUTCHours(n+12,0,0,0):!s&&n===12?e.setUTCHours(0,0,0,0):e.setUTCHours(n,0,0,0),e},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(e,t,n,i){switch(t){case"H":return K(et.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return tt(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=23},set:function(e,t,n,i){return e.setUTCHours(n,0,0,0),e},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(e,t,n,i){switch(t){case"K":return K(et.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return tt(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=11},set:function(e,t,n,i){var s=e.getUTCHours()>=12;return s&&n<12?e.setUTCHours(n+12,0,0,0):e.setUTCHours(n,0,0,0),e},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(e,t,n,i){switch(t){case"k":return K(et.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return tt(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=24},set:function(e,t,n,i){var s=n<=24?n%24:n;return e.setUTCHours(s,0,0,0),e},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(e,t,n,i){switch(t){case"m":return K(et.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return tt(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=59},set:function(e,t,n,i){return e.setUTCMinutes(n,0,0),e},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(e,t,n,i){switch(t){case"s":return K(et.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return tt(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=59},set:function(e,t,n,i){return e.setUTCSeconds(n,0),e},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(e,t,n,i){var s=function(r){return Math.floor(r*Math.pow(10,-t.length+3))};return tt(t.length,e,s)},set:function(e,t,n,i){return e.setUTCMilliseconds(n),e},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(e,t,n,i){switch(t){case"X":return Et(Lt.basicOptionalMinutes,e);case"XX":return Et(Lt.basic,e);case"XXXX":return Et(Lt.basicOptionalSeconds,e);case"XXXXX":return Et(Lt.extendedOptionalSeconds,e);case"XXX":default:return Et(Lt.extended,e)}},set:function(e,t,n,i){return t.timestampIsSet?e:new Date(e.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(e,t,n,i){switch(t){case"x":return Et(Lt.basicOptionalMinutes,e);case"xx":return Et(Lt.basic,e);case"xxxx":return Et(Lt.basicOptionalSeconds,e);case"xxxxx":return Et(Lt.extendedOptionalSeconds,e);case"xxx":default:return Et(Lt.extended,e)}},set:function(e,t,n,i){return t.timestampIsSet?e:new Date(e.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(e,t,n,i){return Kl(e)},set:function(e,t,n,i){return[new Date(n*1e3),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(e,t,n,i){return Kl(e)},set:function(e,t,n,i){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}},tc=Ig;var Lg=10,Eg=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rg=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Fg=/^'([^]*?)'?$/,Wg=/''/g,Ng=/\S/,zg=/[a-zA-Z]/;function Ki(e,t,n,i){_(3,arguments);var s=String(e),r=String(t),o=i||{},a=o.locale||qi;if(!a.match)throw new RangeError("locale must contain match property");var l=a.options&&a.options.firstWeekContainsDate,c=l==null?1:O(l),u=o.firstWeekContainsDate==null?c:O(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var f=a.options&&a.options.weekStartsOn,d=f==null?0:O(f),h=o.weekStartsOn==null?d:O(o.weekStartsOn);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(r==="")return s===""?M(n):new Date(NaN);var p={firstWeekContainsDate:u,weekStartsOn:h,locale:a},g=[{priority:Lg,subPriority:-1,set:Bg,index:0}],m,b=r.match(Rg).map(function(E){var X=E[0];if(X==="p"||X==="P"){var Z=ji[X];return Z(E,a.formatLong,p)}return E}).join("").match(Eg),x=[];for(m=0;m<b.length;m++){var y=b[m];!o.useAdditionalWeekYearTokens&&$i(y)&&$e(y,r,e),!o.useAdditionalDayOfYearTokens&&Xi(y)&&$e(y,r,e);var w=y[0],v=tc[w];if(v){var k=v.incompatibleTokens;if(Array.isArray(k)){for(var S=void 0,D=0;D<x.length;D++){var C=x[D].token;if(k.indexOf(C)!==-1||C===w){S=x[D];break}}if(S)throw new RangeError("The format string mustn't contain `".concat(S.fullToken,"` and `").concat(y,"` at the same time"))}else if(v.incompatibleTokens==="*"&&x.length)throw new RangeError("The format string mustn't contain `".concat(y,"` and any other token at the same time"));x.push({token:w,fullToken:y});var T=v.parse(s,y,a.match,p);if(!T)return new Date(NaN);g.push({priority:v.priority,subPriority:v.subPriority||0,set:v.set,validate:v.validate,value:T.value,index:g.length}),s=T.rest}else{if(w.match(zg))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");if(y==="''"?y="'":w==="'"&&(y=Hg(y)),s.indexOf(y)===0)s=s.slice(y.length);else return new Date(NaN)}}if(s.length>0&&Ng.test(s))return new Date(NaN);var P=g.map(function(E){return E.priority}).sort(function(E,X){return X-E}).filter(function(E,X,Z){return Z.indexOf(E)===X}).map(function(E){return g.filter(function(X){return X.priority===E}).sort(function(X,Z){return Z.subPriority-X.subPriority})}).map(function(E){return E[0]}),I=M(n);if(isNaN(I))return new Date(NaN);var j=Dn(I,ie(I)),ot={};for(m=0;m<P.length;m++){var R=P[m];if(R.validate&&!R.validate(j,R.value,p))return new Date(NaN);var B=R.set(j,ot,R.value,p);B[0]?(j=B[0],Qr(ot,B[1])):j=B}return j}function Bg(e,t){if(t.timestampIsSet)return e;var n=new Date(0);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}function Hg(e){return e.match(Fg)[1].replace(Wg,"'")}function Zi(e){_(1,arguments);var t=M(e);return t.setMinutes(0,0,0),t}function Ji(e){_(1,arguments);var t=M(e);return t.setMilliseconds(0),t}var ec=36e5,nc=6e4,Yg=2,ts={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ug=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Vg=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,qg=/^([+-])(\d{2})(?::?(\d{2}))?$/;function es(e,t){_(1,arguments);var n=t||{},i=n.additionalDigits==null?Yg:O(n.additionalDigits);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var s=jg(e),r;if(s.date){var o=Xg(s.date,i);r=$g(o.restDateString,o.year)}if(isNaN(r)||!r)return new Date(NaN);var a=r.getTime(),l=0,c;if(s.time&&(l=Qg(s.time),isNaN(l)||l===null))return new Date(NaN);if(s.timezone){if(c=Gg(s.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(a+l+c)}function jg(e){var t={},n=e.split(ts.dateTimeDelimiter),i;if(n.length>2)return t;if(/:/.test(n[0])?(t.date=null,i=n[0]):(t.date=n[0],i=n[1],ts.timeZoneDelimiter.test(t.date)&&(t.date=e.split(ts.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){var s=ts.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Xg(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:null};var s=i[1]&&parseInt(i[1]),r=i[2]&&parseInt(i[2]);return{year:r==null?s:r*100,restDateString:e.slice((i[1]||i[2]).length)}}function $g(e,t){if(t===null)return null;var n=e.match(Ug);if(!n)return null;var i=!!n[4],s=An(n[1]),r=An(n[2])-1,o=An(n[3]),a=An(n[4]),l=An(n[5])-1;if(i)return em(t,a,l)?Kg(t,a,l):new Date(NaN);var c=new Date(0);return!Jg(t,r,o)||!tm(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}function An(e){return e?parseInt(e):1}function Qg(e){var t=e.match(Vg);if(!t)return null;var n=to(t[1]),i=to(t[2]),s=to(t[3]);return nm(n,i,s)?n*ec+i*nc+s*1e3:NaN}function to(e){return e&&parseFloat(e.replace(",","."))||0}function Gg(e){if(e==="Z")return 0;var t=e.match(qg);if(!t)return 0;var n=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return im(i,s)?n*(i*ec+s*nc):NaN}function Kg(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var s=i.getUTCDay()||7,r=(t-1)*7+n+1-s;return i.setUTCDate(i.getUTCDate()+r),i}var Zg=[31,null,31,30,31,30,31,31,30,31,30,31];function ic(e){return e%400===0||e%4===0&&e%100}function Jg(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Zg[t]||(ic(e)?29:28))}function tm(e,t){return t>=1&&t<=(ic(e)?366:365)}function em(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function nm(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function im(e,t){return t>=0&&t<=59}var sm={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Nr._date.override({_id:"date-fns",formats:function(){return sm},parse:function(e,t){if(e===null||typeof e>"u")return null;let n=typeof e;return n==="number"||e instanceof Date?e=M(e):n==="string"&&(typeof t=="string"?e=Ki(e,t,new Date,this.options):e=es(e,this.options)),Ye(e)?e.getTime():null},format:function(e,t){return Qi(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return gt(e,t);case"second":return Di(e,t);case"minute":return ki(e,t);case"hour":return Mi(e,t);case"day":return He(e,t);case"week":return Ci(e,t);case"month":return ne(e,t);case"quarter":return Si(e,t);case"year":return Oi(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return At(e,t);case"second":return Ii(e,t);case"minute":return Pi(e,t);case"hour":return Ti(e,t);case"day":return Ue(e,t);case"week":return Li(e,t);case"month":return je(e,t);case"quarter":return Ai(e,t);case"year":return Ei(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return Ji(e);case"minute":return Ri(e);case"hour":return Zi(e);case"day":return me(e);case"week":return kn(e);case"isoWeek":return kn(e,{weekStartsOn:+n});case"month":return Wi(e);case"quarter":return Fi(e);case"year":return Ni(e);default:return e}},endOf:function(e,t){switch(t){case"second":return Vi(e);case"minute":return Yi(e);case"hour":return Bi(e);case"day":return Ve(e);case"week":return Hi(e);case"month":return qe(e);case"quarter":return Ui(e);case"year":return zi(e);default:return e}}});W.use(Fl);})();
6
+ /*! Bundled license information:
7
+
8
+ chartkick/dist/chartkick.esm.js:
9
+ (*!
10
+ * Chartkick.js v5.0.1
11
+ * Create beautiful charts with one line of JavaScript
12
+ * https://github.com/ankane/chartkick.js
13
+ * MIT License
14
+ *)
15
+
16
+ @kurkle/color/dist/color.esm.js:
17
+ (*!
18
+ * @kurkle/color v0.3.2
19
+ * https://github.com/kurkle/color#readme
20
+ * (c) 2023 Jukka Kurkela
21
+ * Released under the MIT License
22
+ *)
23
+
24
+ chart.js/dist/chunks/helpers.segment.js:
25
+ (*!
26
+ * Chart.js v4.4.4
27
+ * https://www.chartjs.org
28
+ * (c) 2024 Chart.js Contributors
29
+ * Released under the MIT License
30
+ *)
31
+
32
+ chart.js/dist/chart.js:
33
+ (*!
34
+ * Chart.js v4.4.4
35
+ * https://www.chartjs.org
36
+ * (c) 2024 Chart.js Contributors
37
+ * Released under the MIT License
38
+ *)
39
+
40
+ chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.esm.js:
41
+ (*!
42
+ * chartjs-adapter-date-fns v3.0.0
43
+ * https://www.chartjs.org
44
+ * (c) 2022 chartjs-adapter-date-fns Contributors
45
+ * Released under the MIT license
46
+ *)
47
+ */