diff --git a/public/js/app.js b/public/js/app.js index 3f6ebe9..8c64215 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,8 +1,8 @@ -import{t as e}from"./jquery.module.js";var t=Object.defineProperty,n=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};window.$=window.jQuery=e,e.migrateMute=!0;function i(e,t){e.migrateVersion=`4.0.2`;function n(e,t){var n,r=/^(\d+)\.(\d+)\.(\d+)/,i=r.exec(e)||[],a=r.exec(t)||[];for(n=1;n<=3;n++){if(+i[n]>+a[n])return 1;if(+i[n]<+a[n])return-1}return 0}function r(t){return n(e.fn.jquery,t)>=0}var i=Object.create(null);e.migrateDisablePatches=function(){var e;for(e=0;e1?(c(`legacy-custom-pseudos`,`Pseudos with multiple arguments are deprecated; use jQuery.expr.createPseudo()`),r=[t,t,``,n],e.expr.setFilters.hasOwnProperty(t.toLowerCase())?E(function(e,t){for(var r,a=i(e,n),o=a.length;o--;)r=Array.prototype.indexOf.call(e,a[o]),e[r]=!(t[r]=a[o])}):function(e){return i(e,0,r)}):i},`legacy-custom-pseudos`),typeof Proxy<`u`&&e.each([`pseudos`,`setFilters`],function(t,n){e.expr[n]=new Proxy(e.expr[n],{set:function(t,n,r){return typeof r==`function`&&!r[e.expando]&&r.length>1&&c(`legacy-custom-pseudos`,`Pseudos with multiple arguments are deprecated; use jQuery.expr.createPseudo()`),Reflect.set.apply(this,arguments)}})}),e.ajax){var D=[],ee=`migrate-`+Date.now(),O=e.ajaxSettings.jsonpCallback,te=/(=)\?(?=&|$)|\?\?/,k=/\?/;e.ajaxSetup({jsonpCallback:function(){if(e.migrateIsPatchEnabled(`jsonp-promotion`)){var t=D.pop()||e.expando+`_`+ee++;return this[t]=!0,t}return O.apply(this,arguments)}}),e.ajaxPrefilter(`+json`,function(n,r,i){if(e.migrateIsPatchEnabled(`jsonp-promotion`)){var a,o,c,l=n.jsonp!==!1&&(te.test(n.url)?`url`:typeof n.data==`string`&&(n.contentType||``).indexOf(`application/x-www-form-urlencoded`)===0&&te.test(n.data)&&`data`);if(l||n.dataTypes[0]===`jsonp`)return s(`jsonp-promotion`,`JSON-to-JSONP auto-promotion is removed`),a=n.jsonpCallback=typeof n.jsonpCallback==`function`?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(te,`$1`+a):n.jsonp!==!1&&(n.url+=(k.test(n.url)?`&`:`?`)+n.jsonp+`=`+a),n.converters[`script json`]=function(){return c||e.error(a+` was not called`),c[0]},n.dataTypes[0]=`json`,o=t[a],t[a]=function(){c=arguments},i.always(function(){o===void 0?e(t).removeProp(a):t[a]=o,n[a]&&(n.jsonpCallback=r.jsonpCallback,D.push(a)),c&&typeof o==`function`&&o(c[0]),c=o=void 0}),`script`}}),e.migrateDisablePatches(`jsonp-promotion`)}var A=e.attr,ne=e.fn.toggleClass,re=`checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped`,j=RegExp(`^(?:`+re+`)$`,`i`),M={hidden:[`until-found`]};e.each(re.split(`|`),function(t,n){var r=e.attrHooks[n]||{};e.attrHooks[n]={get:r.get||function(t){var r;return e.migrateIsPatchEnabled(`boolean-attributes`)&&(r=t.getAttribute(n),r!==n&&r!=null&&(M[n]||[]).indexOf(String(r).toLowerCase())===-1)?(s(`boolean-attributes`,`Boolean attribute '`+n+`' value is different from its lowercased name`),n.toLowerCase()):null},set:r.set||function(t,n,r){if(e.migrateIsPatchEnabled(`boolean-attributes`)&&n!==r&&(M[r]||[]).indexOf(String(n).toLowerCase())===-1)return n!==!1&&s(`boolean-attributes`,`Boolean attribute '`+r+`' is not set to its lowercased name`),n===!1?e.removeAttr(t,r):t.setAttribute(r,r),r}}}),g(e,`attr`,function(t,n,r){var i=t.nodeType;if(i===3||i===8||i===2||t.getAttribute===void 0)return A.apply(this,arguments);if(r===!1&&n.toLowerCase().indexOf(`aria-`)!==0&&!j.test(n)){s(`attr-false`,`Setting the non-ARIA non-boolean attribute '`+n+`' to false`),e.attr(t,n,`false`);return}return A.apply(this,arguments)},`attr-false`),g(e.fn,`toggleClass`,function(t){return t!==void 0&&typeof t!=`boolean`?ne.apply(this,arguments):(s(`toggleClass-bool`,`jQuery.fn.toggleClass( [ boolean ] ) is removed`),this.each(function(){var n=this.getAttribute&&this.getAttribute(`class`)||``;n&&e.data(this,`__className__`,n),this.setAttribute&&this.setAttribute(`class`,n||t===!1?``:e.data(this,`__className__`)||``)}))},`toggleClass-bool`);function ie(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}function ae(e,t){var n,r=t.warningId,i=t.apiName,a=[`__proto__`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],o=Object.create(null);for(n=0;n\x20\t\r\n\f]*)[^>]*)\/>/gi,he=function(e){var n=t.document.implementation.createHTMLDocument(``);return n.body.innerHTML=e,n.body&&n.body.innerHTML},ge=function(e){var t=e.replace(me,`<$1>`);t!==e&&he(e)!==he(t)&&s(`self-closed-tags`,`HTML tags must be properly nested and closed: `+e)};if(g(e,`htmlPrefilter`,function(e){return ge(e),e.replace(me,`<$1>`)},`self-closed-tags`),e.migrateDisablePatches(`self-closed-tags`),e.Deferred){var _e,P=e.Deferred;g(e,`Deferred`,function(e){var t=P(),n=t.promise();return h(t,`pipe`,t.pipe,`deferred-pipe`,`deferred.pipe() is deprecated`),h(n,`pipe`,n.pipe,`deferred-pipe`,`deferred.pipe() is deprecated`),e&&e.call(t,t),t},`deferred-pipe`),e.Deferred.exceptionHook=P.exceptionHook,e.Deferred.getErrorHook=P.getErrorHook,Object.defineProperty(e.Deferred,"getStackHook",{configurable:!0,enumerable:!0,get:function(){return e.migrateIsPatchEnabled(`deferred-getStackHook`)?(s(`deferred-getStackHook`,`jQuery.Deferred.getStackHook is removed; use jQuery.Deferred.getErrorHook`),e.Deferred.getErrorHook):_e},set:function(t){e.migrateIsPatchEnabled(`deferred-getStackHook`)?e.Deferred.getErrorHook!==t&&(s(`deferred-getStackHook`,`jQuery.Deferred.getStackHook is removed; use jQuery.Deferred.getErrorHook`),e.Deferred.getErrorHook=t):_e=t}})}return e}i(e,window);function a(e){return e+.5|0}var o=(e,t,n)=>Math.max(Math.min(e,n),t);function s(e){return o(a(e*2.55),0,255)}function c(e){return o(a(e*255),0,255)}function l(e){return o(a(e/2.55)/100,0,1)}function u(e){return o(a(e*100),0,100)}var d={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},f=[...`0123456789ABCDEF`],p=e=>f[e&15],m=e=>f[(e&240)>>4]+f[e&15],h=e=>(e&240)>>4==(e&15),g=e=>h(e.r)&&h(e.g)&&h(e.b)&&h(e.a);function _(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&d[e[1]]*17,g:255&d[e[2]]*17,b:255&d[e[3]]*17,a:t===5?d[e[4]]*17:255}:(t===7||t===9)&&(n={r:d[e[1]]<<4|d[e[2]],g:d[e[3]]<<4|d[e[4]],b:d[e[5]]<<4|d[e[6]],a:t===9?d[e[7]]<<4|d[e[8]]:255})),n}var v=(e,t)=>e<255?t(e):``;function y(e){var t=g(e)?p:m;return e?`#`+t(e.r)+t(e.g)+t(e.b)+v(e.a,t):void 0}var b=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function x(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function S(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function C(e,t,n){let r=x(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function w(e,t,n,r,i){return e===i?(t-n)/r+(t.5?l/(2-i-a):l/(i+a),s=w(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function E(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(c)}function D(e,t,n){return E(x,e,t,n)}function ee(e,t,n){return E(C,e,t,n)}function O(e,t,n){return E(S,e,t,n)}function te(e){return(e%360+360)%360}function k(e){let t=b.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?s(+t[5]):c(+t[5]));let i=te(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?ee(i,a,o):t[1]===`hsv`?O(i,a,o):D(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function A(e,t){var n=T(e);n[0]=te(n[0]+t),n=D(n),e.r=n[0],e.g=n[1],e.b=n[2]}function ne(e){if(!e)return;let t=T(e),n=t[0],r=u(t[1]),i=u(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${l(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var re={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`},j={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 M(){let e={},t=Object.keys(j),n=Object.keys(re),r,i,a,o,s;for(r=0;r>16&255,a>>8&255,a&255]}return e}var ie;function ae(e){ie||(ie=M(),ie.transparent=[0,0,0,0]);let t=ie[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var oe=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function N(e){let t=oe.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?s(e):o(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?s(r):o(r,0,255)),i=255&(t[4]?s(i):o(i,0,255)),a=255&(t[6]?s(a):o(a,0,255)),{r,g:i,b:a,a:n}}}function se(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${l(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var ce=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,le=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function ue(e,t,n){let r=le(l(e.r)),i=le(l(e.g)),a=le(l(e.b));return{r:c(ce(r+n*(le(l(t.r))-r))),g:c(ce(i+n*(le(l(t.g))-i))),b:c(ce(a+n*(le(l(t.b))-a))),a:e.a+n*(t.a-e.a)}}function de(e,t,n){if(e){let r=T(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=D(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function fe(e,t){return e&&Object.assign(t||{},e)}function pe(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=c(e[3]))):(t=fe(e,{r:0,g:0,b:0,a:1}),t.a=c(t.a)),t}function me(e){return e.charAt(0)===`r`?N(e):k(e)}var he=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=pe(t):n===`string`&&(r=_(t)||ae(t)||me(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=fe(this._rgb);return e&&(e.a=l(e.a)),e}set rgb(e){this._rgb=pe(e)}rgbString(){return this._valid?se(this._rgb):void 0}hexString(){return this._valid?y(this._rgb):void 0}hslString(){return this._valid?ne(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=ue(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=c(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=a(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return de(this._rgb,2,e),this}darken(e){return de(this._rgb,2,-e),this}saturate(e){return de(this._rgb,1,e),this}desaturate(e){return de(this._rgb,1,-e),this}rotate(e){return A(this._rgb,e),this}};function ge(){}var _e=(()=>{let e=0;return()=>e++})();function P(e){return e==null}function ve(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 F(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function ye(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function be(e,t){return ye(e)?e:t}function I(e,t){return e===void 0?t:e}var xe=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,Se=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function L(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function R(e,t,n,r){let i,a,o;if(ve(e)){if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;ie,x:e=>e.x,y:e=>e.y};function je(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function Me(e){let t=je(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Ne(e,t){return(Ae[t]||(Ae[t]=Me(t)))(e)}function Pe(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Fe=e=>e!==void 0,Ie=e=>typeof e==`function`,Le=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Re(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var z=Math.PI,ze=2*z,Be=ze+z,Ve=1/0,He=z/180,Ue=z/2,We=z/4,Ge=z*2/3,Ke=Math.log10,qe=Math.sign;function Je(e,t,n){return Math.abs(e-t)e-t).pop(),t}function Ze(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function B(e){return!Ze(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Qe(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function $e(e,t,n){let r,i,a;for(r=0,i=e.length;rc&&l=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ut(e,t,n){n||=(n=>e[n]1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var dt=(e,t,n,r)=>ut(e,n,r?r=>{let i=e[r][t];return ie[r][t]ut(e,n,r=>e[r][t]>=n);function pt(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{let n=`_onData`+Pe(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function gt(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(mt.forEach(t=>{delete e[t]}),delete e._chartjs)}function _t(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var vt=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function yt(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,vt.call(window,()=>{r=!1,e.apply(t,n)}))}}function bt(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var xt=e=>e===`start`?`left`:e===`end`?`right`:`center`,St=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,Ct=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function wt(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(dt(c,u,d).lo,n?r:dt(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!P(e[s.axis]));i-=Math.max(0,e)}i=st(i,0,r-1)}if(m){let e=Math.max(dt(c,o.axis,f,!0).hi+1,n?0:dt(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!P(e[s.axis]));e+=Math.max(0,t)}a=st(e,i,r)-i}else a=r-i}return{start:i,count:a}}function Tt(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var Et=e=>e===0||e===1,Dt=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*ze/n)),Ot=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*ze/n)+1,kt={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*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*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*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*Ue)+1,easeOutSine:e=>Math.sin(e*Ue),easeInOutSine:e=>-.5*(Math.cos(z*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>Et(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Et(e)?e:Dt(e,.075,.3),easeOutElastic:e=>Et(e)?e:Ot(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return Et(e)?e:e<.5?.5*Dt(e*2,t,n):.5+.5*Ot(e*2-1,t,n)},easeInBack(e){return e*e*(2.70158*e-1.70158)},easeOutBack(e){return--e*e*(2.70158*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-kt.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?kt.easeInBounce(e*2)*.5:kt.easeOutBounce(e*2-1)*.5+.5};function At(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function jt(e){return At(e)?e:new he(e)}function Mt(e){return At(e)?e:new he(e).saturate(.5).darken(.1).hexString()}var Nt=[`x`,`y`,`borderWidth`,`radius`,`tension`],Pt=[`color`,`borderColor`,`backgroundColor`];function Ft(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:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:Pt},numbers:{type:`number`,properties:Nt}}),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:e=>e|0}}}})}function It(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Lt=new Map;function Rt(e,t){t||={};let n=e+JSON.stringify(t),r=Lt.get(n);return r||(r=new Intl.NumberFormat(e,t),Lt.set(n,r)),r}function H(e,t,n){return Rt(t,n).format(e)}var zt={values(e){return ve(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Bt(e,n)}let o=Ke(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),H(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Ke(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?zt.numeric.call(this,e,t,n):``}};function Bt(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 Vt={formatters:zt};function Ht(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:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.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:Vt.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:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Ut=Object.create(null),Wt=Object.create(null);function Gt(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;te.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=(e,t)=>Mt(t.backgroundColor),this.hoverBorderColor=(e,t)=>Mt(t.borderColor),this.hoverColor=(e,t)=>Mt(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Kt(this,e,t)}get(e){return Gt(this,e)}describe(e,t){return Kt(Wt,e,t)}override(e,t){return Kt(Ut,e,t)}route(e,t,n,r){let i=Gt(this,e),a=Gt(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return F(e)?Object.assign({},t,e):I(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Ft,It,Ht]);function Jt(e){return!e||P(e.size)||P(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Yt(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Xt(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;cn.length){for(c=0;c0&&e.stroke()}}function tn(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,sn(e,a),c=0;c+e||0;function gn(e,t){let n={},r=F(t),i=r?Object.keys(t):t,a=F(e)?r?n=>I(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=hn(a(e));return n}function _n(e){return gn(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function vn(e){return gn(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function yn(e){let t=_n(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function bn(e,t){e||={},t||=qt.font;let n=I(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=I(e.style,t.style);r&&!(``+r).match(pn)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:I(e.family,t.family),lineHeight:mn(I(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:I(e.weight,t.weight),string:``};return i.string=Jt(i),i}function xn(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;an&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function Cn(e,t){return Object.assign(Object.create(e),t)}function wn(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=Bn(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>wn([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return kn(n,r,()=>zn(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Vn(e).includes(t)},ownKeys(e){return Vn(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function Tn(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:En(e,r),setContext:t=>Tn(e,t,n,r),override:i=>Tn(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return kn(e,t,()=>An(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function En(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Ie(n)?n:()=>n,isIndexable:Ie(r)?r:()=>r}}var Dn=(e,t)=>e?e+Pe(t):t,On=(e,t)=>F(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function kn(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function An(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Ie(s)&&o.isScriptable(t)&&(s=jn(t,s,e,n)),ve(s)&&s.length&&(s=Mn(t,s,e,o.isIndexable)),On(t,s)&&(s=Tn(s,i,a&&a[t],o)),s}function jn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),On(e,c)&&(c=In(i._scopes,i,e,c)),c}function Mn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(F(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=In(r,i,e,c);t.push(Tn(n,a,o&&o[e],s))}}return t}function Nn(e,t,n){return Ie(e)?e(t,n):e}var Pn=(e,t)=>e===!0?t:typeof e==`string`?Ne(t,e):void 0;function Fn(e,t,n,r,i){for(let a of t){let t=Pn(n,a);if(t){e.add(t);let a=Nn(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function In(e,t,n,r){let i=t._rootScopes,a=Nn(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Ln(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Ln(s,o,a,c,r),c===null)?!1:wn(Array.from(s),[``],i,a,()=>Rn(t,n,r))}function Ln(e,t,n,r,i){for(;n;)n=Fn(e,t,n,r,i);return n}function Rn(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return ve(i)&&F(n)?n:i||{}}function zn(e,t,n,r){let i;for(let a of t)if(i=Bn(Dn(a,e),n),i!==void 0)return On(e,i)?In(n,r,e,i):i}function Bn(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Vn(e){let t=e._keys;return t||=e._keys=Hn(e._scopes),t}function Hn(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}function Un(e,t,n,r){let{iScale:i}=e,{key:a=`r`}=this._parsing,o=Array(r),s,c,l,u;for(s=0,c=r;ste===`x`?`y`:`x`;function qn(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=it(a,i),c=it(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Jn(e,t,n){let r=e.length,i,a,o,s,c,l=Gn(e,0);for(let u=0;u!e.skip)),t.cubicInterpolationMode===`monotone`)Xn(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;ae.ownerDocument.defaultView.getComputedStyle(e,null);function ir(e,t){return rr(e).getPropertyValue(t)}var ar=[`top`,`right`,`bottom`,`left`];function or(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=ar[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var sr=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function cr(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(sr(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function lr(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=rr(n),a=i.boxSizing===`border-box`,o=or(i,`padding`),s=or(i,`border`,`width`),{x:c,y:l,box:u}=cr(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function ur(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&tr(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=rr(a),s=or(o,`border`,`width`),c=or(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=nr(o.maxWidth,a,`clientWidth`),i=nr(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||Ve,maxHeight:i||Ve}}var dr=e=>Math.round(e*10)/10;function fr(e,t,n,r){let i=rr(e),a=or(i,`margin`),o=nr(i.maxWidth,e,`clientWidth`)||Ve,s=nr(i.maxHeight,e,`clientHeight`)||Ve,c=ur(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=or(i,`border`,`width`),t=or(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=dr(Math.min(l,o,c.maxWidth)),u=dr(Math.min(u,s,c.maxHeight)),l&&!u&&(u=dr(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=dr(Math.floor(u*r))),{width:l,height:u}}function pr(e,t,n){let r=t||1,i=dr(e.height*r),a=dr(e.width*r);e.height=dr(e.height),e.width=dr(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!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var mr=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};er()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function hr(e,t){let n=ir(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function U(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function gr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function _r(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=U(e,i,n),s=U(i,a,n),c=U(a,t,n);return U(U(o,s,n),U(s,c,n),n)}var vr=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},W=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function yr(e,t,n){return e?vr(t,n):W()}function br(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function xr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function Sr(e){return e===`angle`?{between:ot,compare:at,normalize:V}:{between:lt,compare:(e,t)=>e-t,normalize:e=>e}}function Cr({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function wr(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=Sr(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;fc(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(Cr({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(Cr({start:g,end:d,loop:f,count:o,style:p})),m}function Er(e,t){let n=[],r=e.segments;for(let i=0;ii&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function Or(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function kr(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=Dr(n,i,a,r);return r===!0?Ar(e,[{start:o,end:s,loop:a}],n,t):Ar(e,Or(n,o,sr({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,vt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},Rr=`transparent`,zr={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=jt(e||Rr),i=r.valid&&jt(t||Rr);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Br=class{constructor(e,t,n,r){let i=t[n];r=xn([e.to,r,i,e.from]);let a=xn([e.from,i,r]);this._active=!0,this._fn=e.fn||zr[e.type||typeof a],this._easing=kt[e.easing]||kt.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=xn([e.to,t,r,e.from]),this._from=xn([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e{let i=e[r];if(!F(i))return;let a={};for(let e of t)a[e]=i[e];(ve(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Ur(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&Hr(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u){if(d&&u.active()){u.update(d,l,o);continue}u.cancel()}if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Br(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Lr.add(this._chart,n),!0}};function Hr(e,t){let n=[],r=Object.keys(t);for(let t=0;t0||!n&&t<0)return i.index}return null}function ti(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Zr(a,o,r),d=t.length,f;for(let e=0;en[e].axis===t).shift()}function ri(e,t){return Cn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function ii(e,t,n){return Cn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function ai(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var oi=e=>e===`reset`||e===`none`,si=(e,t)=>t?e:Object.assign({},e),ci=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:qr(n,!0),values:null},li=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Xr(e.vScale,e),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(e){this.index!==e&&ai(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=I(n.xAxisID,ni(e,`x`)),a=t.yAxisID=I(n.yAxisID,ni(e,`y`)),o=t.rAxisID=I(n.rAxisID,ni(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&>(this._data,this),e._stacked&&ai(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(F(t)){let e=this._cachedMeta;this._data=Yr(t,e)}else if(n!==t){if(n){gt(n,this);let e=this._cachedMeta;ai(e),e._parsed=[]}t&&Object.isExtensible(t)&&ht(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Xr(t.vScale,t),t.stack!==n.stack&&(r=!0,ai(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(ti(this,t._parsed),t._stacked=Xr(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length||n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=ve(r[e])?this.parseArrayData(n,r,e,t):F(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]t||u=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r=0&&ethis.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(si(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new Vr(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||oi(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){oi(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!oi(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;oe-t))}return e._cache.$bar}function di(e){let t=e.iScale,n=ui(t,e.type),r=t._length,i,a,o,s,c=()=>{o!==32767&&o!==-32768&&(Fe(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i0?i[e-1]:null,s=eMath.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function hi(e,t,n,r){return ve(e)?mi(e,t,n,r):t[n.axis]=n.parse(e,r),t}function gi(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l=n?1:-1):qe(e)}function yi(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.basee.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(P(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[I(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;i=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=t,a=this.getParsed(e),o=r.getLabelForValue(a.x),s=i.getLabelForValue(a.y),c=a._custom;return{label:n[e]||``,value:`(`+o+`, `+s+(c?`, `+c:``)+`)`}}update(e){let t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:s,includeOptions:c}=this._getSharedOptions(t,r),l=a.axis,u=o.axis;for(let d=t;dot(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>ot(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(Ue,u,f),_=m(z,l,d),v=m(z+Ue,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var Oi=class extends li{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:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(F(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Ne(n[t],e)}let a,o;for(a=e,o=e+t;a0&&!isNaN(e)?Math.abs(e)/t*ze:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=H(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r0&&this.getParsed(t-1);for(let n=0;n=_){v.skip=!0;continue}let b=this.getParsed(n),x=P(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},Ai=class extends li{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(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:n,color:r}}=e.legend.options;return t.labels.map((t,i)=>{let a=e.getDatasetMeta(0).controller.getStyle(i);return{text:t,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(i),index:i}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:`radialLinear`,angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=H(t._parsed[e].r,n.options.locale);return{label:r[e]||``,value:i}}parseObjectData(e,t,n,r){return Un.bind(this)(e,t,n,r)}update(e){let t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){let e=this._cachedMeta,t={min:1/0,max:-1/0};return e.data.forEach((e,n)=>{let r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(rt.max&&(t.max=r))}),t}_updateRadius(){let e=this.chart,t=e.chartArea,n=e.options,r=Math.min(t.right-t.left,t.bottom-t.top),i=Math.max(r/2,0),a=(i-Math.max(n.cutoutPercentage?i/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.options.animation,s=this._cachedMeta.rScale,c=s.xCenter,l=s.yCenter,u=s.getIndexAngle(0)-.5*z,d=u,f,p=360/this.countVisibleElements();for(f=0;f{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++}),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?et(this.resolveDataElementOptions(e,t).angle||n):0}},ji=Object.freeze({__proto__:null,BarController:Ti,BubbleController:Ei,DoughnutController:Oi,LineController:ki,PieController:class extends Oi{static id=`pie`;static defaults={cutout:0,rotation:0,circumference:360,radius:`100%`}},PolarAreaController:Ai,RadarController:class extends li{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(e){let t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:``+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,r){return Un.bind(this)(e,t,n,r)}update(e){let t=this._cachedMeta,n=t.dataset,r=t.data||[],i=t.iScale.getLabels();if(n.points=r,e!==`resize`){let t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);let a={_loop:!0,_fullLoop:i.length===r.length,options:t};this.updateElement(n,void 0,a,e)}this.updateElements(r,0,r.length,e)}updateElements(e,t,n,r){let i=this._cachedMeta.rScale,a=r===`reset`;for(let o=t;o0&&this.getParsed(t-1);for(let l=t;l0&&Math.abs(n[f]-v[f])>g,h&&(m.parsed=n,m.raw=c.data[l]),d&&(m.options=u||this.resolveDataElementOptions(l,t.active?`active`:r)),_||this.updateElement(t,l,m,r),v=n}this.updateSharedOptions(u,r,l)}getMaxOverflow(){let e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}let n=e.dataset,r=n.options&&n.options.borderWidth||0;if(!t.length)return r;let i=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,i,a)/2}}});function Mi(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var Ni={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Mi()}parse(){return Mi()}format(){return Mi()}add(){return Mi()}diff(){return Mi()}startOf(){return Mi()}endOf(){return Mi()}}};function Pi(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ft:dt;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!P(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!P(e[t.axis]));r.hi+=Math.max(0,o)}return r}if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function Fi(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Hi={evaluateInteractionItems:Fi,modes:{index(e,t,n,r){let i=lr(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Li(e,i,a,r,o):Bi(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=lr(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Li(e,i,a,r,o):Bi(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;ee.pos===t)}function Gi(e,t){return e.filter(e=>Ui.indexOf(e.pos)===-1&&e.box.axis===t)}function Ki(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function qi(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;ne.box.fullSize),!0),r=Ki(Wi(t,`left`),!0),i=Ki(Wi(t,`right`)),a=Ki(Wi(t,`top`),!0),o=Ki(Wi(t,`bottom`)),s=Gi(t,`x`),c=Gi(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:Wi(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function Zi(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Qi(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 $i(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!F(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&Qi(o,a.getPadding());let s=Math.max(0,t.outerWidth-Zi(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-Zi(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function ea(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function ta(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function na(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Qi(f,yn(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Yi(c.concat(l),d);na(s.fullSize,p,d,m),na(c,p,d,m),na(l,p,d,m)&&na(c,p,d,m),ea(p),ia(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,ia(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},R(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},oa=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},sa=class extends oa{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},ca=`$chartjs`,la={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},ua=e=>e===null||e===``;function G(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[ca]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,ua(i)){let t=hr(e,`width`);t!==void 0&&(e.width=t)}if(ua(r)){if(e.style.height===``)e.height=e.width/(t||2);else{let t=hr(e,`height`);t!==void 0&&(e.height=t)}}return e}var da=mr?{passive:!0}:!1;function fa(e,t,n){e&&e.addEventListener(t,n,da)}function pa(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,da)}function ma(e,t){let n=la[e.type]||e.type,{x:r,y:i}=lr(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function ha(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function ga(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ha(n.addedNodes,r),t&&=!ha(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function _a(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ha(n.removedNodes,r),t&&=!ha(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var va=new Map,ya=0;function ba(){let e=window.devicePixelRatio;e!==ya&&(ya=e,va.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function xa(e,t){va.size||window.addEventListener(`resize`,ba),va.set(e,t)}function Sa(e){va.delete(e),va.size||window.removeEventListener(`resize`,ba)}function Ca(e,t,n){let r=e.canvas,i=r&&tr(r);if(!i)return;let a=yt((e,t)=>{let r=i.clientWidth;n(e,t),r{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;(n!==0||r!==0)&&a(n,r)});return o.observe(i),xa(e,a),o}function wa(e,t,n){n&&n.disconnect(),t===`resize`&&Sa(e)}function Ta(e,t,n){let r=e.canvas,i=yt(t=>{e.ctx!==null&&n(ma(t,e))},e);return fa(r,t,i),i}var Ea=class extends oa{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(G(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[ca])return!1;let n=t[ca].initial;[`height`,`width`].forEach(e=>{let r=n[e];P(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[ca],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:ga,detach:_a,resize:Ca}[t]||Ta)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:wa,detach:wa,resize:wa}[t]||pa)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return fr(e,t,n,r)}isAttached(e){let t=e&&tr(e);return!!(t&&t.isConnected)}};function Da(e){return!er()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?sa:Ea}var Oa=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return B(this.x)&&B(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function ka(e,t){let n=e.options.ticks,r=Aa(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?Ma(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Na(t,l,a,o/i),l;let u=ja(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(Pa(t,l,u,P(r)?0:s-r,s),e=0,n=o-1;ei)return t}return Math.max(i,1)}function Ma(e){let t=[],n,r;for(n=0,r=e.length;ne===`left`?`right`:e===`right`?`left`:e,La=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Ra=(e,t)=>Math.min(t||e,e);function za(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;ao+s)))return c}function Va(e,t){R(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;in?n:t,n=r&&t>n?t:n,{min:be(t,be(n,t)),max:be(n,be(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){L(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Sn(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=st(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-Ha(e.grid)-t.padding-Ua(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=tt(Math.min(Math.asin(st((l.highest.height+6)/o,-1,1)),Math.asin(st(s/c,-1,1))-Math.asin(st(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){L(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){L(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Ua(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=Ha(i)+a):(e.height=this.maxHeight,e.width=Ha(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=et(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){L(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ct(this._alignToPixels?Zt(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&eo*r?o/n:s/r:s*r0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=Ha(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Zt(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(F(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(F(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=I(r.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/ee));for(_=0;_0&&(a-=r/2)}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-et(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);qt.route(a,i,c,s)})}function Qa(e){return`id`in e&&`defaults`in e}var $a=new class{constructor(){this.controllers=new Ya(li,`datasets`,!0),this.elements=new Ya(Oa,`elements`),this.plugins=new Ya(Object,`plugins`),this.scales=new Ya(Ja,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):R(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Pe(e);L(n[`before`+r],[],n),t[e](n),L(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;te.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function to(e){let t={},n=[],r=Object.keys($a.plugins.items);for(let e=0;e1&&co(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function fo(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function po(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return fo(e,`x`,n[0])||fo(e,`y`,n[0])}return{}}function mo(e,t){let n=Ut[e.type]||{scales:{}},r=t.scales||{},i=ao(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!F(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=uo(t,o,po(t,e),qt.scales[o.type]),c=so(s,i),l=n.scales||{};a[t]=Oe(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||ao(i,t),s=(Ut[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=oo(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),Oe(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];Oe(t,[qt.scales[t.type],qt.scale])}),a}function ho(e){let t=e.options||={};t.plugins=I(t.plugins,{}),t.scales=mo(e,t)}function go(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function _o(e){return e||={},e.data=go(e.data),ho(e),e}var vo=new Map,yo=new Set;function bo(e,t){let n=vo.get(e);return n||(n=t(),vo.set(e,n),yo.add(n)),n}var xo=(e,t,n)=>{let r=Ne(t,n);r!==void 0&&e.add(r)},So=class{constructor(e){this._config=_o(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=go(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),ho(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return bo(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return bo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return bo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return bo(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>xo(s,e,t))),t.forEach(e=>xo(s,r,e)),t.forEach(e=>xo(s,Ut[i]||{},e)),t.forEach(e=>xo(s,qt,e)),t.forEach(e=>xo(s,Wt,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),yo.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Ut[t]||{},qt.datasets[t]||{},{type:t},qt,Wt]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=Co(this._resolverCache,e,r),s=a;if(To(a,t)){i.$shared=!1,n=Ie(n)?n():n;let t=this.createResolver(e,n,o);s=Tn(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=Co(this._resolverCache,e,n);return F(t)?Tn(i,t,void 0,r):i}};function Co(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:wn(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var wo=e=>F(e)&&Object.getOwnPropertyNames(e).some(t=>Ie(e[t]));function To(e,t){let{isScriptable:n,isIndexable:r}=En(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Ie(o)||wo(o))||a&&ve(o))return!0}return!1}var Eo=`4.5.1`,Do=[`top`,`bottom`,`left`,`right`,`chartArea`];function Oo(e,t){return e===`top`||e===`bottom`||Do.indexOf(e)===-1&&t===`x`}function ko(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Ao(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),L(n&&n.onComplete,[e],t)}function jo(e){let t=e.chart,n=t.options.animation;L(n&&n.onProgress,[e],t)}function Mo(e){return er()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var No={},K=e=>{let t=Mo(e);return Object.values(No).filter(e=>e.canvas===t).pop()};function Po(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Fo(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var Io=class{static defaults=qt;static instances=No;static overrides=Ut;static registry=$a;static version=Eo;static getChart=K;static register(...e){$a.add(...e),Lo()}static unregister(...e){$a.remove(...e),Lo()}constructor(e,t){let n=this.config=new So(t),r=Mo(e),i=K(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(Da(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=_e(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new eo,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=bt(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],No[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}Lr.listen(this,`complete`,Ao),Lr.listen(this,`progress`,jo),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return P(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return $a}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():pr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Qt(this.canvas,this.ctx),this}stop(){return Lr.stop(this),this}resize(e,t){Lr.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,pr(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),L(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){R(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=uo(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),R(i,t=>{let i=t.options,a=i.id,o=uo(a,i),s=I(i.type,t.dtype);(i.position===void 0||Oo(i.position,o)!==Oo(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new($a.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),R(r,(e,t)=>{e||delete n[t]}),R(n,e=>{aa.configure(this,e,e.options),aa.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;et.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(ko(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){R(this.scales,e=>{aa.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!Le(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)Po(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;ee.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;aa.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],R(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Ir(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&nn(t,r),e.controller.draw(),r&&rn(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return tn(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Hi.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=Cn(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);Fe(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Lr.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};R(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){R(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},R(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});Ce(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Re(e),c=Fo(e,this._lastEvent,n,s);n&&(this._lastEvent=null,L(i.onHover,[e,o,this],this),s&&L(i.onClick,[e,o,this],this));let l=!Ce(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Lo(){return R(Io.instances,e=>e._plugins.invalidate())}function Ro(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,V(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,V(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*V(r-n));if(u===`round`)e.arc(i,a,t,n-z/2,r+z/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+z/2)+i,c=-o*Math.sin(n+z/2)+a,l=o*Math.cos(r+z/2)+i,u=o*Math.sin(r+z/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function zo(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+Ue,r-Ue),e.closePath(),e.clip()}function Bo(e){return gn(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function Vo(e,t,n,r){let i=Bo(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return st(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:st(i.innerStart,0,o),innerEnd:st(i.innerEnd,0,o)}}function Ho(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Uo(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/z)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=Vo(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,ee=g+b/E,O=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=Ho(C,T,o,s);e.arc(t.x,t.y,y,T,_+Ue)}let n=Ho(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=Ho(D,O,o,s);e.arc(t.x,t.y,x,_+Ue,O+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=Ho(E,ee,o,s);e.arc(t.x,t.y,b,ee+Math.PI,g-Ue)}let i=Ho(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=Ho(S,w,o,s);e.arc(t.x,t.y,v,g-Ue,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Wo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Uo(e,t,n,r,c,i);for(let t=0;t=z&&p===0&&u!==`miter`&&Ro(e,t,h),a||(Uo(e,t,n,r,h,i),e.stroke())}var Ko=class extends Oa{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,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=rt(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=I(l,o-a),f=ot(r,a,o)&&a!==o,p=d>=ze||f,m=lt(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>ze?Math.floor(n/ze):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(z,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Wo(e,this,s,i,a),Go(e,this,s,i,a),e.restore()}};function qo(e,t,n=t){e.lineCap=I(n.borderCapStyle,t.borderCapStyle),e.setLineDash(I(n.borderDash,t.borderDash)),e.lineDashOffset=I(n.borderDashOffset,t.borderDashOffset),e.lineJoin=I(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=I(n.borderWidth,t.borderWidth),e.strokeStyle=I(n.borderColor,t.borderColor)}function Jo(e,t,n){e.lineTo(n.x,n.y)}function Yo(e){return e.stepped?an:e.tension||e.cubicInterpolationMode===`monotone`?on:Jo}function Xo(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=is&&a>s;return{count:r,start:c,loop:t.loop,ilen:l(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(ng&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function $o(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?Qo:Zo}function es(e){return e.stepped?gr:e.tension||e.cubicInterpolationMode===`monotone`?_r:U}function ts(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),qo(e,t.options),e.stroke(i)}function ns(e,t,n,r){let{segments:i,options:a}=t,o=$o(t);for(let s of i)qo(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var rs=typeof Path2D==`function`;function is(e,t,n,r){rs&&!t.options.segment?ts(e,t,n,r):ns(e,t,n,r)}var as=class extends Oa{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:e=>e!==`borderDash`&&e!==`fill`};constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;$n(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=kr(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=Er(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=es(n),c,l;for(c=0,l=a.length;ce.replace(`rgb(`,`rgba(`).replace(`)`,`, 0.5)`));function bs(e){return vs[e%vs.length]}function xs(e){return ys[e%ys.length]}function Ss(e,t){return e.borderColor=bs(t),e.backgroundColor=xs(t),++t}function Cs(e,t){return e.backgroundColor=e.data.map(()=>bs(t++)),t}function ws(e,t){return e.backgroundColor=e.data.map(()=>xs(t++)),t}function Ts(e){let t=0;return(n,r)=>{let i=e.getDatasetMeta(r).controller;i instanceof Oi?t=Cs(n,t):i instanceof Ai?t=ws(n,t):i&&(t=Ss(n,t))}}function Es(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Ds(e){return e&&(e.borderColor||e.backgroundColor)}function Os(){return qt.borderColor!==`rgba(0,0,0,0.1)`||qt.backgroundColor!==`rgba(0,0,0,0.1)`}var ks={id:`colors`,defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;let{data:{datasets:r},options:i}=e.config,{elements:a}=i,o=Es(r)||Ds(i)||a&&Es(a)||Os();if(!n.forceOverride&&o)return;let s=Ts(e);r.forEach(s)}};function As(e,t,n,r,i){let a=i.samples||r;if(a>=n)return e.slice(t,t+n);let o=[],s=(n-2)/(a-2),c=0,l=t+n-1,u=t,d,f,p,m,h;for(o[c++]=e[u],d=0;dp&&(p=m,f=e[a],h=a);o[c++]=f,u=h}return o[c++]=e[l],o}function js(e,t,n,r){let i=0,a=0,o,s,c,l,u,d,f,p,m,h,g=[],_=t+n-1,v=e[t].x,y=e[_].x-v;for(o=t;oh&&(h=l,f=o),i=(a*i+s.x)/++a;else{let n=o-1;if(!P(d)&&!P(f)){let t=Math.min(d,f),r=Math.max(d,f);t!==p&&t!==n&&g.push({...e[t],x:i}),r!==p&&r!==n&&g.push({...e[r],x:i})}o>0&&n!==p&&g.push(e[n]),g.push(s),u=t,a=0,m=h=l,d=f=p=o}}return g}function Ms(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 Ns(e){e.data.datasets.forEach(e=>{Ms(e)})}function Ps(e,t){let n=t.length,r=0,i,{iScale:a}=e,{min:o,max:s,minDefined:c,maxDefined:l}=a.getUserBounds();return c&&(r=st(dt(t,a.axis,o).lo,0,n-1)),i=l?st(dt(t,a.axis,s).hi+1,r,n)-r:n-r,{start:r,count:i}}var Fs={id:`decimation`,defaults:{algorithm:`min-max`,enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ns(e);return}let r=e.width;e.data.datasets.forEach((t,i)=>{let{_data:a,indexAxis:o}=t,s=e.getDatasetMeta(i),c=a||t.data;if(xn([o,e.options.indexAxis])===`y`||!s.controller.supportsDecimation)return;let l=e.scales[s.xAxisID];if(l.type!==`linear`&&l.type!==`time`||e.options.parsing)return;let{start:u,count:d}=Ps(s,c);if(d<=(n.threshold||4*r)){Ms(t);return}P(a)&&(t._data=c,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}}));let f;switch(n.algorithm){case`lttb`:f=As(c,u,d,r,n);break;case`min-max`:f=js(c,u,d,r);break;default:throw Error(`Unsupported decimation algorithm '${n.algorithm}'`)}t._decimated=f})},destroy(e){Ns(e)}};function Is(e,t,n){let r=e.segments,i=e.points,a=t.points,o=[];for(let e of r){let{start:r,end:s}=e;s=zs(r,s,i);let c=Ls(n,i[r],i[s],e.loop);if(!t.segments){o.push({source:e,target:c,start:i[r],end:i[s]});continue}let l=Er(t,c);for(let t of l){let r=Ls(n,a[t.start],a[t.end],t.loop),s=Tr(e,i,r);for(let e of s)o.push({source:e,target:t,start:{[n]:Bs(c,r,`start`,Math.max)},end:{[n]:Bs(c,r,`end`,Math.min)}})}}return o}function Ls(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e===`angle`&&(i=V(i),a=V(a)),{property:e,start:i,end:a}}function Rs(e,t){let{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:e,end:t})=>{t=zs(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function zs(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function Bs(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Vs(e,t){let n=[],r=!1;return ve(e)?(r=!0,n=e):n=Rs(e,t),n.length?new as({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Hs(e){return e&&e.fill!==!1}function Us(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!ye(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function Ws(e,t,n){let r=Js(e);if(F(r))return!isNaN(r.value)&&r;let i=parseFloat(r);return ye(i)&&Math.floor(i)===i?Gs(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function Gs(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Ks(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:F(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function qs(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:F(e)?e.value:t.getBaseValue(),r}function Js(e){let t=e.options,n=t.fill,r=I(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function Ys(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=Xs(t,n);s.push(Vs({x:null,y:t.bottom},r));for(let e=0;e=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&ac(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;Hs(n)&&ac(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!Hs(r)||n.drawTime!==`beforeDatasetDraw`||ac(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},pc=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},mc=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,hc=class extends Oa{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=L(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=bn(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=pc(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=gc(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=yr(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=St(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=St(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=St(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=St(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;nn(e,this),this._draw(),rn(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=qt.color,s=yr(e.rtl,this.left,this.width),c=bn(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=pc(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=I(n.lineWidth,1);if(r.fillStyle=I(n.fillStyle,o),r.lineCap=I(n.lineCap,`butt`),r.lineDashOffset=I(n.lineDashOffset,0),r.lineJoin=I(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=I(n.strokeStyle,o),r.setLineDash(I(n.lineDash,[])),a.usePointStyle){let o={radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},c=s.xPlus(e,p/2),l=t+d;en(r,o,c,l,a.pointStyleWidth&&p)}else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=vn(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?dn(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){un(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:St(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:St(i,this.top+y+l,this.bottom-t[0].height),line:0},br(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=St(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=St(i,this.top+y+l,this.bottom-t[f.line].height));let w=s.x(S);if(g(w,C,o),S=Ct(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=yc(o,e)+l}else f.y+=b}),xr(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=bn(t.font),r=yn(t.padding);if(!t.display)return;let i=yr(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=St(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+St(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=St(o,u,u+d);a.textAlign=i.textAlign(xt(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,un(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=bn(e.font),n=yn(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(lt(e,this.left,this.right)&<(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;ne.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function vc(e,t,n){let r=e;return typeof t.text!=`string`&&(r=yc(t,n)),r}function yc(e,t){return t*(e.text?e.text.length:0)}function bc(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var xc={id:`legend`,_element:hc,start(e,t,n){let r=e.legend=new hc({ctx:e.ctx,options:n,chart:e});aa.configure(e,r,n),aa.addBox(e,r)},stop(e){aa.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;aa.configure(e,r,n),r.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 r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),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:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=yn(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.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)}}},Sc=class extends Oa{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=ve(n.text)?n.text.length:1;this._padding=yn(n.padding);let i=r*bn(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){let e=this.options.position;return e===`top`||e===`bottom`}_drawArgs(e){let{top:t,left:n,bottom:r,right:i,options:a}=this,o=a.align,s=0,c,l,u;return this.isHorizontal()?(l=St(o,n,i),u=t+e,c=i-n):(a.position===`left`?(l=n+e,u=St(o,r,t),s=z*-.5):(l=i-e,u=St(o,t,r),s=z*.5),c=r-t),{titleX:l,titleY:u,maxWidth:c,rotation:s}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=bn(t.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:o,rotation:s}=this._drawArgs(r);un(e,t.text,0,0,n,{color:t.color,maxWidth:o,rotation:s,textAlign:xt(t.align),textBaseline:`middle`,translation:[i,a]})}};function Cc(e,t){let n=new Sc({ctx:e.ctx,options:t,chart:e});aa.configure(e,n,t),aa.addBox(e,n),e.titleBlock=n}var wc={id:`title`,_element:Sc,start(e,t,n){Cc(e,n)},stop(e){let t=e.titleBlock;aa.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let r=e.titleBlock;aa.configure(e,r,n),r.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}},Tc=new WeakMap,Ec={id:`subtitle`,start(e,t,n){let r=new Sc({ctx:e.ctx,options:n,chart:e});aa.configure(e,r,n),aa.addBox(e,r),Tc.set(e,r)},stop(e){aa.removeBox(e,Tc.get(e)),Tc.delete(e)},beforeUpdate(e,t,n){let r=Tc.get(e);aa.configure(e,r,n),r.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}},Dc={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;te+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};window.$=window.jQuery=e,e.migrateMute=!0;function i(e,t){e.migrateVersion=`4.0.2`;function n(e,t){var n,r=/^(\d+)\.(\d+)\.(\d+)/,i=r.exec(e)||[],a=r.exec(t)||[];for(n=1;n<=3;n++){if(+i[n]>+a[n])return 1;if(+i[n]<+a[n])return-1}return 0}function r(t){return n(e.fn.jquery,t)>=0}var i=Object.create(null);e.migrateDisablePatches=function(){for(var e=0;e1?(c(`legacy-custom-pseudos`,`Pseudos with multiple arguments are deprecated; use jQuery.expr.createPseudo()`),r=[t,t,``,n],e.expr.setFilters.hasOwnProperty(t.toLowerCase())?E(function(e,t){for(var r,a=i(e,n),o=a.length;o--;)r=Array.prototype.indexOf.call(e,a[o]),e[r]=!(t[r]=a[o])}):function(e){return i(e,0,r)}):i},`legacy-custom-pseudos`),typeof Proxy<`u`&&e.each([`pseudos`,`setFilters`],function(t,n){e.expr[n]=new Proxy(e.expr[n],{set:function(t,n,r){return typeof r==`function`&&!r[e.expando]&&r.length>1&&c(`legacy-custom-pseudos`,`Pseudos with multiple arguments are deprecated; use jQuery.expr.createPseudo()`),Reflect.set.apply(this,arguments)}})}),e.ajax){var D=[],ee=`migrate-`+Date.now(),O=e.ajaxSettings.jsonpCallback,te=/(=)\?(?=&|$)|\?\?/,k=/\?/;e.ajaxSetup({jsonpCallback:function(){if(e.migrateIsPatchEnabled(`jsonp-promotion`)){var t=D.pop()||e.expando+`_`+ee++;return this[t]=!0,t}return O.apply(this,arguments)}}),e.ajaxPrefilter(`+json`,function(n,r,i){if(e.migrateIsPatchEnabled(`jsonp-promotion`)){var a,o,c,l=n.jsonp!==!1&&(te.test(n.url)?`url`:typeof n.data==`string`&&(n.contentType||``).indexOf(`application/x-www-form-urlencoded`)===0&&te.test(n.data)&&`data`);if(l||n.dataTypes[0]===`jsonp`)return s(`jsonp-promotion`,`JSON-to-JSONP auto-promotion is removed`),a=n.jsonpCallback=typeof n.jsonpCallback==`function`?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(te,`$1`+a):n.jsonp!==!1&&(n.url+=(k.test(n.url)?`&`:`?`)+n.jsonp+`=`+a),n.converters[`script json`]=function(){return c||e.error(a+` was not called`),c[0]},n.dataTypes[0]=`json`,o=t[a],t[a]=function(){c=arguments},i.always(function(){o===void 0?e(t).removeProp(a):t[a]=o,n[a]&&(n.jsonpCallback=r.jsonpCallback,D.push(a)),c&&typeof o==`function`&&o(c[0]),c=o=void 0}),`script`}}),e.migrateDisablePatches(`jsonp-promotion`)}var A=e.attr,ne=e.fn.toggleClass,re=`checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped`,j=RegExp(`^(?:`+re+`)$`,`i`),M={hidden:[`until-found`]};e.each(re.split(`|`),function(t,n){var r=e.attrHooks[n]||{};e.attrHooks[n]={get:r.get||function(t){var r;return e.migrateIsPatchEnabled(`boolean-attributes`)&&(r=t.getAttribute(n),r!==n&&r!=null&&(M[n]||[]).indexOf(String(r).toLowerCase())===-1)?(s(`boolean-attributes`,`Boolean attribute '`+n+`' value is different from its lowercased name`),n.toLowerCase()):null},set:r.set||function(t,n,r){if(e.migrateIsPatchEnabled(`boolean-attributes`)&&n!==r&&(M[r]||[]).indexOf(String(n).toLowerCase())===-1)return n!==!1&&s(`boolean-attributes`,`Boolean attribute '`+r+`' is not set to its lowercased name`),n===!1?e.removeAttr(t,r):t.setAttribute(r,r),r}}}),g(e,`attr`,function(t,n,r){var i=t.nodeType;if(i===3||i===8||i===2||t.getAttribute===void 0)return A.apply(this,arguments);if(r===!1&&n.toLowerCase().indexOf(`aria-`)!==0&&!j.test(n)){s(`attr-false`,`Setting the non-ARIA non-boolean attribute '`+n+`' to false`),e.attr(t,n,`false`);return}return A.apply(this,arguments)},`attr-false`),g(e.fn,`toggleClass`,function(t){return t!==void 0&&typeof t!=`boolean`?ne.apply(this,arguments):(s(`toggleClass-bool`,`jQuery.fn.toggleClass( [ boolean ] ) is removed`),this.each(function(){var n=this.getAttribute&&this.getAttribute(`class`)||``;n&&e.data(this,`__className__`,n),this.setAttribute&&this.setAttribute(`class`,n||t===!1?``:e.data(this,`__className__`)||``)}))},`toggleClass-bool`);function ie(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}function ae(e,t){var n,r=t.warningId,i=t.apiName,a=[`__proto__`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],o=Object.create(null);for(n=0;n\x20\t\r\n\f]*)[^>]*)\/>/gi,he=function(e){var n=t.document.implementation.createHTMLDocument(``);return n.body.innerHTML=e,n.body&&n.body.innerHTML},ge=function(e){var t=e.replace(me,`<$1>`);t!==e&&he(e)!==he(t)&&s(`self-closed-tags`,`HTML tags must be properly nested and closed: `+e)};if(g(e,`htmlPrefilter`,function(e){return ge(e),e.replace(me,`<$1>`)},`self-closed-tags`),e.migrateDisablePatches(`self-closed-tags`),e.Deferred){var _e,P=e.Deferred;g(e,`Deferred`,function(e){var t=P(),n=t.promise();return h(t,`pipe`,t.pipe,`deferred-pipe`,`deferred.pipe() is deprecated`),h(n,`pipe`,n.pipe,`deferred-pipe`,`deferred.pipe() is deprecated`),e&&e.call(t,t),t},`deferred-pipe`),e.Deferred.exceptionHook=P.exceptionHook,e.Deferred.getErrorHook=P.getErrorHook,Object.defineProperty(e.Deferred,"getStackHook",{configurable:!0,enumerable:!0,get:function(){return e.migrateIsPatchEnabled(`deferred-getStackHook`)?(s(`deferred-getStackHook`,`jQuery.Deferred.getStackHook is removed; use jQuery.Deferred.getErrorHook`),e.Deferred.getErrorHook):_e},set:function(t){e.migrateIsPatchEnabled(`deferred-getStackHook`)?e.Deferred.getErrorHook!==t&&(s(`deferred-getStackHook`,`jQuery.Deferred.getStackHook is removed; use jQuery.Deferred.getErrorHook`),e.Deferred.getErrorHook=t):_e=t}})}return e}i(e,window);function a(e){return e+.5|0}var o=(e,t,n)=>Math.max(Math.min(e,n),t);function s(e){return o(a(e*2.55),0,255)}function c(e){return o(a(e*255),0,255)}function l(e){return o(a(e/2.55)/100,0,1)}function u(e){return o(a(e*100),0,100)}var d={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},f=[...`0123456789ABCDEF`],p=e=>f[e&15],m=e=>f[(e&240)>>4]+f[e&15],h=e=>(e&240)>>4==(e&15),g=e=>h(e.r)&&h(e.g)&&h(e.b)&&h(e.a);function _(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&d[e[1]]*17,g:255&d[e[2]]*17,b:255&d[e[3]]*17,a:t===5?d[e[4]]*17:255}:(t===7||t===9)&&(n={r:d[e[1]]<<4|d[e[2]],g:d[e[3]]<<4|d[e[4]],b:d[e[5]]<<4|d[e[6]],a:t===9?d[e[7]]<<4|d[e[8]]:255})),n}var v=(e,t)=>e<255?t(e):``;function y(e){var t=g(e)?p:m;return e?`#`+t(e.r)+t(e.g)+t(e.b)+v(e.a,t):void 0}var b=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function x(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function S(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function C(e,t,n){let r=x(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function w(e,t,n,r,i){return e===i?(t-n)/r+(t.5?l/(2-i-a):l/(i+a),s=w(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function E(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(c)}function D(e,t,n){return E(x,e,t,n)}function ee(e,t,n){return E(C,e,t,n)}function O(e,t,n){return E(S,e,t,n)}function te(e){return(e%360+360)%360}function k(e){let t=b.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?s(+t[5]):c(+t[5]));let i=te(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?ee(i,a,o):t[1]===`hsv`?O(i,a,o):D(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function A(e,t){var n=T(e);n[0]=te(n[0]+t),n=D(n),e.r=n[0],e.g=n[1],e.b=n[2]}function ne(e){if(!e)return;let t=T(e),n=t[0],r=u(t[1]),i=u(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${l(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var re={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`},j={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 M(){let e={},t=Object.keys(j),n=Object.keys(re),r,i,a,o,s;for(r=0;r>16&255,a>>8&255,a&255]}return e}var ie;function ae(e){ie||(ie=M(),ie.transparent=[0,0,0,0]);let t=ie[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var oe=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function N(e){let t=oe.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?s(e):o(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?s(r):o(r,0,255)),i=255&(t[4]?s(i):o(i,0,255)),a=255&(t[6]?s(a):o(a,0,255)),{r,g:i,b:a,a:n}}}function se(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${l(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var ce=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,le=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function ue(e,t,n){let r=le(l(e.r)),i=le(l(e.g)),a=le(l(e.b));return{r:c(ce(r+n*(le(l(t.r))-r))),g:c(ce(i+n*(le(l(t.g))-i))),b:c(ce(a+n*(le(l(t.b))-a))),a:e.a+n*(t.a-e.a)}}function de(e,t,n){if(e){let r=T(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=D(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function fe(e,t){return e&&Object.assign(t||{},e)}function pe(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=c(e[3]))):(t=fe(e,{r:0,g:0,b:0,a:1}),t.a=c(t.a)),t}function me(e){return e.charAt(0)===`r`?N(e):k(e)}var he=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=pe(t):n===`string`&&(r=_(t)||ae(t)||me(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=fe(this._rgb);return e&&(e.a=l(e.a)),e}set rgb(e){this._rgb=pe(e)}rgbString(){return this._valid?se(this._rgb):void 0}hexString(){return this._valid?y(this._rgb):void 0}hslString(){return this._valid?ne(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=ue(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=c(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=a(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return de(this._rgb,2,e),this}darken(e){return de(this._rgb,2,-e),this}saturate(e){return de(this._rgb,1,e),this}desaturate(e){return de(this._rgb,1,-e),this}rotate(e){return A(this._rgb,e),this}};function ge(){}var _e=(()=>{let e=0;return()=>e++})();function P(e){return e==null}function ve(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 F(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function ye(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function be(e,t){return ye(e)?e:t}function I(e,t){return e===void 0?t:e}var xe=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,Se=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function L(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function R(e,t,n,r){let i,a,o;if(ve(e)){if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;ie,x:e=>e.x,y:e=>e.y};function je(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function Me(e){let t=je(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Ne(e,t){return(Ae[t]||(Ae[t]=Me(t)))(e)}function Pe(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Fe=e=>e!==void 0,Ie=e=>typeof e==`function`,Le=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Re(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var z=Math.PI,ze=2*z,Be=ze+z,Ve=1/0,He=z/180,Ue=z/2,We=z/4,Ge=z*2/3,Ke=Math.log10,qe=Math.sign;function Je(e,t,n){return Math.abs(e-t)e-t).pop(),t}function Ze(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function B(e){return!Ze(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Qe(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function $e(e,t,n){let r,i,a;for(r=0,i=e.length;rc&&l=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ut(e,t,n){n||=(n=>e[n]1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var dt=(e,t,n,r)=>ut(e,n,r?r=>{let i=e[r][t];return ie[r][t]ut(e,n,r=>e[r][t]>=n);function pt(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{let n=`_onData`+Pe(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function gt(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(mt.forEach(t=>{delete e[t]}),delete e._chartjs)}function _t(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var vt=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function yt(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,vt.call(window,()=>{r=!1,e.apply(t,n)}))}}function bt(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var xt=e=>e===`start`?`left`:e===`end`?`right`:`center`,St=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,Ct=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function wt(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(dt(c,u,d).lo,n?r:dt(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!P(e[s.axis]));i-=Math.max(0,e)}i=st(i,0,r-1)}if(m){let e=Math.max(dt(c,o.axis,f,!0).hi+1,n?0:dt(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!P(e[s.axis]));e+=Math.max(0,t)}a=st(e,i,r)-i}else a=r-i}return{start:i,count:a}}function Tt(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var Et=e=>e===0||e===1,Dt=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*ze/n)),Ot=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*ze/n)+1,kt={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*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*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*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*Ue)+1,easeOutSine:e=>Math.sin(e*Ue),easeInOutSine:e=>-.5*(Math.cos(z*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>Et(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Et(e)?e:Dt(e,.075,.3),easeOutElastic:e=>Et(e)?e:Ot(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return Et(e)?e:e<.5?.5*Dt(e*2,t,n):.5+.5*Ot(e*2-1,t,n)},easeInBack(e){return e*e*(2.70158*e-1.70158)},easeOutBack(e){return--e*e*(2.70158*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-kt.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?kt.easeInBounce(e*2)*.5:kt.easeOutBounce(e*2-1)*.5+.5};function At(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function jt(e){return At(e)?e:new he(e)}function Mt(e){return At(e)?e:new he(e).saturate(.5).darken(.1).hexString()}var Nt=[`x`,`y`,`borderWidth`,`radius`,`tension`],Pt=[`color`,`borderColor`,`backgroundColor`];function Ft(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:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:Pt},numbers:{type:`number`,properties:Nt}}),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:e=>e|0}}}})}function It(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Lt=new Map;function Rt(e,t){t||={};let n=e+JSON.stringify(t),r=Lt.get(n);return r||(r=new Intl.NumberFormat(e,t),Lt.set(n,r)),r}function H(e,t,n){return Rt(t,n).format(e)}var zt={values(e){return ve(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Bt(e,n)}let o=Ke(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),H(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Ke(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?zt.numeric.call(this,e,t,n):``}};function Bt(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 Vt={formatters:zt};function Ht(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:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.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:Vt.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:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Ut=Object.create(null),Wt=Object.create(null);function Gt(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;te.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=(e,t)=>Mt(t.backgroundColor),this.hoverBorderColor=(e,t)=>Mt(t.borderColor),this.hoverColor=(e,t)=>Mt(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Kt(this,e,t)}get(e){return Gt(this,e)}describe(e,t){return Kt(Wt,e,t)}override(e,t){return Kt(Ut,e,t)}route(e,t,n,r){let i=Gt(this,e),a=Gt(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return F(e)?Object.assign({},t,e):I(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Ft,It,Ht]);function Jt(e){return!e||P(e.size)||P(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Yt(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Xt(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;cn.length){for(c=0;c0&&e.stroke()}}function tn(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,sn(e,a),c=0;c+e||0;function gn(e,t){let n={},r=F(t),i=r?Object.keys(t):t,a=F(e)?r?n=>I(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=hn(a(e));return n}function _n(e){return gn(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function vn(e){return gn(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function yn(e){let t=_n(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function bn(e,t){e||={},t||=qt.font;let n=I(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=I(e.style,t.style);r&&!(``+r).match(pn)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:I(e.family,t.family),lineHeight:mn(I(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:I(e.weight,t.weight),string:``};return i.string=Jt(i),i}function xn(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;an&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function Cn(e,t){return Object.assign(Object.create(e),t)}function wn(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=Bn(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>wn([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return kn(n,r,()=>zn(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Vn(e).includes(t)},ownKeys(e){return Vn(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function Tn(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:En(e,r),setContext:t=>Tn(e,t,n,r),override:i=>Tn(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return kn(e,t,()=>An(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function En(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Ie(n)?n:()=>n,isIndexable:Ie(r)?r:()=>r}}var Dn=(e,t)=>e?e+Pe(t):t,On=(e,t)=>F(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function kn(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function An(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Ie(s)&&o.isScriptable(t)&&(s=jn(t,s,e,n)),ve(s)&&s.length&&(s=Mn(t,s,e,o.isIndexable)),On(t,s)&&(s=Tn(s,i,a&&a[t],o)),s}function jn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),On(e,c)&&(c=In(i._scopes,i,e,c)),c}function Mn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(F(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=In(r,i,e,c);t.push(Tn(n,a,o&&o[e],s))}}return t}function Nn(e,t,n){return Ie(e)?e(t,n):e}var Pn=(e,t)=>e===!0?t:typeof e==`string`?Ne(t,e):void 0;function Fn(e,t,n,r,i){for(let a of t){let t=Pn(n,a);if(t){e.add(t);let a=Nn(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function In(e,t,n,r){let i=t._rootScopes,a=Nn(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Ln(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Ln(s,o,a,c,r),c===null)?!1:wn(Array.from(s),[``],i,a,()=>Rn(t,n,r))}function Ln(e,t,n,r,i){for(;n;)n=Fn(e,t,n,r,i);return n}function Rn(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return ve(i)&&F(n)?n:i||{}}function zn(e,t,n,r){let i;for(let a of t)if(i=Bn(Dn(a,e),n),i!==void 0)return On(e,i)?In(n,r,e,i):i}function Bn(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Vn(e){let t=e._keys;return t||=e._keys=Hn(e._scopes),t}function Hn(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}function Un(e,t,n,r){let{iScale:i}=e,{key:a=`r`}=this._parsing,o=Array(r),s,c,l,u;for(s=0,c=r;ste===`x`?`y`:`x`;function qn(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=it(a,i),c=it(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Jn(e,t,n){let r=e.length,i,a,o,s,c,l=Gn(e,0);for(let u=0;u!e.skip)),t.cubicInterpolationMode===`monotone`)Xn(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;ae.ownerDocument.defaultView.getComputedStyle(e,null);function ir(e,t){return rr(e).getPropertyValue(t)}var ar=[`top`,`right`,`bottom`,`left`];function or(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=ar[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var sr=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function cr(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(sr(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function lr(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=rr(n),a=i.boxSizing===`border-box`,o=or(i,`padding`),s=or(i,`border`,`width`),{x:c,y:l,box:u}=cr(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function ur(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&tr(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=rr(a),s=or(o,`border`,`width`),c=or(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=nr(o.maxWidth,a,`clientWidth`),i=nr(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||Ve,maxHeight:i||Ve}}var dr=e=>Math.round(e*10)/10;function fr(e,t,n,r){let i=rr(e),a=or(i,`margin`),o=nr(i.maxWidth,e,`clientWidth`)||Ve,s=nr(i.maxHeight,e,`clientHeight`)||Ve,c=ur(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=or(i,`border`,`width`),t=or(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=dr(Math.min(l,o,c.maxWidth)),u=dr(Math.min(u,s,c.maxHeight)),l&&!u&&(u=dr(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=dr(Math.floor(u*r))),{width:l,height:u}}function pr(e,t,n){let r=t||1,i=dr(e.height*r),a=dr(e.width*r);e.height=dr(e.height),e.width=dr(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!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var mr=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};er()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function hr(e,t){let n=ir(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function U(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function gr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function _r(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=U(e,i,n),s=U(i,a,n),c=U(a,t,n);return U(U(o,s,n),U(s,c,n),n)}var vr=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},W=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function yr(e,t,n){return e?vr(t,n):W()}function br(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function xr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function Sr(e){return e===`angle`?{between:ot,compare:at,normalize:V}:{between:lt,compare:(e,t)=>e-t,normalize:e=>e}}function Cr({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function wr(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=Sr(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;fc(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(Cr({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(Cr({start:g,end:d,loop:f,count:o,style:p})),m}function Er(e,t){let n=[],r=e.segments;for(let i=0;ii&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function Or(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function kr(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=Dr(n,i,a,r);return r===!0?Ar(e,[{start:o,end:s,loop:a}],n,t):Ar(e,Or(n,o,sr({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,vt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},Rr=`transparent`,zr={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=jt(e||Rr),i=r.valid&&jt(t||Rr);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Br=class{constructor(e,t,n,r){let i=t[n];r=xn([e.to,r,i,e.from]);let a=xn([e.from,i,r]);this._active=!0,this._fn=e.fn||zr[e.type||typeof a],this._easing=kt[e.easing]||kt.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=xn([e.to,t,r,e.from]),this._from=xn([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e{let i=e[r];if(!F(i))return;let a={};for(let e of t)a[e]=i[e];(ve(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Ur(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&Hr(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u){if(d&&u.active()){u.update(d,l,o);continue}u.cancel()}if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Br(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Lr.add(this._chart,n),!0}};function Hr(e,t){let n=[],r=Object.keys(t);for(let t=0;t0||!n&&t<0)return i.index}return null}function ti(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Zr(a,o,r),d=t.length,f;for(let e=0;en[e].axis===t).shift()}function ri(e,t){return Cn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function ii(e,t,n){return Cn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function ai(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var oi=e=>e===`reset`||e===`none`,si=(e,t)=>t?e:Object.assign({},e),ci=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:qr(n,!0),values:null},li=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Xr(e.vScale,e),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(e){this.index!==e&&ai(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=I(n.xAxisID,ni(e,`x`)),a=t.yAxisID=I(n.yAxisID,ni(e,`y`)),o=t.rAxisID=I(n.rAxisID,ni(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&>(this._data,this),e._stacked&&ai(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(F(t)){let e=this._cachedMeta;this._data=Yr(t,e)}else if(n!==t){if(n){gt(n,this);let e=this._cachedMeta;ai(e),e._parsed=[]}t&&Object.isExtensible(t)&&ht(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Xr(t.vScale,t),t.stack!==n.stack&&(r=!0,ai(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(ti(this,t._parsed),t._stacked=Xr(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length||n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=ve(r[e])?this.parseArrayData(n,r,e,t):F(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]t||u=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r=0&&ethis.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(si(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new Vr(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||oi(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){oi(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!oi(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;oe-t))}return e._cache.$bar}function di(e){let t=e.iScale,n=ui(t,e.type),r=t._length,i,a,o,s,c=()=>{o!==32767&&o!==-32768&&(Fe(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i0?i[e-1]:null,s=eMath.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function hi(e,t,n,r){return ve(e)?mi(e,t,n,r):t[n.axis]=n.parse(e,r),t}function gi(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l=n?1:-1):qe(e)}function yi(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.basee.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(P(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[I(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;i=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=t,a=this.getParsed(e),o=r.getLabelForValue(a.x),s=i.getLabelForValue(a.y),c=a._custom;return{label:n[e]||``,value:`(`+o+`, `+s+(c?`, `+c:``)+`)`}}update(e){let t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:s,includeOptions:c}=this._getSharedOptions(t,r),l=a.axis,u=o.axis;for(let d=t;dot(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>ot(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(Ue,u,f),_=m(z,l,d),v=m(z+Ue,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var Oi=class extends li{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:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(F(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Ne(n[t],e)}let a,o;for(a=e,o=e+t;a0&&!isNaN(e)?Math.abs(e)/t*ze:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=H(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r0&&this.getParsed(t-1);for(let n=0;n=_){v.skip=!0;continue}let b=this.getParsed(n),x=P(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},Ai=class extends li{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(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:n,color:r}}=e.legend.options;return t.labels.map((t,i)=>{let a=e.getDatasetMeta(0).controller.getStyle(i);return{text:t,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(i),index:i}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:`radialLinear`,angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=H(t._parsed[e].r,n.options.locale);return{label:r[e]||``,value:i}}parseObjectData(e,t,n,r){return Un.bind(this)(e,t,n,r)}update(e){let t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){let e=this._cachedMeta,t={min:1/0,max:-1/0};return e.data.forEach((e,n)=>{let r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(rt.max&&(t.max=r))}),t}_updateRadius(){let e=this.chart,t=e.chartArea,n=e.options,r=Math.min(t.right-t.left,t.bottom-t.top),i=Math.max(r/2,0),a=(i-Math.max(n.cutoutPercentage?i/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.options.animation,s=this._cachedMeta.rScale,c=s.xCenter,l=s.yCenter,u=s.getIndexAngle(0)-.5*z,d=u,f,p=360/this.countVisibleElements();for(f=0;f{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++}),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?et(this.resolveDataElementOptions(e,t).angle||n):0}},ji=Object.freeze({__proto__:null,BarController:Ti,BubbleController:Ei,DoughnutController:Oi,LineController:ki,PieController:class extends Oi{static id=`pie`;static defaults={cutout:0,rotation:0,circumference:360,radius:`100%`}},PolarAreaController:Ai,RadarController:class extends li{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(e){let t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:``+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,r){return Un.bind(this)(e,t,n,r)}update(e){let t=this._cachedMeta,n=t.dataset,r=t.data||[],i=t.iScale.getLabels();if(n.points=r,e!==`resize`){let t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);let a={_loop:!0,_fullLoop:i.length===r.length,options:t};this.updateElement(n,void 0,a,e)}this.updateElements(r,0,r.length,e)}updateElements(e,t,n,r){let i=this._cachedMeta.rScale,a=r===`reset`;for(let o=t;o0&&this.getParsed(t-1);for(let l=t;l0&&Math.abs(n[f]-v[f])>g,h&&(m.parsed=n,m.raw=c.data[l]),d&&(m.options=u||this.resolveDataElementOptions(l,t.active?`active`:r)),_||this.updateElement(t,l,m,r),v=n}this.updateSharedOptions(u,r,l)}getMaxOverflow(){let e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}let n=e.dataset,r=n.options&&n.options.borderWidth||0;if(!t.length)return r;let i=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,i,a)/2}}});function Mi(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var Ni={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Mi()}parse(){return Mi()}format(){return Mi()}add(){return Mi()}diff(){return Mi()}startOf(){return Mi()}endOf(){return Mi()}}};function Pi(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ft:dt;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!P(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!P(e[t.axis]));r.hi+=Math.max(0,o)}return r}if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function Fi(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Hi={evaluateInteractionItems:Fi,modes:{index(e,t,n,r){let i=lr(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Li(e,i,a,r,o):Bi(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=lr(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Li(e,i,a,r,o):Bi(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;ee.pos===t)}function Gi(e,t){return e.filter(e=>Ui.indexOf(e.pos)===-1&&e.box.axis===t)}function Ki(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function qi(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;ne.box.fullSize),!0),r=Ki(Wi(t,`left`),!0),i=Ki(Wi(t,`right`)),a=Ki(Wi(t,`top`),!0),o=Ki(Wi(t,`bottom`)),s=Gi(t,`x`),c=Gi(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:Wi(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function Zi(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Qi(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 $i(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!F(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&Qi(o,a.getPadding());let s=Math.max(0,t.outerWidth-Zi(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-Zi(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function ea(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function ta(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function na(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Qi(f,yn(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Yi(c.concat(l),d);na(s.fullSize,p,d,m),na(c,p,d,m),na(l,p,d,m)&&na(c,p,d,m),ea(p),ia(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,ia(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},R(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},oa=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},sa=class extends oa{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},ca=`$chartjs`,la={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},ua=e=>e===null||e===``;function G(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[ca]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,ua(i)){let t=hr(e,`width`);t!==void 0&&(e.width=t)}if(ua(r)){if(e.style.height===``)e.height=e.width/(t||2);else{let t=hr(e,`height`);t!==void 0&&(e.height=t)}}return e}var da=mr?{passive:!0}:!1;function fa(e,t,n){e&&e.addEventListener(t,n,da)}function pa(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,da)}function ma(e,t){let n=la[e.type]||e.type,{x:r,y:i}=lr(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function ha(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function ga(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ha(n.addedNodes,r),t&&=!ha(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function _a(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ha(n.removedNodes,r),t&&=!ha(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var va=new Map,ya=0;function ba(){let e=window.devicePixelRatio;e!==ya&&(ya=e,va.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function xa(e,t){va.size||window.addEventListener(`resize`,ba),va.set(e,t)}function Sa(e){va.delete(e),va.size||window.removeEventListener(`resize`,ba)}function Ca(e,t,n){let r=e.canvas,i=r&&tr(r);if(!i)return;let a=yt((e,t)=>{let r=i.clientWidth;n(e,t),r{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;(n!==0||r!==0)&&a(n,r)});return o.observe(i),xa(e,a),o}function wa(e,t,n){n&&n.disconnect(),t===`resize`&&Sa(e)}function Ta(e,t,n){let r=e.canvas,i=yt(t=>{e.ctx!==null&&n(ma(t,e))},e);return fa(r,t,i),i}var Ea=class extends oa{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(G(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[ca])return!1;let n=t[ca].initial;[`height`,`width`].forEach(e=>{let r=n[e];P(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[ca],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:ga,detach:_a,resize:Ca}[t]||Ta)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:wa,detach:wa,resize:wa}[t]||pa)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return fr(e,t,n,r)}isAttached(e){let t=e&&tr(e);return!!(t&&t.isConnected)}};function Da(e){return!er()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?sa:Ea}var Oa=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return B(this.x)&&B(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function ka(e,t){let n=e.options.ticks,r=Aa(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?Ma(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Na(t,l,a,o/i),l;let u=ja(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(Pa(t,l,u,P(r)?0:s-r,s),e=0,n=o-1;ei)return t}return Math.max(i,1)}function Ma(e){let t=[],n,r;for(n=0,r=e.length;ne===`left`?`right`:e===`right`?`left`:e,La=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Ra=(e,t)=>Math.min(t||e,e);function za(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;ao+s)))return c}function Va(e,t){R(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;in?n:t,n=r&&t>n?t:n,{min:be(t,be(n,t)),max:be(n,be(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){L(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Sn(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=st(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-Ha(e.grid)-t.padding-Ua(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=tt(Math.min(Math.asin(st((l.highest.height+6)/o,-1,1)),Math.asin(st(s/c,-1,1))-Math.asin(st(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){L(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){L(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Ua(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=Ha(i)+a):(e.height=this.maxHeight,e.width=Ha(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=et(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){L(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ct(this._alignToPixels?Zt(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&eo*r?o/n:s/r:s*r0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=Ha(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Zt(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(F(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(F(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=I(r.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/ee));for(_=0;_0&&(a-=r/2)}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-et(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);qt.route(a,i,c,s)})}function Qa(e){return`id`in e&&`defaults`in e}var $a=new class{constructor(){this.controllers=new Ya(li,`datasets`,!0),this.elements=new Ya(Oa,`elements`),this.plugins=new Ya(Object,`plugins`),this.scales=new Ya(Ja,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):R(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Pe(e);L(n[`before`+r],[],n),t[e](n),L(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;te.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function to(e){let t={},n=[],r=Object.keys($a.plugins.items);for(let e=0;e1&&co(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function fo(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function po(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return fo(e,`x`,n[0])||fo(e,`y`,n[0])}return{}}function mo(e,t){let n=Ut[e.type]||{scales:{}},r=t.scales||{},i=ao(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!F(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=uo(t,o,po(t,e),qt.scales[o.type]),c=so(s,i),l=n.scales||{};a[t]=Oe(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||ao(i,t),s=(Ut[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=oo(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),Oe(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];Oe(t,[qt.scales[t.type],qt.scale])}),a}function ho(e){let t=e.options||={};t.plugins=I(t.plugins,{}),t.scales=mo(e,t)}function go(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function _o(e){return e||={},e.data=go(e.data),ho(e),e}var vo=new Map,yo=new Set;function bo(e,t){let n=vo.get(e);return n||(n=t(),vo.set(e,n),yo.add(n)),n}var xo=(e,t,n)=>{let r=Ne(t,n);r!==void 0&&e.add(r)},So=class{constructor(e){this._config=_o(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=go(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),ho(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return bo(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return bo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return bo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return bo(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>xo(s,e,t))),t.forEach(e=>xo(s,r,e)),t.forEach(e=>xo(s,Ut[i]||{},e)),t.forEach(e=>xo(s,qt,e)),t.forEach(e=>xo(s,Wt,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),yo.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Ut[t]||{},qt.datasets[t]||{},{type:t},qt,Wt]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=Co(this._resolverCache,e,r),s=a;if(To(a,t)){i.$shared=!1,n=Ie(n)?n():n;let t=this.createResolver(e,n,o);s=Tn(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=Co(this._resolverCache,e,n);return F(t)?Tn(i,t,void 0,r):i}};function Co(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:wn(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var wo=e=>F(e)&&Object.getOwnPropertyNames(e).some(t=>Ie(e[t]));function To(e,t){let{isScriptable:n,isIndexable:r}=En(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Ie(o)||wo(o))||a&&ve(o))return!0}return!1}var Eo=`4.5.1`,Do=[`top`,`bottom`,`left`,`right`,`chartArea`];function Oo(e,t){return e===`top`||e===`bottom`||Do.indexOf(e)===-1&&t===`x`}function ko(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Ao(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),L(n&&n.onComplete,[e],t)}function jo(e){let t=e.chart,n=t.options.animation;L(n&&n.onProgress,[e],t)}function Mo(e){return er()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var No={},K=e=>{let t=Mo(e);return Object.values(No).filter(e=>e.canvas===t).pop()};function Po(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Fo(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var Io=class{static defaults=qt;static instances=No;static overrides=Ut;static registry=$a;static version=Eo;static getChart=K;static register(...e){$a.add(...e),Lo()}static unregister(...e){$a.remove(...e),Lo()}constructor(e,t){let n=this.config=new So(t),r=Mo(e),i=K(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(Da(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=_e(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new eo,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=bt(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],No[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}Lr.listen(this,`complete`,Ao),Lr.listen(this,`progress`,jo),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return P(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return $a}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():pr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Qt(this.canvas,this.ctx),this}stop(){return Lr.stop(this),this}resize(e,t){Lr.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,pr(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),L(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){R(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=uo(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),R(i,t=>{let i=t.options,a=i.id,o=uo(a,i),s=I(i.type,t.dtype);(i.position===void 0||Oo(i.position,o)!==Oo(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new($a.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),R(r,(e,t)=>{e||delete n[t]}),R(n,e=>{aa.configure(this,e,e.options),aa.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;et.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(ko(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){R(this.scales,e=>{aa.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!Le(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)Po(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;ee.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;aa.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],R(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Ir(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&nn(t,r),e.controller.draw(),r&&rn(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return tn(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Hi.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=Cn(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);Fe(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Lr.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};R(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){R(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},R(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});Ce(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Re(e),c=Fo(e,this._lastEvent,n,s);n&&(this._lastEvent=null,L(i.onHover,[e,o,this],this),s&&L(i.onClick,[e,o,this],this));let l=!Ce(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Lo(){return R(Io.instances,e=>e._plugins.invalidate())}function Ro(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,V(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,V(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*V(r-n));if(u===`round`)e.arc(i,a,t,n-z/2,r+z/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+z/2)+i,c=-o*Math.sin(n+z/2)+a,l=o*Math.cos(r+z/2)+i,u=o*Math.sin(r+z/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function zo(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+Ue,r-Ue),e.closePath(),e.clip()}function Bo(e){return gn(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function Vo(e,t,n,r){let i=Bo(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return st(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:st(i.innerStart,0,o),innerEnd:st(i.innerEnd,0,o)}}function Ho(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Uo(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/z)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=Vo(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,ee=g+b/E,O=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=Ho(C,T,o,s);e.arc(t.x,t.y,y,T,_+Ue)}let n=Ho(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=Ho(D,O,o,s);e.arc(t.x,t.y,x,_+Ue,O+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=Ho(E,ee,o,s);e.arc(t.x,t.y,b,ee+Math.PI,g-Ue)}let i=Ho(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=Ho(S,w,o,s);e.arc(t.x,t.y,v,g-Ue,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Wo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Uo(e,t,n,r,c,i);for(let t=0;t=z&&p===0&&u!==`miter`&&Ro(e,t,h),a||(Uo(e,t,n,r,h,i),e.stroke())}var Ko=class extends Oa{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,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=rt(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=I(l,o-a),f=ot(r,a,o)&&a!==o,p=d>=ze||f,m=lt(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>ze?Math.floor(n/ze):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(z,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Wo(e,this,s,i,a),Go(e,this,s,i,a),e.restore()}};function qo(e,t,n=t){e.lineCap=I(n.borderCapStyle,t.borderCapStyle),e.setLineDash(I(n.borderDash,t.borderDash)),e.lineDashOffset=I(n.borderDashOffset,t.borderDashOffset),e.lineJoin=I(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=I(n.borderWidth,t.borderWidth),e.strokeStyle=I(n.borderColor,t.borderColor)}function Jo(e,t,n){e.lineTo(n.x,n.y)}function Yo(e){return e.stepped?an:e.tension||e.cubicInterpolationMode===`monotone`?on:Jo}function Xo(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=is&&a>s;return{count:r,start:c,loop:t.loop,ilen:l(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(ng&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function $o(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?Qo:Zo}function es(e){return e.stepped?gr:e.tension||e.cubicInterpolationMode===`monotone`?_r:U}function ts(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),qo(e,t.options),e.stroke(i)}function ns(e,t,n,r){let{segments:i,options:a}=t,o=$o(t);for(let s of i)qo(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var rs=typeof Path2D==`function`;function is(e,t,n,r){rs&&!t.options.segment?ts(e,t,n,r):ns(e,t,n,r)}var as=class extends Oa{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:e=>e!==`borderDash`&&e!==`fill`};constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;$n(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=kr(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=Er(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=es(n),c,l;for(c=0,l=a.length;ce.replace(`rgb(`,`rgba(`).replace(`)`,`, 0.5)`));function bs(e){return vs[e%vs.length]}function xs(e){return ys[e%ys.length]}function Ss(e,t){return e.borderColor=bs(t),e.backgroundColor=xs(t),++t}function Cs(e,t){return e.backgroundColor=e.data.map(()=>bs(t++)),t}function ws(e,t){return e.backgroundColor=e.data.map(()=>xs(t++)),t}function Ts(e){let t=0;return(n,r)=>{let i=e.getDatasetMeta(r).controller;i instanceof Oi?t=Cs(n,t):i instanceof Ai?t=ws(n,t):i&&(t=Ss(n,t))}}function Es(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Ds(e){return e&&(e.borderColor||e.backgroundColor)}function Os(){return qt.borderColor!==`rgba(0,0,0,0.1)`||qt.backgroundColor!==`rgba(0,0,0,0.1)`}var ks={id:`colors`,defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;let{data:{datasets:r},options:i}=e.config,{elements:a}=i,o=Es(r)||Ds(i)||a&&Es(a)||Os();if(!n.forceOverride&&o)return;let s=Ts(e);r.forEach(s)}};function As(e,t,n,r,i){let a=i.samples||r;if(a>=n)return e.slice(t,t+n);let o=[],s=(n-2)/(a-2),c=0,l=t+n-1,u=t,d,f,p,m,h;for(o[c++]=e[u],d=0;dp&&(p=m,f=e[a],h=a);o[c++]=f,u=h}return o[c++]=e[l],o}function js(e,t,n,r){let i=0,a=0,o,s,c,l,u,d,f,p,m,h,g=[],_=t+n-1,v=e[t].x,y=e[_].x-v;for(o=t;oh&&(h=l,f=o),i=(a*i+s.x)/++a;else{let n=o-1;if(!P(d)&&!P(f)){let t=Math.min(d,f),r=Math.max(d,f);t!==p&&t!==n&&g.push({...e[t],x:i}),r!==p&&r!==n&&g.push({...e[r],x:i})}o>0&&n!==p&&g.push(e[n]),g.push(s),u=t,a=0,m=h=l,d=f=p=o}}return g}function Ms(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 Ns(e){e.data.datasets.forEach(e=>{Ms(e)})}function Ps(e,t){let n=t.length,r=0,i,{iScale:a}=e,{min:o,max:s,minDefined:c,maxDefined:l}=a.getUserBounds();return c&&(r=st(dt(t,a.axis,o).lo,0,n-1)),i=l?st(dt(t,a.axis,s).hi+1,r,n)-r:n-r,{start:r,count:i}}var Fs={id:`decimation`,defaults:{algorithm:`min-max`,enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ns(e);return}let r=e.width;e.data.datasets.forEach((t,i)=>{let{_data:a,indexAxis:o}=t,s=e.getDatasetMeta(i),c=a||t.data;if(xn([o,e.options.indexAxis])===`y`||!s.controller.supportsDecimation)return;let l=e.scales[s.xAxisID];if(l.type!==`linear`&&l.type!==`time`||e.options.parsing)return;let{start:u,count:d}=Ps(s,c);if(d<=(n.threshold||4*r)){Ms(t);return}P(a)&&(t._data=c,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}}));let f;switch(n.algorithm){case`lttb`:f=As(c,u,d,r,n);break;case`min-max`:f=js(c,u,d,r);break;default:throw Error(`Unsupported decimation algorithm '${n.algorithm}'`)}t._decimated=f})},destroy(e){Ns(e)}};function Is(e,t,n){let r=e.segments,i=e.points,a=t.points,o=[];for(let e of r){let{start:r,end:s}=e;s=zs(r,s,i);let c=Ls(n,i[r],i[s],e.loop);if(!t.segments){o.push({source:e,target:c,start:i[r],end:i[s]});continue}let l=Er(t,c);for(let t of l){let r=Ls(n,a[t.start],a[t.end],t.loop),s=Tr(e,i,r);for(let e of s)o.push({source:e,target:t,start:{[n]:Bs(c,r,`start`,Math.max)},end:{[n]:Bs(c,r,`end`,Math.min)}})}}return o}function Ls(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e===`angle`&&(i=V(i),a=V(a)),{property:e,start:i,end:a}}function Rs(e,t){let{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:e,end:t})=>{t=zs(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function zs(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function Bs(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Vs(e,t){let n=[],r=!1;return ve(e)?(r=!0,n=e):n=Rs(e,t),n.length?new as({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Hs(e){return e&&e.fill!==!1}function Us(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!ye(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function Ws(e,t,n){let r=Js(e);if(F(r))return!isNaN(r.value)&&r;let i=parseFloat(r);return ye(i)&&Math.floor(i)===i?Gs(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function Gs(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Ks(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:F(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function qs(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:F(e)?e.value:t.getBaseValue(),r}function Js(e){let t=e.options,n=t.fill,r=I(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function Ys(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=Xs(t,n);s.push(Vs({x:null,y:t.bottom},r));for(let e=0;e=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&ac(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;Hs(n)&&ac(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;Hs(r)&&n.drawTime===`beforeDatasetDraw`&&ac(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},pc=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},mc=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,hc=class extends Oa{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=L(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=bn(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=pc(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=gc(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=yr(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=St(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=St(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=St(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=St(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;nn(e,this),this._draw(),rn(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=qt.color,s=yr(e.rtl,this.left,this.width),c=bn(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=pc(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=I(n.lineWidth,1);if(r.fillStyle=I(n.fillStyle,o),r.lineCap=I(n.lineCap,`butt`),r.lineDashOffset=I(n.lineDashOffset,0),r.lineJoin=I(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=I(n.strokeStyle,o),r.setLineDash(I(n.lineDash,[])),a.usePointStyle){let o={radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},c=s.xPlus(e,p/2),l=t+d;en(r,o,c,l,a.pointStyleWidth&&p)}else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=vn(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?dn(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){un(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:St(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:St(i,this.top+y+l,this.bottom-t[0].height),line:0},br(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=St(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=St(i,this.top+y+l,this.bottom-t[f.line].height));let w=s.x(S);if(g(w,C,o),S=Ct(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=yc(o,e)+l}else f.y+=b}),xr(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=bn(t.font),r=yn(t.padding);if(!t.display)return;let i=yr(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=St(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+St(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=St(o,u,u+d);a.textAlign=i.textAlign(xt(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,un(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=bn(e.font),n=yn(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(lt(e,this.left,this.right)&<(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;ne.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function vc(e,t,n){let r=e;return typeof t.text!=`string`&&(r=yc(t,n)),r}function yc(e,t){return t*(e.text?e.text.length:0)}function bc(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var xc={id:`legend`,_element:hc,start(e,t,n){let r=e.legend=new hc({ctx:e.ctx,options:n,chart:e});aa.configure(e,r,n),aa.addBox(e,r)},stop(e){aa.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;aa.configure(e,r,n),r.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 r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),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:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=yn(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.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)}}},Sc=class extends Oa{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=ve(n.text)?n.text.length:1;this._padding=yn(n.padding);let i=r*bn(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){let e=this.options.position;return e===`top`||e===`bottom`}_drawArgs(e){let{top:t,left:n,bottom:r,right:i,options:a}=this,o=a.align,s=0,c,l,u;return this.isHorizontal()?(l=St(o,n,i),u=t+e,c=i-n):(a.position===`left`?(l=n+e,u=St(o,r,t),s=z*-.5):(l=i-e,u=St(o,t,r),s=z*.5),c=r-t),{titleX:l,titleY:u,maxWidth:c,rotation:s}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=bn(t.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:o,rotation:s}=this._drawArgs(r);un(e,t.text,0,0,n,{color:t.color,maxWidth:o,rotation:s,textAlign:xt(t.align),textBaseline:`middle`,translation:[i,a]})}};function Cc(e,t){let n=new Sc({ctx:e.ctx,options:t,chart:e});aa.configure(e,n,t),aa.addBox(e,n),e.titleBlock=n}var wc={id:`title`,_element:Sc,start(e,t,n){Cc(e,n)},stop(e){let t=e.titleBlock;aa.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let r=e.titleBlock;aa.configure(e,r,n),r.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}},Tc=new WeakMap,Ec={id:`subtitle`,start(e,t,n){let r=new Sc({ctx:e.ctx,options:n,chart:e});aa.configure(e,r,n),aa.addBox(e,r),Tc.set(e,r)},stop(e){aa.removeBox(e,Tc.get(e)),Tc.delete(e)},beforeUpdate(e,t,n){let r=Tc.get(e);aa.configure(e,r,n),r.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}},Dc={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;te+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a-1?e.split(` -`):e}function Ac(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function jc(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=bn(t.bodyFont),l=bn(t.titleFont),u=bn(t.footerFont),d=a.length,f=i.length,p=r.length,m=yn(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,R(e.title,y),n.font=c.string,R(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,R(r,e=>{R(e.before,y),R(e.lines,y),R(e.after,y)}),v=0,n.font=u.string,R(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function Mc(e,t){let{y:n,height:r}=t;return ne.height-r/2?`bottom`:`center`}function Nc(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function Pc(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),Nc(l,e,t,n)&&(l=`center`),l}function Fc(e,t,n){let r=n.yAlign||t.yAlign||Mc(e,n);return{xAlign:n.xAlign||t.xAlign||Pc(e,t,n,r),yAlign:r}}function Ic(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function Lc(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:r-=t===`bottom`?i+n:i/2,r}function Rc(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=vn(o),m=Ic(t,s),h=Lc(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:st(m,0,r.width-t.width),y:st(h,0,r.height-t.height)}}function zc(e,t,n){let r=yn(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function Bc(e){return Oc([],kc(e))}function Vc(e,t,n){return Cn(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function Hc(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var Uc={beforeTitle:ge,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex{let t={before:[],lines:[],after:[]},i=Hc(n,e);Oc(t.before,kc(Wc(i,`beforeLabel`,this,e))),Oc(t.lines,Wc(i,`label`,this,e)),Oc(t.after,kc(Wc(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return Bc(Wc(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=Wc(n,`beforeFooter`,this,e),i=Wc(n,`footer`,this,e),a=Wc(n,`afterFooter`,this,e),o=[];return o=Oc(o,kc(r)),o=Oc(o,kc(i)),o=Oc(o,kc(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;se.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),R(o,t=>{let n=Hc(e.callbacks,t);r.push(Wc(n,`labelColor`,this,t)),i.push(Wc(n,`labelPointStyle`,this,t)),a.push(Wc(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=Dc[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=jc(this,n),o=Object.assign({},e,t),s=Fc(this.chart,n,o),c=Rc(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=vn(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=yr(n.rtl,this.x,this.width);for(e.x=zc(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=bn(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;se!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,dn(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),dn(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=bn(n.bodyFont),d=u.lineHeight,f=0,p=yr(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=zc(this,h,n),t.fillStyle=n.bodyColor,R(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=Dc[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=jc(this,e),o=Object.assign({},n,this._size),s=Fc(t,e,o),c=Rc(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=yn(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),br(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),xr(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!Ce(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!Ce(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=Dc[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},Kc=Object.freeze({__proto__:null,Colors:ks,Decimation:Fs,Filler:fc,Legend:xc,SubTitle:Ec,Title:wc,Tooltip:{id:`tooltip`,_element:Gc,positioners:Dc,afterInit(e,t,n){n&&(e.tooltip=new Gc({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:Uc},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`]}}),qc=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Jc(e,t,n,r){let i=e.indexOf(t);return i===-1?qc(e,t,n,r):i===e.lastIndexOf(t)?i:n}var Yc=(e,t)=>e===null?null:st(Math.round(e),0,t);function Xc(e){let t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function Qc(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!P(a),_=!P(o),v=!P(c),y=(h-m)/(u+1),b=Ye((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=Ye(w*b/p/f)*f),P(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&Qe((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Je(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(nt(b),nt(S));x=10**(P(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),So)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Je(n[n.length-1].value,o,$c(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function $c(e,t,{horizontal:n,minRotation:r}){let i=et(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var el=class extends Ja{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return P(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=qe(r),t=qe(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=Qc({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&$e(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return H(e,this.chart.options.locale,this.options.ticks.format)}},tl=class extends el{static id=`linear`;static defaults={ticks:{callback:Vt.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=ye(e)?e:0,this.max=ye(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=et(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},nl=e=>Math.floor(Ke(e)),rl=(e,t)=>10**(nl(e)+t);function il(e){return e/10**nl(e)==1}function al(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function ol(e,t){let n=nl(t-e);for(;al(e,t,n)>10;)n++;for(;al(e,t,n)<10;)n--;return Math.min(n,nl(e))}function sl(e,{min:t,max:n}){t=be(e.min,t);let r=[],i=nl(t),a=ol(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=be(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=be(e.max,f);return r.push({value:p,major:il(p),significand:d}),r}var cl=class extends Ja{static id=`logarithmic`;static defaults={ticks:{callback:Vt.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=el.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return ye(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=ye(e)?Math.max(0,e):null,this.max=ye(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ye(this._userMin)&&(this.min=e===rl(this.min,0)?rl(this.min,-1):rl(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(rl(n,-1)),a(rl(r,1)))),n<=0&&i(rl(r,-1)),r<=0&&a(rl(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=sl({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&$e(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:H(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Ke(e),this._valueRange=Ke(this.max)-Ke(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ke(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}};function ll(e){let t=e.ticks;if(t.display&&e.display){let e=yn(t.backdropPadding);return I(t.font&&t.font.size,qt.font.size)+e.height}return 0}function ul(e,t,n){return n=ve(n)?n:[n],{w:Xt(e,t.string,n),h:n.length*t.lineHeight}}function dl(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function fl(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),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?z/a:0;for(let c=0;ct.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.startt.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function ml(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(tt(V(c.angle+Ue))),u=yl(c.y,s.h,l),d=_l(l),f=vl(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function hl(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(tn({x:n,y:r},t)||tn({x:n,y:a},t)||tn({x:i,y:r},t)||tn({x:i,y:a},t))}function gl(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:ll(a)/2,additionalAngle:o?z/i:0},l;for(let a=0;a270||n<90)&&(e-=t),e}function bl(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!P(s)){let n=vn(t.borderRadius),c=yn(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),dn(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function xl(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));bl(n,a,t);let o=bn(a.font),{x:s,y:c,textAlign:l}=t;un(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function Sl(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ze);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a{let n=L(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?fl(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=ze/(this._pointLabels.length||1),n=this.options.startAngle||0;return V(e*t+et(n))}getDistanceFromCenterForValue(e){if(P(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(P(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);Cl(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;!a||!i||(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=bn(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=yn(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}un(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}},El={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}},Dl=Object.keys(El);function Ol(e,t){return e-t}function kl(e,t){if(P(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),ye(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(B(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function Al(e,t,n,r){let i=Dl.length;for(let a=Dl.indexOf(e);a=Dl.indexOf(n);a--){let n=Dl[a];if(El[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return Dl[n?Dl.indexOf(n):0]}function Ml(e){for(let t=Dl.indexOf(e)+1,n=Dl.length;t=t?n[r]:n[i];e[a]=!0}}function Pl(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function Fl(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=st(t,0,a),n=st(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||Al(i.minUnit,t,n,this._getLabelCapacity(t)),o=I(r.ticks.stepSize,1),s=a===`week`&&i.isoWeekday,c=B(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return L(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=dt(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=dt(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}var Rl=class extends Il{static id=`timeseries`;static defaults=Il.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Ll(t,this.min),this._tableRange=Ll(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;ae-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Ll(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Ll(this._table,n*this._tableRange+this._minPos,!0)}},zl=[ji,_s,Kc,Object.freeze({__proto__:null,CategoryScale:Zc,LinearScale:tl,LogarithmicScale:cl,RadialLinearScale:Tl,TimeScale:Il,TimeSeriesScale:Rl})];Io.register(...zl);var Bl=Io,Vl={white:`#ffffff`,"red-50":`#ffebee`,"red-100":`#ffcdd2`,"red-200":`#ef9a9a`,"red-300":`#e57373`,"red-400":`#ef5350`,"red-500":`#f44336`,"red-600":`#e53935`,"red-700":`#d32f2f`,"red-800":`#c62828`,"red-900":`#b71c1c`,"red-a100":`#ff8a80`,"red-a200":`#ff5252`,"red-a400":`#ff1744`,"red-a700":`#d50000`,"pink-50":`#fce4ec`,"pink-100":`#f8bbd0`,"pink-200":`#f48fb1`,"pink-300":`#f06292`,"pink-400":`#ec407a`,"pink-500":`#e91e63`,"pink-600":`#d81b60`,"pink-700":`#c2185b`,"pink-800":`#ad1457`,"pink-900":`#880e4f`,"pink-a100":`#ff80ab`,"pink-a200":`#ff4081`,"pink-a400":`#f50057`,"pink-a700":`#c51162`,"purple-50":`#f3e5f5`,"purple-100":`#e1bee7`,"purple-200":`#ce93d8`,"purple-300":`#ba68c8`,"purple-400":`#ab47bc`,"purple-500":`#9c27b0`,"purple-600":`#8e24aa`,"purple-700":`#7b1fa2`,"purple-800":`#6a1b9a`,"purple-900":`#4a148c`,"purple-a100":`#ea80fc`,"purple-a200":`#e040fb`,"purple-a400":`#d500f9`,"purple-a700":`#aa00ff`,"deep-purple-50":`#ede7f6`,"deep-purple-100":`#d1c4e9`,"deep-purple-200":`#b39ddb`,"deep-purple-300":`#9575cd`,"deep-purple-400":`#7e57c2`,"deep-purple-500":`#673ab7`,"deep-purple-600":`#5e35b1`,"deep-purple-700":`#512da8`,"deep-purple-800":`#4527a0`,"deep-purple-900":`#311b92`,"deep-purple-a100":`#b388ff`,"deep-purple-a200":`#7c4dff`,"deep-purple-a400":`#651fff`,"deep-purple-a700":`#6200ea`,"indigo-50":`#e8eaf6`,"indigo-100":`#c5cae9`,"indigo-200":`#9fa8da`,"indigo-300":`#7986cb`,"indigo-400":`#5c6bc0`,"indigo-500":`#3f51b5`,"indigo-600":`#3949ab`,"indigo-700":`#303f9f`,"indigo-800":`#283593`,"indigo-900":`#1a237e`,"indigo-a100":`#8c9eff`,"indigo-a200":`#536dfe`,"indigo-a400":`#3d5afe`,"indigo-a700":`#304ffe`,"blue-50":`#e3f2fd`,"blue-100":`#bbdefb`,"blue-200":`#90caf9`,"blue-300":`#64b5f6`,"blue-400":`#42a5f5`,"blue-500":`#2196f3`,"blue-600":`#1e88e5`,"blue-700":`#1976d2`,"blue-800":`#1565c0`,"blue-900":`#0d47a1`,"blue-a100":`#82b1ff`,"blue-a200":`#448aff`,"blue-a400":`#2979ff`,"blue-a700":`#2962ff`,"light-blue-50":`#e1f5fe`,"light-blue-100":`#b3e5fc`,"light-blue-200":`#81d4fa`,"light-blue-300":`#4fc3f7`,"light-blue-400":`#29b6f6`,"light-blue-500":`#03a9f4`,"light-blue-600":`#039be5`,"light-blue-700":`#0288d1`,"light-blue-800":`#0277bd`,"light-blue-900":`#01579b`,"light-blue-a100":`#80d8ff`,"light-blue-a200":`#40c4ff`,"light-blue-a400":`#00b0ff`,"light-blue-a700":`#0091ea`,"cyan-50":`#e0f7fa`,"cyan-100":`#b2ebf2`,"cyan-200":`#80deea`,"cyan-300":`#4dd0e1`,"cyan-400":`#26c6da`,"cyan-500":`#00bcd4`,"cyan-600":`#00acc1`,"cyan-700":`#0097a7`,"cyan-800":`#00838f`,"cyan-900":`#006064`,"cyan-a100":`#84ffff`,"cyan-a200":`#18ffff`,"cyan-a400":`#00e5ff`,"cyan-a700":`#00b8d4`,"teal-50":`#e0f2f1`,"teal-100":`#b2dfdb`,"teal-200":`#80cbc4`,"teal-300":`#4db6ac`,"teal-400":`#26a69a`,"teal-500":`#009688`,"teal-600":`#00897b`,"teal-700":`#00796b`,"teal-800":`#00695c`,"teal-900":`#004d40`,"teal-a100":`#a7ffeb`,"teal-a200":`#64ffda`,"teal-a400":`#1de9b6`,"teal-a700":`#00bfa5`,"green-50":`#e8f5e9`,"green-100":`#c8e6c9`,"green-200":`#a5d6a7`,"green-300":`#81c784`,"green-400":`#66bb6a`,"green-500":`#4caf50`,"green-600":`#43a047`,"green-700":`#388e3c`,"green-800":`#2e7d32`,"green-900":`#1b5e20`,"green-a100":`#b9f6ca`,"green-a200":`#69f0ae`,"green-a400":`#00e676`,"green-a700":`#00c853`,"light-green-50":`#f1f8e9`,"light-green-100":`#dcedc8`,"light-green-200":`#c5e1a5`,"light-green-300":`#aed581`,"light-green-400":`#9ccc65`,"light-green-500":`#8bc34a`,"light-green-600":`#7cb342`,"light-green-700":`#689f38`,"light-green-800":`#558b2f`,"light-green-900":`#33691e`,"light-green-a100":`#ccff90`,"light-green-a200":`#b2ff59`,"light-green-a400":`#76ff03`,"light-green-a700":`#64dd17`,"lime-50":`#f9fbe7`,"lime-100":`#f0f4c3`,"lime-200":`#e6ee9c`,"lime-300":`#dce775`,"lime-400":`#d4e157`,"lime-500":`#cddc39`,"lime-600":`#c0ca33`,"lime-700":`#afb42b`,"lime-800":`#9e9d24`,"lime-900":`#827717`,"lime-a100":`#f4ff81`,"lime-a200":`#eeff41`,"lime-a400":`#c6ff00`,"lime-a700":`#aeea00`,"yellow-50":`#fffde7`,"yellow-100":`#fff9c4`,"yellow-200":`#fff59d`,"yellow-300":`#fff176`,"yellow-400":`#ffee58`,"yellow-500":`#ffeb3b`,"yellow-600":`#fdd835`,"yellow-700":`#fbc02d`,"yellow-800":`#f9a825`,"yellow-900":`#f57f17`,"yellow-a100":`#ffff8d`,"yellow-a200":`#ffff00`,"yellow-a400":`#ffea00`,"yellow-a700":`#ffd600`,"amber-50":`#fff8e1`,"amber-100":`#ffecb3`,"amber-200":`#ffe082`,"amber-300":`#ffd54f`,"amber-400":`#ffca28`,"amber-500":`#ffc107`,"amber-600":`#ffb300`,"amber-700":`#ffa000`,"amber-800":`#ff8f00`,"amber-900":`#ff6f00`,"amber-a100":`#ffe57f`,"amber-a200":`#ffd740`,"amber-a400":`#ffc400`,"amber-a700":`#ffab00`,"orange-50":`#fff3e0`,"orange-100":`#ffe0b2`,"orange-200":`#ffcc80`,"orange-300":`#ffb74d`,"orange-400":`#ffa726`,"orange-500":`#ff9800`,"orange-600":`#fb8c00`,"orange-700":`#f57c00`,"orange-800":`#ef6c00`,"orange-900":`#e65100`,"orange-a100":`#ffd180`,"orange-a200":`#ffab40`,"orange-a400":`#ff9100`,"orange-a700":`#ff6d00`,"deep-orange-50":`#fbe9e7`,"deep-orange-100":`#ffccbc`,"deep-orange-200":`#ffab91`,"deep-orange-300":`#ff8a65`,"deep-orange-400":`#ff7043`,"deep-orange-500":`#ff5722`,"deep-orange-600":`#f4511e`,"deep-orange-700":`#e64a19`,"deep-orange-800":`#d84315`,"deep-orange-900":`#bf360c`,"deep-orange-a100":`#ff9e80`,"deep-orange-a200":`#ff6e40`,"deep-orange-a400":`#ff3d00`,"deep-orange-a700":`#dd2c00`,"brown-50":`#efebe9`,"brown-100":`#d7ccc8`,"brown-200":`#bcaaa4`,"brown-300":`#a1887f`,"brown-400":`#8d6e63`,"brown-500":`#795548`,"brown-600":`#6d4c41`,"brown-700":`#5d4037`,"brown-800":`#4e342e`,"brown-900":`#3e2723`,"grey-50":`#fafafa`,"grey-100":`#f5f5f5`,"grey-200":`#eeeeee`,"grey-300":`#e0e0e0`,"grey-400":`#bdbdbd`,"grey-500":`#9e9e9e`,"grey-600":`#757575`,"grey-700":`#616161`,"grey-800":`#424242`,"grey-900":`#212121`,"blue-grey-50":`#eceff1`,"blue-grey-100":`#cfd8dc`,"blue-grey-200":`#b0bec5`,"blue-grey-300":`#90a4ae`,"blue-grey-400":`#78909c`,"blue-grey-500":`#607d8b`,"blue-grey-600":`#546e7a`,"blue-grey-700":`#455a64`,"blue-grey-800":`#37474f`,"blue-grey-900":`#263238`};(function(){let e=document.getElementById(`line-chart`);if(e){let t=e.getContext(`2d`);e.height=80,new Bl(t,{type:`line`,data:{labels:[`January`,`February`,`March`,`April`,`May`,`June`,`July`],datasets:[{label:`Series A`,backgroundColor:`rgba(237, 231, 246, 0.5)`,borderColor:Vl[`deep-purple-500`],pointBackgroundColor:Vl[`deep-purple-700`],borderWidth:2,data:[60,50,70,60,50,70,60]},{label:`Series B`,backgroundColor:`rgba(232, 245, 233, 0.5)`,borderColor:Vl[`blue-500`],pointBackgroundColor:Vl[`blue-700`],borderWidth:2,data:[70,75,85,70,75,85,70]}]},options:{legend:{display:!1}}})}let t=document.getElementById(`bar-chart`);t&&new Bl(t.getContext(`2d`),{type:`bar`,data:{labels:[`January`,`February`,`March`,`April`,`May`,`June`,`July`],datasets:[{label:`Dataset 1`,backgroundColor:Vl[`deep-purple-500`],borderColor:Vl[`deep-purple-800`],borderWidth:1,data:[10,50,20,40,60,30,70]},{label:`Dataset 2`,backgroundColor:Vl[`light-blue-500`],borderColor:Vl[`light-blue-800`],borderWidth:1,data:[10,50,20,40,60,30,70]}]},options:{responsive:!0,legend:{position:`bottom`}}});let n=document.getElementById(`area-chart`);n&&new Bl(n.getContext(`2d`),{type:`line`,data:{labels:[`January`,`February`,`March`,`April`,`May`,`June`,`July`],datasets:[{backgroundColor:`rgba(3, 169, 244, 0.5)`,borderColor:Vl[`light-blue-800`],data:[10,50,20,40,60,30,70],label:`Dataset`,fill:`start`}]}});let r=document.getElementById(`scatter-chart`);if(r){let e=r.getContext(`2d`);Bl.Scatter(e,{data:{datasets:[{label:`My First dataset`,borderColor:Vl[`red-500`],backgroundColor:Vl[`red-500`],data:[{x:10,y:20},{x:30,y:40},{x:50,y:60},{x:70,y:80},{x:90,y:100},{x:110,y:120},{x:130,y:140}]},{label:`My Second dataset`,borderColor:Vl[`green-500`],backgroundColor:Vl[`green-500`],data:[{x:150,y:160},{x:170,y:180},{x:190,y:200},{x:210,y:220},{x:230,y:240},{x:250,y:260},{x:270,y:280}]}]}})}})(),(function(e,t,n){(function(e){typeof define==`function`&&define.amd?define([`jquery`],e):jQuery&&!jQuery.fn.sparkline&&e(jQuery)})(function(r){var i={},a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,ee,O,te,k,A,ne,re,j,M=0;a=function(){return{common:{type:`line`,lineColor:`#00f`,fillColor:`#cdf`,defaultPixelsPerValue:3,width:`auto`,height:`auto`,composite:!1,tagValuesAttribute:`values`,tagOptionsPrefix:`spark`,enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:``,tooltipSuffix:``,disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:`,`,numberDecimalMark:`.`,disableTooltips:!1,disableInteraction:!1},line:{spotColor:`#f80`,highlightSpotColor:`#5f5`,highlightLineColor:`#f22`,spotRadius:1.5,minSpotColor:`#f80`,maxSpotColor:`#f80`,lineWidth:1,normalRangeMin:n,normalRangeMax:n,normalRangeColor:`#ccc`,drawNormalOnTop:!1,chartRangeMin:n,chartRangeMax:n,chartRangeMinX:n,chartRangeMaxX:n,tooltipFormat:new s(` {{prefix}}{{y}}{{suffix}}`)},bar:{barColor:`#3366cc`,negBarColor:`#f44`,stackedBarColor:[`#3366cc`,`#dc3912`,`#ff9900`,`#109618`,`#66aa00`,`#dd4477`,`#0099c6`,`#990099`],zeroColor:n,nullColor:n,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:n,chartRangeMin:n,chartRangeClip:!1,colorMap:n,tooltipFormat:new s(` {{prefix}}{{value}}{{suffix}}`)},tristate:{barWidth:4,barSpacing:1,posBarColor:`#6f6`,negBarColor:`#f44`,zeroBarColor:`#999`,colorMap:{},tooltipFormat:new s(` {{value:map}}`),tooltipValueLookups:{map:{"-1":`Loss`,0:`Draw`,1:`Win`}}},discrete:{lineHeight:`auto`,thresholdColor:n,thresholdValue:0,chartRangeMax:n,chartRangeMin:n,chartRangeClip:!1,tooltipFormat:new s(`{{prefix}}{{value}}{{suffix}}`)},bullet:{targetColor:`#f33`,targetWidth:3,performanceColor:`#33f`,rangeColors:[`#d3dafe`,`#a8b6ff`,`#7f94ff`],base:n,tooltipFormat:new s(`{{fieldkey:fields}} - {{value}}`),tooltipValueLookups:{fields:{r:`Range`,p:`Performance`,t:`Target`}}},pie:{offset:0,sliceColors:[`#3366cc`,`#dc3912`,`#ff9900`,`#109618`,`#66aa00`,`#dd4477`,`#0099c6`,`#990099`],borderWidth:0,borderColor:`#000`,tooltipFormat:new s(` {{value}} ({{percent.1}}%)`)},box:{raw:!1,boxLineColor:`#000`,boxFillColor:`#cdf`,whiskerColor:`#000`,outlierLineColor:`#333`,outlierFillColor:`#fff`,medianColor:`#f00`,showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:n,targetColor:`#4a2`,chartRangeMax:n,chartRangeMin:n,tooltipFormat:new s(`{{field:fields}}: {{value}}`),tooltipFormatFieldlistKey:`field`,tooltipValueLookups:{fields:{lq:`Lower Quartile`,med:`Median`,uq:`Upper Quartile`,lo:`Left Outlier`,ro:`Right Outlier`,lw:`Left Whisker`,rw:`Right Whisker`}}}}},O=`.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;box-sizing: content-box;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}`,o=function(){var e=function(){this.init.apply(this,arguments)},t;return arguments.length>1?(arguments[0]?(e.prototype=r.extend(new arguments[0],arguments[arguments.length-1]),e._super=arguments[0].prototype):e.prototype=arguments[arguments.length-1],arguments.length>2&&(t=Array.prototype.slice.call(arguments,1,-1),t.unshift(e.prototype),r.extend.apply(r,t))):e.prototype=arguments[0],e.prototype.cls=e,e},r.SPFormatClass=s=o({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(e,t){this.format=e,this.fclass=t},render:function(e,t,r){var i=this,a=e,o,s,c,l,u;return this.format.replace(this.fre,function(){var e;return s=arguments[1],c=arguments[3],o=i.precre.exec(s),o?(u=o[2],s=o[1]):u=!1,l=a[s],l===n?``:c&&t&&t[c]?(e=t[c],e.get?t[c].get(l)||l:t[c][l]||l):(p(l)&&(l=r.get(`numberFormatter`)?r.get(`numberFormatter`)(l):_(l,u,r.get(`numberDigitGroupCount`),r.get(`numberDigitGroupSep`),r.get(`numberDecimalMark`))),l)})}}),r.spformat=function(e,t){return new s(e,t)},c=function(e,t,n){return en?n:e},l=function(e,n){var r;return n===2?(r=t.floor(e.length/2),e.length%2?e[r]:(e[r-1]+e[r])/2):e.length%2?(r=(e.length*n+n)/4,r%1?(e[t.floor(r)]+e[t.floor(r)-1])/2:e[r-1]):(r=(e.length*n+2)/4,r%1?(e[t.floor(r)]+e[t.floor(r)-1])/2:e[r-1])},u=function(e){var t;switch(e){case`undefined`:e=n;break;case`null`:e=null;break;case`true`:e=!0;break;case`false`:e=!1;break;default:t=parseFloat(e),e==t&&(e=t)}return e},d=function(e){var t,n=[];for(t=e.length;t--;)n[t]=u(e[t]);return n},f=function(e,t){var n,r,i=[];for(n=0,r=e.length;n0;s-=n)e.splice(s,0,i);return e.join(``)},m=function(e,t,n){var r;for(r=t.length;r--;)if(!(n&&t[r]===null)&&t[r]!==e)return!1;return!0},g=function(e){return r.isArray(e)?e:[e]},h=function(t){var n,r;if(e.createStyleSheet)try{e.createStyleSheet().cssText=t;return}catch{r=!0}n=e.createElement(`style`),n.type=`text/css`,e.getElementsByTagName(`head`)[0].appendChild(n),r?e.styleSheets[e.styleSheets.length-1].cssText=t:n[typeof e.body.style.WebkitAppearance==`string`?`innerText`:`innerHTML`]=t},r.fn.simpledraw=function(t,i,a,o){var s,c;if(a&&(s=this.data(`_jqs_vcanvas`)))return s;if(r.fn.sparkline.canvas===!1)return!1;if(r.fn.sparkline.canvas===n){var l=e.createElement(`canvas`);if(l.getContext&&l.getContext(`2d`))r.fn.sparkline.canvas=function(e,t,n,r){return new ne(e,t,n,r)};else if(e.namespaces&&!e.namespaces.v)e.namespaces.add(`v`,`urn:schemas-microsoft-com:vml`,`#default#VML`),r.fn.sparkline.canvas=function(e,t,n,r){return new re(e,t,n)};else return r.fn.sparkline.canvas=!1,!1}return t===n&&(t=r(this).innerWidth()),i===n&&(i=r(this).innerHeight()),s=r.fn.sparkline.canvas(t,i,this,o),c=r(this).data(`_jqs_mhandler`),c&&c.registerCanvas(s),s},r.fn.cleardraw=function(){var e=this.data(`_jqs_vcanvas`);e&&e.reset()},r.RangeMapClass=v=o({init:function(e){var t,n,r=[];for(t in e)e.hasOwnProperty(t)&&typeof t==`string`&&t.indexOf(`:`)>-1&&(n=t.split(`:`),n[0]=n[0].length===0?-1/0:parseFloat(n[0]),n[1]=n[1].length===0?1/0:parseFloat(n[1]),n[2]=e[t],r.push(n));this.map=e,this.rangelist=r||!1},get:function(e){var t=this.rangelist,r,i,a;if((a=this.map[e])!==n)return a;if(t){for(r=t.length;r--;)if(i=t[r],i[0]<=e&&i[1]>=e)return i[2]}return n}}),r.range_map=function(e){return new v(e)},y=o({init:function(e,t){var n=r(e);this.$el=n,this.options=t,this.currentPageX=0,this.currentPageY=0,this.el=e,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!t.get(`disableTooltips`),this.highlightEnabled=!t.get(`disableHighlight`)},registerSparkline:function(e){this.splist.push(e),this.over&&this.updateDisplay()},registerCanvas:function(e){var t=r(e.canvas);this.canvas=e,this.$canvas=t,t.mouseenter(r.proxy(this.mouseenter,this)),t.mouseleave(r.proxy(this.mouseleave,this)),t.click(r.proxy(this.mouseclick,this))},reset:function(e){this.splist=[],this.tooltip&&e&&(this.tooltip.remove(),this.tooltip=n)},mouseclick:function(e){var t=r.Event(`sparklineClick`);t.originalEvent=e,t.sparklines=this.splist,this.$el.trigger(t)},mouseenter:function(t){r(e.body).unbind(`mousemove.jqs`),r(e.body).bind(`mousemove.jqs`,r.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=t.pageX,this.currentPageY=t.pageY,this.currentEl=t.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new b(this.options),this.tooltip.updatePosition(t.pageX,t.pageY)),this.updateDisplay()},mouseleave:function(){r(e.body).unbind(`mousemove.jqs`);var t=this.splist,n=t.length,i=!1,a,o;for(this.over=!1,this.currentEl=null,this.tooltip&&=(this.tooltip.remove(),null),o=0;o