mirror of https://github.com/FastGitORG/uptime
9 lines
231 KiB
JavaScript
9 lines
231 KiB
JavaScript
import{_ as t,a as e,b as i,c as n,i as a,s as r,d as o,e as s,S as l,f as u,g as h,h as c,k as f,m as d,r as v,u as g,v as p,w as m,x as y,y as b,z as x,A as _,t as k,j as w,n as M,B as S,p as P,q as D,l as O,O as A,o as C,E as T,F as R,G as L,H as E,C as I,D as z,$ as F,V,a0 as B,a1 as N,a2 as j,a3 as W,a4 as H,a5 as $,a6 as Y,K as U,a7 as X,a8 as q,a9 as K}from"./client.6bb31ae0.js";import{_ as G,h as Z,L as J,c as Q,a as tt,b as et}from"./createOctokit.3eb43daa.js";function it(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,r=e(t);if(n){var o=e(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return i(this,a)}}function nt(t){var e,i,n,a,r,o,s,l,v,g,p,m,y,b,x=t[1].name+"",T=("up"===t[1].status?_.i18n.up:_.i18n.down)+"",R=_.i18n.overallUptimeTitle+"",L=t[1].uptime+"",E=(void 0===t[1].showAverageResponseTime||t[1].showAverageResponseTime)&&rt(t);return{c:function(){e=u("h1"),i=u("a"),n=k(x),r=P(),o=u("span"),s=k(T),v=P(),g=u("dl"),p=u("dt"),m=k(R),y=u("dd"),b=k(L),E&&E.c(),this.h()},l:function(t){e=h(t,"H1",{});var a=c(e);i=h(a,"A",{class:!0,href:!0});var l=c(i);n=w(l,x),l.forEach(f),r=D(a),o=h(a,"SPAN",{class:!0});var u=c(o);s=w(u,T),u.forEach(f),a.forEach(f),v=D(t),g=h(t,"DL",{});var d=c(g);p=h(d,"DT",{});var _=c(p);m=w(_,R),_.forEach(f),y=h(d,"DD",{});var k=c(y);b=w(k,L),k.forEach(f),E&&E.l(d),d.forEach(f),this.h()},h:function(){O(i,"class","no-underline svelte-1d3m0a"),O(i,"href",a=t[1].url.startsWith("$")?"#":t[1].url),O(o,"class",l=A("tag ".concat(t[1].status))+" svelte-1d3m0a")},m:function(t,a){d(t,e,a),M(e,i),M(i,n),M(e,r),M(e,o),M(o,s),d(t,v,a),d(t,g,a),M(g,p),M(p,m),M(g,y),M(y,b),E&&E.m(g,null)},p:function(t,e){2&e&&x!==(x=t[1].name+"")&&S(n,x),2&e&&a!==(a=t[1].url.startsWith("$")?"#":t[1].url)&&O(i,"href",a),2&e&&T!==(T=("up"===t[1].status?_.i18n.up:_.i18n.down)+"")&&S(s,T),2&e&&l!==(l=A("tag ".concat(t[1].status))+" svelte-1d3m0a")&&O(o,"class",l),2&e&&L!==(L=t[1].uptime+"")&&S(b,L),void 0===t[1].showAverageResponseTime||t[1].showAverageResponseTime?E?E.p(t,e):((E=rt(t)).c(),E.m(g,null)):E&&(E.d(1),E=null)},i:C,o:C,d:function(t){t&&f(e),t&&f(v),t&&f(g),E&&E.d()}}}function at(t){var e,i;return e=new J({}),{c:function(){T(e.$$.fragment)},l:function(t){R(e.$$.fragment,t)},m:function(t,n){L(e,t,n),i=!0},p:C,i:function(t){i||(y(e.$$.fragment,t),i=!0)},o:function(t){p(e.$$.fragment,t),i=!1},d:function(t){E(e,t)}}}function rt(t){var e,i,n,a,r,o=_.i18n.averageResponseTimeTitle+"",s=t[1].time+"",l=_.i18n.ms+"";return{c:function(){e=u("dt"),i=k(o),n=u("dd"),a=k(s),r=k(l)},l:function(t){e=h(t,"DT",{});var u=c(e);i=w(u,o),u.forEach(f),n=h(t,"DD",{});var d=c(n);a=w(d,s),r=w(d,l),d.forEach(f)},m:function(t,o){d(t,e,o),M(e,i),d(t,n,o),M(n,a),M(n,r)},p:function(t,e){2&e&&s!==(s=t[1].time+"")&&S(a,s)},d:function(t){t&&f(e),t&&f(n)}}}function ot(t){var e,i,n,a,r=[at,nt],o=[];function s(t,e){return t[0]?0:t[1]?1:-1}return~(i=s(t))&&(n=o[i]=r[i](t)),{c:function(){e=u("section"),n&&n.c()},l:function(t){e=h(t,"SECTION",{});var i=c(e);n&&n.l(i),i.forEach(f)},m:function(t,n){d(t,e,n),~i&&o[i].m(e,null),a=!0},p:function(t,a){var l=v(a,1)[0],u=i;(i=s(t))===u?~i&&o[i].p(t,l):(n&&(g(),p(o[u],1,1,(function(){o[u]=null})),m()),~i?((n=o[i])?n.p(t,l):(n=o[i]=r[i](t)).c(),y(n,1),n.m(e,null)):n=null)},i:function(t){a||(y(n),a=!0)},o:function(t){p(n),a=!1},d:function(t){t&&f(e),~i&&o[i].d()}}}function st(t,e,i){var n=e.slug,a=!0,r=(_["status-website"]||{}).apiBaseUrl;r||(r="https://api.github.com");var o=r.includes("api.github.com")?"https://raw.githubusercontent.com":r,s=_.owner,l=_.repo,u=null;return b(G(x.mark((function t(){var e;return x.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("".concat(o,"/").concat(s,"/").concat(l,"/master/history/summary.json"));case 3:return e=t.sent,t.t0=i,t.next=7,e.json();case 7:t.t1=u=t.sent.find((function(t){return t.slug===n})),(0,t.t0)(1,t.t1),t.next=14;break;case 11:t.prev=11,t.t2=t.catch(0),Z(t.t2);case 14:i(0,a=!1);case 15:case"end":return t.stop()}}),t,null,[[0,11]])})))),t.$$set=function(t){"slug"in t&&i(2,n=t.slug)},[a,u,n]}var lt=function(e){t(u,l);var i=it(u);function u(t){var e;return n(this,u),e=i.call(this),a(o(e),t,st,ot,r,{slug:2}),e}return s(u)}();function ut(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,r=e(t);if(n){var o=e(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return i(this,a)}}function ht(t,e,i){var n=t.slice();return n[6]=e[i],n}function ct(t){for(var e,i,n,a,r=_.i18n.pastIncidents+"",o=t[1],s=[],l=0;l<o.length;l+=1)s[l]=vt(ht(t,o,l));return{c:function(){e=u("h2"),i=k(r),n=P();for(var t=0;t<s.length;t+=1)s[t].c();a=I(),this.h()},l:function(t){e=h(t,"H2",{class:!0});var o=c(e);i=w(o,r),o.forEach(f),n=D(t);for(var l=0;l<s.length;l+=1)s[l].l(t);a=I(),this.h()},h:function(){O(e,"class","svelte-18y4uo2")},m:function(t,r){d(t,e,r),M(e,i),d(t,n,r);for(var o=0;o<s.length;o+=1)s[o].m(t,r);d(t,a,r)},p:function(t,e){if(2&e){var i;for(o=t[1],i=0;i<o.length;i+=1){var n=ht(t,o,i);s[i]?s[i].p(n,e):(s[i]=vt(n),s[i].c(),s[i].m(a.parentNode,a))}for(;i<s.length;i+=1)s[i].d(1);s.length=o.length}},i:C,o:C,d:function(t){t&&f(e),t&&f(n),z(s,t),t&&f(a)}}}function ft(t){var e,i;return e=new J({}),{c:function(){T(e.$$.fragment)},l:function(t){R(e.$$.fragment,t)},m:function(t,n){L(e,t,n),i=!0},p:C,i:function(t){i||(y(e.$$.fragment,t),i=!0)},o:function(t){p(e.$$.fragment,t),i=!1},d:function(t){E(e,t)}}}function dt(t){var e,i,n=new Date(t[6].created_at).toLocaleDateString()+"";return{c:function(){e=u("h3"),i=k(n)},l:function(t){e=h(t,"H3",{});var a=c(e);i=w(a,n),a.forEach(f)},m:function(t,n){d(t,e,n),M(e,i)},p:function(t,e){2&e&&n!==(n=new Date(t[6].created_at).toLocaleDateString()+"")&&S(i,n)},d:function(t){t&&f(e)}}}function vt(t){var e,i,n,a,r,o,s,l,v,g,p,m,y,b,x,A=t[6].title.replace("🛑","").replace("⚠️","").trim()+"",C=_.i18n.pastIncidentsResolved.replace(/\$MINUTES/g,((new Date(t[6].closed_at).getTime()-new Date(t[6].created_at).getTime())/6e4).toFixed(0)).replace(/\$POSTS/g,t[6].comments)+"",T=_.i18n.incidentReport.replace(/\$NUMBER/g,t[6].number)+"",R=t[6].showHeading&&dt(t);return{c:function(){R&&R.c(),e=P(),i=u("article"),n=u("div"),a=u("div"),r=u("h4"),o=k(A),s=P(),l=u("div"),v=P(),g=u("div"),p=u("a"),m=k(T),b=P(),this.h()},l:function(t){R&&R.l(t),e=D(t),i=h(t,"ARTICLE",{class:!0});var u=c(i);n=h(u,"DIV",{class:!0});var d=c(n);a=h(d,"DIV",{});var y=c(a);r=h(y,"H4",{});var x=c(r);o=w(x,A),x.forEach(f),s=D(y),l=h(y,"DIV",{}),c(l).forEach(f),y.forEach(f),v=D(d),g=h(d,"DIV",{class:!0});var _=c(g);p=h(_,"A",{href:!0});var k=c(p);m=w(k,T),k.forEach(f),_.forEach(f),d.forEach(f),b=D(u),u.forEach(f),this.h()},h:function(){O(p,"href",y="".concat(_.path,"/incident/").concat(t[6].number)),O(g,"class","f r"),O(n,"class","f"),O(i,"class",x="down link "+(t[6].title.includes("degraded")?"degraded":""))},m:function(t,u){R&&R.m(t,u),d(t,e,u),d(t,i,u),M(i,n),M(n,a),M(a,r),M(r,o),M(a,s),M(a,l),l.innerHTML=C,M(n,v),M(n,g),M(g,p),M(p,m),M(i,b)},p:function(t,n){t[6].showHeading?R?R.p(t,n):((R=dt(t)).c(),R.m(e.parentNode,e)):R&&(R.d(1),R=null),2&n&&A!==(A=t[6].title.replace("🛑","").replace("⚠️","").trim()+"")&&S(o,A),2&n&&C!==(C=_.i18n.pastIncidentsResolved.replace(/\$MINUTES/g,((new Date(t[6].closed_at).getTime()-new Date(t[6].created_at).getTime())/6e4).toFixed(0)).replace(/\$POSTS/g,t[6].comments)+"")&&(l.innerHTML=C),2&n&&T!==(T=_.i18n.incidentReport.replace(/\$NUMBER/g,t[6].number)+"")&&S(m,T),2&n&&y!==(y="".concat(_.path,"/incident/").concat(t[6].number))&&O(p,"href",y),2&n&&x!==(x="down link "+(t[6].title.includes("degraded")?"degraded":""))&&O(i,"class",x)},d:function(t){R&&R.d(t),t&&f(e),t&&f(i)}}}function gt(t){var e,i,n,a,r=[ft,ct],o=[];function s(t,e){return t[0]?0:t[1].length?1:-1}return~(i=s(t))&&(n=o[i]=r[i](t)),{c:function(){e=u("section"),n&&n.c()},l:function(t){e=h(t,"SECTION",{});var i=c(e);n&&n.l(i),i.forEach(f)},m:function(t,n){d(t,e,n),~i&&o[i].m(e,null),a=!0},p:function(t,a){var l=v(a,1)[0],u=i;(i=s(t))===u?~i&&o[i].p(t,l):(n&&(g(),p(o[u],1,1,(function(){o[u]=null})),m()),~i?((n=o[i])?n.p(t,l):(n=o[i]=r[i](t)).c(),y(n,1),n.m(e,null)):n=null)},i:function(t){a||(y(n),a=!0)},o:function(t){p(n),a=!1},d:function(t){t&&f(e),~i&&o[i].d()}}}function pt(t,e,i){var n=e.slug,a=!0,r=Q(),o=_.owner,s=_.repo,l=[];return b(G(x.mark((function t(){return x.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=i,t.next=4,tt("closed-issues-".concat(o,"-").concat(s,"-").concat(n),(function(){return r.issues.listForRepo({owner:o,repo:s,state:"closed",filter:"all",sort:"created",direction:"desc",labels:"status,".concat(n)})}));case 4:t.t1=l=t.sent.data,(0,t.t0)(1,t.t1),t.next=11;break;case 8:t.prev=8,t.t2=t.catch(0),Z(t.t2);case 11:i(1,l=l.map((function(t,e){return t.showHeading=0===e||new Date(l[e-1].created_at).toLocaleDateString()!==new Date(t.created_at).toLocaleDateString(),t}))),i(0,a=!1);case 13:case"end":return t.stop()}}),t,null,[[0,8]])})))),t.$$set=function(t){"slug"in t&&i(2,n=t.slug)},[a,l,n]}var mt=function(e){t(u,l);var i=ut(u);function u(t){var e;return n(this,u),e=i.call(this),a(o(e),t,pt,gt,r,{slug:2}),e}return s(u)}();function yt(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return bt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return bt(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw r}}}}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var xt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function _t(t,e,i){var n=i||function(t){return Array.prototype.slice.call(t)},a=!1,r=[];return function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r=n(o),a||(a=!0,xt.call(window,(function(){a=!1,t.apply(e,r)})))}}var kt=function(t){return"start"===t?"left":"end"===t?"right":"center"},wt=function(t,e,i){return"start"===t?e:"end"===t?i:(e+i)/2};function Mt(){}var St,Pt=(St=0,function(){return St++});function Dt(t){return null==t}function Ot(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function At(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}var Ct=function(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)};function Tt(t,e){return Ct(t)?t:e}function Rt(t,e){return void 0===t?e:t}var Lt=function(t,e){return"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t};function Et(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function It(t,e,i,n){var a,r,o;if(Ot(t))if(r=t.length,n)for(a=r-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;a<r;a++)e.call(i,t[a],a);else if(At(t))for(r=(o=Object.keys(t)).length,a=0;a<r;a++)e.call(i,t[o[a]],o[a])}function zt(t,e){var i,n,a,r;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(a=t[i],r=e[i],a.datasetIndex!==r.datasetIndex||a.index!==r.index)return!1;return!0}function Ft(t){if(Ot(t))return t.map(Ft);if(At(t)){for(var e=Object.create(null),i=Object.keys(t),n=i.length,a=0;a<n;++a)e[i[a]]=Ft(t[i[a]]);return e}return t}function Vt(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function Bt(t,e,i,n){if(Vt(t)){var a=e[t],r=i[t];At(a)&&At(r)?Nt(a,r,n):e[t]=Ft(r)}}function Nt(t,e,i){var n=Ot(e)?e:[e],a=n.length;if(!At(t))return t;for(var r=(i=i||{}).merger||Bt,o=0;o<a;++o)if(At(e=n[o]))for(var s=Object.keys(e),l=0,u=s.length;l<u;++l)r(s[l],t,e,i);return t}function jt(t,e){return Nt(t,e,{merger:Wt})}function Wt(t,e,i){if(Vt(t)){var n=e[t],a=i[t];At(n)&&At(a)?jt(n,a):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ft(a))}}function Ht(t,e){var i=t.indexOf(".",e);return-1===i?t.length:i}function $t(t,e){if(""===e)return t;for(var i=0,n=Ht(e,i);t&&n>i;)t=t[e.slice(i,n)],n=Ht(e,i=n+1);return t}function Yt(t){return t.charAt(0).toUpperCase()+t.slice(1)}var Ut=function(t){return void 0!==t},Xt=function(t){return"function"==typeof t},qt=function(t,e){if(t.size!==e.size)return!1;var i,n=yt(t);try{for(n.s();!(i=n.n()).done;){var a=i.value;if(!e.has(a))return!1}}catch(t){n.e(t)}finally{n.f()}return!0};var Kt=Math.PI,Gt=2*Kt,Zt=Gt+Kt,Jt=Number.POSITIVE_INFINITY,Qt=Kt/180,te=Kt/2,ee=Kt/4,ie=2*Kt/3,ne=Math.log10,ae=Math.sign;function re(t){var e=Math.round(t);t=se(t,e,t/1e3)?e:t;var i=Math.pow(10,Math.floor(ne(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function oe(t){return!isNaN(parseFloat(t))&&isFinite(t)}function se(t,e,i){return Math.abs(t-e)<i}function le(t,e,i){var n,a,r;for(n=0,a=t.length;n<a;n++)r=t[n][i],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function ue(t){return t*(Kt/180)}function he(t){return t*(180/Kt)}function ce(t){if(Ct(t)){for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}}function fe(t,e){var i=e.x-t.x,n=e.y-t.y,a=Math.sqrt(i*i+n*n),r=Math.atan2(n,i);return r<-.5*Kt&&(r+=Gt),{angle:r,distance:a}}function de(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ve(t,e){return(t-e+Zt)%Gt-Kt}function ge(t){return(t%Gt+Gt)%Gt}function pe(t,e,i,n){var a=ge(t),r=ge(e),o=ge(i),s=ge(r-a),l=ge(o-a),u=ge(a-r),h=ge(a-o);return a===r||a===o||n&&r===o||s>l&&u<h}function me(t,e,i){return Math.max(e,Math.min(i,t))}function ye(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-6;return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}var be=function(t){return 0===t||1===t},xe=function(t,e,i){return-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Gt/i)},_e=function(t,e,i){return Math.pow(2,-10*t)*Math.sin((t-e)*Gt/i)+1},ke={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*te)},easeOutSine:function(t){return Math.sin(t*te)},easeInOutSine:function(t){return-.5*(Math.cos(Kt*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return be(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1)))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){return be(t)?t:xe(t,.075,.3)},easeOutElastic:function(t){return be(t)?t:_e(t,.075,.3)},easeInOutElastic:function(t){var e=.1125;return be(t)?t:t<.5?.5*xe(2*t,e,.45):.5+.5*_e(2*t-1,e,.45)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-ke.easeOutBounce(1-t)},easeOutBounce:function(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*ke.easeInBounce(2*t):.5*ke.easeOutBounce(2*t-1)+.5}};
|
|
/*!
|
|
* @kurkle/color v0.2.1
|
|
* https://github.com/kurkle/color#readme
|
|
* (c) 2022 Jukka Kurkela
|
|
* Released under the MIT License
|
|
*/
|
|
function we(t){return t+.5|0}var Me=function(t,e,i){return Math.max(Math.min(t,i),e)};function Se(t){return Me(we(2.55*t),0,255)}function Pe(t){return Me(we(255*t),0,255)}function De(t){return Me(we(t/2.55)/100,0,1)}function Oe(t){return Me(we(100*t),0,100)}var Ae={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},Ce=F("0123456789ABCDEF"),Te=function(t){return Ce[15&t]},Re=function(t){return Ce[(240&t)>>4]+Ce[15&t]},Le=function(t){return(240&t)>>4==(15&t)};function Ee(t){var e=function(t){return Le(t.r)&&Le(t.g)&&Le(t.b)&&Le(t.a)}(t)?Te:Re;return t?"#"+e(t.r)+e(t.g)+e(t.b)+function(t,e){return t<255?e(t):""}(t.a,e):void 0}var Ie=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ze(t,e,i){var n=e*Math.min(i,1-i),a=function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+t/30)%12;return i-n*Math.max(Math.min(a-3,9-a,1),-1)};return[a(0),a(8),a(4)]}function Fe(t,e,i){var n=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(n+t/60)%6;return i-i*e*Math.max(Math.min(a,4-a,1),0)};return[n(5),n(3),n(1)]}function Ve(t,e,i){var n,a=ze(t,1,.5);for(e+i>1&&(e*=n=1/(e+i),i*=n),n=0;n<3;n++)a[n]*=1-e-i,a[n]+=e;return a}function Be(t){var e,i,n,a=t.r/255,r=t.g/255,o=t.b/255,s=Math.max(a,r,o),l=Math.min(a,r,o),u=(s+l)/2;return s!==l&&(n=s-l,i=u>.5?n/(2-s-l):n/(s+l),e=function(t,e,i,n,a){return t===a?(e-i)/n+(e<i?6:0):e===a?(i-t)/n+2:(t-e)/n+4}(a,r,o,n,s),e=60*e+.5),[0|e,i||0,u]}function Ne(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(Pe)}function je(t,e,i){return Ne(ze,t,e,i)}function We(t){return(t%360+360)%360}function He(t){var e,i=Ie.exec(t),n=255;if(i){i[5]!==e&&(n=i[6]?Se(+i[5]):Pe(+i[5]));var a=We(+i[2]),r=+i[3]/100,o=+i[4]/100;return{r:(e="hwb"===i[1]?function(t,e,i){return Ne(Ve,t,e,i)}(a,r,o):"hsv"===i[1]?function(t,e,i){return Ne(Fe,t,e,i)}(a,r,o):je(a,r,o))[0],g:e[1],b:e[2],a:n}}}var $e,Ye={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"},Ue={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 Xe(t){$e||(($e=function(){var t,e,i,n,a,r={},o=Object.keys(Ue),s=Object.keys(Ye);for(t=0;t<o.length;t++){for(n=a=o[t],e=0;e<s.length;e++)i=s[e],a=a.replace(i,Ye[i]);i=parseInt(Ue[n],16),r[a]=[i>>16&255,i>>8&255,255&i]}return r}()).transparent=[0,0,0,0]);var e=$e[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}var qe=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;var Ke=function(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055},Ge=function(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)};function Ze(t,e,i){if(t){var n=Be(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=je(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function Je(t,e){return t?Object.assign(e||{},t):t}function Qe(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Pe(t[3]))):(e=Je(t,{r:0,g:0,b:0,a:1})).a=Pe(e.a),e}function ti(t){return"r"===t.charAt(0)?function(t){var e,i,n,a=qe.exec(t),r=255;if(a){if(a[7]!==e){var o=+a[7];r=a[8]?Se(o):Me(255*o,0,255)}return e=+a[1],i=+a[3],n=+a[5],{r:e=255&(a[2]?Se(e):Me(e,0,255)),g:i=255&(a[4]?Se(i):Me(i,0,255)),b:n=255&(a[6]?Se(n):Me(n,0,255)),a:r}}}(t):He(t)}var ei=function(){function t(e){if(n(this,t),e instanceof t)return e;var i,a,r,o,s=V(e);"object"===s?i=Qe(e):"string"===s&&(o=(a=e).length,"#"===a[0]&&(4===o||5===o?r={r:255&17*Ae[a[1]],g:255&17*Ae[a[2]],b:255&17*Ae[a[3]],a:5===o?17*Ae[a[4]]:255}:7!==o&&9!==o||(r={r:Ae[a[1]]<<4|Ae[a[2]],g:Ae[a[3]]<<4|Ae[a[4]],b:Ae[a[5]]<<4|Ae[a[6]],a:9===o?Ae[a[7]]<<4|Ae[a[8]]:255})),i=r||Xe(e)||ti(e)),this._rgb=i,this._valid=!!i}return s(t,[{key:"valid",get:function(){return this._valid}},{key:"rgb",get:function(){var t=Je(this._rgb);return t&&(t.a=De(t.a)),t},set:function(t){this._rgb=Qe(t)}},{key:"rgbString",value:function(){return this._valid?(t=this._rgb)&&(t.a<255?"rgba(".concat(t.r,", ").concat(t.g,", ").concat(t.b,", ").concat(De(t.a),")"):"rgb(".concat(t.r,", ").concat(t.g,", ").concat(t.b,")")):void 0;var t}},{key:"hexString",value:function(){return this._valid?Ee(this._rgb):void 0}},{key:"hslString",value:function(){return this._valid?function(t){if(t){var e=Be(t),i=e[0],n=Oe(e[1]),a=Oe(e[2]);return t.a<255?"hsla(".concat(i,", ").concat(n,"%, ").concat(a,"%, ").concat(De(t.a),")"):"hsl(".concat(i,", ").concat(n,"%, ").concat(a,"%)")}}(this._rgb):void 0}},{key:"mix",value:function(t,e){if(t){var i,n=this.rgb,a=t.rgb,r=e===i?.5:e,o=2*r-1,s=n.a-a.a,l=((o*s==-1?o:(o+s)/(1+o*s))+1)/2;i=1-l,n.r=255&l*n.r+i*a.r+.5,n.g=255&l*n.g+i*a.g+.5,n.b=255&l*n.b+i*a.b+.5,n.a=r*n.a+(1-r)*a.a,this.rgb=n}return this}},{key:"interpolate",value:function(t,e){return t&&(this._rgb=function(t,e,i){var n=Ge(De(t.r)),a=Ge(De(t.g)),r=Ge(De(t.b));return{r:Pe(Ke(n+i*(Ge(De(e.r))-n))),g:Pe(Ke(a+i*(Ge(De(e.g))-a))),b:Pe(Ke(r+i*(Ge(De(e.b))-r))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}},{key:"clone",value:function(){return new t(this.rgb)}},{key:"alpha",value:function(t){return this._rgb.a=Pe(t),this}},{key:"clearer",value:function(t){return this._rgb.a*=1-t,this}},{key:"greyscale",value:function(){var t=this._rgb,e=we(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}},{key:"opaquer",value:function(t){return this._rgb.a*=1+t,this}},{key:"negate",value:function(){var t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}},{key:"lighten",value:function(t){return Ze(this._rgb,2,t),this}},{key:"darken",value:function(t){return Ze(this._rgb,2,-t),this}},{key:"saturate",value:function(t){return Ze(this._rgb,1,t),this}},{key:"desaturate",value:function(t){return Ze(this._rgb,1,-t),this}},{key:"rotate",value:function(t){return function(t,e){var i=Be(t);i[0]=We(i[0]+e),i=je(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}]),t}();function ii(t){return new ei(t)}function ni(t){if(t&&"object"===V(t)){var e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function ai(t){return ni(t)?t:ii(t)}function ri(t){return ni(t)?t:ii(t).saturate(.5).darken(.1).hexString()}var oi=Object.create(null),si=Object.create(null);function li(t,e){if(!e)return t;for(var i=e.split("."),n=0,a=i.length;n<a;++n){var r=i[n];t=t[r]||(t[r]=Object.create(null))}return t}function ui(t,e,i){return"string"==typeof e?Nt(li(t,e),i):Nt(li(t,""),e)}var hi=function(){function t(e){n(this,t),this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=function(t){return t.chart.platform.getDevicePixelRatio()},this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=function(t,e){return ri(e.backgroundColor)},this.hoverBorderColor=function(t,e){return ri(e.borderColor)},this.hoverColor=function(t,e){return ri(e.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)}return s(t,[{key:"set",value:function(t,e){return ui(this,t,e)}},{key:"get",value:function(t){return li(this,t)}},{key:"describe",value:function(t,e){return ui(si,t,e)}},{key:"override",value:function(t,e){return ui(oi,t,e)}},{key:"route",value:function(t,e,i,n){var a,r=li(this,t),o=li(this,i),s="_"+e;Object.defineProperties(r,(et(a={},s,{value:r[e],writable:!0}),et(a,e,{enumerable:!0,get:function(){var t=this[s],e=o[n];return At(t)?Object.assign({},e,t):Rt(t,e)},set:function(t){this[s]=t}}),a))}}]),t}(),ci=new hi({_scriptable:function(t){return!t.startsWith("on")},_indexable:function(t){return"events"!==t},hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function fi(t,e,i,n,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,i.push(a)),r>n&&(n=r),n}function di(t,e,i,n){var a=(n=n||{}).data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},r=n.garbageCollect=[],n.font=e),t.save(),t.font=e;var o,s,l,u,h,c=0,f=i.length;for(o=0;o<f;o++)if(null!=(u=i[o])&&!0!==Ot(u))c=fi(t,a,r,c,u);else if(Ot(u))for(s=0,l=u.length;s<l;s++)null==(h=u[s])||Ot(h)||(c=fi(t,a,r,c,h));t.restore();var d=r.length/2;if(d>i.length){for(o=0;o<d;o++)delete a[r[o]];r.splice(0,d)}return c}function vi(t,e,i){var n=t.currentDevicePixelRatio,a=0!==i?Math.max(i/2,.5):0;return Math.round((e-a)*n)/n+a}function gi(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function pi(t,e,i,n){var a,r,o,s,l,u=e.pointStyle,h=e.rotation,c=e.radius,f=(h||0)*Qt;if(u&&"object"===V(u)&&("[object HTMLImageElement]"===(a=u.toString())||"[object HTMLCanvasElement]"===a))return t.save(),t.translate(i,n),t.rotate(f),t.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),void t.restore();if(!(isNaN(c)||c<=0)){switch(t.beginPath(),u){default:t.arc(i,n,c,0,Gt),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(f)*c,n-Math.cos(f)*c),f+=ie,t.lineTo(i+Math.sin(f)*c,n-Math.cos(f)*c),f+=ie,t.lineTo(i+Math.sin(f)*c,n-Math.cos(f)*c),t.closePath();break;case"rectRounded":s=c-(l=.516*c),r=Math.cos(f+ee)*s,o=Math.sin(f+ee)*s,t.arc(i-r,n-o,l,f-Kt,f-te),t.arc(i+o,n-r,l,f-te,f),t.arc(i+r,n+o,l,f,f+te),t.arc(i-o,n+r,l,f+te,f+Kt),t.closePath();break;case"rect":if(!h){s=Math.SQRT1_2*c,t.rect(i-s,n-s,2*s,2*s);break}f+=ee;case"rectRot":r=Math.cos(f)*c,o=Math.sin(f)*c,t.moveTo(i-r,n-o),t.lineTo(i+o,n-r),t.lineTo(i+r,n+o),t.lineTo(i-o,n+r),t.closePath();break;case"crossRot":f+=ee;case"cross":r=Math.cos(f)*c,o=Math.sin(f)*c,t.moveTo(i-r,n-o),t.lineTo(i+r,n+o),t.moveTo(i+o,n-r),t.lineTo(i-o,n+r);break;case"star":r=Math.cos(f)*c,o=Math.sin(f)*c,t.moveTo(i-r,n-o),t.lineTo(i+r,n+o),t.moveTo(i+o,n-r),t.lineTo(i-o,n+r),f+=ee,r=Math.cos(f)*c,o=Math.sin(f)*c,t.moveTo(i-r,n-o),t.lineTo(i+r,n+o),t.moveTo(i+o,n-r),t.lineTo(i-o,n+r);break;case"line":r=Math.cos(f)*c,o=Math.sin(f)*c,t.moveTo(i-r,n-o),t.lineTo(i+r,n+o);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(f)*c,n+Math.sin(f)*c)}t.fill(),e.borderWidth>0&&t.stroke()}}function mi(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function yi(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function bi(t){t.restore()}function xi(t,e,i,n,a){if(!e)return t.lineTo(i.x,i.y);if("middle"===a){var r=(e.x+i.x)/2;t.lineTo(r,e.y),t.lineTo(r,i.y)}else"after"===a!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function _i(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function ki(t,e,i,n,a){var r,o,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},l=Ot(e)?e:[e],u=s.strokeWidth>0&&""!==s.strokeColor;for(t.save(),t.font=a.string,wi(t,s),r=0;r<l.length;++r)o=l[r],u&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Dt(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(o,i,n,s.maxWidth)),t.fillText(o,i,n,s.maxWidth),Mi(t,i,n,o,s),n+=a.lineHeight;t.restore()}function wi(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Dt(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function Mi(t,e,i,n,a){if(a.strikethrough||a.underline){var r=t.measureText(n),o=e-r.actualBoundingBoxLeft,s=e+r.actualBoundingBoxRight,l=i-r.actualBoundingBoxAscent,u=i+r.actualBoundingBoxDescent,h=a.strikethrough?(l+u)/2:u;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(o,h),t.lineTo(s,h),t.stroke()}}function Si(t,e){var i=e.x,n=e.y,a=e.w,r=e.h,o=e.radius;t.arc(i+o.topLeft,n+o.topLeft,o.topLeft,-te,Kt,!0),t.lineTo(i,n+r-o.bottomLeft),t.arc(i+o.bottomLeft,n+r-o.bottomLeft,o.bottomLeft,Kt,te,!0),t.lineTo(i+a-o.bottomRight,n+r),t.arc(i+a-o.bottomRight,n+r-o.bottomRight,o.bottomRight,te,0,!0),t.lineTo(i+a,n+o.topRight),t.arc(i+a-o.topRight,n+o.topRight,o.topRight,0,-te,!0),t.lineTo(i+o.topLeft,n)}var Pi=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Di=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Oi(t,e){var i=(""+t).match(Pi);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function Ai(t,e){var i,n={},a=At(e),r=a?Object.keys(e):e,o=At(t)?a?function(i){return Rt(t[i],t[e[i]])}:function(e){return t[e]}:function(){return t},s=yt(r);try{for(s.s();!(i=s.n()).done;){var l=i.value;n[l]=+o(l)||0}}catch(t){s.e(t)}finally{s.f()}return n}function Ci(t){return Ai(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ti(t){return Ai(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ri(t){var e=Ci(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Li(t,e){t=t||{},e=e||ci.font;var i=Rt(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));var n=Rt(t.style,e.style);n&&!(""+n).match(Di)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");var a={family:Rt(t.family,e.family),lineHeight:Oi(Rt(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:Rt(t.weight,e.weight),string:""};return a.string=function(t){return!t||Dt(t.size)||Dt(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(a),a}function Ei(t,e,i,n){var a,r,o,s=!0;for(a=0,r=t.length;a<r;++a)if(void 0!==(o=t[a])&&(void 0!==e&&"function"==typeof o&&(o=o(e),s=!1),void 0!==i&&Ot(o)&&(o=o[i%o.length],s=!1),void 0!==o))return n&&!s&&(n.cacheable=!1),o}function Ii(t,e){return Object.assign(Object.create(t),e)}function zi(t,e,i){i=i||function(i){return t[i]<e};for(var n,a=t.length-1,r=0;a-r>1;)i(n=r+a>>1)?r=n:a=n;return{lo:r,hi:a}}var Fi=function(t,e,i){return zi(t,i,(function(n){return t[n][e]<i}))},Vi=function(t,e,i){return zi(t,i,(function(n){return t[n][e]>=i}))};var Bi=["push","pop","shift","splice","unshift"];function Ni(t,e){var i=t._chartjs;if(i){var n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(Bi.forEach((function(e){delete t[e]})),delete t._chartjs)}}function ji(t){var e,i,n=new Set;for(e=0,i=t.length;e<i;++e)n.add(t[e]);return n.size===i?t:Array.from(n)}function Wi(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,a=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return t[0]};Ut(a)||(a=tn("_fallback",t));var o=(et(e={},Symbol.toStringTag,"Object"),et(e,"_cacheable",!0),et(e,"_scopes",t),et(e,"_rootScopes",n),et(e,"_fallback",a),et(e,"_getTarget",r),et(e,"override",(function(e){return Wi([e].concat(F(t)),i,n,a)})),e);return new Proxy(o,{deleteProperty:function(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get:function(e,n){return Xi(e,n,(function(){return Qi(n,i,t,e)}))},getOwnPropertyDescriptor:function(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf:function(){return Reflect.getPrototypeOf(t[0])},has:function(t,e){return en(t).includes(e)},ownKeys:function(t){return en(t)},set:function(t,e,i){var n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function Hi(t,e,i,n){var a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:$i(t,n),setContext:function(e){return Hi(t,e,i,n)},override:function(a){return Hi(t.override(a),e,i,n)}};return new Proxy(a,{deleteProperty:function(e,i){return delete e[i],delete t[i],!0},get:function(t,e,i){return Xi(t,e,(function(){return function(t,e,i){var n=t._proxy,a=t._context,r=t._subProxy,o=t._descriptors,s=n[e];Xt(s)&&o.isScriptable(e)&&(s=function(t,e,i,n){var a=i._proxy,r=i._context,o=i._subProxy,s=i._stack;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t),e=e(r,o||n),s.delete(t),Ui(t,e)&&(e=Zi(a._scopes,a,t,e));return e}(e,s,t,i));Ot(s)&&s.length&&(s=function(t,e,i,n){var a=i._proxy,r=i._context,o=i._subProxy,s=i._descriptors;if(Ut(r.index)&&n(t))e=e[r.index%e.length];else if(At(e[0])){var l=e,u=a._scopes.filter((function(t){return t!==l}));e=[];var h,c=yt(l);try{for(c.s();!(h=c.n()).done;){var f=Zi(u,a,t,h.value);e.push(Hi(f,r,o&&o[t],s))}}catch(t){c.e(t)}finally{c.f()}}return e}(e,s,t,o.isIndexable));Ui(e,s)&&(s=Hi(s,a,r&&r[e],o));return s}(t,e,i)}))},getOwnPropertyDescriptor:function(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf:function(){return Reflect.getPrototypeOf(t)},has:function(e,i){return Reflect.has(t,i)},ownKeys:function(){return Reflect.ownKeys(t)},set:function(e,i,n){return t[i]=n,delete e[i],!0}})}function $i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0},i=t._scriptable,n=void 0===i?e.scriptable:i,a=t._indexable,r=void 0===a?e.indexable:a,o=t._allKeys,s=void 0===o?e.allKeys:o;return{allKeys:s,scriptable:n,indexable:r,isScriptable:Xt(n)?n:function(){return n},isIndexable:Xt(r)?r:function(){return r}}}var Yi=function(t,e){return t?t+Yt(e):e},Ui=function(t,e){return At(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object)};function Xi(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];var n=i();return t[e]=n,n}function qi(t,e,i){return Xt(t)?t(e,i):t}var Ki=function(t,e){return!0===t?e:"string"==typeof t?$t(e,t):void 0};function Gi(t,e,i,n,a){var r,o=yt(e);try{for(o.s();!(r=o.n()).done;){var s=r.value,l=Ki(i,s);if(l){t.add(l);var u=qi(l._fallback,i,a);if(Ut(u)&&u!==i&&u!==n)return u}else if(!1===l&&Ut(n)&&i!==n)return null}}catch(t){o.e(t)}finally{o.f()}return!1}function Zi(t,e,i,n){var a=e._rootScopes,r=qi(e._fallback,i,n),o=[].concat(F(t),F(a)),s=new Set;s.add(n);var l=Ji(s,o,i,r||i,n);return null!==l&&((!Ut(r)||r===i||null!==(l=Ji(s,o,r,l,n)))&&Wi(Array.from(s),[""],a,r,(function(){return function(t,e,i){var n=t._getTarget();e in n||(n[e]={});var a=n[e];if(Ot(a)&&At(i))return i;return a}(e,i,n)})))}function Ji(t,e,i,n,a){for(;i;)i=Gi(t,e,i,n,a);return i}function Qi(t,e,i,n){var a,r,o=yt(e);try{for(o.s();!(r=o.n()).done;){var s=r.value;if(a=tn(Yi(s,t),i),Ut(a))return Ui(t,a)?Zi(i,n,t,a):a}}catch(t){o.e(t)}finally{o.f()}}function tn(t,e){var i,n=yt(e);try{for(n.s();!(i=n.n()).done;){var a=i.value;if(a){var r=a[t];if(Ut(r))return r}}}catch(t){n.e(t)}finally{n.f()}}function en(t){var e=t._keys;return e||(e=t._keys=function(t){var e,i=new Set,n=yt(t);try{for(n.s();!(e=n.n()).done;){var a,r=e.value,o=yt(Object.keys(r).filter((function(t){return!t.startsWith("_")})));try{for(o.s();!(a=o.n()).done;){var s=a.value;i.add(s)}}catch(t){o.e(t)}finally{o.f()}}}catch(t){n.e(t)}finally{n.f()}return Array.from(i)}(t._scopes)),e}function nn(t,e,i,n){var a,r,o,s,l=t.iScale,u=this._parsing.key,h=void 0===u?"r":u,c=new Array(n);for(a=0,r=n;a<r;++a)s=e[o=a+i],c[a]={r:l.parse($t(s,h),o)};return c}var an=Number.EPSILON||1e-14,rn=function(t,e){return e<t.length&&!t[e].skip&&t[e]},on=function(t){return"x"===t?"y":"x"};function sn(t,e,i){for(var n,a,r,o,s,l=t.length,u=rn(t,0),h=0;h<l-1;++h)s=u,u=rn(t,h+1),s&&u&&(se(e[h],0,an)?i[h]=i[h+1]=0:(n=i[h]/e[h],a=i[h+1]/e[h],(o=Math.pow(n,2)+Math.pow(a,2))<=9||(r=3/Math.sqrt(o),i[h]=n*r*e[h],i[h+1]=a*r*e[h])))}function ln(t,e){for(var i,n,a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",o=on(r),s=t.length,l=rn(t,0),u=0;u<s;++u)if(n=a,a=l,l=rn(t,u+1),a){var h=a[r],c=a[o];n&&(i=(h-n[r])/3,a["cp1".concat(r)]=h-i,a["cp1".concat(o)]=c-i*e[u]),l&&(i=(l[r]-h)/3,a["cp2".concat(r)]=h+i,a["cp2".concat(o)]=c+i*e[u])}}function un(t,e,i){return Math.max(Math.min(t,i),e)}function hn(t,e,i,n,a){var r,o,s,l,u,h,c,f,d,v,g,p,m,y,b,x,_;if(e.spanGaps&&(t=t.filter((function(t){return!t.skip}))),"monotone"===e.cubicInterpolationMode)!function(t){var e,i,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",r=on(a),o=t.length,s=Array(o).fill(0),l=Array(o),u=rn(t,0);for(e=0;e<o;++e)if(i=n,n=u,u=rn(t,e+1),n){if(u){var h=u[a]-n[a];s[e]=0!==h?(u[r]-n[r])/h:0}l[e]=i?u?ae(s[e-1])!==ae(s[e])?0:(s[e-1]+s[e])/2:s[e-1]:s[e]}sn(t,s,l),ln(t,l,a)}(t,a);else{var k=n?t[t.length-1]:t[0];for(r=0,o=t.length;r<o;++r)s=t[r],u=k,h=s,c=t[Math.min(r+1,o-(n?0:1))%o],f=e.tension,d=void 0,v=void 0,g=void 0,p=void 0,m=void 0,y=void 0,b=void 0,x=void 0,_=void 0,d=u.skip?h:u,v=h,g=c.skip?h:c,p=de(v,d),m=de(g,v),y=p/(p+m),b=m/(p+m),x=f*(y=isNaN(y)?0:y),_=f*(b=isNaN(b)?0:b),l={previous:{x:v.x-x*(g.x-d.x),y:v.y-x*(g.y-d.y)},next:{x:v.x+_*(g.x-d.x),y:v.y+_*(g.y-d.y)}},s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,k=s}e.capBezierPoints&&function(t,e){var i,n,a,r,o,s=mi(t[0],e);for(i=0,n=t.length;i<n;++i)o=r,r=s,s=i<n-1&&mi(t[i+1],e),r&&(a=t[i],o&&(a.cp1x=un(a.cp1x,e.left,e.right),a.cp1y=un(a.cp1y,e.top,e.bottom)),s&&(a.cp2x=un(a.cp2x,e.left,e.right),a.cp2y=un(a.cp2y,e.top,e.bottom)))}(t,i)}function cn(){return"undefined"!=typeof window&&"undefined"!=typeof document}function fn(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function dn(t,e,i){var n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}var vn=function(t){return window.getComputedStyle(t,null)};var gn=["top","right","bottom","left"];function pn(t,e,i){var n={};i=i?"-"+i:"";for(var a=0;a<4;a++){var r=gn[a];n[r]=parseFloat(t[e+"-"+r+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function mn(t,e){if("native"in t)return t;var i=e.canvas,n=e.currentDevicePixelRatio,a=vn(i),r="border-box"===a.boxSizing,o=pn(a,"padding"),s=pn(a,"border","width"),l=function(t,e){var i,n,a=t.touches,r=a&&a.length?a[0]:t,o=r.offsetX,s=r.offsetY,l=!1;if(function(t,e,i){return(t>0||e>0)&&(!i||!i.shadowRoot)}(o,s,t.target))i=o,n=s;else{var u=e.getBoundingClientRect();i=r.clientX-u.left,n=r.clientY-u.top,l=!0}return{x:i,y:n,box:l}}(t,i),u=l.x,h=l.y,c=l.box,f=o.left+(c&&s.left),d=o.top+(c&&s.top),v=e.width,g=e.height;return r&&(v-=o.width+s.width,g-=o.height+s.height),{x:Math.round((u-f)/v*i.width/n),y:Math.round((h-d)/g*i.height/n)}}var yn=function(t){return Math.round(10*t)/10};function bn(t,e,i,n){var a=vn(t),r=pn(a,"margin"),o=dn(a.maxWidth,t,"clientWidth")||Jt,s=dn(a.maxHeight,t,"clientHeight")||Jt,l=function(t,e,i){var n,a;if(void 0===e||void 0===i){var r=fn(t);if(r){var o=r.getBoundingClientRect(),s=vn(r),l=pn(s,"border","width"),u=pn(s,"padding");e=o.width-u.width-l.width,i=o.height-u.height-l.height,n=dn(s.maxWidth,r,"clientWidth"),a=dn(s.maxHeight,r,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Jt,maxHeight:a||Jt}}(t,e,i),u=l.width,h=l.height;if("content-box"===a.boxSizing){var c=pn(a,"border","width"),f=pn(a,"padding");u-=f.width+c.width,h-=f.height+c.height}return u=Math.max(0,u-r.width),h=Math.max(0,n?Math.floor(u/n):h-r.height),u=yn(Math.min(u,o,l.maxWidth)),h=yn(Math.min(h,s,l.maxHeight)),u&&!h&&(h=yn(u/2)),{width:u,height:h}}function xn(t,e,i){var n=e||1,a=Math.floor(t.height*n),r=Math.floor(t.width*n);t.height=a/n,t.width=r/n;var o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height="".concat(t.height,"px"),o.style.width="".concat(t.width,"px")),(t.currentDevicePixelRatio!==n||o.height!==a||o.width!==r)&&(t.currentDevicePixelRatio=n,o.height=a,o.width=r,t.ctx.setTransform(n,0,0,n,0,0),!0)}var _n=function(){var t=!1;try{var e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function kn(t,e){var i=function(t,e){return vn(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function wn(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Mn(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Sn(t,e,i,n){var a={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=wn(t,a,i),s=wn(a,r,i),l=wn(r,e,i),u=wn(o,s,i),h=wn(s,l,i);return wn(u,h,i)}var Pn=new Map;function Dn(t,e,i){return function(t,e){e=e||{};var i=t+JSON.stringify(e),n=Pn.get(i);return n||(n=new Intl.NumberFormat(t,e),Pn.set(i,n)),n}(e,i).format(t)}function On(t,e,i){return t?function(t,e){return{x:function(i){return t+t+e-i},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}}(e,i):{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}}function An(t,e){var i,n;"ltr"!==e&&"rtl"!==e||(n=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Cn(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Tn(t){return"angle"===t?{between:pe,compare:ve,normalize:ge}:{between:ye,compare:function(t,e){return t-e},normalize:function(t){return t}}}function Rn(t){var e=t.start,i=t.end,n=t.count;return{start:e%n,end:i%n,loop:t.loop&&(i-e+1)%n==0,style:t.style}}function Ln(t,e,i){if(!i)return[t];for(var n,a,r,o=i.property,s=i.start,l=i.end,u=e.length,h=Tn(o),c=h.compare,f=h.between,d=h.normalize,v=function(t,e,i){var n,a,r=i.property,o=i.start,s=i.end,l=Tn(r),u=l.between,h=l.normalize,c=e.length,f=t.start,d=t.end,v=t.loop;if(v){for(f+=c,d+=c,n=0,a=c;n<a&&u(h(e[f%c][r]),o,s);++n)f--,d--;f%=c,d%=c}return d<f&&(d+=c),{start:f,end:d,loop:v,style:t.style}}(t,e,i),g=v.start,p=v.end,m=v.loop,y=v.style,b=[],x=!1,_=null,k=function(){return x||f(s,r,n)&&0!==c(s,r)},w=function(){return!x||0===c(l,n)||f(l,r,n)},M=g,S=g;M<=p;++M)(a=e[M%u]).skip||(n=d(a[o]))!==r&&(x=f(n,s,l),null===_&&k()&&(_=0===c(n,s)?M:S),null!==_&&w()&&(b.push(Rn({start:_,end:M,loop:m,count:u,style:y})),_=null),S=M,r=n);return null!==_&&b.push(Rn({start:_,end:p,loop:m,count:u,style:y})),b}function En(t,e){for(var i=[],n=t.segments,a=0;a<n.length;a++){var r=Ln(n[a],t.points,e);r.length&&i.push.apply(i,F(r))}return i}function In(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){var a=t._chart.getContext(),r=zn(t.options),o=t._datasetIndex,s=t.options.spanGaps,l=i.length,u=[],h=r,c=e[0].start,f=c;function d(t,e,n,a){var r=s?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=r;for(;i[e%l].skip;)e+=r;t%l!=e%l&&(u.push({start:t%l,end:e%l,loop:n,style:a}),h=a,c=e%l)}}var v,g=yt(e);try{for(g.s();!(v=g.n()).done;){var p=v.value;c=s?c:p.start;var m=i[c%l],y=void 0;for(f=c+1;f<=p.end;f++){var b=i[f%l];Fn(y=zn(n.setContext(Ii(a,{type:"segment",p0:m,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),h)&&d(c,f-1,p.loop,h),m=b,h=y}c<f-1&&d(c,f-1,p.loop,h)}}catch(t){g.e(t)}finally{g.f()}return u}(t,e,i,n):e}function zn(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Fn(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}function Vn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Bn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Vn(Object(i),!0).forEach((function(e){et(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Vn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Nn(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,r=e(t);if(n){var o=e(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return i(this,a)}}function jn(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return Wn(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Wn(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw r}}}}function Wn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var Hn=new(function(){function t(){n(this,t),this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}return s(t,[{key:"_notify",value:function(t,e,i,n){var a=e.listeners[n],r=e.duration;a.forEach((function(n){return n({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)})}))}},{key:"_refresh",value:function(){var t=this;this._request||(this._running=!0,this._request=xt.call(window,(function(){t._update(),t._request=null,t._running&&t._refresh()})))}},{key:"_update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),i=0;this._charts.forEach((function(n,a){if(n.running&&n.items.length){for(var r,o=n.items,s=o.length-1,l=!1;s>=0;--s)(r=o[s])._active?(r._total>n.duration&&(n.duration=r._total),r.tick(e),l=!0):(o[s]=o[o.length-1],o.pop());l&&(a.draw(),t._notify(a,n,e,"progress")),o.length||(n.running=!1,t._notify(a,n,e,"complete"),n.initial=!1),i+=o.length}})),this._lastDate=e,0===i&&(this._running=!1)}},{key:"_getAnims",value:function(t){var e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}},{key:"listen",value:function(t,e,i){this._getAnims(t).listeners[e].push(i)}},{key:"add",value:function(t,e){var i;e&&e.length&&(i=this._getAnims(t).items).push.apply(i,F(e))}},{key:"has",value:function(t){return this._getAnims(t).items.length>0}},{key:"start",value:function(t){var e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((function(t,e){return Math.max(t,e._duration)}),0),this._refresh())}},{key:"running",value:function(t){if(!this._running)return!1;var e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}},{key:"stop",value:function(t){var e=this._charts.get(t);if(e&&e.items.length){for(var i=e.items,n=i.length-1;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}}},{key:"remove",value:function(t){return this._charts.delete(t)}}]),t}()),$n={boolean:function(t,e,i){return i>.5?e:t},color:function(t,e,i){var n=ai(t||"transparent"),a=n.valid&&ai(e||"transparent");return a&&a.valid?a.mix(n,i).hexString():e},number:function(t,e,i){return t+(e-t)*i}},Yn=function(){function t(e,i,a,r){n(this,t);var o=i[a];r=Ei([e.to,r,o,e.from]);var s=Ei([e.from,o,r]);this._active=!0,this._fn=e.fn||$n[e.type||V(s)],this._easing=ke[e.easing]||ke.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=i,this._prop=a,this._from=s,this._to=r,this._promises=void 0}return s(t,[{key:"active",value:function(){return this._active}},{key:"update",value:function(t,e,i){if(this._active){this._notify(!1);var n=this._target[this._prop],a=i-this._start,r=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Ei([t.to,e,n,t.from]),this._from=Ei([t.from,n,e])}}},{key:"cancel",value:function(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}},{key:"tick",value:function(t){var e,i=t-this._start,n=this._duration,a=this._prop,r=this._from,o=this._loop,s=this._to;if(this._active=r!==s&&(o||i<n),!this._active)return this._target[a]=s,void this._notify(!0);i<0?this._target[a]=r:(e=i/n%2,e=o&&e>1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[a]=this._fn(r,s,e))}},{key:"wait",value:function(){var t=this._promises||(this._promises=[]);return new Promise((function(e,i){t.push({res:e,rej:i})}))}},{key:"_notify",value:function(t){for(var e=t?"res":"rej",i=this._promises||[],n=0;n<i.length;n++)i[n][e]()}}]),t}();ci.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});var Un=Object.keys(ci.animation);ci.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:function(t){return"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}}),ci.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),ci.describe("animations",{_fallback:"animation"}),ci.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:function(t){return 0|t}}}}});var Xn=function(){function t(e,i){n(this,t),this._chart=e,this._properties=new Map,this.configure(i)}return s(t,[{key:"configure",value:function(t){if(At(t)){var e=this._properties;Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];if(At(n)){var a,r={},o=jn(Un);try{for(o.s();!(a=o.n()).done;){var s=a.value;r[s]=n[s]}}catch(t){o.e(t)}finally{o.f()}(Ot(n.properties)&&n.properties||[i]).forEach((function(t){t!==i&&e.has(t)||e.set(t,r)}))}}))}}},{key:"_animateOptions",value:function(t,e){var i=e.options,n=function(t,e){if(!e)return;var i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];var a=this._createAnimations(n,i);return i.$shared&&function(t,e){for(var i=[],n=Object.keys(e),a=0;a<n.length;a++){var r=t[n[a]];r&&r.active()&&i.push(r.wait())}return Promise.all(i)}(t.options.$animations,i).then((function(){t.options=i}),(function(){})),a}},{key:"_createAnimations",value:function(t,e){var i,n=this._properties,a=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),s=Date.now();for(i=o.length-1;i>=0;--i){var l=o[i];if("$"!==l.charAt(0))if("options"!==l){var u=e[l],h=r[l],c=n.get(l);if(h){if(c&&h.active()){h.update(c,u,s);continue}h.cancel()}c&&c.duration?(r[l]=h=new Yn(c,t,l,u),a.push(h)):t[l]=u}else a.push.apply(a,F(this._animateOptions(t,e)))}return a}},{key:"update",value:function(t,e){if(0!==this._properties.size){var i=this._createAnimations(t,e);return i.length?(Hn.add(this._chart,i),!0):void 0}Object.assign(t,e)}}]),t}();function qn(t,e){var i=t&&t.options||{},n=i.reverse,a=void 0===i.min?e:0,r=void 0===i.max?e:0;return{start:n?r:a,end:n?a:r}}function Kn(t,e){var i,n,a=[],r=t._getSortedDatasetMetas(e);for(i=0,n=r.length;i<n;++i)a.push(r[i].index);return a}function Gn(t,e,i){var n,a,r,o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=t.keys,u="single"===s.mode;if(null!==e){for(n=0,a=l.length;n<a;++n){if((r=+l[n])===i){if(s.all)continue;break}o=t.values[r],Ct(o)&&(u||0===e||ae(e)===ae(o))&&(e+=o)}return e}}function Zn(t,e){var i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Jn(t,e,i){var n=t[e]||(t[e]={});return n[i]||(n[i]={})}function Qn(t,e,i,n){var a,r=jn(e.getMatchingVisibleMetas(n).reverse());try{for(r.s();!(a=r.n()).done;){var o=a.value,s=t[o.index];if(i&&s>0||!i&&s<0)return o.index}}catch(t){r.e(t)}finally{r.f()}return null}function ta(t,e){for(var i,n=t.chart,a=t._cachedMeta,r=n._stacks||(n._stacks={}),o=a.iScale,s=a.vScale,l=a.index,u=o.axis,h=s.axis,c=function(t,e,i){return"".concat(t.id,".").concat(e.id,".").concat(i.stack||i.type)}(o,s,a),f=e.length,d=0;d<f;++d){var v=e[d],g=v[u],p=v[h];(i=(v._stacks||(v._stacks={}))[h]=Jn(r,c,g))[l]=p,i._top=Qn(i,s,!0,a.type),i._bottom=Qn(i,s,!1,a.type)}}function ea(t,e){var i=t.scales;return Object.keys(i).filter((function(t){return i[t].axis===e})).shift()}function ia(t,e){var i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){var a,r=jn(e=e||t._parsed);try{for(r.s();!(a=r.n()).done;){var o=a.value._stacks;if(!o||void 0===o[n]||void 0===o[n][i])return;delete o[n][i]}}catch(t){r.e(t)}finally{r.f()}}}var na=function(t){return"reset"===t||"none"===t},aa=function(t,e){return e?t:Object.assign({},t)},ra=function(){function t(e,i){n(this,t),this.chart=e,this._ctx=e.ctx,this.index=i,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.initialize()}return s(t,[{key:"initialize",value:function(){var t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Zn(t.vScale,t),this.addElements()}},{key:"updateIndex",value:function(t){this.index!==t&&ia(this._cachedMeta),this.index=t}},{key:"linkScales",value:function(){var t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=function(t,e,i,n){return"x"===t?e:"r"===t?n:i},a=e.xAxisID=Rt(i.xAxisID,ea(t,"x")),r=e.yAxisID=Rt(i.yAxisID,ea(t,"y")),o=e.rAxisID=Rt(i.rAxisID,ea(t,"r")),s=e.indexAxis,l=e.iAxisID=n(s,a,r,o),u=e.vAxisID=n(s,r,a,o);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(u)}},{key:"getDataset",value:function(){return this.chart.data.datasets[this.index]}},{key:"getMeta",value:function(){return this.chart.getDatasetMeta(this.index)}},{key:"getScaleForId",value:function(t){return this.chart.scales[t]}},{key:"_getOtherScale",value:function(t){var e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}},{key:"reset",value:function(){this._update("reset")}},{key:"_destroy",value:function(){var t=this._cachedMeta;this._data&&Ni(this._data,this),t._stacked&&ia(t)}},{key:"_dataCheck",value:function(){var t,e,i=this.getDataset(),n=i.data||(i.data=[]),a=this._data;if(At(n))this._data=function(t){var e,i,n,a=Object.keys(t),r=new Array(a.length);for(e=0,i=a.length;e<i;++e)n=a[e],r[e]={x:n,y:t[n]};return r}(n);else if(a!==n){if(a){Ni(a,this);var r=this._cachedMeta;ia(r),r._parsed=[]}n&&Object.isExtensible(n)&&(e=this,(t=n)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Bi.forEach((function(e){var i="_onData"+Yt(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];var o=n.apply(this,a);return t._chartjs.listeners.forEach((function(t){"function"==typeof t[i]&&t[i].apply(t,a)})),o}})})))),this._syncList=[],this._data=n}}},{key:"addElements",value:function(){var t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}},{key:"buildOrUpdateElements",value:function(t){var e=this._cachedMeta,i=this.getDataset(),n=!1;this._dataCheck();var a=e._stacked;e._stacked=Zn(e.vScale,e),e.stack!==i.stack&&(n=!0,ia(e),e.stack=i.stack),this._resyncElements(t),(n||a!==e._stacked)&&ta(this,e._parsed)}},{key:"configure",value:function(){var t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}},{key:"parse",value:function(t,e){var i,n,a,r=this._cachedMeta,o=this._data,s=r.iScale,l=r._stacked,u=s.axis,h=0===t&&e===o.length||r._sorted,c=t>0&&r._parsed[t-1];if(!1===this._parsing)r._parsed=o,r._sorted=!0,a=o;else{a=Ot(o[t])?this.parseArrayData(r,o,t,e):At(o[t])?this.parseObjectData(r,o,t,e):this.parsePrimitiveData(r,o,t,e);for(i=0;i<e;++i)r._parsed[i+t]=n=a[i],h&&((null===n[u]||c&&n[u]<c[u])&&(h=!1),c=n);r._sorted=h}l&&ta(this,a)}},{key:"parsePrimitiveData",value:function(t,e,i,n){var a,r,o,s=t.iScale,l=t.vScale,u=s.axis,h=l.axis,c=s.getLabels(),f=s===l,d=new Array(n);for(a=0,r=n;a<r;++a){var v;o=a+i,d[a]=(et(v={},u,f||s.parse(c[o],o)),et(v,h,l.parse(e[o],o)),v)}return d}},{key:"parseArrayData",value:function(t,e,i,n){var a,r,o,s,l=t.xScale,u=t.yScale,h=new Array(n);for(a=0,r=n;a<r;++a)s=e[o=a+i],h[a]={x:l.parse(s[0],o),y:u.parse(s[1],o)};return h}},{key:"parseObjectData",value:function(t,e,i,n){var a,r,o,s,l=t.xScale,u=t.yScale,h=this._parsing,c=h.xAxisKey,f=void 0===c?"x":c,d=h.yAxisKey,v=void 0===d?"y":d,g=new Array(n);for(a=0,r=n;a<r;++a)s=e[o=a+i],g[a]={x:l.parse($t(s,f),o),y:u.parse($t(s,v),o)};return g}},{key:"getParsed",value:function(t){return this._cachedMeta._parsed[t]}},{key:"getDataElement",value:function(t){return this._cachedMeta.data[t]}},{key:"applyStack",value:function(t,e,i){var n=this.chart,a=this._cachedMeta,r=e[t.axis];return Gn({keys:Kn(n,!0),values:e._stacks[t.axis]},r,a.index,{mode:i})}},{key:"updateRangeFromParsed",value:function(t,e,i,n){var a=i[e.axis],r=null===a?NaN:a,o=n&&i._stacks[e.axis];n&&o&&(n.values=o,r=Gn(n,a,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}},{key:"getMinMax",value:function(t,e){var i,n,a=this._cachedMeta,r=a._parsed,o=a._sorted&&t===a.iScale,s=r.length,l=this._getOtherScale(t),u=function(t,e,i){return t&&!e.hidden&&e._stacked&&{keys:Kn(i,!0),values:null}}(e,a,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},c=function(t){var e=t.getUserBounds(),i=e.min,n=e.max,a=e.minDefined,r=e.maxDefined;return{min:a?i:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}(l),f=c.min,d=c.max;function v(){var e=(n=r[i])[l.axis];return!Ct(n[t.axis])||f>e||d<e}for(i=0;i<s&&(v()||(this.updateRangeFromParsed(h,t,n,u),!o));++i);if(o)for(i=s-1;i>=0;--i)if(!v()){this.updateRangeFromParsed(h,t,n,u);break}return h}},{key:"getAllParsedValues",value:function(t){var e,i,n,a=this._cachedMeta._parsed,r=[];for(e=0,i=a.length;e<i;++e)n=a[e][t.axis],Ct(n)&&r.push(n);return r}},{key:"getMaxOverflow",value:function(){return!1}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=e.iScale,n=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:n?""+n.getLabelForValue(a[n.axis]):""}}},{key:"_update",value:function(t){var e,i,n,a,r,o=this._cachedMeta;this.update(t||"default"),o._clip=(At(e=Rt(this.options.clip,function(t,e,i){if(!1===i)return!1;var n=qn(t,i),a=qn(e,i);return{top:a.end,right:n.end,bottom:a.start,left:n.start}}(o.xScale,o.yScale,this.getMaxOverflow())))?(i=e.top,n=e.right,a=e.bottom,r=e.left):i=n=a=r=e,{top:i,right:n,bottom:a,left:r,disabled:!1===e})}},{key:"update",value:function(t){}},{key:"draw",value:function(){var t,e=this._ctx,i=this.chart,n=this._cachedMeta,a=n.data||[],r=i.chartArea,o=[],s=this._drawStart||0,l=this._drawCount||a.length-s,u=this.options.drawActiveElementsOnTop;for(n.dataset&&n.dataset.draw(e,r,s,l),t=s;t<s+l;++t){var h=a[t];h.hidden||(h.active&&u?o.push(h):h.draw(e,r))}for(t=0;t<o.length;++t)o[t].draw(e,r)}},{key:"getStyle",value:function(t,e){var i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}},{key:"getContext",value:function(t,e,i){var n,a=this.getDataset();if(t>=0&&t<this._cachedMeta.data.length){var r=this._cachedMeta.data[t];n=r.$context||(r.$context=function(t,e,i){return Ii(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,r)),n.parsed=this.getParsed(t),n.raw=a.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return Ii(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=a,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}},{key:"resolveDatasetElementOptions",value:function(t){return this._resolveElementOptions(this.datasetElementType.id,t)}},{key:"resolveDataElementOptions",value:function(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}},{key:"_resolveElementOptions",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=arguments.length>2?arguments[2]:void 0,a="active"===i,r=this._cachedDataOpts,o=t+"-"+i,s=r[o],l=this.enableOptionSharing&&Ut(n);if(s)return aa(s,l);var u=this.chart.config,h=u.datasetElementScopeKeys(this._type,t),c=a?["".concat(t,"Hover"),"hover",t,""]:[t,""],f=u.getOptionScopes(this.getDataset(),h),d=Object.keys(ci.elements[t]),v=function(){return e.getContext(n,a)},g=u.resolveNamedOptions(f,d,v,c);return g.$shared&&(g.$shared=l,r[o]=Object.freeze(aa(g,l))),g}},{key:"_resolveAnimations",value:function(t,e,i){var n,a=this.chart,r=this._cachedDataOpts,o="animation-".concat(e),s=r[o];if(s)return s;if(!1!==a.options.animation){var l=this.chart.config,u=l.datasetAnimationScopeKeys(this._type,e),h=l.getOptionScopes(this.getDataset(),u);n=l.createResolver(h,this.getContext(t,i,e))}var c=new Xn(a,n&&n.animations);return n&&n._cacheable&&(r[o]=Object.freeze(c)),c}},{key:"getSharedOptions",value:function(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}},{key:"includeOptions",value:function(t,e){return!e||na(t)||this.chart._animationsDisabled}},{key:"updateElement",value:function(t,e,i,n){na(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}},{key:"updateSharedOptions",value:function(t,e,i){t&&!na(e)&&this._resolveAnimations(void 0,e).update(t,i)}},{key:"_setStyle",value:function(t,e,i,n){t.active=n;var a=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(a)||a})}},{key:"removeHoverStyle",value:function(t,e,i){this._setStyle(t,i,"active",!1)}},{key:"setHoverStyle",value:function(t,e,i){this._setStyle(t,i,"active",!0)}},{key:"_removeDatasetHoverStyle",value:function(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}},{key:"_setDatasetHoverStyle",value:function(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}},{key:"_resyncElements",value:function(t){var e,i=this._data,n=this._cachedMeta.data,a=jn(this._syncList);try{for(a.s();!(e=a.n()).done;){var r=v(e.value,3),o=r[0],s=r[1],l=r[2];this[o](s,l)}}catch(t){a.e(t)}finally{a.f()}this._syncList=[];var u=n.length,h=i.length,c=Math.min(h,u);c&&this.parse(0,c),h>u?this._insertElements(u,h-u,t):h<u&&this._removeElements(h,u-h)}},{key:"_insertElements",value:function(t,e){var i,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this._cachedMeta,r=a.data,o=t+e,s=function(t){for(t.length+=e,i=t.length-1;i>=o;i--)t[i]=t[i-e]};for(s(r),i=t;i<o;++i)r[i]=new this.dataElementType;this._parsing&&s(a._parsed),this.parse(t,e),n&&this.updateElements(r,t,e,"reset")}},{key:"updateElements",value:function(t,e,i,n){}},{key:"_removeElements",value:function(t,e){var i=this._cachedMeta;if(this._parsing){var n=i._parsed.splice(t,e);i._stacked&&ia(i,n)}i.data.splice(t,e)}},{key:"_sync",value:function(t){if(this._parsing)this._syncList.push(t);else{var e=v(t,3),i=e[0],n=e[1],a=e[2];this[i](n,a)}this.chart._dataChanges.push([this.index].concat(F(t)))}},{key:"_onDataPush",value:function(){var t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}},{key:"_onDataPop",value:function(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}},{key:"_onDataShift",value:function(){this._sync(["_removeElements",0,1])}},{key:"_onDataSplice",value:function(t,e){e&&this._sync(["_removeElements",t,e]);var i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}},{key:"_onDataUnshift",value:function(){this._sync(["_insertElements",0,arguments.length])}}]),t}();function oa(t){var e,i,n,a,r=t.iScale,o=function(t,e){if(!t._cache.$bar){for(var i=t.getMatchingVisibleMetas(e),n=[],a=0,r=i.length;a<r;a++)n=n.concat(i[a].controller.getAllParsedValues(t));t._cache.$bar=ji(n.sort((function(t,e){return t-e})))}return t._cache.$bar}(r,t.type),s=r._length,l=function(){32767!==n&&-32768!==n&&(Ut(a)&&(s=Math.min(s,Math.abs(n-a)||s)),a=n)};for(e=0,i=o.length;e<i;++e)n=r.getPixelForValue(o[e]),l();for(a=void 0,e=0,i=r.ticks.length;e<i;++e)n=r.getPixelForTick(e),l();return s}function sa(t,e,i,n){return Ot(t)?function(t,e,i,n){var a=i.parse(t[0],n),r=i.parse(t[1],n),o=Math.min(a,r),s=Math.max(a,r),l=o,u=s;Math.abs(o)>Math.abs(s)&&(l=s,u=o),e[i.axis]=u,e._custom={barStart:l,barEnd:u,start:a,end:r,min:o,max:s}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function la(t,e,i,n){var a,r,o,s,l=t.iScale,u=t.vScale,h=l.getLabels(),c=l===u,f=[];for(a=i,r=i+n;a<r;++a)s=e[a],(o={})[l.axis]=c||l.parse(h[a],a),f.push(sa(s,o,u,a));return f}function ua(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function ha(t,e,i,n){var a=e.borderSkipped,r={};if(a){var o=function(t){var e,i,n,a,r;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(a="end",r="start"):(a="start",r="end"),{start:i,end:n,reverse:e,top:a,bottom:r}}(t),s=o.start,l=o.end,u=o.reverse,h=o.top,c=o.bottom;"middle"===a&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?a=h:(i._bottom||0)===n?a=c:(r[ca(c,s,l,u)]=!0,a=h)),r[ca(a,s,l,u)]=!0,t.borderSkipped=r}else t.borderSkipped=r}function ca(t,e,i,n){var a,r,o;return n?(o=i,t=fa(t=(a=t)===(r=e)?o:a===o?r:a,i,e)):t=fa(t,e,i),t}function fa(t,e,i){return"start"===t?e:"end"===t?i:t}function da(t,e,i){var n=e.inflateAmount;t.inflateAmount="auto"===n?1===i?.33:0:n}ra.defaults={},ra.prototype.datasetElementType=null,ra.prototype.dataElementType=null;var va=function(i){t(r,ra);var a=Nn(r);function r(){return n(this,r),a.apply(this,arguments)}return s(r,[{key:"parsePrimitiveData",value:function(t,e,i,n){return la(t,e,i,n)}},{key:"parseArrayData",value:function(t,e,i,n){return la(t,e,i,n)}},{key:"parseObjectData",value:function(t,e,i,n){var a,r,o,s,l=t.iScale,u=t.vScale,h=this._parsing,c=h.xAxisKey,f=void 0===c?"x":c,d=h.yAxisKey,v=void 0===d?"y":d,g="x"===l.axis?f:v,p="x"===u.axis?f:v,m=[];for(a=i,r=i+n;a<r;++a)s=e[a],(o={})[l.axis]=l.parse($t(s,g),a),m.push(sa($t(s,p),o,u,a));return m}},{key:"updateRangeFromParsed",value:function(t,i,n,a){B(e(r.prototype),"updateRangeFromParsed",this).call(this,t,i,n,a);var o=n._custom;o&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}},{key:"getMaxOverflow",value:function(){return 0}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=e.iScale,n=e.vScale,a=this.getParsed(t),r=a._custom,o=ua(r)?"["+r.start+", "+r.end+"]":""+n.getLabelForValue(a[n.axis]);return{label:""+i.getLabelForValue(a[i.axis]),value:o}}},{key:"initialize",value:function(){this.enableOptionSharing=!0,B(e(r.prototype),"initialize",this).call(this),this._cachedMeta.stack=this.getDataset().stack}},{key:"update",value:function(t){var e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}},{key:"updateElements",value:function(t,e,i,n){var a="reset"===n,r=this.index,o=this._cachedMeta.vScale,s=o.getBasePixel(),l=o.isHorizontal(),u=this._getRuler(),h=this.resolveDataElementOptions(e,n),c=this.getSharedOptions(h),f=this.includeOptions(n,c);this.updateSharedOptions(c,n,h);for(var d=e;d<e+i;d++){var v=this.getParsed(d),g=a||Dt(v[o.axis])?{base:s,head:s}:this._calculateBarValuePixels(d),p=this._calculateBarIndexPixels(d,u),m=(v._stacks||{})[o.axis],y={horizontal:l,base:g.base,enableBorderRadius:!m||ua(v._custom)||r===m._top||r===m._bottom,x:l?g.head:p.center,y:l?p.center:g.head,height:l?p.size:Math.abs(g.size),width:l?Math.abs(g.size):p.size};f&&(y.options=c||this.resolveDataElementOptions(d,t[d].active?"active":n));var b=y.options||t[d].options;ha(y,b,m,r),da(y,b,u.ratio),this.updateElement(t[d],d,y,n)}}},{key:"_getStacks",value:function(t,e){var i,n,a=this._cachedMeta.iScale,r=a.getMatchingVisibleMetas(this._type),o=a.options.stacked,s=r.length,l=[];for(i=0;i<s;++i)if((n=r[i]).controller.options.grouped){if(void 0!==e){var u=n.controller.getParsed(e)[n.controller._cachedMeta.vScale.axis];if(Dt(u)||isNaN(u))continue}if((!1===o||-1===l.indexOf(n.stack)||void 0===o&&void 0===n.stack)&&l.push(n.stack),n.index===t)break}return l.length||l.push(void 0),l}},{key:"_getStackCount",value:function(t){return this._getStacks(void 0,t).length}},{key:"_getStackIndex",value:function(t,e,i){var n=this._getStacks(t,i),a=void 0!==e?n.indexOf(e):-1;return-1===a?n.length-1:a}},{key:"_getRuler",value:function(){var t,e,i=this.options,n=this._cachedMeta,a=n.iScale,r=[];for(t=0,e=n.data.length;t<e;++t)r.push(a.getPixelForValue(this.getParsed(t)[a.axis],t));var o=i.barThickness;return{min:o||oa(n),pixels:r,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:i.grouped,ratio:o?1:i.categoryPercentage*i.barPercentage}}},{key:"_calculateBarValuePixels",value:function(t){var e,i,n=this._cachedMeta,a=n.vScale,r=n._stacked,o=this.options,s=o.base,l=o.minBarLength,u=s||0,h=this.getParsed(t),c=h._custom,f=ua(c),d=h[a.axis],v=0,g=r?this.applyStack(a,h,r):d;g!==d&&(v=g-d,g=d),f&&(d=c.barStart,g=c.barEnd-c.barStart,0!==d&&ae(d)!==ae(c.barEnd)&&(v=0),v+=d);var p=Dt(s)||f?v:s,m=a.getPixelForValue(p);if(i=(e=this.chart.getDataVisibility(t)?a.getPixelForValue(v+g):m)-m,Math.abs(i)<l){i=function(t,e,i){return 0!==t?ae(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(i,a,u)*l,d===u&&(m-=i/2);var y=a.getPixelForDecimal(0),b=a.getPixelForDecimal(1),x=Math.min(y,b),_=Math.max(y,b);e=(m=Math.max(Math.min(m,_),x))+i}if(m===a.getPixelForValue(u)){var k=ae(i)*a.getLineWidthForValue(u)/2;m+=k,i-=k}return{size:i,base:m,head:e,center:e+i/2}}},{key:"_calculateBarIndexPixels",value:function(t,e){var i,n,a=e.scale,r=this.options,o=r.skipNull,s=Rt(r.maxBarThickness,1/0);if(e.grouped){var l=o?this._getStackCount(t):e.stackCount,u="flex"===r.barThickness?function(t,e,i,n){var a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t<a.length-1?a[t+1]:null,l=i.categoryPercentage;null===o&&(o=r-(null===s?e.end-e.start:s-r)),null===s&&(s=r+r-o);var u=r-(r-Math.min(o,s))/2*l;return{chunk:Math.abs(s-o)/2*l/n,ratio:i.barPercentage,start:u}}(t,e,r,l):function(t,e,i,n){var a,r,o=i.barThickness;return Dt(o)?(a=e.min*i.categoryPercentage,r=i.barPercentage):(a=o*n,r=1),{chunk:a/n,ratio:r,start:e.pixels[t]-a/2}}(t,e,r,l),h=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);i=u.start+u.chunk*h+u.chunk/2,n=Math.min(s,u.chunk*u.ratio)}else i=a.getPixelForValue(this.getParsed(t)[a.axis],t),n=Math.min(s,e.min*e.ratio);return{base:i-n/2,head:i+n/2,center:i,size:n}}},{key:"draw",value:function(){for(var t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length,a=0;a<n;++a)null!==this.getParsed(a)[e.axis]&&i[a].draw(this._ctx)}}]),r}();va.id="bar",va.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},va.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};var ga=function(i){t(r,ra);var a=Nn(r);function r(){return n(this,r),a.apply(this,arguments)}return s(r,[{key:"initialize",value:function(){this.enableOptionSharing=!0,B(e(r.prototype),"initialize",this).call(this)}},{key:"parsePrimitiveData",value:function(t,i,n,a){for(var o=B(e(r.prototype),"parsePrimitiveData",this).call(this,t,i,n,a),s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+n).radius;return o}},{key:"parseArrayData",value:function(t,i,n,a){for(var o=B(e(r.prototype),"parseArrayData",this).call(this,t,i,n,a),s=0;s<o.length;s++){var l=i[n+s];o[s]._custom=Rt(l[2],this.resolveDataElementOptions(s+n).radius)}return o}},{key:"parseObjectData",value:function(t,i,n,a){for(var o=B(e(r.prototype),"parseObjectData",this).call(this,t,i,n,a),s=0;s<o.length;s++){var l=i[n+s];o[s]._custom=Rt(l&&l.r&&+l.r,this.resolveDataElementOptions(s+n).radius)}return o}},{key:"getMaxOverflow",value:function(){for(var t=this._cachedMeta.data,e=0,i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=e.xScale,n=e.yScale,a=this.getParsed(t),r=i.getLabelForValue(a.x),o=n.getLabelForValue(a.y),s=a._custom;return{label:e.label,value:"("+r+", "+o+(s?", "+s:"")+")"}}},{key:"update",value:function(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}},{key:"updateElements",value:function(t,e,i,n){for(var a="reset"===n,r=this._cachedMeta,o=r.iScale,s=r.vScale,l=this.resolveDataElementOptions(e,n),u=this.getSharedOptions(l),h=this.includeOptions(n,u),c=o.axis,f=s.axis,d=e;d<e+i;d++){var v=t[d],g=!a&&this.getParsed(d),p={},m=p[c]=a?o.getPixelForDecimal(.5):o.getPixelForValue(g[c]),y=p[f]=a?s.getBasePixel():s.getPixelForValue(g[f]);p.skip=isNaN(m)||isNaN(y),h&&(p.options=this.resolveDataElementOptions(d,v.active?"active":n),a&&(p.options.radius=0)),this.updateElement(v,d,p,n)}this.updateSharedOptions(u,n,l)}},{key:"resolveDataElementOptions",value:function(t,i){var n=this.getParsed(t),a=B(e(r.prototype),"resolveDataElementOptions",this).call(this,t,i);a.$shared&&(a=Object.assign({},a,{$shared:!1}));var o=a.radius;return"active"!==i&&(a.radius=0),a.radius+=Rt(n&&n._custom,o),a}}]),r}();ga.id="bubble",ga.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},ga.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:function(){return""}}}}};var pa=function(e){t(a,ra);var i=Nn(a);function a(t,e){var r;return n(this,a),(r=i.call(this,t,e)).enableOptionSharing=!0,r.innerRadius=void 0,r.outerRadius=void 0,r.offsetX=void 0,r.offsetY=void 0,r}return s(a,[{key:"linkScales",value:function(){}},{key:"parse",value:function(t,e){var i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{var a,r,o=function(t){return+i[t]};if(At(i[t])){var s=this._parsing.key,l=void 0===s?"value":s;o=function(t){return+$t(i[t],l)}}for(a=t,r=t+e;a<r;++a)n._parsed[a]=o(a)}}},{key:"_getRotation",value:function(){return ue(this.options.rotation-90)}},{key:"_getCircumference",value:function(){return ue(this.options.circumference)}},{key:"_getRotationExtents",value:function(){for(var t=Gt,e=-Gt,i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){var n=this.chart.getDatasetMeta(i).controller,a=n._getRotation(),r=n._getCircumference();t=Math.min(t,a),e=Math.max(e,a+r)}return{rotation:t,circumference:e-t}}},{key:"update",value:function(t){var e,i,n=this.chart.chartArea,a=this._cachedMeta,r=a.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,s=Math.max((Math.min(n.width,n.height)-o)/2,0),l=Math.min((e=this.options.cutout,i=s,"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100:e/i),1),u=this._getRingWeight(this.index),h=this._getRotationExtents(),c=h.circumference,f=function(t,e,i){var n=1,a=1,r=0,o=0;if(e<Gt){var s=t,l=s+e,u=Math.cos(s),h=Math.sin(s),c=Math.cos(l),f=Math.sin(l),d=function(t,e,n){return pe(t,s,l,!0)?1:Math.max(e,e*i,n,n*i)},v=function(t,e,n){return pe(t,s,l,!0)?-1:Math.min(e,e*i,n,n*i)},g=d(0,u,c),p=d(te,h,f),m=v(Kt,u,c),y=v(Kt+te,h,f);n=(g-m)/2,a=(p-y)/2,r=-(g+m)/2,o=-(p+y)/2}return{ratioX:n,ratioY:a,offsetX:r,offsetY:o}}(h.rotation,c,l),d=f.ratioX,v=f.ratioY,g=f.offsetX,p=f.offsetY,m=(n.width-o)/d,y=(n.height-o)/v,b=Math.max(Math.min(m,y)/2,0),x=Lt(this.options.radius,b),_=(x-Math.max(x*l,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=p*x,a.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*u,0),this.updateElements(r,0,r.length,t)}},{key:"_circumference",value:function(t,e){var i=this.options,n=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*a/Gt)}},{key:"updateElements",value:function(t,e,i,n){var a,r="reset"===n,o=this.chart,s=o.chartArea,l=o.options.animation,u=(s.left+s.right)/2,h=(s.top+s.bottom)/2,c=r&&l.animateScale,f=c?0:this.innerRadius,d=c?0:this.outerRadius,v=this.resolveDataElementOptions(e,n),g=this.getSharedOptions(v),p=this.includeOptions(n,g),m=this._getRotation();for(a=0;a<e;++a)m+=this._circumference(a,r);for(a=e;a<e+i;++a){var y=this._circumference(a,r),b=t[a],x={x:u+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+y,circumference:y,outerRadius:d,innerRadius:f};p&&(x.options=g||this.resolveDataElementOptions(a,b.active?"active":n)),m+=y,this.updateElement(b,a,x,n)}this.updateSharedOptions(g,n,v)}},{key:"calculateTotal",value:function(){var t,e=this._cachedMeta,i=e.data,n=0;for(t=0;t<i.length;t++){var a=e._parsed[t];null===a||isNaN(a)||!this.chart.getDataVisibility(t)||i[t].hidden||(n+=Math.abs(a))}return n}},{key:"calculateCircumference",value:function(t){var e=this._cachedMeta.total;return e>0&&!isNaN(t)?Gt*(Math.abs(t)/e):0}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=Dn(e._parsed[t],i.options.locale);return{label:n[t]||"",value:a}}},{key:"getMaxBorderWidth",value:function(t){var e,i,n,a,r,o=0,s=this.chart;if(!t)for(e=0,i=s.data.datasets.length;e<i;++e)if(s.isDatasetVisible(e)){t=(n=s.getDatasetMeta(e)).data,a=n.controller;break}if(!t)return 0;for(e=0,i=t.length;e<i;++e)"inner"!==(r=a.resolveDataElementOptions(e)).borderAlign&&(o=Math.max(o,r.borderWidth||0,r.hoverBorderWidth||0));return o}},{key:"getMaxOffset",value:function(t){for(var e=0,i=0,n=t.length;i<n;++i){var a=this.resolveDataElementOptions(i);e=Math.max(e,a.offset||0,a.hoverOffset||0)}return e}},{key:"_getRingWeightOffset",value:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}},{key:"_getRingWeight",value:function(t){return Math.max(Rt(this.chart.data.datasets[t].weight,1),0)}},{key:"_getVisibleDatasetWeightTotal",value:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}]),a}();pa.id="doughnut",pa.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"},pa.descriptors={_scriptable:function(t){return"spacing"!==t},_indexable:function(t){return"spacing"!==t}},pa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels:function(t){var e=t.data;if(e.labels.length&&e.datasets.length){var i=t.legend.options.labels.pointStyle;return e.labels.map((function(e,n){var a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick:function(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:function(){return""},label:function(t){var e=t.label,i=": "+t.formattedValue;return Ot(e)?(e=e.slice())[0]+=i:e+=i,e}}}}};var ma=function(i){t(r,ra);var a=Nn(r);function r(){return n(this,r),a.apply(this,arguments)}return s(r,[{key:"initialize",value:function(){this.enableOptionSharing=!0,this.supportsDecimation=!0,B(e(r.prototype),"initialize",this).call(this)}},{key:"update",value:function(t){var e=this._cachedMeta,i=e.dataset,n=e.data,a=void 0===n?[]:n,r=e._dataset,o=this.chart._animationsDisabled,s=function(t,e,i){var n=e.length,a=0,r=n;if(t._sorted){var o=t.iScale,s=t._parsed,l=o.axis,u=o.getUserBounds(),h=u.min,c=u.max,f=u.minDefined,d=u.maxDefined;f&&(a=me(Math.min(Fi(s,o.axis,h).lo,i?n:Fi(e,l,o.getPixelForValue(h)).lo),0,n-1)),r=d?me(Math.max(Fi(s,o.axis,c).hi+1,i?0:Fi(e,l,o.getPixelForValue(c)).hi+1),a,n)-a:n-a}return{start:a,count:r}}(e,a,o),l=s.start,u=s.count;this._drawStart=l,this._drawCount=u,function(t){var e=t.xScale,i=t.yScale,n=t._scaleRanges,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=a,!0;var r=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,a),r}(e)&&(l=0,u=a.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=a;var h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:h},t),this.updateElements(a,l,u,t)}},{key:"updateElements",value:function(t,e,i,n){for(var a="reset"===n,r=this._cachedMeta,o=r.iScale,s=r.vScale,l=r._stacked,u=r._dataset,h=this.resolveDataElementOptions(e,n),c=this.getSharedOptions(h),f=this.includeOptions(n,c),d=o.axis,v=s.axis,g=this.options,p=g.spanGaps,m=g.segment,y=oe(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||"none"===n,x=e>0&&this.getParsed(e-1),_=e;_<e+i;++_){var k=t[_],w=this.getParsed(_),M=b?k:{},S=Dt(w[v]),P=M[d]=o.getPixelForValue(w[d],_),D=M[v]=a||S?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,w,l):w[v],_);M.skip=isNaN(P)||isNaN(D)||S,M.stop=_>0&&Math.abs(w[d]-x[d])>y,m&&(M.parsed=w,M.raw=u.data[_]),f&&(M.options=c||this.resolveDataElementOptions(_,k.active?"active":n)),b||this.updateElement(k,_,M,n),x=w}this.updateSharedOptions(c,n,h)}},{key:"getMaxOverflow",value:function(){var t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;var a=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,a,r)/2}},{key:"draw",value:function(){var t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),B(e(r.prototype),"draw",this).call(this)}}]),r}();ma.id="line",ma.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},ma.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var ya=function(e){t(a,ra);var i=Nn(a);function a(t,e){var r;return n(this,a),(r=i.call(this,t,e)).innerRadius=void 0,r.outerRadius=void 0,r}return s(a,[{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=Dn(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:a}}},{key:"parseObjectData",value:function(t,e,i,n){return nn.bind(this)(t,e,i,n)}},{key:"update",value:function(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}},{key:"getMinMax",value:function(){var t=this,e=this._cachedMeta,i={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((function(e,n){var a=t.getParsed(n).r;!isNaN(a)&&t.chart.getDataVisibility(n)&&(a<i.min&&(i.min=a),a>i.max&&(i.max=a))})),i}},{key:"_updateRadius",value:function(){var t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(n/2,0),r=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=a-r*this.index,this.innerRadius=this.outerRadius-r}},{key:"updateElements",value:function(t,e,i,n){var a,r="reset"===n,o=this.chart,s=o.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,h=l.yCenter,c=l.getIndexAngle(0)-.5*Kt,f=c,d=360/this.countVisibleElements();for(a=0;a<e;++a)f+=this._computeAngle(a,n,d);for(a=e;a<e+i;a++){var v=t[a],g=f,p=f+this._computeAngle(a,n,d),m=o.getDataVisibility(a)?l.getDistanceFromCenterForValue(this.getParsed(a).r):0;f=p,r&&(s.animateScale&&(m=0),s.animateRotate&&(g=p=c));var y={x:u,y:h,innerRadius:0,outerRadius:m,startAngle:g,endAngle:p,options:this.resolveDataElementOptions(a,v.active?"active":n)};this.updateElement(v,a,y,n)}}},{key:"countVisibleElements",value:function(){var t=this,e=this._cachedMeta,i=0;return e.data.forEach((function(e,n){!isNaN(t.getParsed(n).r)&&t.chart.getDataVisibility(n)&&i++})),i}},{key:"_computeAngle",value:function(t,e,i){return this.chart.getDataVisibility(t)?ue(this.resolveDataElementOptions(t,e).angle||i):0}}]),a}();ya.id="polarArea",ya.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},ya.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels:function(t){var e=t.data;if(e.labels.length&&e.datasets.length){var i=t.legend.options.labels.pointStyle;return e.labels.map((function(e,n){var a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick:function(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:function(){return""},label:function(t){return t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var ba=function(e){t(a,pa);var i=Nn(a);function a(){return n(this,a),i.apply(this,arguments)}return s(a)}();ba.id="pie",ba.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var xa=function(e){t(a,ra);var i=Nn(a);function a(){return n(this,a),i.apply(this,arguments)}return s(a,[{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}},{key:"parseObjectData",value:function(t,e,i,n){return nn.bind(this)(t,e,i,n)}},{key:"update",value:function(t){var e=this._cachedMeta,i=e.dataset,n=e.data||[],a=e.iScale.getLabels();if(i.points=n,"resize"!==t){var r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);var o={_loop:!0,_fullLoop:a.length===n.length,options:r};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}},{key:"updateElements",value:function(t,e,i,n){for(var a=this._cachedMeta.rScale,r="reset"===n,o=e;o<e+i;o++){var s=t[o],l=this.resolveDataElementOptions(o,s.active?"active":n),u=a.getPointPositionForValue(o,this.getParsed(o).r),h=r?a.xCenter:u.x,c=r?a.yCenter:u.y,f={x:h,y:c,angle:u.angle,skip:isNaN(h)||isNaN(c),options:l};this.updateElement(s,o,f,n)}}}]),a}();xa.id="radar",xa.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},xa.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};var _a=function(e){t(a,ma);var i=Nn(a);function a(){return n(this,a),i.apply(this,arguments)}return s(a)}();_a.id="scatter",_a.defaults={showLine:!1,fill:!1},_a.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:function(){return""},label:function(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var ka=Object.freeze({__proto__:null,BarController:va,BubbleController:ga,DoughnutController:pa,LineController:ma,PolarAreaController:ya,PieController:ba,RadarController:xa,ScatterController:_a});function wa(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Ma=function(){function t(e){n(this,t),this.options=e||{}}return s(t,[{key:"formats",value:function(){return wa()}},{key:"parse",value:function(t,e){return wa()}},{key:"format",value:function(t,e){return wa()}},{key:"add",value:function(t,e,i){return wa()}},{key:"diff",value:function(t,e,i){return wa()}},{key:"startOf",value:function(t,e,i){return wa()}},{key:"endOf",value:function(t,e){return wa()}}]),t}();Ma.override=function(t){Object.assign(Ma.prototype,t)};var Sa={_date:Ma};function Pa(t,e,i,n){var a=t.controller,r=t.data,o=t._sorted,s=a._cachedMeta.iScale;if(s&&e===s.axis&&"r"!==e&&o&&r.length){var l=s._reversePixels?Vi:Fi;if(!n)return l(r,e,i);if(a._sharedOptions){var u=r[0],h="function"==typeof u.getRange&&u.getRange(e);if(h){var c=l(r,e,i-h),f=l(r,e,i+h);return{lo:c.lo,hi:f.hi}}}}return{lo:0,hi:r.length-1}}function Da(t,e,i,n,a){for(var r=t.getSortedVisibleDatasetMetas(),o=i[e],s=0,l=r.length;s<l;++s)for(var u=r[s],h=u.index,c=u.data,f=Pa(r[s],e,o,a),d=f.lo,v=f.hi,g=d;g<=v;++g){var p=c[g];p.skip||n(p,h,g)}}function Oa(t,e,i,n,a){var r=[];if(!a&&!t.isPointInArea(e))return r;return Da(t,i,e,(function(i,o,s){(a||mi(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&r.push({element:i,datasetIndex:o,index:s})}),!0),r}function Aa(t,e,i,n,a,r){var o=[],s=function(t){var e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){var a=e?Math.abs(t.x-n.x):0,r=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}(i),l=Number.POSITIVE_INFINITY;return Da(t,i,e,(function(i,u,h){var c=i.inRange(e.x,e.y,a);if(!n||c){var f=i.getCenterPoint(a);if(!!r||t.isPointInArea(f)||c){var d=s(e,f);d<l?(o=[{element:i,datasetIndex:u,index:h}],l=d):d===l&&o.push({element:i,datasetIndex:u,index:h})}}})),o}function Ca(t,e,i,n,a,r){return r||t.isPointInArea(e)?"r"!==i||n?Aa(t,e,i,n,a,r):function(t,e,i,n){var a=[];return Da(t,i,e,(function(t,i,r){var o=t.getProps(["startAngle","endAngle"],n),s=o.startAngle,l=o.endAngle;pe(fe(t,{x:e.x,y:e.y}).angle,s,l)&&a.push({element:t,datasetIndex:i,index:r})})),a}(t,e,i,a):[]}function Ta(t,e,i,n,a){var r=[],o="x"===i?"inXRange":"inYRange",s=!1;return Da(t,i,e,(function(t,n,l){t[o](e[i],a)&&(r.push({element:t,datasetIndex:n,index:l}),s=s||t.inRange(e.x,e.y,a))})),n&&!s?[]:r}var Ra={evaluateInteractionItems:Da,modes:{index:function(t,e,i,n){var a=mn(e,t),r=i.axis||"x",o=i.includeInvisible||!1,s=i.intersect?Oa(t,a,r,n,o):Ca(t,a,r,!1,n,o),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach((function(t){var e=s[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset:function(t,e,i,n){var a=mn(e,t),r=i.axis||"xy",o=i.includeInvisible||!1,s=i.intersect?Oa(t,a,r,n,o):Ca(t,a,r,!1,n,o);if(s.length>0){var l=s[0].datasetIndex,u=t.getDatasetMeta(l).data;s=[];for(var h=0;h<u.length;++h)s.push({element:u[h],datasetIndex:l,index:h})}return s},point:function(t,e,i,n){return Oa(t,mn(e,t),i.axis||"xy",n,i.includeInvisible||!1)},nearest:function(t,e,i,n){var a=mn(e,t),r=i.axis||"xy",o=i.includeInvisible||!1;return Ca(t,a,r,i.intersect,n,o)},x:function(t,e,i,n){return Ta(t,mn(e,t),"x",i.intersect,n)},y:function(t,e,i,n){return Ta(t,mn(e,t),"y",i.intersect,n)}}},La=["left","top","right","bottom"];function Ea(t,e){return t.filter((function(t){return t.pos===e}))}function Ia(t,e){return t.filter((function(t){return-1===La.indexOf(t.pos)&&t.box.axis===e}))}function za(t,e){return t.sort((function(t,i){var n=e?i:t,a=e?t:i;return n.weight===a.weight?n.index-a.index:n.weight-a.weight}))}function Fa(t,e){var i,n,a,r=function(t){var e,i={},n=jn(t);try{for(n.s();!(e=n.n()).done;){var a=e.value,r=a.stack,o=a.pos,s=a.stackWeight;if(r&&La.includes(o)){var l=i[r]||(i[r]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=s}}}catch(t){n.e(t)}finally{n.f()}return i}(t),o=e.vBoxMaxWidth,s=e.hBoxMaxHeight;for(i=0,n=t.length;i<n;++i){var l=(a=t[i]).box.fullSize,u=r[a.stack],h=u&&a.stackWeight/u.weight;a.horizontal?(a.width=h?h*o:l&&e.availableWidth,a.height=s):(a.width=o,a.height=h?h*s:l&&e.availableHeight)}return r}function Va(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function Ba(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Na(t,e,i,n){var a=i.pos,r=i.box,o=t.maxPadding;if(!At(a)){i.size&&(t[a]-=i.size);var s=n[i.stack]||{size:0,count:1};s.size=Math.max(s.size,i.horizontal?r.height:r.width),i.size=s.size/s.count,t[a]+=i.size}r.getPadding&&Ba(o,r.getPadding());var l=Math.max(0,e.outerWidth-Va(o,t,"left","right")),u=Math.max(0,e.outerHeight-Va(o,t,"top","bottom")),h=l!==t.w,c=u!==t.h;return t.w=l,t.h=u,i.horizontal?{same:h,other:c}:{same:c,other:h}}function ja(t,e){var i=e.maxPadding;function n(t){var n={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){n[t]=Math.max(e[t],i[t])})),n}return n(t?["left","right"]:["top","bottom"])}function Wa(t,e,i,n){var a,r,o,s,l,u,h=[];for(a=0,r=t.length,l=0;a<r;++a){(s=(o=t[a]).box).update(o.width||e.w,o.height||e.h,ja(o.horizontal,e));var c=Na(e,i,o,n),f=c.same,d=c.other;l|=f&&h.length,u=u||d,s.fullSize||h.push(o)}return l&&Wa(h,e,i,n)||u}function Ha(t,e,i,n,a){t.top=i,t.left=e,t.right=e+n,t.bottom=i+a,t.width=n,t.height=a}function $a(t,e,i,n){var a,r=i.padding,o=e.x,s=e.y,l=jn(t);try{for(l.s();!(a=l.n()).done;){var u=a.value,h=u.box,c=n[u.stack]||{count:1,placed:0,weight:1},f=u.stackWeight/c.weight||1;if(u.horizontal){var d=e.w*f,v=c.size||h.height;Ut(c.start)&&(s=c.start),h.fullSize?Ha(h,r.left,s,i.outerWidth-r.right-r.left,v):Ha(h,e.left+c.placed,s,d,v),c.start=s,c.placed+=d,s=h.bottom}else{var g=e.h*f,p=c.size||h.width;Ut(c.start)&&(o=c.start),h.fullSize?Ha(h,o,r.top,p,i.outerHeight-r.bottom-r.top):Ha(h,o,e.top+c.placed,p,g),c.start=o,c.placed+=g,o=h.right}}}catch(t){l.e(t)}finally{l.f()}e.x=o,e.y=s}ci.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Ya=function(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(t){e.draw(t)}}]},t.boxes.push(e)},Ua=function(t,e){var i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},Xa=function(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},qa=function(t,e,i,n){if(t){var a=Ri(t.options.layout.padding),r=Math.max(e-a.width,0),o=Math.max(i-a.height,0),s=function(t){var e=function(t){var e,i,n,a,r,o,s=[];for(e=0,i=(t||[]).length;e<i;++e){var l=n=t[e];a=l.position;var u=l.options;r=u.stack;var h=u.stackWeight;o=void 0===h?1:h,s.push({index:e,box:n,pos:a,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&a+r,stackWeight:o})}return s}(t),i=za(e.filter((function(t){return t.box.fullSize})),!0),n=za(Ea(e,"left"),!0),a=za(Ea(e,"right")),r=za(Ea(e,"top"),!0),o=za(Ea(e,"bottom")),s=Ia(e,"x"),l=Ia(e,"y");return{fullSize:i,leftAndTop:n.concat(r),rightAndBottom:a.concat(l).concat(o).concat(s),chartArea:Ea(e,"chartArea"),vertical:n.concat(a).concat(l),horizontal:r.concat(o).concat(s)}}(t.boxes),l=s.vertical,u=s.horizontal;It(t.boxes,(function(t){"function"==typeof t.beforeLayout&&t.beforeLayout()}));var h=l.reduce((function(t,e){return e.box.options&&!1===e.box.options.display?t:t+1}),0)||1,c=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),f=Object.assign({},a);Ba(f,Ri(n));var d=Object.assign({maxPadding:f,w:r,h:o,x:a.left,y:a.top},a),v=Fa(l.concat(u),c);Wa(s.fullSize,d,c,v),Wa(l,d,c,v),Wa(u,d,c,v)&&Wa(l,d,c,v),function(t){var e=t.maxPadding;function i(i){var n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(d),$a(s.leftAndTop,d,c,v),d.x+=d.w,d.y+=d.h,$a(s.rightAndBottom,d,c,v),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},It(s.chartArea,(function(e){var i=e.box;Object.assign(i,t.chartArea),i.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})}))}},Ka=function(){function t(){n(this,t)}return s(t,[{key:"acquireContext",value:function(t,e){}},{key:"releaseContext",value:function(t){return!1}},{key:"addEventListener",value:function(t,e,i){}},{key:"removeEventListener",value:function(t,e,i){}},{key:"getDevicePixelRatio",value:function(){return 1}},{key:"getMaximumSize",value:function(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}},{key:"isAttached",value:function(t){return!0}},{key:"updateConfig",value:function(t){}}]),t}(),Ga=function(e){t(a,Ka);var i=Nn(a);function a(){return n(this,a),i.apply(this,arguments)}return s(a,[{key:"acquireContext",value:function(t){return t&&t.getContext&&t.getContext("2d")||null}},{key:"updateConfig",value:function(t){t.options.animation=!1}}]),a}(),Za={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ja=function(t){return null===t||""===t};var Qa=!!_n&&{passive:!0};function tr(t,e,i){t.canvas.removeEventListener(e,i,Qa)}function er(t,e){var i,n=jn(t);try{for(n.s();!(i=n.n()).done;){var a=i.value;if(a===e||a.contains(e))return!0}}catch(t){n.e(t)}finally{n.f()}}function ir(t,e,i){var n=t.canvas,a=new MutationObserver((function(t){var e,a=!1,r=jn(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;a=(a=a||er(o.addedNodes,n))&&!er(o.removedNodes,n)}}catch(t){r.e(t)}finally{r.f()}a&&i()}));return a.observe(document,{childList:!0,subtree:!0}),a}function nr(t,e,i){var n=t.canvas,a=new MutationObserver((function(t){var e,a=!1,r=jn(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;a=(a=a||er(o.removedNodes,n))&&!er(o.addedNodes,n)}}catch(t){r.e(t)}finally{r.f()}a&&i()}));return a.observe(document,{childList:!0,subtree:!0}),a}var ar=new Map,rr=0;function or(){var t=window.devicePixelRatio;t!==rr&&(rr=t,ar.forEach((function(e,i){i.currentDevicePixelRatio!==t&&e()})))}function sr(t,e,i){var n=t.canvas,a=n&&fn(n);if(a){var r=_t((function(t,e){var n=a.clientWidth;i(t,e),n<a.clientWidth&&i()}),window),o=new ResizeObserver((function(t){var e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)}));return o.observe(a),function(t,e){ar.size||window.addEventListener("resize",or),ar.set(t,e)}(t,r),o}}function lr(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){ar.delete(t),ar.size||window.removeEventListener("resize",or)}(t)}function ur(t,e,i){var n=t.canvas,a=_t((function(e){null!==t.ctx&&i(function(t,e){var i=Za[t.type]||t.type,n=mn(t,e),a=n.x,r=n.y;return{type:i,chart:e,native:t,x:void 0!==a?a:null,y:void 0!==r?r:null}}(e,t))}),t,(function(t){var e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,i){t.addEventListener(e,i,Qa)}(n,e,a),a}var hr=function(e){t(a,Ka);var i=Nn(a);function a(){return n(this,a),i.apply(this,arguments)}return s(a,[{key:"acquireContext",value:function(t,e){var i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){var i=t.style,n=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Ja(a)){var r=kn(t,"width");void 0!==r&&(t.width=r)}if(Ja(n))if(""===t.style.height)t.height=t.width/(e||2);else{var o=kn(t,"height");void 0!==o&&(t.height=o)}}(t,e),i):null}},{key:"releaseContext",value:function(t){var e=t.canvas;if(!e.$chartjs)return!1;var i=e.$chartjs.initial;["height","width"].forEach((function(t){var n=i[t];Dt(n)?e.removeAttribute(t):e.setAttribute(t,n)}));var n=i.style||{};return Object.keys(n).forEach((function(t){e.style[t]=n[t]})),e.width=e.width,delete e.$chartjs,!0}},{key:"addEventListener",value:function(t,e,i){this.removeEventListener(t,e);var n=t.$proxies||(t.$proxies={}),a={attach:ir,detach:nr,resize:sr}[e]||ur;n[e]=a(t,e,i)}},{key:"removeEventListener",value:function(t,e){var i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:lr,detach:lr,resize:lr}[e]||tr)(t,e,n),i[e]=void 0)}},{key:"getDevicePixelRatio",value:function(){return window.devicePixelRatio}},{key:"getMaximumSize",value:function(t,e,i,n){return bn(t,e,i,n)}},{key:"isAttached",value:function(t){var e=fn(t);return!(!e||!e.isConnected)}}]),a}();var cr=function(){function t(){n(this,t),this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}return s(t,[{key:"tooltipPosition",value:function(t){var e=this.getProps(["x","y"],t);return{x:e.x,y:e.y}}},{key:"hasValue",value:function(){return oe(this.x)&&oe(this.y)}},{key:"getProps",value:function(t,e){var i=this,n=this.$animations;if(!e||!n)return this;var a={};return t.forEach((function(t){a[t]=n[t]&&n[t].active()?n[t]._to:i[t]})),a}}]),t}();cr.defaults={},cr.defaultRoutes=void 0;var fr={values:function(t){return Ot(t)?t:""+t},numeric:function(t,e,i){if(0===t)return"0";var n,a=this.chart.options.locale,r=t;if(i.length>1){var o=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(o<1e-4||o>1e15)&&(n="scientific"),r=function(t,e){var i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}var s=ne(Math.abs(r)),l=Math.max(Math.min(-1*Math.floor(s),20),0),u={notation:n,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),Dn(t,a,u)},logarithmic:function(t,e,i){if(0===t)return"0";var n=t/Math.pow(10,Math.floor(ne(t)));return 1===n||2===n||5===n?fr.numeric.call(this,t,e,i):""}};var dr={formatters:fr};function vr(t,e){var i=t.options.ticks,n=i.maxTicksLimit||function(t){var e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),a=t._maxLength/i;return Math.floor(Math.min(n,a))}(t),a=i.major.enabled?function(t){var e,i,n=[];for(e=0,i=t.length;e<i;e++)t[e].major&&n.push(e);return n}(e):[],r=a.length,o=a[0],s=a[r-1],l=[];if(r>n)return function(t,e,i,n){var a,r=0,o=i[0];for(n=Math.ceil(n),a=0;a<t.length;a++)a===o&&(e.push(t[a]),o=i[++r*n])}(e,l,a,r/n),l;var u=function(t,e,i){var n=function(t){var e,i,n=t.length;if(n<2)return!1;for(i=t[0],e=1;e<n;++e)if(t[e]-t[e-1]!==i)return!1;return i}(t),a=e.length/i;if(!n)return Math.max(a,1);for(var r=function(t){var e,i=[],n=Math.sqrt(t);for(e=1;e<n;e++)t%e==0&&(i.push(e),i.push(t/e));return n===(0|n)&&i.push(n),i.sort((function(t,e){return t-e})).pop(),i}(n),o=0,s=r.length-1;o<s;o++){var l=r[o];if(l>a)return l}return Math.max(a,1)}(a,e,n);if(r>0){var h,c,f=r>1?Math.round((s-o)/(r-1)):null;for(gr(e,l,u,Dt(f)?0:o-f,o),h=0,c=r-1;h<c;h++)gr(e,l,u,a[h],a[h+1]);return gr(e,l,u,s,Dt(f)?e.length:s+f),l}return gr(e,l,u),l}function gr(t,e,i,n,a){var r,o,s,l=Rt(n,0),u=Math.min(Rt(a,t.length),t.length),h=0;for(i=Math.ceil(i),a&&(i=(r=a-n)/Math.floor(r/i)),s=l;s<0;)h++,s=Math.round(l+h*i);for(o=Math.max(l,0);o<u;o++)o===s&&(e.push(t[o]),h++,s=Math.round(l+h*i))}ci.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:function(t,e){return e.lineWidth},tickColor:function(t,e){return e.color},offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:dr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ci.route("scale.ticks","color","","color"),ci.route("scale.grid","color","","borderColor"),ci.route("scale.grid","borderColor","","borderColor"),ci.route("scale.title","color","","color"),ci.describe("scale",{_fallback:!1,_scriptable:function(t){return!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t},_indexable:function(t){return"borderDash"!==t&&"tickBorderDash"!==t}}),ci.describe("scales",{_fallback:"scale"}),ci.describe("scale.ticks",{_scriptable:function(t){return"backdropPadding"!==t&&"callback"!==t},_indexable:function(t){return"backdropPadding"!==t}});var pr=function(t,e,i){return"top"===e||"left"===e?t[e]+i:t[e]-i};function mr(t,e){for(var i=[],n=t.length/e,a=t.length,r=0;r<a;r+=n)i.push(t[Math.floor(r)]);return i}function yr(t,e,i){var n,a=t.ticks.length,r=Math.min(e,a-1),o=t._startPixel,s=t._endPixel,l=1e-6,u=t.getPixelForTick(r);if(!(i&&(n=1===a?Math.max(u-o,s-u):0===e?(t.getPixelForTick(1)-u)/2:(u-t.getPixelForTick(r-1))/2,(u+=r<e?n:-n)<o-l||u>s+l)))return u}function br(t){return t.drawTicks?t.tickLength:0}function xr(t,e){if(!t.display)return 0;var i=Li(t.font,e),n=Ri(t.padding);return(Ot(t.text)?t.text.length:1)*i.lineHeight+n.height}function _r(t,e,i){var n=kt(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=function(t){return"left"===t?"right":"right"===t?"left":t}(n)),n}var kr=function(e){t(a,cr);var i=Nn(a);function a(t){var e;return n(this,a),(e=i.call(this)).id=t.id,e.type=t.type,e.options=void 0,e.ctx=t.ctx,e.chart=t.chart,e.top=void 0,e.bottom=void 0,e.left=void 0,e.right=void 0,e.width=void 0,e.height=void 0,e._margins={left:0,right:0,top:0,bottom:0},e.maxWidth=void 0,e.maxHeight=void 0,e.paddingTop=void 0,e.paddingBottom=void 0,e.paddingLeft=void 0,e.paddingRight=void 0,e.axis=void 0,e.labelRotation=void 0,e.min=void 0,e.max=void 0,e._range=void 0,e.ticks=[],e._gridLineItems=null,e._labelItems=null,e._labelSizes=null,e._length=0,e._maxLength=0,e._longestTextCache={},e._startPixel=void 0,e._endPixel=void 0,e._reversePixels=!1,e._userMax=void 0,e._userMin=void 0,e._suggestedMax=void 0,e._suggestedMin=void 0,e._ticksLength=0,e._borderValue=0,e._cache={},e._dataLimitsCached=!1,e.$context=void 0,e}return s(a,[{key:"init",value:function(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}},{key:"parse",value:function(t,e){return t}},{key:"getUserBounds",value:function(){var t=this._userMin,e=this._userMax,i=this._suggestedMin,n=this._suggestedMax;return t=Tt(t,Number.POSITIVE_INFINITY),e=Tt(e,Number.NEGATIVE_INFINITY),i=Tt(i,Number.POSITIVE_INFINITY),n=Tt(n,Number.NEGATIVE_INFINITY),{min:Tt(t,i),max:Tt(e,n),minDefined:Ct(t),maxDefined:Ct(e)}}},{key:"getMinMax",value:function(t){var e,i=this.getUserBounds(),n=i.min,a=i.max,r=i.minDefined,o=i.maxDefined;if(r&&o)return{min:n,max:a};for(var s=this.getMatchingVisibleMetas(),l=0,u=s.length;l<u;++l)e=s[l].controller.getMinMax(this,t),r||(n=Math.min(n,e.min)),o||(a=Math.max(a,e.max));return{min:Tt(n=o&&n>a?a:n,Tt(a=r&&n>a?n:a,n)),max:Tt(a,Tt(n,a))}}},{key:"getPadding",value:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}},{key:"getTicks",value:function(){return this.ticks}},{key:"getLabels",value:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}},{key:"beforeLayout",value:function(){this._cache={},this._dataLimitsCached=!1}},{key:"beforeUpdate",value:function(){Et(this.options.beforeUpdate,[this])}},{key:"update",value:function(t,e,i){var n=this.options,a=n.beginAtZero,r=n.grace,o=n.ticks,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){var n=t.min,a=t.max,r=Lt(e,(a-n)/2),o=function(t,e){return i&&0===t?0:t+e};return{min:o(n,-Math.abs(r)),max:o(a,r)}}(this,r,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();var l=s<this.ticks.length;this._convertTicksToLabels(l?mr(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=vr(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}},{key:"configure",value:function(){var t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}},{key:"afterUpdate",value:function(){Et(this.options.afterUpdate,[this])}},{key:"beforeSetDimensions",value:function(){Et(this.options.beforeSetDimensions,[this])}},{key:"setDimensions",value:function(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}},{key:"afterSetDimensions",value:function(){Et(this.options.afterSetDimensions,[this])}},{key:"_callHooks",value:function(t){this.chart.notifyPlugins(t,this.getContext()),Et(this.options[t],[this])}},{key:"beforeDataLimits",value:function(){this._callHooks("beforeDataLimits")}},{key:"determineDataLimits",value:function(){}},{key:"afterDataLimits",value:function(){this._callHooks("afterDataLimits")}},{key:"beforeBuildTicks",value:function(){this._callHooks("beforeBuildTicks")}},{key:"buildTicks",value:function(){return[]}},{key:"afterBuildTicks",value:function(){this._callHooks("afterBuildTicks")}},{key:"beforeTickToLabelConversion",value:function(){Et(this.options.beforeTickToLabelConversion,[this])}},{key:"generateTickLabels",value:function(t){var e,i,n,a=this.options.ticks;for(e=0,i=t.length;e<i;e++)(n=t[e]).label=Et(a.callback,[n.value,e,t],this)}},{key:"afterTickToLabelConversion",value:function(){Et(this.options.afterTickToLabelConversion,[this])}},{key:"beforeCalculateLabelRotation",value:function(){Et(this.options.beforeCalculateLabelRotation,[this])}},{key:"calculateLabelRotation",value:function(){var t,e,i,n=this.options,a=n.ticks,r=this.ticks.length,o=a.minRotation||0,s=a.maxRotation,l=o;if(!this._isVisible()||!a.display||o>=s||r<=1||!this.isHorizontal())this.labelRotation=o;else{var u=this._getLabelSizes(),h=u.widest.width,c=u.highest.height,f=me(this.chart.width-h,0,this.maxWidth);h+6>(t=n.offset?this.maxWidth/r:f/(r-1))&&(t=f/(r-(n.offset?.5:1)),e=this.maxHeight-br(n.grid)-a.padding-xr(n.title,this.chart.options.font),i=Math.sqrt(h*h+c*c),l=he(Math.min(Math.asin(me((u.highest.height+6)/t,-1,1)),Math.asin(me(e/i,-1,1))-Math.asin(me(c/i,-1,1)))),l=Math.max(o,Math.min(s,l))),this.labelRotation=l}}},{key:"afterCalculateLabelRotation",value:function(){Et(this.options.afterCalculateLabelRotation,[this])}},{key:"afterAutoSkip",value:function(){}},{key:"beforeFit",value:function(){Et(this.options.beforeFit,[this])}},{key:"fit",value:function(){var t={width:0,height:0},e=this.chart,i=this.options,n=i.ticks,a=i.title,r=i.grid,o=this._isVisible(),s=this.isHorizontal();if(o){var l=xr(a,e.options.font);if(s?(t.width=this.maxWidth,t.height=br(r)+l):(t.height=this.maxHeight,t.width=br(r)+l),n.display&&this.ticks.length){var u=this._getLabelSizes(),h=u.first,c=u.last,f=u.widest,d=u.highest,v=2*n.padding,g=ue(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(s){var y=n.mirror?0:m*f.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+y+v)}else{var b=n.mirror?0:p*f.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+b+v)}this._calculatePadding(h,c,m,p)}}this._handleMargins(),s?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}},{key:"_calculatePadding",value:function(t,e,i,n){var a=this.options,r=a.ticks,o=r.align,s=r.padding,l=a.position,u=0!==this.labelRotation,h="top"!==l&&"x"===this.axis;if(this.isHorizontal()){var c=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),d=0,v=0;u?h?(d=n*t.width,v=i*e.height):(d=i*t.height,v=n*e.width):"start"===o?v=e.width:"end"===o?d=t.width:"inner"!==o&&(d=t.width/2,v=e.width/2),this.paddingLeft=Math.max((d-c+s)*this.width/(this.width-c),0),this.paddingRight=Math.max((v-f+s)*this.width/(this.width-f),0)}else{var g=e.height/2,p=t.height/2;"start"===o?(g=0,p=t.height):"end"===o&&(g=e.height,p=0),this.paddingTop=g+s,this.paddingBottom=p+s}}},{key:"_handleMargins",value:function(){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))}},{key:"afterFit",value:function(){Et(this.options.afterFit,[this])}},{key:"isHorizontal",value:function(){var t=this.options,e=t.axis,i=t.position;return"top"===i||"bottom"===i||"x"===e}},{key:"isFullSize",value:function(){return this.options.fullSize}},{key:"_convertTicksToLabels",value:function(t){var e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)Dt(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}},{key:"_getLabelSizes",value:function(){var t=this._labelSizes;if(!t){var e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=mr(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}},{key:"_computeLabelSizes",value:function(t,e){var i,n,a,r,o,s,l,u,h,c,f,d=this.ctx,v=this._longestTextCache,g=[],p=[],m=0,y=0;for(i=0;i<e;++i){if(r=t[i].label,o=this._resolveTickFontOptions(i),d.font=s=o.string,l=v[s]=v[s]||{data:{},gc:[]},u=o.lineHeight,h=c=0,Dt(r)||Ot(r)){if(Ot(r))for(n=0,a=r.length;n<a;++n)Dt(f=r[n])||Ot(f)||(h=fi(d,l.data,l.gc,h,f),c+=u)}else h=fi(d,l.data,l.gc,h,r),c=u;g.push(h),p.push(c),m=Math.max(h,m),y=Math.max(c,y)}!function(t,e){It(t,(function(t){var i,n=t.gc,a=n.length/2;if(a>e){for(i=0;i<a;++i)delete t.data[n[i]];n.splice(0,a)}}))}(v,e);var b=g.indexOf(m),x=p.indexOf(y),_=function(t){return{width:g[t]||0,height:p[t]||0}};return{first:_(0),last:_(e-1),widest:_(b),highest:_(x),widths:g,heights:p}}},{key:"getLabelForValue",value:function(t){return t}},{key:"getPixelForValue",value:function(t,e){return NaN}},{key:"getValueForPixel",value:function(t){}},{key:"getPixelForTick",value:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}},{key:"getPixelForDecimal",value:function(t){this._reversePixels&&(t=1-t);var e=this._startPixel+t*this._length;return me(this._alignToPixels?vi(this.chart,e,0):e,-32768,32767)}},{key:"getDecimalForPixel",value:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}},{key:"getBasePixel",value:function(){return this.getPixelForValue(this.getBaseValue())}},{key:"getBaseValue",value:function(){var t=this.min,e=this.max;return t<0&&e<0?e:t>0&&e>0?t:0}},{key:"getContext",value:function(t){var e=this.ticks||[];if(t>=0&&t<e.length){var i=e[t];return i.$context||(i.$context=function(t,e,i){return Ii(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=Ii(this.chart.getContext(),{scale:this,type:"scale"}))}},{key:"_tickSize",value:function(){var t=this.options.ticks,e=ue(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),a=this._getLabelSizes(),r=t.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*i>o*n?o/i:s/n:s*n<o*i?s/i:o/n}},{key:"_isVisible",value:function(){var t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}},{key:"_computeGridLineItems",value:function(t){var e,i,n,a,r,o,s,l,u,h,c,f,d=this.axis,v=this.chart,g=this.options,p=g.grid,m=g.position,y=p.offset,b=this.isHorizontal(),x=this.ticks.length+(y?1:0),_=br(p),k=[],w=p.setContext(this.getContext()),M=w.drawBorder?w.borderWidth:0,S=M/2,P=function(t){return vi(v,t,M)};if("top"===m)e=P(this.bottom),o=this.bottom-_,l=e-S,h=P(t.top)+S,f=t.bottom;else if("bottom"===m)e=P(this.top),h=t.top,f=P(t.bottom)-S,o=e+S,l=this.top+_;else if("left"===m)e=P(this.right),r=this.right-_,s=e-S,u=P(t.left)+S,c=t.right;else if("right"===m)e=P(this.left),u=t.left,c=P(t.right)-S,r=e+S,s=this.left+_;else if("x"===d){if("center"===m)e=P((t.top+t.bottom)/2+.5);else if(At(m)){var D=Object.keys(m)[0],O=m[D];e=P(this.chart.scales[D].getPixelForValue(O))}h=t.top,f=t.bottom,l=(o=e+S)+_}else if("y"===d){if("center"===m)e=P((t.left+t.right)/2);else if(At(m)){var A=Object.keys(m)[0],C=m[A];e=P(this.chart.scales[A].getPixelForValue(C))}s=(r=e-S)-_,u=t.left,c=t.right}var T=Rt(g.ticks.maxTicksLimit,x),R=Math.max(1,Math.ceil(x/T));for(i=0;i<x;i+=R){var L=p.setContext(this.getContext(i)),E=L.lineWidth,I=L.color,z=p.borderDash||[],F=L.borderDashOffset,V=L.tickWidth,B=L.tickColor,N=L.tickBorderDash||[],j=L.tickBorderDashOffset;void 0!==(n=yr(this,i,y))&&(a=vi(v,n,E),b?r=s=u=c=a:o=l=h=f=a,k.push({tx1:r,ty1:o,tx2:s,ty2:l,x1:u,y1:h,x2:c,y2:f,width:E,color:I,borderDash:z,borderDashOffset:F,tickWidth:V,tickColor:B,tickBorderDash:N,tickBorderDashOffset:j}))}return this._ticksLength=x,this._borderValue=e,k}},{key:"_computeLabelItems",value:function(t){var e,i,n,a,r,o,s,l,u,h,c,f=this.axis,d=this.options,v=d.position,g=d.ticks,p=this.isHorizontal(),m=this.ticks,y=g.align,b=g.crossAlign,x=g.padding,_=g.mirror,k=br(d.grid),w=k+x,M=_?-x:w,S=-ue(this.labelRotation),P=[],D="middle";if("top"===v)r=this.bottom-M,o=this._getXAxisLabelAlignment();else if("bottom"===v)r=this.top+M,o=this._getXAxisLabelAlignment();else if("left"===v){var O=this._getYAxisLabelAlignment(k);o=O.textAlign,a=O.x}else if("right"===v){var A=this._getYAxisLabelAlignment(k);o=A.textAlign,a=A.x}else if("x"===f){if("center"===v)r=(t.top+t.bottom)/2+w;else if(At(v)){var C=Object.keys(v)[0],T=v[C];r=this.chart.scales[C].getPixelForValue(T)+w}o=this._getXAxisLabelAlignment()}else if("y"===f){if("center"===v)a=(t.left+t.right)/2-w;else if(At(v)){var R=Object.keys(v)[0],L=v[R];a=this.chart.scales[R].getPixelForValue(L)}o=this._getYAxisLabelAlignment(k).textAlign}"y"===f&&("start"===y?D="top":"end"===y&&(D="bottom"));var E=this._getLabelSizes();for(e=0,i=m.length;e<i;++e){n=m[e].label;var I=g.setContext(this.getContext(e));s=this.getPixelForTick(e)+g.labelOffset,u=(l=this._resolveTickFontOptions(e)).lineHeight;var z=(h=Ot(n)?n.length:1)/2,F=I.color,V=I.textStrokeColor,B=I.textStrokeWidth,N=o;p?(a=s,"inner"===o&&(N=e===i-1?this.options.reverse?"left":"right":0===e?this.options.reverse?"right":"left":"center"),c="top"===v?"near"===b||0!==S?-h*u+u/2:"center"===b?-E.highest.height/2-z*u+u:-E.highest.height+u/2:"near"===b||0!==S?u/2:"center"===b?E.highest.height/2-z*u:E.highest.height-h*u,_&&(c*=-1)):(r=s,c=(1-h)*u/2);var j=void 0;if(I.showLabelBackdrop){var W=Ri(I.backdropPadding),H=E.heights[e],$=E.widths[e],Y=r+c-W.top,U=a-W.left;switch(D){case"middle":Y-=H/2;break;case"bottom":Y-=H}switch(o){case"center":U-=$/2;break;case"right":U-=$}j={left:U,top:Y,width:$+W.width,height:H+W.height,color:I.backdropColor}}P.push({rotation:S,label:n,font:l,color:F,strokeColor:V,strokeWidth:B,textOffset:c,textAlign:N,textBaseline:D,translation:[a,r],backdrop:j})}return P}},{key:"_getXAxisLabelAlignment",value:function(){var t=this.options,e=t.position,i=t.ticks;if(-ue(this.labelRotation))return"top"===e?"left":"right";var n="center";return"start"===i.align?n="left":"end"===i.align?n="right":"inner"===i.align&&(n="inner"),n}},{key:"_getYAxisLabelAlignment",value:function(t){var e,i,n=this.options,a=n.position,r=n.ticks,o=r.crossAlign,s=r.mirror,l=r.padding,u=t+l,h=this._getLabelSizes().widest.width;return"left"===a?s?(i=this.right+l,"near"===o?e="left":"center"===o?(e="center",i+=h/2):(e="right",i+=h)):(i=this.right-u,"near"===o?e="right":"center"===o?(e="center",i-=h/2):(e="left",i=this.left)):"right"===a?s?(i=this.left+l,"near"===o?e="right":"center"===o?(e="center",i-=h/2):(e="left",i-=h)):(i=this.left+u,"near"===o?e="left":"center"===o?(e="center",i+=h/2):(e="right",i=this.right)):e="right",{textAlign:e,x:i}}},{key:"_computeLabelArea",value:function(){if(!this.options.ticks.mirror){var t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}}},{key:"drawBackground",value:function(){var t=this.ctx,e=this.options.backgroundColor,i=this.left,n=this.top,a=this.width,r=this.height;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,a,r),t.restore())}},{key:"getLineWidthForValue",value:function(t){var e=this.options.grid;if(!this._isVisible()||!e.display)return 0;var i=this.ticks.findIndex((function(e){return e.value===t}));return i>=0?e.setContext(this.getContext(i)).lineWidth:0}},{key:"drawGrid",value:function(t){var e,i,n=this.options.grid,a=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o=function(t,e,i){i.width&&i.color&&(a.save(),a.lineWidth=i.width,a.strokeStyle=i.color,a.setLineDash(i.borderDash||[]),a.lineDashOffset=i.borderDashOffset,a.beginPath(),a.moveTo(t.x,t.y),a.lineTo(e.x,e.y),a.stroke(),a.restore())};if(n.display)for(e=0,i=r.length;e<i;++e){var s=r[e];n.drawOnChartArea&&o({x:s.x1,y:s.y1},{x:s.x2,y:s.y2},s),n.drawTicks&&o({x:s.tx1,y:s.ty1},{x:s.tx2,y:s.ty2},{color:s.tickColor,width:s.tickWidth,borderDash:s.tickBorderDash,borderDashOffset:s.tickBorderDashOffset})}}},{key:"drawBorder",value:function(){var t=this.chart,e=this.ctx,i=this.options.grid,n=i.setContext(this.getContext()),a=i.drawBorder?n.borderWidth:0;if(a){var r,o,s,l,u=i.setContext(this.getContext(0)).lineWidth,h=this._borderValue;this.isHorizontal()?(r=vi(t,this.left,a)-a/2,o=vi(t,this.right,u)+u/2,s=l=h):(s=vi(t,this.top,a)-a/2,l=vi(t,this.bottom,u)+u/2,r=o=h),e.save(),e.lineWidth=n.borderWidth,e.strokeStyle=n.borderColor,e.beginPath(),e.moveTo(r,s),e.lineTo(o,l),e.stroke(),e.restore()}}},{key:"drawLabels",value:function(t){if(this.options.ticks.display){var e=this.ctx,i=this._computeLabelArea();i&&yi(e,i);var n,a,r=this._labelItems||(this._labelItems=this._computeLabelItems(t));for(n=0,a=r.length;n<a;++n){var o=r[n],s=o.font,l=o.label;o.backdrop&&(e.fillStyle=o.backdrop.color,e.fillRect(o.backdrop.left,o.backdrop.top,o.backdrop.width,o.backdrop.height)),ki(e,l,0,o.textOffset,s,o)}i&&bi(e)}}},{key:"drawTitle",value:function(){var t=this.ctx,e=this.options,i=e.position,n=e.title,a=e.reverse;if(n.display){var r=Li(n.font),o=Ri(n.padding),s=n.align,l=r.lineHeight/2;"bottom"===i||"center"===i||At(i)?(l+=o.bottom,Ot(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=o.top;var u=function(t,e,i,n){var a,r,o,s=t.top,l=t.left,u=t.bottom,h=t.right,c=t.chart,f=c.chartArea,d=c.scales,v=0,g=u-s,p=h-l;if(t.isHorizontal()){if(r=wt(n,l,h),At(i)){var m=Object.keys(i)[0],y=i[m];o=d[m].getPixelForValue(y)+g-e}else o="center"===i?(f.bottom+f.top)/2+g-e:pr(t,i,e);a=h-l}else{if(At(i)){var b=Object.keys(i)[0],x=i[b];r=d[b].getPixelForValue(x)-p+e}else r="center"===i?(f.left+f.right)/2-p+e:pr(t,i,e);o=wt(n,u,s),v="left"===i?-te:te}return{titleX:r,titleY:o,maxWidth:a,rotation:v}}(this,l,i,s),h=u.titleX,c=u.titleY,f=u.maxWidth,d=u.rotation;ki(t,n.text,0,0,r,{color:n.color,maxWidth:f,rotation:d,textAlign:_r(s,i,a),textBaseline:"middle",translation:[h,c]})}}},{key:"draw",value:function(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}},{key:"_layers",value:function(){var t=this,e=this.options,i=e.ticks&&e.ticks.z||0,n=Rt(e.grid&&e.grid.z,-1);return this._isVisible()&&this.draw===a.prototype.draw?[{z:n,draw:function(e){t.drawBackground(),t.drawGrid(e),t.drawTitle()}},{z:n+1,draw:function(){t.drawBorder()}},{z:i,draw:function(e){t.drawLabels(e)}}]:[{z:i,draw:function(e){t.draw(e)}}]}},{key:"getMatchingVisibleMetas",value:function(t){var e,i,n=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",r=[];for(e=0,i=n.length;e<i;++e){var o=n[e];o[a]!==this.id||t&&o.type!==t||r.push(o)}return r}},{key:"_resolveTickFontOptions",value:function(t){return Li(this.options.ticks.setContext(this.getContext(t)).font)}},{key:"_maxDigits",value:function(){var t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}]),a}(),wr=function(){function t(e,i,a){n(this,t),this.type=e,this.scope=i,this.override=a,this.items=Object.create(null)}return s(t,[{key:"isForType",value:function(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}},{key:"register",value:function(t){var e,i=Object.getPrototypeOf(t);(function(t){return"id"in t&&"defaults"in t})(i)&&(e=this.register(i));var n=this.items,a=t.id,r=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in n||(n[a]=t,function(t,e,i){var n=Nt(Object.create(null),[i?ci.get(i):{},ci.get(e),t.defaults]);ci.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((function(i){var n=i.split("."),a=n.pop(),r=[t].concat(n).join("."),o=e[i].split("."),s=o.pop(),l=o.join(".");ci.route(r,a,l,s)}))}(e,t.defaultRoutes);t.descriptors&&ci.describe(e,t.descriptors)}(t,r,e),this.override&&ci.override(t.id,t.overrides)),r}},{key:"get",value:function(t){return this.items[t]}},{key:"unregister",value:function(t){var e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in ci[n]&&(delete ci[n][i],this.override&&delete oi[i])}}]),t}();var Mr=function(){function t(){n(this,t),this.controllers=new wr(ra,"datasets",!0),this.elements=new wr(cr,"elements"),this.plugins=new wr(Object,"plugins"),this.scales=new wr(kr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}return s(t,[{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("register",e)}},{key:"remove",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("unregister",e)}},{key:"addControllers",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("register",e,this.controllers)}},{key:"addElements",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("register",e,this.elements)}},{key:"addPlugins",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("register",e,this.plugins)}},{key:"addScales",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("register",e,this.scales)}},{key:"getController",value:function(t){return this._get(t,this.controllers,"controller")}},{key:"getElement",value:function(t){return this._get(t,this.elements,"element")}},{key:"getPlugin",value:function(t){return this._get(t,this.plugins,"plugin")}},{key:"getScale",value:function(t){return this._get(t,this.scales,"scale")}},{key:"removeControllers",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("unregister",e,this.controllers)}},{key:"removeElements",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("unregister",e,this.elements)}},{key:"removePlugins",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("unregister",e,this.plugins)}},{key:"removeScales",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("unregister",e,this.scales)}},{key:"_each",value:function(t,e,i){var n=this;F(e).forEach((function(e){var a=i||n._getRegistryForType(e);i||a.isForType(e)||a===n.plugins&&e.id?n._exec(t,a,e):It(e,(function(e){var a=i||n._getRegistryForType(e);n._exec(t,a,e)}))}))}},{key:"_exec",value:function(t,e,i){var n=Yt(t);Et(i["before"+n],[],i),e[t](i),Et(i["after"+n],[],i)}},{key:"_getRegistryForType",value:function(t){for(var e=0;e<this._typedRegistries.length;e++){var i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}},{key:"_get",value:function(t,e,i){var n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}]),t}(),Sr=new Mr,Pr=function(){function t(){n(this,t),this._init=[]}return s(t,[{key:"notify",value:function(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));var a=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(a,t,e,i);return"afterDestroy"===e&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),r}},{key:"_notify",value:function(t,e,i,n){n=n||{};var a,r=jn(t);try{for(r.s();!(a=r.n()).done;){var o=a.value,s=o.plugin;if(!1===Et(s[i],[e,n,o.options],s)&&n.cancelable)return!1}}catch(t){r.e(t)}finally{r.f()}return!0}},{key:"invalidate",value:function(){Dt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}},{key:"_descriptors",value:function(t){if(this._cache)return this._cache;var e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}},{key:"_createDescriptors",value:function(t,e){var i=t&&t.config,n=Rt(i.options&&i.options.plugins,{}),a=function(t){for(var e=[],i=Object.keys(Sr.plugins.items),n=0;n<i.length;n++)e.push(Sr.getPlugin(i[n]));for(var a=t.plugins||[],r=0;r<a.length;r++){var o=a[r];-1===e.indexOf(o)&&e.push(o)}return e}(i);return!1!==n||e?function(t,e,i,n){for(var a=[],r=t.getContext(),o=0;o<e.length;o++){var s=e[o],l=Dr(i[s.id],n);null!==l&&a.push({plugin:s,options:Or(t.config,s,l,r)})}return a}(t,a,n,e):[]}},{key:"_notifyStateChanges",value:function(t){var e=this._oldCache||[],i=this._cache,n=function(t,e){return t.filter((function(t){return!e.some((function(e){return t.plugin.id===e.plugin.id}))}))};this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}]),t}();function Dr(t,e){return e||!1!==t?!0===t?{}:t:null}function Or(t,e,i,n){var a=t.pluginScopeKeys(e),r=t.getOptionScopes(i,a);return t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ar(t,e){var i=ci.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Cr(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function Tr(t){var e=t.options||(t.options={});e.plugins=Rt(e.plugins,{}),e.scales=function(t,e){var i=oi[t.type]||{scales:{}},n=e.scales||{},a=Ar(t.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(n).forEach((function(t){var e=n[t];if(!At(e))return console.error("Invalid scale configuration for scale: ".concat(t));if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: ".concat(t));var s=Cr(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(s,a),u=i.scales||{};r[s]=r[s]||t,o[t]=jt(Object.create(null),[{axis:s},e,u[s],u[l]])})),t.data.datasets.forEach((function(i){var a=i.type||t.type,s=i.indexAxis||Ar(a,e),l=(oi[a]||{}).scales||{};Object.keys(l).forEach((function(t){var e=function(t,e){var i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,s),a=i[e+"AxisID"]||r[e]||e;o[a]=o[a]||Object.create(null),jt(o[a],[{axis:e},n[a],l[t]])}))})),Object.keys(o).forEach((function(t){var e=o[t];jt(e,[ci.scales[e.type],ci.scale])})),o}(t,e)}function Rr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}var Lr=new Map,Er=new Set;function Ir(t,e){var i=Lr.get(t);return i||(i=e(),Lr.set(t,i),Er.add(i)),i}var zr=function(t,e,i){var n=$t(e,i);void 0!==n&&t.add(n)},Fr=function(){function t(e){n(this,t),this._config=function(t){return(t=t||{}).data=Rr(t.data),Tr(t),t}(e),this._scopeCache=new Map,this._resolverCache=new Map}return s(t,[{key:"platform",get:function(){return this._config.platform}},{key:"type",get:function(){return this._config.type},set:function(t){this._config.type=t}},{key:"data",get:function(){return this._config.data},set:function(t){this._config.data=Rr(t)}},{key:"options",get:function(){return this._config.options},set:function(t){this._config.options=t}},{key:"plugins",get:function(){return this._config.plugins}},{key:"update",value:function(){var t=this._config;this.clearCache(),Tr(t)}},{key:"clearCache",value:function(){this._scopeCache.clear(),this._resolverCache.clear()}},{key:"datasetScopeKeys",value:function(t){return Ir(t,(function(){return[["datasets.".concat(t),""]]}))}},{key:"datasetAnimationScopeKeys",value:function(t,e){return Ir("".concat(t,".transition.").concat(e),(function(){return[["datasets.".concat(t,".transitions.").concat(e),"transitions.".concat(e)],["datasets.".concat(t),""]]}))}},{key:"datasetElementScopeKeys",value:function(t,e){return Ir("".concat(t,"-").concat(e),(function(){return[["datasets.".concat(t,".elements.").concat(e),"datasets.".concat(t),"elements.".concat(e),""]]}))}},{key:"pluginScopeKeys",value:function(t){var e=t.id,i=this.type;return Ir("".concat(i,"-plugin-").concat(e),(function(){return[["plugins.".concat(e)].concat(F(t.additionalOptionScopes||[]))]}))}},{key:"_cachedScopes",value:function(t,e){var i=this._scopeCache,n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}},{key:"getOptionScopes",value:function(t,e,i){var n=this.options,a=this.type,r=this._cachedScopes(t,i),o=r.get(e);if(o)return o;var s=new Set;e.forEach((function(e){t&&(s.add(t),e.forEach((function(e){return zr(s,t,e)}))),e.forEach((function(t){return zr(s,n,t)})),e.forEach((function(t){return zr(s,oi[a]||{},t)})),e.forEach((function(t){return zr(s,ci,t)})),e.forEach((function(t){return zr(s,si,t)}))}));var l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),Er.has(e)&&r.set(e,l),l}},{key:"chartOptionScopes",value:function(){var t=this.options,e=this.type;return[t,oi[e]||{},ci.datasets[e]||{},{type:e},ci,si]}},{key:"resolveNamedOptions",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[""],a={$shared:!0},r=Vr(this._resolverCache,t,n),o=r.resolver,s=r.subPrefixes,l=o;if(Nr(o,e)){a.$shared=!1,i=Xt(i)?i():i;var u=this.createResolver(t,i,s);l=Hi(o,i,u)}var h,c=jn(e);try{for(c.s();!(h=c.n()).done;){var f=h.value;a[f]=l[f]}}catch(t){c.e(t)}finally{c.f()}return a}},{key:"createResolver",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],n=arguments.length>3?arguments[3]:void 0,a=Vr(this._resolverCache,t,i),r=a.resolver;return At(e)?Hi(r,e,void 0,n):r}}]),t}();function Vr(t,e,i){var n=t.get(e);n||(n=new Map,t.set(e,n));var a=i.join(),r=n.get(a);r||(r={resolver:Wi(e,i),subPrefixes:i.filter((function(t){return!t.toLowerCase().includes("hover")}))},n.set(a,r));return r}var Br=function(t){return At(t)&&Object.getOwnPropertyNames(t).reduce((function(e,i){return e||Xt(t[i])}),!1)};function Nr(t,e){var i,n=$i(t),a=n.isScriptable,r=n.isIndexable,o=jn(e);try{for(o.s();!(i=o.n()).done;){var s=i.value,l=a(s),u=r(s),h=(u||l)&&t[s];if(l&&(Xt(h)||Br(h))||u&&Ot(h))return!0}}catch(t){o.e(t)}finally{o.f()}return!1}var jr=["top","bottom","left","right","chartArea"];function Wr(t,e){return"top"===t||"bottom"===t||-1===jr.indexOf(t)&&"x"===e}function Hr(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function $r(t){var e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Et(i&&i.onComplete,[t],e)}function Yr(t){var e=t.chart,i=e.options.animation;Et(i&&i.onProgress,[t],e)}function Ur(t){return cn()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}var Xr={},qr=function(t){var e=Ur(t);return Object.values(Xr).filter((function(t){return t.canvas===e})).pop()};function Kr(t,e,i){for(var n=0,a=Object.keys(t);n<a.length;n++){var r=a[n],o=+r;if(o>=e){var s=t[r];delete t[r],(i>0||o>e)&&(t[o+i]=s)}}}var Gr=function(){function t(e,i){var a=this;n(this,t);var r=this.config=new Fr(i),o=Ur(e),s=qr(o);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");var l=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||function(t){return!cn()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Ga:hr}(o)),this.platform.updateConfig(r);var u,h,c,f=this.platform.acquireContext(o,l.aspectRatio),d=f&&f.canvas,v=d&&d.height,g=d&&d.width;this.id=Pt(),this.ctx=f,this.canvas=d,this.width=g,this.height=v,this._options=l,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 Pr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(u=function(t){return a.update(t)},h=l.resizeDelay||0,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return h?(clearTimeout(c),c=setTimeout(u,h,e)):u.apply(this,e),h}),this._dataChanges=[],Xr[this.id]=this,f&&d?(Hn.listen(this,"complete",$r),Hn.listen(this,"progress",Yr),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}return s(t,[{key:"aspectRatio",get:function(){var t=this.options,e=t.aspectRatio,i=t.maintainAspectRatio,n=this.width,a=this.height,r=this._aspectRatio;return Dt(e)?i&&r?r:a?n/a:null:e}},{key:"data",get:function(){return this.config.data},set:function(t){this.config.data=t}},{key:"options",get:function(){return this._options},set:function(t){this.config.options=t}},{key:"_initialize",value:function(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():xn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}},{key:"clear",value:function(){return gi(this.canvas,this.ctx),this}},{key:"stop",value:function(){return Hn.stop(this),this}},{key:"resize",value:function(t,e){Hn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}},{key:"_resize",value:function(t,e){var i=this.options,n=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,a),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,xn(this,o,!0)&&(this.notifyPlugins("resize",{size:r}),Et(i.onResize,[this,r],this),this.attached&&this._doResize(s)&&this.render())}},{key:"ensureScalesHaveIDs",value:function(){It(this.options.scales||{},(function(t,e){t.id=e}))}},{key:"buildOrUpdateScales",value:function(){var t=this,e=this.options,i=e.scales,n=this.scales,a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{}),r=[];i&&(r=r.concat(Object.keys(i).map((function(t){var e=i[t],n=Cr(t,e),a="r"===n,r="x"===n;return{options:e,dposition:a?"chartArea":r?"bottom":"left",dtype:a?"radialLinear":r?"category":"linear"}})))),It(r,(function(i){var r=i.options,o=r.id,s=Cr(o,r),l=Rt(r.type,i.dtype);void 0!==r.position&&Wr(r.position,s)===Wr(i.dposition)||(r.position=i.dposition),a[o]=!0;var u=null;o in n&&n[o].type===l?u=n[o]:(u=new(Sr.getScale(l))({id:o,type:l,ctx:t.ctx,chart:t}),n[u.id]=u);u.init(r,e)})),It(a,(function(t,e){t||delete n[e]})),It(n,(function(e){Xa(t,e,e.options),Ya(t,e)}))}},{key:"_updateMetasets",value:function(){var t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((function(t,e){return t.index-e.index})),i>e){for(var n=e;n<i;++n)this._destroyDatasetMeta(n);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Hr("order","index"))}},{key:"_removeUnreferencedMetasets",value:function(){var t=this,e=this._metasets,i=this.data.datasets;e.length>i.length&&delete this._stacks,e.forEach((function(e,n){0===i.filter((function(t){return t===e._dataset})).length&&t._destroyDatasetMeta(n)}))}},{key:"buildOrUpdateControllers",value:function(){var t,e,i=[],n=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=n.length;t<e;t++){var a=n[t],r=this.getDatasetMeta(t),o=a.type||this.config.type;if(r.type&&r.type!==o&&(this._destroyDatasetMeta(t),r=this.getDatasetMeta(t)),r.type=o,r.indexAxis=a.indexAxis||Ar(o,this.options),r.order=a.order||0,r.index=t,r.label=""+a.label,r.visible=this.isDatasetVisible(t),r.controller)r.controller.updateIndex(t),r.controller.linkScales();else{var s=Sr.getController(o),l=ci.datasets[o],u=l.datasetElementType,h=l.dataElementType;Object.assign(s.prototype,{dataElementType:Sr.getElement(h),datasetElementType:u&&Sr.getElement(u)}),r.controller=new s(this,t),i.push(r.controller)}}return this._updateMetasets(),i}},{key:"_resetElements",value:function(){var t=this;It(this.data.datasets,(function(e,i){t.getDatasetMeta(i).controller.reset()}),this)}},{key:"reset",value:function(){this._resetElements(),this.notifyPlugins("reset")}},{key:"update",value:function(t){var e=this.config;e.update();var i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1!==this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})){var a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");for(var r=0,o=0,s=this.data.datasets.length;o<s;o++){var l=this.getDatasetMeta(o).controller,u=!n&&-1===a.indexOf(l);l.buildOrUpdateElements(u),r=Math.max(+l.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),n||It(a,(function(t){t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Hr("z","_idx"));var h=this._active,c=this._lastEvent;c?this._eventHandler(c,!0):h.length&&this._updateHoverStyles(h,h,!0),this.render()}}},{key:"_updateScales",value:function(){var t=this;It(this.scales,(function(e){Ua(t,e)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}},{key:"_checkEventBindings",value:function(){var t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);qt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}},{key:"_updateHiddenIndices",value:function(){var t,e=this._hiddenIndices,i=jn(this._getUniformDataChanges()||[]);try{for(i.s();!(t=i.n()).done;){var n=t.value,a=n.method,r=n.start,o=n.count;Kr(e,r,"_removeElements"===a?-o:o)}}catch(t){i.e(t)}finally{i.f()}}},{key:"_getUniformDataChanges",value:function(){var t=this._dataChanges;if(t&&t.length){this._dataChanges=[];for(var e=this.data.datasets.length,i=function(e){return new Set(t.filter((function(t){return t[0]===e})).map((function(t,e){return e+","+t.splice(1).join(",")})))},n=i(0),a=1;a<e;a++)if(!qt(n,i(a)))return;return Array.from(n).map((function(t){return t.split(",")})).map((function(t){return{method:t[1],start:+t[2],count:+t[3]}}))}}},{key:"_updateLayout",value:function(t){var e=this;if(!1!==this.notifyPlugins("beforeLayout",{cancelable:!0})){qa(this,this.width,this.height,t);var i=this.chartArea,n=i.width<=0||i.height<=0;this._layers=[],It(this.boxes,(function(t){var i;n&&"chartArea"===t.position||(t.configure&&t.configure(),(i=e._layers).push.apply(i,F(t._layers())))}),this),this._layers.forEach((function(t,e){t._idx=e})),this.notifyPlugins("afterLayout")}}},{key:"_updateDatasets",value:function(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(var e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(var n=0,a=this.data.datasets.length;n<a;++n)this._updateDataset(n,Xt(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}},{key:"_updateDataset",value:function(t,e){var i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}},{key:"render",value:function(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Hn.has(this)?this.attached&&!Hn.running(this)&&Hn.start(this):(this.draw(),$r({chart:this})))}},{key:"draw",value:function(){var t;if(this._resizeBeforeDraw){var e=this._resizeBeforeDraw,i=e.width,n=e.height;this._resize(i,n),this._resizeBeforeDraw=null}if(this.clear(),!(this.width<=0||this.height<=0)&&!1!==this.notifyPlugins("beforeDraw",{cancelable:!0})){var a=this._layers;for(t=0;t<a.length&&a[t].z<=0;++t)a[t].draw(this.chartArea);for(this._drawDatasets();t<a.length;++t)a[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}}},{key:"_getSortedDatasetMetas",value:function(t){var e,i,n=this._sortedMetasets,a=[];for(e=0,i=n.length;e<i;++e){var r=n[e];t&&!r.visible||a.push(r)}return a}},{key:"getSortedVisibleDatasetMetas",value:function(){return this._getSortedDatasetMetas(!0)}},{key:"_drawDatasets",value:function(){if(!1!==this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){for(var t=this.getSortedVisibleDatasetMetas(),e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}}},{key:"_drawDataset",value:function(t){var e=this.ctx,i=t._clip,n=!i.disabled,a=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(n&&yi(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),n&&bi(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}},{key:"isPointInArea",value:function(t){return mi(t,this.chartArea,this._minPadding)}},{key:"getElementsAtEventForMode",value:function(t,e,i,n){var a=Ra.modes[e];return"function"==typeof a?a(this,t,i,n):[]}},{key:"getDatasetMeta",value:function(t){var e=this.data.datasets[t],i=this._metasets,n=i.filter((function(t){return t&&t._dataset===e})).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}},{key:"getContext",value:function(){return this.$context||(this.$context=Ii(null,{chart:this,type:"chart"}))}},{key:"getVisibleDatasetCount",value:function(){return this.getSortedVisibleDatasetMetas().length}},{key:"isDatasetVisible",value:function(t){var e=this.data.datasets[t];if(!e)return!1;var i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}},{key:"setDatasetVisibility",value:function(t,e){this.getDatasetMeta(t).hidden=!e}},{key:"toggleDataVisibility",value:function(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}},{key:"getDataVisibility",value:function(t){return!this._hiddenIndices[t]}},{key:"_updateVisibility",value:function(t,e,i){var n=i?"show":"hide",a=this.getDatasetMeta(t),r=a.controller._resolveAnimations(void 0,n);Ut(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(a,{visible:i}),this.update((function(e){return e.datasetIndex===t?n:void 0})))}},{key:"hide",value:function(t,e){this._updateVisibility(t,e,!1)}},{key:"show",value:function(t,e){this._updateVisibility(t,e,!0)}},{key:"_destroyDatasetMeta",value:function(t){var e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}},{key:"_stop",value:function(){var t,e;for(this.stop(),Hn.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}},{key:"destroy",value:function(){this.notifyPlugins("beforeDestroy");var t=this.canvas,e=this.ctx;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),gi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Xr[this.id],this.notifyPlugins("afterDestroy")}},{key:"toBase64Image",value:function(){var t;return(t=this.canvas).toDataURL.apply(t,arguments)}},{key:"bindEvents",value:function(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}},{key:"bindUserEvents",value:function(){var t=this,e=this._listeners,i=this.platform,n=function(e,i,n){e.offsetX=i,e.offsetY=n,t._eventHandler(e)};It(this.options.events,(function(a){return function(n,a){i.addEventListener(t,n,a),e[n]=a}(a,n)}))}},{key:"bindResponsiveEvents",value:function(){var t=this;this._responsiveListeners||(this._responsiveListeners={});var e,i=this._responsiveListeners,n=this.platform,a=function(e,a){n.addEventListener(t,e,a),i[e]=a},r=function(e,a){i[e]&&(n.removeEventListener(t,e,a),delete i[e])},o=function(e,i){t.canvas&&t.resize(e,i)},s=function i(){r("attach",i),t.attached=!0,t.resize(),a("resize",o),a("detach",e)};e=function(){t.attached=!1,r("resize",o),t._stop(),t._resize(0,0),a("attach",s)},n.isAttached(this.canvas)?s():e()}},{key:"unbindEvents",value:function(){var t=this;It(this._listeners,(function(e,i){t.platform.removeEventListener(t,i,e)})),this._listeners={},It(this._responsiveListeners,(function(e,i){t.platform.removeEventListener(t,i,e)})),this._responsiveListeners=void 0}},{key:"updateHoverStyle",value:function(t,e,i){var n,a,r,o=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+o+"DatasetHoverStyle"](),a=0,r=t.length;a<r;++a){var s=(n=t[a])&&this.getDatasetMeta(n.datasetIndex).controller;s&&s[o+"HoverStyle"](n.element,n.datasetIndex,n.index)}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(t){var e=this,i=this._active||[],n=t.map((function(t){var i=t.datasetIndex,n=t.index,a=e.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[n],index:n}}));!zt(n,i)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,i))}},{key:"notifyPlugins",value:function(t,e,i){return this._plugins.notify(this,t,e,i)}},{key:"_updateHoverStyles",value:function(t,e,i){var n=this.options.hover,a=function(t,e){return t.filter((function(t){return!e.some((function(e){return t.datasetIndex===e.datasetIndex&&t.index===e.index}))}))},r=a(e,t),o=i?t:a(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}},{key:"_eventHandler",value:function(t,e){var i=this,n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},a=function(e){return(e.options.events||i.options.events).includes(t.native.type)};if(!1!==this.notifyPlugins("beforeEvent",n,a)){var r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,a),(r||n.changed)&&this.render(),this}}},{key:"_handleEvent",value:function(t,e,i){var n=this._active,a=void 0===n?[]:n,r=this.options,o=e,s=this._getActiveElements(t,a,i,o),l=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),u=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Et(r.onHover,[t,s,this],this),l&&Et(r.onClick,[t,s,this],this));var h=!zt(s,a);return(h||e)&&(this._active=s,this._updateHoverStyles(s,a,e)),this._lastEvent=u,h}},{key:"_getActiveElements",value:function(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;var a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,n)}}]),t}(),Zr=function(){return It(Gr.instances,(function(t){return t._plugins.invalidate()}))};function Jr(t,e,i){var n=e.startAngle,a=e.pixelMargin,r=e.x,o=e.y,s=e.outerRadius,l=e.innerRadius,u=a/s;t.beginPath(),t.arc(r,o,s,n-u,i+u),l>a?(u=a/l,t.arc(r,o,l,i+u,n-u,!0)):t.arc(r,o,a,i+te,n-te),t.closePath(),t.clip()}function Qr(t,e,i,n){var a=Ai(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),r=(i-e)/2,o=Math.min(r,n*e/2),s=function(t){var e=(i-Math.min(r,t))*n/2;return me(t,0,Math.min(r,e))};return{outerStart:s(a.outerStart),outerEnd:s(a.outerEnd),innerStart:me(a.innerStart,0,o),innerEnd:me(a.innerEnd,0,o)}}function to(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function eo(t,e,i,n,a){var r=e.x,o=e.y,s=e.startAngle,l=e.pixelMargin,u=e.innerRadius,h=Math.max(e.outerRadius+n+i-l,0),c=u>0?u+n+i+l:0,f=0,d=a-s;if(n){var v=((u>0?u-n:0)+(h>0?h-n:0))/2;f=(d-(0!==v?d*v/(v+n):d))/2}var g=(d-Math.max(.001,d*h-i/Kt)/h)/2,p=s+g+f,m=a-g-f,y=Qr(e,c,h,m-p),b=y.outerStart,x=y.outerEnd,_=y.innerStart,k=y.innerEnd,w=h-b,M=h-x,S=p+b/w,P=m-x/M,D=c+_,O=c+k,A=p+_/D,C=m-k/O;if(t.beginPath(),t.arc(r,o,h,S,P),x>0){var T=to(M,P,r,o);t.arc(T.x,T.y,x,P,m+te)}var R=to(O,m,r,o);if(t.lineTo(R.x,R.y),k>0){var L=to(O,C,r,o);t.arc(L.x,L.y,k,m+te,C+Math.PI)}if(t.arc(r,o,c,m-k/c,p+_/c,!0),_>0){var E=to(D,A,r,o);t.arc(E.x,E.y,_,A+Math.PI,p-te)}var I=to(w,p,r,o);if(t.lineTo(I.x,I.y),b>0){var z=to(w,S,r,o);t.arc(z.x,z.y,b,p-te,S)}t.closePath()}function io(t,e,i,n,a){var r=e.options,o=r.borderWidth,s=r.borderJoinStyle,l="inner"===r.borderAlign;o&&(l?(t.lineWidth=2*o,t.lineJoin=s||"round"):(t.lineWidth=o,t.lineJoin=s||"bevel"),e.fullCircles&&function(t,e,i){var n,a=e.x,r=e.y,o=e.startAngle,s=e.pixelMargin,l=e.fullCircles,u=Math.max(e.outerRadius-s,0),h=e.innerRadius+s;for(i&&Jr(t,e,o+Gt),t.beginPath(),t.arc(a,r,h,o+Gt,o,!0),n=0;n<l;++n)t.stroke();for(t.beginPath(),t.arc(a,r,u,o,o+Gt),n=0;n<l;++n)t.stroke()}(t,e,l),l&&Jr(t,e,a),eo(t,e,i,n,a),t.stroke())}Object.defineProperties(Gr,{defaults:{enumerable:true,value:ci},instances:{enumerable:true,value:Xr},overrides:{enumerable:true,value:oi},registry:{enumerable:true,value:Sr},version:{enumerable:true,value:"3.8.0"},getChart:{enumerable:true,value:qr},register:{enumerable:true,value:function(){Sr.add.apply(Sr,arguments),Zr()}},unregister:{enumerable:true,value:function(){Sr.remove.apply(Sr,arguments),Zr()}}});var no=function(e){t(a,cr);var i=Nn(a);function a(t){var e;return n(this,a),(e=i.call(this)).options=void 0,e.circumference=void 0,e.startAngle=void 0,e.endAngle=void 0,e.innerRadius=void 0,e.outerRadius=void 0,e.pixelMargin=0,e.fullCircles=0,t&&Object.assign(o(e),t),e}return s(a,[{key:"inRange",value:function(t,e,i){var n=fe(this.getProps(["x","y"],i),{x:t,y:e}),a=n.angle,r=n.distance,o=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),s=o.startAngle,l=o.endAngle,u=o.innerRadius,h=o.outerRadius,c=o.circumference,f=this.options.spacing/2,d=Rt(c,l-s)>=Gt||pe(a,s,l),v=ye(r,u+f,h+f);return d&&v}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),i=e.x,n=e.y,a=e.startAngle,r=e.endAngle,o=e.innerRadius,s=e.outerRadius,l=this.options,u=l.offset,h=(a+r)/2,c=(o+s+l.spacing+u)/2;return{x:i+Math.cos(h)*c,y:n+Math.sin(h)*c}}},{key:"tooltipPosition",value:function(t){return this.getCenterPoint(t)}},{key:"draw",value:function(t){var e=this.options,i=this.circumference,n=(e.offset||0)/2,a=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>Gt?Math.floor(i/Gt):0,!(0===i||this.innerRadius<0||this.outerRadius<0)){t.save();var r=0;if(n){r=n/2;var o=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(o)*r,Math.sin(o)*r),this.circumference>=Kt&&(r=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;var s=function(t,e,i,n){var a=e.fullCircles,r=e.startAngle,o=e.circumference,s=e.endAngle;if(a){eo(t,e,i,n,r+Gt);for(var l=0;l<a;++l)t.fill();isNaN(o)||(s=r+o%Gt,o%Gt==0&&(s+=Gt))}return eo(t,e,i,n,s),t.fill(),s}(t,this,r,a);io(t,this,r,a,s),t.restore()}}}]),a}();function ao(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;t.lineCap=Rt(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Rt(i.borderDash,e.borderDash)),t.lineDashOffset=Rt(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Rt(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Rt(i.borderWidth,e.borderWidth),t.strokeStyle=Rt(i.borderColor,e.borderColor)}function ro(t,e,i){t.lineTo(i.x,i.y)}function oo(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.length,a=i.start,r=void 0===a?0:a,o=i.end,s=void 0===o?n-1:o,l=e.start,u=e.end,h=Math.max(r,l),c=Math.min(s,u),f=r<l&&s<l||r>u&&s>u;return{count:n,start:h,loop:e.loop,ilen:c<h&&!f?n+c-h:c-h}}function so(t,e,i,n){var a,r,o,s=e.points,l=e.options,u=oo(s,i,n),h=u.count,c=u.start,f=u.loop,d=u.ilen,v=function(t){return t.stepped?xi:t.tension||"monotone"===t.cubicInterpolationMode?_i:ro}(l),g=n||{},p=g.move,m=void 0===p||p,y=g.reverse;for(a=0;a<=d;++a)(r=s[(c+(y?d-a:a))%h]).skip||(m?(t.moveTo(r.x,r.y),m=!1):v(t,o,r,y,l.stepped),o=r);return f&&v(t,o,r=s[(c+(y?d:0))%h],y,l.stepped),!!f}function lo(t,e,i,n){var a,r,o,s,l,u,h=e.points,c=oo(h,i,n),f=c.count,d=c.start,v=c.ilen,g=n||{},p=g.move,m=void 0===p||p,y=g.reverse,b=0,x=0,_=function(t){return(d+(y?v-t:t))%f},k=function(){s!==l&&(t.lineTo(b,l),t.lineTo(b,s),t.lineTo(b,u))};for(m&&(r=h[_(0)],t.moveTo(r.x,r.y)),a=0;a<=v;++a)if(!(r=h[_(a)]).skip){var w=r.x,M=r.y,S=0|w;S===o?(M<s?s=M:M>l&&(l=M),b=(x*b+w)/++x):(k(),t.lineTo(w,M),o=S,x=0,s=l=M),u=M}k()}function uo(t){var e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?lo:so}no.id="arc",no.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},no.defaultRoutes={backgroundColor:"backgroundColor"};var ho="function"==typeof Path2D;function co(t,e,i,n){ho&&!e.options.segment?function(t,e,i,n){var a=e._path;a||(a=e._path=new Path2D,e.path(a,i,n)&&a.closePath()),ao(t,e.options),t.stroke(a)}(t,e,i,n):function(t,e,i,n){var a,r=e.segments,o=e.options,s=uo(e),l=jn(r);try{for(l.s();!(a=l.n()).done;){var u=a.value;ao(t,o,u.style),t.beginPath(),s(t,e,u,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}}catch(t){l.e(t)}finally{l.f()}}(t,e,i,n)}var fo=function(e){t(a,cr);var i=Nn(a);function a(t){var e;return n(this,a),(e=i.call(this)).animated=!0,e.options=void 0,e._chart=void 0,e._loop=void 0,e._fullLoop=void 0,e._path=void 0,e._points=void 0,e._segments=void 0,e._decimated=!1,e._pointsUpdated=!1,e._datasetIndex=void 0,t&&Object.assign(o(e),t),e}return s(a,[{key:"updateControlPoints",value:function(t,e){var i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){var n=i.spanGaps?this._loop:this._fullLoop;hn(this._points,i,t,n,e),this._pointsUpdated=!0}}},{key:"points",get:function(){return this._points},set:function(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}},{key:"segments",get:function(){return this._segments||(this._segments=function(t,e){var i=t.points,n=t.options.spanGaps,a=i.length;if(!a)return[];var r=!!t._loop,o=function(t,e,i,n){var a=0,r=e-1;if(i&&!n)for(;a<e&&!t[a].skip;)a++;for(;a<e&&t[a].skip;)a++;for(a%=e,i&&(r+=a);r>a&&t[r%e].skip;)r--;return{start:a,end:r%=e}}(i,a,r,n),s=o.start,l=o.end;return In(t,!0===n?[{start:s,end:l,loop:r}]:function(t,e,i,n){var a,r=t.length,o=[],s=e,l=t[e];for(a=e+1;a<=i;++a){var u=t[a%r];u.skip||u.stop?l.skip||(n=!1,o.push({start:e%r,end:(a-1)%r,loop:n}),e=s=u.stop?a:null):(s=a,l.skip&&(e=a)),l=u}return null!==s&&o.push({start:e%r,end:s%r,loop:n}),o}(i,s,l<s?l+a:l,!!t._fullLoop&&0===s&&l===a-1),i,e)}(this,this.options.segment))}},{key:"first",value:function(){var t=this.segments,e=this.points;return t.length&&e[t[0].start]}},{key:"last",value:function(){var t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}},{key:"interpolate",value:function(t,e){var i=this.options,n=t[e],a=this.points,r=En(this,{property:e,start:n,end:n});if(r.length){var o,s,l=[],u=function(t){return t.stepped?Mn:t.tension||"monotone"===t.cubicInterpolationMode?Sn:wn}(i);for(o=0,s=r.length;o<s;++o){var h=r[o],c=h.start,f=h.end,d=a[c],v=a[f];if(d!==v){var g=u(d,v,Math.abs((n-d[e])/(v[e]-d[e])),i.stepped);g[e]=t[e],l.push(g)}else l.push(d)}return 1===l.length?l[0]:l}}},{key:"pathSegment",value:function(t,e,i){return uo(this)(t,this,e,i)}},{key:"path",value:function(t,e,i){var n=this.segments,a=uo(this),r=this._loop;e=e||0,i=i||this.points.length-e;var o,s=jn(n);try{for(s.s();!(o=s.n()).done;){r&=a(t,this,o.value,{start:e,end:e+i-1})}}catch(t){s.e(t)}finally{s.f()}return!!r}},{key:"draw",value:function(t,e,i,n){var a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),co(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}]),a}();function vo(t,e,i,n){var a=t.options,r=t.getProps([i],n)[i];return Math.abs(e-r)<a.radius+a.hitRadius}fo.id="line",fo.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},fo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},fo.descriptors={_scriptable:!0,_indexable:function(t){return"borderDash"!==t&&"fill"!==t}};var go=function(e){t(a,cr);var i=Nn(a);function a(t){var e;return n(this,a),(e=i.call(this)).options=void 0,e.parsed=void 0,e.skip=void 0,e.stop=void 0,t&&Object.assign(o(e),t),e}return s(a,[{key:"inRange",value:function(t,e,i){var n=this.options,a=this.getProps(["x","y"],i),r=a.x,o=a.y;return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(n.hitRadius+n.radius,2)}},{key:"inXRange",value:function(t,e){return vo(this,t,"x",e)}},{key:"inYRange",value:function(t,e){return vo(this,t,"y",e)}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y"],t);return{x:e.x,y:e.y}}},{key:"size",value:function(t){var e=(t=t||this.options||{}).radius||0;return 2*((e=Math.max(e,e&&t.hoverRadius||0))+(e&&t.borderWidth||0))}},{key:"draw",value:function(t,e){var i=this.options;this.skip||i.radius<.1||!mi(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,pi(t,i,this.x,this.y))}},{key:"getRange",value:function(){var t=this.options||{};return t.radius+t.hitRadius}}]),a}();function po(t,e){var i,n,a,r,o,s=t.getProps(["x","y","base","width","height"],e),l=s.x,u=s.y,h=s.base,c=s.width,f=s.height;return t.horizontal?(o=f/2,i=Math.min(l,h),n=Math.max(l,h),a=u-o,r=u+o):(i=l-(o=c/2),n=l+o,a=Math.min(u,h),r=Math.max(u,h)),{left:i,top:a,right:n,bottom:r}}function mo(t,e,i,n){return t?0:me(e,i,n)}function yo(t){var e=po(t),i=e.right-e.left,n=e.bottom-e.top,a=function(t,e,i){var n=t.options.borderWidth,a=t.borderSkipped,r=Ci(n);return{t:mo(a.top,r.top,0,i),r:mo(a.right,r.right,0,e),b:mo(a.bottom,r.bottom,0,i),l:mo(a.left,r.left,0,e)}}(t,i/2,n/2),r=function(t,e,i){var n=t.getProps(["enableBorderRadius"]).enableBorderRadius,a=t.options.borderRadius,r=Ti(a),o=Math.min(e,i),s=t.borderSkipped,l=n||At(a);return{topLeft:mo(!l||s.top||s.left,r.topLeft,0,o),topRight:mo(!l||s.top||s.right,r.topRight,0,o),bottomLeft:mo(!l||s.bottom||s.left,r.bottomLeft,0,o),bottomRight:mo(!l||s.bottom||s.right,r.bottomRight,0,o)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:r},inner:{x:e.left+a.l,y:e.top+a.t,w:i-a.l-a.r,h:n-a.t-a.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,r.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(a.b,a.r))}}}}function bo(t,e,i,n){var a=null===e,r=null===i,o=t&&!(a&&r)&&po(t,n);return o&&(a||ye(e,o.left,o.right))&&(r||ye(i,o.top,o.bottom))}function xo(t,e){t.rect(e.x,e.y,e.w,e.h)}function _o(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.x!==i.x?-e:0,a=t.y!==i.y?-e:0,r=(t.x+t.w!==i.x+i.w?e:0)-n,o=(t.y+t.h!==i.y+i.h?e:0)-a;return{x:t.x+n,y:t.y+a,w:t.w+r,h:t.h+o,radius:t.radius}}go.id="point",go.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},go.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var ko=function(e){t(a,cr);var i=Nn(a);function a(t){var e;return n(this,a),(e=i.call(this)).options=void 0,e.horizontal=void 0,e.base=void 0,e.width=void 0,e.height=void 0,e.inflateAmount=void 0,t&&Object.assign(o(e),t),e}return s(a,[{key:"draw",value:function(t){var e,i=this.inflateAmount,n=this.options,a=n.borderColor,r=n.backgroundColor,o=yo(this),s=o.inner,l=o.outer,u=(e=l.radius).topLeft||e.topRight||e.bottomLeft||e.bottomRight?Si:xo;t.save(),l.w===s.w&&l.h===s.h||(t.beginPath(),u(t,_o(l,i,s)),t.clip(),u(t,_o(s,-i,l)),t.fillStyle=a,t.fill("evenodd")),t.beginPath(),u(t,_o(s,i)),t.fillStyle=r,t.fill(),t.restore()}},{key:"inRange",value:function(t,e,i){return bo(this,t,e,i)}},{key:"inXRange",value:function(t,e){return bo(this,t,null,e)}},{key:"inYRange",value:function(t,e){return bo(this,null,t,e)}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","base","horizontal"],t),i=e.x,n=e.y,a=e.base,r=e.horizontal;return{x:r?(i+a)/2:i,y:r?n:(n+a)/2}}},{key:"getRange",value:function(t){return"x"===t?this.width/2:this.height/2}}]),a}();ko.id="bar",ko.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},ko.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var wo=Object.freeze({__proto__:null,ArcElement:no,LineElement:fo,PointElement:go,BarElement:ko});function Mo(t){if(t._decimated){var e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function So(t){t.data.datasets.forEach((function(t){Mo(t)}))}var Po={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:function(t,e,i){if(i.enabled){var n=t.width;t.data.datasets.forEach((function(e,a){var r=e._data,o=e.indexAxis,s=t.getDatasetMeta(a),l=r||e.data;if("y"!==Ei([o,t.options.indexAxis])&&s.controller.supportsDecimation){var u=t.scales[s.xAxisID];if(("linear"===u.type||"time"===u.type)&&!t.options.parsing){var h=function(t,e){var i=e.length,n=0,a=t.iScale,r=a.getUserBounds(),o=r.min,s=r.max,l=r.minDefined,u=r.maxDefined;return l&&(n=me(Fi(e,a.axis,o).lo,0,i-1)),{start:n,count:u?me(Fi(e,a.axis,s).hi+1,n,i)-n:i-n}}(s,l),c=h.start,f=h.count;if(f<=(i.threshold||4*n))Mo(e);else{var d;switch(Dt(r)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":d=function(t,e,i,n,a){var r=a.samples||n;if(r>=i)return t.slice(e,e+i);var o,s,l,u,h,c=[],f=(i-2)/(r-2),d=0,v=e+i-1,g=e;for(c[d++]=t[g],o=0;o<r-2;o++){var p=0,m=0,y=void 0,b=Math.floor((o+1)*f)+1+e,x=Math.min(Math.floor((o+2)*f)+1,i)+e,_=x-b;for(y=b;y<x;y++)p+=t[y].x,m+=t[y].y;p/=_,m/=_;var k=Math.floor(o*f)+1+e,w=Math.min(Math.floor((o+1)*f)+1,i)+e,M=t[g],S=M.x,P=M.y;for(l=u=-1,y=k;y<w;y++)(u=.5*Math.abs((S-p)*(t[y].y-P)-(S-t[y].x)*(m-P)))>l&&(l=u,s=t[y],h=y);c[d++]=s,g=h}return c[d++]=t[v],c}(l,c,f,n,i);break;case"min-max":d=function(t,e,i,n){var a,r,o,s,l,u,h,c,f,d,v=0,g=0,p=[],m=e+i-1,y=t[e].x,b=t[m].x-y;for(a=e;a<e+i;++a){o=((r=t[a]).x-y)/b*n,s=r.y;var x=0|o;if(x===l)s<f?(f=s,u=a):s>d&&(d=s,h=a),v=(g*v+r.x)/++g;else{var _=a-1;if(!Dt(u)&&!Dt(h)){var k=Math.min(u,h),w=Math.max(u,h);k!==c&&k!==_&&p.push(Bn(Bn({},t[k]),{},{x:v})),w!==c&&w!==_&&p.push(Bn(Bn({},t[w]),{},{x:v}))}a>0&&_!==c&&p.push(t[_]),p.push(r),l=x,g=0,f=d=s,u=h=c=a}}return p}(l,c,f,n);break;default:throw new Error("Unsupported decimation algorithm '".concat(i.algorithm,"'"))}e._decimated=d}}}}))}else So(t)},destroy:function(t){So(t)}};function Do(t,e,i,n){if(!n){var a=e[t],r=i[t];return"angle"===t&&(a=ge(a),r=ge(r)),{property:t,start:a,end:r}}}function Oo(t,e,i){for(;e>t;e--){var n=i[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function Ao(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Co(t,e){var i=[],n=!1;return Ot(t)?(n=!0,i=t):i=function(t,e){var i=t||{},n=i.x,a=void 0===n?null:n,r=i.y,o=void 0===r?null:r,s=e.points,l=[];return e.segments.forEach((function(t){var e=t.start,i=t.end;i=Oo(e,i,s);var n=s[e],r=s[i];null!==o?(l.push({x:n.x,y:o}),l.push({x:r.x,y:o})):null!==a&&(l.push({x:a,y:n.y}),l.push({x:a,y:r.y}))})),l}(t,e),i.length?new fo({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function To(t,e,i){var n,a=t[e].fill,r=[e];if(!i)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!Ct(a))return a;if(!(n=t[a]))return!1;if(n.visible)return a;r.push(a),a=n.fill}return!1}function Ro(t,e,i){var n=function(t){var e=t.options,i=e.fill,n=Rt(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(At(n))return!isNaN(n.value)&&n;var a=parseFloat(n);return Ct(a)&&Math.floor(a)===a?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,a,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Lo(t,e,i){for(var n=[],a=0;a<i.length;a++){var r=Eo(i[a],e,"x"),o=r.first,s=r.last,l=r.point;if(!(!l||o&&s))if(o)n.unshift(l);else if(t.push(l),!s)break}t.push.apply(t,n)}function Eo(t,e,i){var n=t.interpolate(e,i);if(!n)return{};for(var a=n[i],r=t.segments,o=t.points,s=!1,l=!1,u=0;u<r.length;u++){var h=r[u],c=o[h.start][i],f=o[h.end][i];if(ye(a,c,f)){s=a===c,l=a===f;break}}return{first:s,last:l,point:n}}var Io=function(){function t(e){n(this,t),this.x=e.x,this.y=e.y,this.radius=e.radius}return s(t,[{key:"pathSegment",value:function(t,e,i){var n=this.x,a=this.y,r=this.radius;return e=e||{start:0,end:Gt},t.arc(n,a,r,e.end,e.start,!0),!i.bounds}},{key:"interpolate",value:function(t){var e=this.x,i=this.y,n=this.radius,a=t.angle;return{x:e+Math.cos(a)*n,y:i+Math.sin(a)*n,angle:a}}}]),t}();function zo(t){var e=t.chart,i=t.fill,n=t.line;if(Ct(i))return function(t,e){var i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){var e=t.scale,i=t.index,n=t.line,a=[],r=n.segments,o=n.points,s=function(t,e){for(var i=[],n=t.getMatchingVisibleMetas("line"),a=0;a<n.length;a++){var r=n[a];if(r.index===e)break;r.hidden||i.unshift(r.dataset)}return i}(e,i);s.push(Co({x:null,y:e.bottom},n));for(var l=0;l<r.length;l++)for(var u=r[l],h=u.start;h<=u.end;h++)Lo(a,o[h],s);return new fo({points:a,options:{}})}(t);if("shape"===i)return!0;var a=function(t){if((t.scale||{}).getPointPositionForValue)return function(t){var e=t.scale,i=t.fill,n=e.options,a=e.getLabels().length,r=n.reverse?e.max:e.min,o=function(t,e,i){return"start"===t?i:"end"===t?e.options.reverse?e.min:e.max:At(t)?t.value:e.getBaseValue()}(i,e,r),s=[];if(n.grid.circular){var l=e.getPointPositionForValue(0,r);return new Io({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(o)})}for(var u=0;u<a;++u)s.push(e.getPointPositionForValue(u,o));return s}(t);return function(t){var e=t.scale,i=void 0===e?{}:e,n=function(t,e){var i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:At(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(t.fill,i);if(Ct(n)){var a=i.isHorizontal();return{x:a?n:null,y:a?null:n}}return null}(t)}(t);return a instanceof Io?a:Co(a,n)}function Fo(t,e,i){var n=zo(e),a=e.line,r=e.scale,o=e.axis,s=a.options,l=s.fill,u=s.backgroundColor,h=l||{},c=h.above,f=void 0===c?u:c,d=h.below,v=void 0===d?u:d;n&&a.points.length&&(yi(t,i),function(t,e){var i=e.line,n=e.target,a=e.above,r=e.below,o=e.area,s=e.scale,l=i._loop?"angle":e.axis;t.save(),"x"===l&&r!==a&&(Vo(t,n,o.top),Bo(t,{line:i,target:n,color:a,scale:s,property:l}),t.restore(),t.save(),Vo(t,n,o.bottom));Bo(t,{line:i,target:n,color:r,scale:s,property:l}),t.restore()}(t,{line:a,target:n,above:f,below:v,area:i,scale:r,axis:o}),bi(t))}function Vo(t,e,i){var n=e.segments,a=e.points,r=!0,o=!1;t.beginPath();var s,l=jn(n);try{for(l.s();!(s=l.n()).done;){var u=s.value,h=u.start,c=u.end,f=a[h],d=a[Oo(h,c,a)];r?(t.moveTo(f.x,f.y),r=!1):(t.lineTo(f.x,i),t.lineTo(f.x,f.y)),(o=!!e.pathSegment(t,u,{move:o}))?t.closePath():t.lineTo(d.x,i)}}catch(t){l.e(t)}finally{l.f()}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Bo(t,e){var i,n=e.line,a=e.target,r=e.property,o=e.color,s=e.scale,l=function(t,e,i){var n,a=t.segments,r=t.points,o=e.points,s=[],l=jn(a);try{for(l.s();!(n=l.n()).done;){var u=n.value,h=u.start,c=u.end;c=Oo(h,c,r);var f=Do(i,r[h],r[c],u.loop);if(e.segments){var d,v=jn(En(e,f));try{for(v.s();!(d=v.n()).done;){var g,p=d.value,m=Do(i,o[p.start],o[p.end],p.loop),y=jn(Ln(u,r,m));try{for(y.s();!(g=y.n()).done;){var b=g.value;s.push({source:b,target:p,start:et({},i,Ao(f,m,"start",Math.max)),end:et({},i,Ao(f,m,"end",Math.min))})}}catch(t){y.e(t)}finally{y.f()}}}catch(t){v.e(t)}finally{v.f()}}else s.push({source:u,target:f,start:r[h],end:r[c]})}}catch(t){l.e(t)}finally{l.f()}return s}(n,a,r),u=jn(l);try{for(u.s();!(i=u.n()).done;){var h=i.value,c=h.source,f=h.target,d=h.start,v=h.end,g=c.style,p=(g=void 0===g?{}:g).backgroundColor,m=void 0===p?o:p,y=!0!==a;t.save(),t.fillStyle=m,No(t,s,y&&Do(r,d,v)),t.beginPath();var b=!!n.pathSegment(t,c),x=void 0;if(y){b?t.closePath():jo(t,a,v,r);var _=!!a.pathSegment(t,f,{move:b,reverse:!0});(x=b&&_)||jo(t,a,d,r)}t.closePath(),t.fill(x?"evenodd":"nonzero"),t.restore()}}catch(t){u.e(t)}finally{u.f()}}function No(t,e,i){var n=e.chart.chartArea,a=n.top,r=n.bottom,o=i||{},s=o.property,l=o.start,u=o.end;"x"===s&&(t.beginPath(),t.rect(l,a,u-l,r-a),t.clip())}function jo(t,e,i,n){var a=e.interpolate(i,n);a&&t.lineTo(a.x,a.y)}var Wo={id:"filler",afterDatasetsUpdate:function(t,e,i){var n,a,r,o,s=(t.data.datasets||[]).length,l=[];for(a=0;a<s;++a)o=null,(r=(n=t.getDatasetMeta(a)).dataset)&&r.options&&r instanceof fo&&(o={visible:t.isDatasetVisible(a),index:a,fill:Ro(r,a,s),chart:t,axis:n.controller.options.indexAxis,scale:n.vScale,line:r}),n.$filler=o,l.push(o);for(a=0;a<s;++a)(o=l[a])&&!1!==o.fill&&(o.fill=To(l,a,i.propagate))},beforeDraw:function(t,e,i){for(var n="beforeDraw"===i.drawTime,a=t.getSortedVisibleDatasetMetas(),r=t.chartArea,o=a.length-1;o>=0;--o){var s=a[o].$filler;s&&(s.line.updateControlPoints(r,s.axis),n&&Fo(t.ctx,s,r))}},beforeDatasetsDraw:function(t,e,i){if("beforeDatasetsDraw"===i.drawTime)for(var n=t.getSortedVisibleDatasetMetas(),a=n.length-1;a>=0;--a){var r=n[a].$filler;r&&Fo(t.ctx,r,t.chartArea)}},beforeDatasetDraw:function(t,e,i){var n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&Fo(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Ho=function(t,e){var i=t.boxHeight,n=void 0===i?e:i,a=t.boxWidth,r=void 0===a?e:a;return t.usePointStyle&&(n=Math.min(n,e),r=Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},$o=function(e){t(a,cr);var i=Nn(a);function a(t){var e;return n(this,a),(e=i.call(this))._added=!1,e.legendHitBoxes=[],e._hoveredItem=null,e.doughnutMode=!1,e.chart=t.chart,e.options=t.options,e.ctx=t.ctx,e.legendItems=void 0,e.columnSizes=void 0,e.lineWidths=void 0,e.maxHeight=void 0,e.maxWidth=void 0,e.top=void 0,e.bottom=void 0,e.left=void 0,e.right=void 0,e.height=void 0,e.width=void 0,e._margins=void 0,e.position=void 0,e.weight=void 0,e.fullSize=void 0,e}return s(a,[{key:"update",value:function(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}},{key:"setDimensions",value:function(){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)}},{key:"buildLabels",value:function(){var t=this,e=this.options.labels||{},i=Et(e.generateLabels,[this.chart],this)||[];e.filter&&(i=i.filter((function(i){return e.filter(i,t.chart.data)}))),e.sort&&(i=i.sort((function(i,n){return e.sort(i,n,t.chart.data)}))),this.options.reverse&&i.reverse(),this.legendItems=i}},{key:"fit",value:function(){var t=this.options,e=this.ctx;if(t.display){var i,n,a=t.labels,r=Li(a.font),o=r.size,s=this._computeTitleHeight(),l=Ho(a,o),u=l.boxWidth,h=l.itemHeight;e.font=r.string,this.isHorizontal()?(i=this.maxWidth,n=this._fitRows(s,o,u,h)+10):(n=this.maxHeight,i=this._fitCols(s,o,u,h)+10),this.width=Math.min(i,t.maxWidth||this.maxWidth),this.height=Math.min(n,t.maxHeight||this.maxHeight)}else this.width=this.height=0}},{key:"_fitRows",value:function(t,e,i,n){var a=this.ctx,r=this.maxWidth,o=this.options.labels.padding,s=this.legendHitBoxes=[],l=this.lineWidths=[0],u=n+o,h=t;a.textAlign="left",a.textBaseline="middle";var c=-1,f=-u;return this.legendItems.forEach((function(t,d){var v=i+e/2+a.measureText(t.text).width;(0===d||l[l.length-1]+v+2*o>r)&&(h+=u,l[l.length-(d>0?0:1)]=0,f+=u,c++),s[d]={left:0,top:f,row:c,width:v,height:n},l[l.length-1]+=v+o})),h}},{key:"_fitCols",value:function(t,e,i,n){var a=this.ctx,r=this.maxHeight,o=this.options.labels.padding,s=this.legendHitBoxes=[],l=this.columnSizes=[],u=r-t,h=o,c=0,f=0,d=0,v=0;return this.legendItems.forEach((function(t,r){var g=i+e/2+a.measureText(t.text).width;r>0&&f+n+2*o>u&&(h+=c+o,l.push({width:c,height:f}),d+=c+o,v++,c=f=0),s[r]={left:d,top:f,col:v,width:g,height:n},c=Math.max(c,g),f+=n+o})),h+=c,l.push({width:c,height:f}),h}},{key:"adjustHitBoxes",value:function(){if(this.options.display){var t=this._computeTitleHeight(),e=this.legendHitBoxes,i=this.options,n=i.align,a=i.labels.padding,r=On(i.rtl,this.left,this.width);if(this.isHorizontal()){var o,s=0,l=wt(n,this.left+a,this.right-this.lineWidths[s]),u=jn(e);try{for(u.s();!(o=u.n()).done;){var h=o.value;s!==h.row&&(s=h.row,l=wt(n,this.left+a,this.right-this.lineWidths[s])),h.top+=this.top+t+a,h.left=r.leftForLtr(r.x(l),h.width),l+=h.width+a}}catch(t){u.e(t)}finally{u.f()}}else{var c,f=0,d=wt(n,this.top+t+a,this.bottom-this.columnSizes[f].height),v=jn(e);try{for(v.s();!(c=v.n()).done;){var g=c.value;g.col!==f&&(f=g.col,d=wt(n,this.top+t+a,this.bottom-this.columnSizes[f].height)),g.top=d,g.left+=this.left+a,g.left=r.leftForLtr(r.x(g.left),g.width),d+=g.height+a}}catch(t){v.e(t)}finally{v.f()}}}}},{key:"isHorizontal",value:function(){return"top"===this.options.position||"bottom"===this.options.position}},{key:"draw",value:function(){if(this.options.display){var t=this.ctx;yi(t,this),this._draw(),bi(t)}}},{key:"_draw",value:function(){var t,e=this,i=this.options,n=this.columnSizes,a=this.lineWidths,r=this.ctx,o=i.align,s=i.labels,l=ci.color,u=On(i.rtl,this.left,this.width),h=Li(s.font),c=s.color,f=s.padding,d=h.size,v=d/2;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=h.string;var g=Ho(s,d),p=g.boxWidth,m=g.boxHeight,y=g.itemHeight,b=this.isHorizontal(),x=this._computeTitleHeight();t=b?{x:wt(o,this.left+f,this.right-a[0]),y:this.top+f+x,line:0}:{x:this.left+f,y:wt(o,this.top+x+f,this.bottom-n[0].height),line:0},An(this.ctx,i.textDirection);var _=y+f;this.legendItems.forEach((function(g,k){r.strokeStyle=g.fontColor||c,r.fillStyle=g.fontColor||c;var w=r.measureText(g.text).width,M=u.textAlign(g.textAlign||(g.textAlign=s.textAlign)),S=p+v+w,P=t.x,D=t.y;u.setWidth(e.width),b?k>0&&P+S+f>e.right&&(D=t.y+=_,t.line++,P=t.x=wt(o,e.left+f,e.right-a[t.line])):k>0&&D+_>e.bottom&&(P=t.x=P+n[t.line].width+f,t.line++,D=t.y=wt(o,e.top+x+f,e.bottom-n[t.line].height)),function(t,e,i){if(!(isNaN(p)||p<=0||isNaN(m)||m<0)){r.save();var n=Rt(i.lineWidth,1);if(r.fillStyle=Rt(i.fillStyle,l),r.lineCap=Rt(i.lineCap,"butt"),r.lineDashOffset=Rt(i.lineDashOffset,0),r.lineJoin=Rt(i.lineJoin,"miter"),r.lineWidth=n,r.strokeStyle=Rt(i.strokeStyle,l),r.setLineDash(Rt(i.lineDash,[])),s.usePointStyle){var a={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},o=u.xPlus(t,p/2);pi(r,a,o,e+v)}else{var h=e+Math.max((d-m)/2,0),c=u.leftForLtr(t,p),f=Ti(i.borderRadius);r.beginPath(),Object.values(f).some((function(t){return 0!==t}))?Si(r,{x:c,y:h,w:p,h:m,radius:f}):r.rect(c,h,p,m),r.fill(),0!==n&&r.stroke()}r.restore()}}(u.x(P),D,g),P=function(t,e,i,n){return t===(n?"left":"right")?i:"center"===t?(e+i)/2:e}(M,P+p+v,b?P+S:e.right,i.rtl),function(t,e,i){ki(r,i.text,t,e+y/2,h,{strikethrough:i.hidden,textAlign:u.textAlign(i.textAlign)})}(u.x(P),D,g),b?t.x+=S+f:t.y+=_})),Cn(this.ctx,i.textDirection)}},{key:"drawTitle",value:function(){var t=this.options,e=t.title,i=Li(e.font),n=Ri(e.padding);if(e.display){var a,r=On(t.rtl,this.left,this.width),o=this.ctx,s=e.position,l=i.size/2,u=n.top+l,h=this.left,c=this.width;if(this.isHorizontal())c=Math.max.apply(Math,F(this.lineWidths)),a=this.top+u,h=wt(t.align,h,this.right-c);else{var f=this.columnSizes.reduce((function(t,e){return Math.max(t,e.height)}),0);a=u+wt(t.align,this.top,this.bottom-f-t.labels.padding-this._computeTitleHeight())}var d=wt(s,h,h+c);o.textAlign=r.textAlign(kt(s)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,ki(o,e.text,d,a,i)}}},{key:"_computeTitleHeight",value:function(){var t=this.options.title,e=Li(t.font),i=Ri(t.padding);return t.display?e.lineHeight+i.height:0}},{key:"_getLegendItemAt",value:function(t,e){var i,n,a;if(ye(t,this.left,this.right)&&ye(e,this.top,this.bottom))for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(ye(t,(n=a[i]).left,n.left+n.width)&&ye(e,n.top,n.top+n.height))return this.legendItems[i];return null}},{key:"handleEvent",value:function(t){var e=this.options;if(function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e)){var i,n,a=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){var r=this._hoveredItem,o=(n=a,null!==(i=r)&&null!==n&&i.datasetIndex===n.datasetIndex&&i.index===n.index);r&&!o&&Et(e.onLeave,[t,r,this],this),this._hoveredItem=a,a&&!o&&Et(e.onHover,[t,a,this],this)}else a&&Et(e.onClick,[t,a,this],this)}}}]),a}();var Yo={id:"legend",_element:$o,start:function(t,e,i){var n=t.legend=new $o({ctx:t.ctx,options:i,chart:t});Xa(t,n,i),Ya(t,n)},stop:function(t){Ua(t,t.legend),delete t.legend},beforeUpdate:function(t,e,i){var n=t.legend;Xa(t,n,i),n.options=i},afterUpdate:function(t){var e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent:function(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick:function(t,e,i){var n=e.datasetIndex,a=i.chart;a.isDatasetVisible(n)?(a.hide(n),e.hidden=!0):(a.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:function(t){return t.chart.options.color},boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,i=t.legend.options.labels,n=i.usePointStyle,a=i.pointStyle,r=i.textAlign,o=i.color;return t._getSortedDatasetMetas().map((function(t){var i=t.controller.getStyle(n?0:void 0),s=Ri(i.borderWidth);return{text:e[t.index].label,fillStyle:i.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:i.borderColor,pointStyle:a||i.pointStyle,rotation:i.rotation,textAlign:r||i.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:function(t){return t.chart.options.color},display:!1,position:"center",text:""}},descriptors:{_scriptable:function(t){return!t.startsWith("on")},labels:{_scriptable:function(t){return!["generateLabels","filter","sort"].includes(t)}}}},Uo=function(e){t(a,cr);var i=Nn(a);function a(t){var e;return n(this,a),(e=i.call(this)).chart=t.chart,e.options=t.options,e.ctx=t.ctx,e._padding=void 0,e.top=void 0,e.bottom=void 0,e.left=void 0,e.right=void 0,e.width=void 0,e.height=void 0,e.position=void 0,e.weight=void 0,e.fullSize=void 0,e}return s(a,[{key:"update",value:function(t,e){var i=this.options;if(this.left=0,this.top=0,i.display){this.width=this.right=t,this.height=this.bottom=e;var n=Ot(i.text)?i.text.length:1;this._padding=Ri(i.padding);var a=n*Li(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}else this.width=this.height=this.right=this.bottom=0}},{key:"isHorizontal",value:function(){var t=this.options.position;return"top"===t||"bottom"===t}},{key:"_drawArgs",value:function(t){var e,i,n,a=this.top,r=this.left,o=this.bottom,s=this.right,l=this.options,u=l.align,h=0;return this.isHorizontal()?(i=wt(u,r,s),n=a+t,e=s-r):("left"===l.position?(i=r+t,n=wt(u,o,a),h=-.5*Kt):(i=s-t,n=wt(u,a,o),h=.5*Kt),e=o-a),{titleX:i,titleY:n,maxWidth:e,rotation:h}}},{key:"draw",value:function(){var t=this.ctx,e=this.options;if(e.display){var i=Li(e.font),n=i.lineHeight/2+this._padding.top,a=this._drawArgs(n),r=a.titleX,o=a.titleY,s=a.maxWidth,l=a.rotation;ki(t,e.text,0,0,i,{color:e.color,maxWidth:s,rotation:l,textAlign:kt(e.align),textBaseline:"middle",translation:[r,o]})}}}]),a}();var Xo={id:"title",_element:Uo,start:function(t,e,i){!function(t,e){var i=new Uo({ctx:t.ctx,options:e,chart:t});Xa(t,i,e),Ya(t,i),t.titleBlock=i}(t,i)},stop:function(t){var e=t.titleBlock;Ua(t,e),delete t.titleBlock},beforeUpdate:function(t,e,i){var n=t.titleBlock;Xa(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},qo=new WeakMap,Ko={id:"subtitle",start:function(t,e,i){var n=new Uo({ctx:t.ctx,options:i,chart:t});Xa(t,n,i),Ya(t,n),qo.set(t,n)},stop:function(t){Ua(t,qo.get(t)),qo.delete(t)},beforeUpdate:function(t,e,i){var n=qo.get(t);Xa(t,n,i),n.options=i},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}},Go={average:function(t){if(!t.length)return!1;var e,i,n=0,a=0,r=0;for(e=0,i=t.length;e<i;++e){var o=t[e].element;if(o&&o.hasValue()){var s=o.tooltipPosition();n+=s.x,a+=s.y,++r}}return{x:n/r,y:a/r}},nearest:function(t,e){if(!t.length)return!1;var i,n,a,r=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){var l=t[i].element;if(l&&l.hasValue()){var u=de(e,l.getCenterPoint());u<s&&(s=u,a=l)}}if(a){var h=a.tooltipPosition();r=h.x,o=h.y}return{x:r,y:o}}};function Zo(t,e){return e&&(Ot(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Jo(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Qo(t,e){var i=e.element,n=e.datasetIndex,a=e.index,r=t.getDatasetMeta(n).controller,o=r.getLabelAndValue(a),s=o.label,l=o.value;return{chart:t,label:s,parsed:r.getParsed(a),raw:t.data.datasets[n].data[a],formattedValue:l,dataset:r.getDataset(),dataIndex:a,datasetIndex:n,element:i}}function ts(t,e){var i=t.chart.ctx,n=t.body,a=t.footer,r=t.title,o=e.boxWidth,s=e.boxHeight,l=Li(e.bodyFont),u=Li(e.titleFont),h=Li(e.footerFont),c=r.length,f=a.length,d=n.length,v=Ri(e.padding),g=v.height,p=0,m=n.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0);(m+=t.beforeBody.length+t.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),m)&&(g+=d*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(m-d)*l.lineHeight+(m-1)*e.bodySpacing);f&&(g+=e.footerMarginTop+f*h.lineHeight+(f-1)*e.footerSpacing);var y=0,b=function(t){p=Math.max(p,i.measureText(t).width+y)};return i.save(),i.font=u.string,It(t.title,b),i.font=l.string,It(t.beforeBody.concat(t.afterBody),b),y=e.displayColors?o+2+e.boxPadding:0,It(n,(function(t){It(t.before,b),It(t.lines,b),It(t.after,b)})),y=0,i.font=h.string,It(t.footer,b),i.restore(),{width:p+=v.width,height:g}}function es(t,e,i,n){var a=i.x,r=i.width,o=t.width,s=t.chartArea,l=s.left,u=s.right,h="center";return"center"===n?h=a<=(l+u)/2?"left":"right":a<=r/2?h="left":a>=o-r/2&&(h="right"),function(t,e,i,n){var a=n.x,r=n.width,o=i.caretSize+i.caretPadding;return"left"===t&&a+r+o>e.width||"right"===t&&a-r-o<0||void 0}(h,t,e,i)&&(h="center"),h}function is(t,e,i){var n=i.yAlign||e.yAlign||function(t,e){var i=e.y,n=e.height;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||es(t,e,i,n),yAlign:n}}function ns(t,e,i,n){var a=t.caretSize,r=t.caretPadding,o=t.cornerRadius,s=i.xAlign,l=i.yAlign,u=a+r,h=Ti(o),c=h.topLeft,f=h.topRight,d=h.bottomLeft,v=h.bottomRight,g=function(t,e){var i=t.x,n=t.width;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,s),p=function(t,e,i){var n=t.y,a=t.height;return"top"===e?n+=i:n-="bottom"===e?a+i:a/2,n}(e,l,u);return"center"===l?"left"===s?g+=u:"right"===s&&(g-=u):"left"===s?g-=Math.max(c,d)+a:"right"===s&&(g+=Math.max(f,v)+a),{x:me(g,0,n.width-e.width),y:me(p,0,n.height-e.height)}}function as(t,e,i){var n=Ri(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function rs(t){return Zo([],Jo(t))}function os(t,e){var i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}var ss=function(e){t(a,cr);var i=Nn(a);function a(t){var e;return n(this,a),(e=i.call(this)).opacity=0,e._active=[],e._eventPosition=void 0,e._size=void 0,e._cachedAnimations=void 0,e._tooltipItems=[],e.$animations=void 0,e.$context=void 0,e.chart=t.chart||t._chart,e._chart=e.chart,e.options=t.options,e.dataPoints=void 0,e.title=void 0,e.beforeBody=void 0,e.body=void 0,e.afterBody=void 0,e.footer=void 0,e.xAlign=void 0,e.yAlign=void 0,e.x=void 0,e.y=void 0,e.height=void 0,e.width=void 0,e.caretX=void 0,e.caretY=void 0,e.labelColors=void 0,e.labelPointStyles=void 0,e.labelTextColors=void 0,e}return s(a,[{key:"initialize",value:function(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}},{key:"_resolveAnimations",value:function(){var t=this._cachedAnimations;if(t)return t;var e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,a=new Xn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}},{key:"getContext",value:function(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,Ii(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}},{key:"getTitle",value:function(t,e){var i=e.callbacks,n=i.beforeTitle.apply(this,[t]),a=i.title.apply(this,[t]),r=i.afterTitle.apply(this,[t]),o=[];return o=Zo(o,Jo(n)),o=Zo(o,Jo(a)),o=Zo(o,Jo(r))}},{key:"getBeforeBody",value:function(t,e){return rs(e.callbacks.beforeBody.apply(this,[t]))}},{key:"getBody",value:function(t,e){var i=this,n=e.callbacks,a=[];return It(t,(function(t){var e={before:[],lines:[],after:[]},r=os(n,t);Zo(e.before,Jo(r.beforeLabel.call(i,t))),Zo(e.lines,r.label.call(i,t)),Zo(e.after,Jo(r.afterLabel.call(i,t))),a.push(e)})),a}},{key:"getAfterBody",value:function(t,e){return rs(e.callbacks.afterBody.apply(this,[t]))}},{key:"getFooter",value:function(t,e){var i=e.callbacks,n=i.beforeFooter.apply(this,[t]),a=i.footer.apply(this,[t]),r=i.afterFooter.apply(this,[t]),o=[];return o=Zo(o,Jo(n)),o=Zo(o,Jo(a)),o=Zo(o,Jo(r))}},{key:"_createItems",value:function(t){var e,i,n=this,a=this._active,r=this.chart.data,o=[],s=[],l=[],u=[];for(e=0,i=a.length;e<i;++e)u.push(Qo(this.chart,a[e]));return t.filter&&(u=u.filter((function(e,i,n){return t.filter(e,i,n,r)}))),t.itemSort&&(u=u.sort((function(e,i){return t.itemSort(e,i,r)}))),It(u,(function(e){var i=os(t.callbacks,e);o.push(i.labelColor.call(n,e)),s.push(i.labelPointStyle.call(n,e)),l.push(i.labelTextColor.call(n,e))})),this.labelColors=o,this.labelPointStyles=s,this.labelTextColors=l,this.dataPoints=u,u}},{key:"update",value:function(t,e){var i,n=this.options.setContext(this.getContext()),a=this._active,r=[];if(a.length){var o=Go[n.position].call(this,a,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);var s=this._size=ts(this,n),l=Object.assign({},o,s),u=is(this.chart,n,l),h=ns(n,l,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:h.x,y:h.y,width:s.width,height:s.height,caretX:o.x,caretY:o.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=r,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}},{key:"drawCaret",value:function(t,e,i,n){var a=this.getCaretPosition(t,i,n);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}},{key:"getCaretPosition",value:function(t,e,i){var n,a,r,o,s,l,u=this.xAlign,h=this.yAlign,c=i.caretSize,f=Ti(i.cornerRadius),d=f.topLeft,v=f.topRight,g=f.bottomLeft,p=f.bottomRight,m=t.x,y=t.y,b=e.width,x=e.height;return"center"===h?(s=y+x/2,"left"===u?(a=(n=m)-c,o=s+c,l=s-c):(a=(n=m+b)+c,o=s-c,l=s+c),r=n):(a="left"===u?m+Math.max(d,g)+c:"right"===u?m+b-Math.max(v,p)-c:this.caretX,"top"===h?(s=(o=y)-c,n=a-c,r=a+c):(s=(o=y+x)+c,n=a+c,r=a-c),l=o),{x1:n,x2:a,x3:r,y1:o,y2:s,y3:l}}},{key:"drawTitle",value:function(t,e,i){var n,a,r,o=this.title,s=o.length;if(s){var l=On(i.rtl,this.x,this.width);for(t.x=as(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",n=Li(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=n.string,r=0;r<s;++r)e.fillText(o[r],l.x(t.x),t.y+n.lineHeight/2),t.y+=n.lineHeight+a,r+1===s&&(t.y+=i.titleMarginBottom-a)}}},{key:"_drawColorBox",value:function(t,e,i,n,a){var r=this.labelColors[i],o=this.labelPointStyles[i],s=a.boxHeight,l=a.boxWidth,u=a.boxPadding,h=Li(a.bodyFont),c=as(this,"left",a),f=n.x(c),d=s<h.lineHeight?(h.lineHeight-s)/2:0,v=e.y+d;if(a.usePointStyle){var g={radius:Math.min(l,s)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},p=n.leftForLtr(f,l)+l/2,m=v+s/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,pi(t,g,p,m),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,pi(t,g,p,m)}else{t.lineWidth=r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;var y=n.leftForLtr(f,l-u),b=n.leftForLtr(n.xPlus(f,1),l-u-2),x=Ti(r.borderRadius);Object.values(x).some((function(t){return 0!==t}))?(t.beginPath(),t.fillStyle=a.multiKeyBackground,Si(t,{x:y,y:v,w:l,h:s,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Si(t,{x:b,y:v+1,w:l-2,h:s-2,radius:x}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(y,v,l,s),t.strokeRect(y,v,l,s),t.fillStyle=r.backgroundColor,t.fillRect(b,v+1,l-2,s-2))}t.fillStyle=this.labelTextColors[i]}},{key:"drawBody",value:function(t,e,i){var n,a,r,o,s,l,u,h=this.body,c=i.bodySpacing,f=i.bodyAlign,d=i.displayColors,v=i.boxHeight,g=i.boxWidth,p=i.boxPadding,m=Li(i.bodyFont),y=m.lineHeight,b=0,x=On(i.rtl,this.x,this.width),_=function(i){e.fillText(i,x.x(t.x+b),t.y+y/2),t.y+=y+c},k=x.textAlign(f);for(e.textAlign=f,e.textBaseline="middle",e.font=m.string,t.x=as(this,k,i),e.fillStyle=i.bodyColor,It(this.beforeBody,_),b=d&&"right"!==k?"center"===f?g/2+p:g+2+p:0,o=0,l=h.length;o<l;++o){for(n=h[o],a=this.labelTextColors[o],e.fillStyle=a,It(n.before,_),r=n.lines,d&&r.length&&(this._drawColorBox(e,t,o,x,i),y=Math.max(m.lineHeight,v)),s=0,u=r.length;s<u;++s)_(r[s]),y=m.lineHeight;It(n.after,_)}b=0,y=m.lineHeight,It(this.afterBody,_),t.y-=c}},{key:"drawFooter",value:function(t,e,i){var n,a,r=this.footer,o=r.length;if(o){var s=On(i.rtl,this.x,this.width);for(t.x=as(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=s.textAlign(i.footerAlign),e.textBaseline="middle",n=Li(i.footerFont),e.fillStyle=i.footerColor,e.font=n.string,a=0;a<o;++a)e.fillText(r[a],s.x(t.x),t.y+n.lineHeight/2),t.y+=n.lineHeight+i.footerSpacing}}},{key:"drawBackground",value:function(t,e,i,n){var a=this.xAlign,r=this.yAlign,o=t.x,s=t.y,l=i.width,u=i.height,h=Ti(n.cornerRadius),c=h.topLeft,f=h.topRight,d=h.bottomLeft,v=h.bottomRight;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(o+c,s),"top"===r&&this.drawCaret(t,e,i,n),e.lineTo(o+l-f,s),e.quadraticCurveTo(o+l,s,o+l,s+f),"center"===r&&"right"===a&&this.drawCaret(t,e,i,n),e.lineTo(o+l,s+u-v),e.quadraticCurveTo(o+l,s+u,o+l-v,s+u),"bottom"===r&&this.drawCaret(t,e,i,n),e.lineTo(o+d,s+u),e.quadraticCurveTo(o,s+u,o,s+u-d),"center"===r&&"left"===a&&this.drawCaret(t,e,i,n),e.lineTo(o,s+c),e.quadraticCurveTo(o,s,o+c,s),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}},{key:"_updateAnimationTarget",value:function(t){var e=this.chart,i=this.$animations,n=i&&i.x,a=i&&i.y;if(n||a){var r=Go[t.position].call(this,this._active,this._eventPosition);if(!r)return;var o=this._size=ts(this,t),s=Object.assign({},r,this._size),l=is(e,t,s),u=ns(t,s,l,e);n._to===u.x&&a._to===u.y||(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=o.width,this.height=o.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}},{key:"_willRender",value:function(){return!!this.opacity}},{key:"draw",value:function(t){var e=this.options.setContext(this.getContext()),i=this.opacity;if(i){this._updateAnimationTarget(e);var n={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;var r=Ri(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,n,e),An(t,e.textDirection),a.y+=r.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),Cn(t,e.textDirection),t.restore())}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(t,e){var i=this,n=this._active,a=t.map((function(t){var e=t.datasetIndex,n=t.index,a=i.chart.getDatasetMeta(e);if(!a)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:a.data[n],index:n}})),r=!zt(n,a),o=this._positionChanged(a,e);(r||o)&&(this._active=a,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}},{key:"handleEvent",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var n=this.options,a=this._active||[],r=this._getActiveElements(t,a,e,i),o=this._positionChanged(r,t),s=e||!zt(r,a)||o;return s&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}},{key:"_getActiveElements",value:function(t,e,i,n){var a=this.options;if("mouseout"===t.type)return[];if(!n)return e;var r=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&r.reverse(),r}},{key:"_positionChanged",value:function(t,e){var i=this.caretX,n=this.caretY,a=this.options,r=Go[a.position].call(this,t,e);return!1!==r&&(i!==r.x||n!==r.y)}}]),a}();ss.positioners=Go;var ls={id:"tooltip",_element:ss,positioners:Go,afterInit:function(t,e,i){i&&(t.tooltip=new ss({chart:t,options:i}))},beforeUpdate:function(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset:function(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw:function(t){var e=t.tooltip;if(e&&e._willRender()){var i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",i))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent:function(t,e){if(t.tooltip){var i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:function(t,e){return e.bodyFont.size},boxWidth:function(t,e){return e.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:{beforeTitle:Mt,title:function(t){if(t.length>0){var e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:Mt,beforeBody:Mt,beforeLabel:Mt,label:function(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;var e=t.dataset.label||"";e&&(e+=": ");var i=t.formattedValue;return Dt(i)||(e+=i),e},labelColor:function(t){var e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor:function(){return this.options.bodyColor},labelPointStyle:function(t){var e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Mt,afterBody:Mt,beforeFooter:Mt,footer:Mt,afterFooter:Mt}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:function(t){return"filter"!==t&&"itemSort"!==t&&"external"!==t},_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},us=Object.freeze({__proto__:null,Decimation:Po,Filler:Wo,Legend:Yo,SubTitle:Ko,Title:Xo,Tooltip:ls});function hs(t,e,i,n){var a=t.indexOf(e);return-1===a?function(t,e,i,n){return"string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i}(t,e,i,n):a!==t.lastIndexOf(e)?i:a}var cs=function(i){t(r,kr);var a=Nn(r);function r(t){var e;return n(this,r),(e=a.call(this,t))._startValue=void 0,e._valueRange=0,e._addedLabels=[],e}return s(r,[{key:"init",value:function(t){var i=this._addedLabels;if(i.length){var n,a=this.getLabels(),o=jn(i);try{for(o.s();!(n=o.n()).done;){var s=n.value,l=s.index,u=s.label;a[l]===u&&a.splice(l,1)}}catch(t){o.e(t)}finally{o.f()}this._addedLabels=[]}B(e(r.prototype),"init",this).call(this,t)}},{key:"parse",value:function(t,e){if(Dt(t))return null;var i=this.getLabels();return function(t,e){return null===t?null:me(Math.round(t),0,e)}(e=isFinite(e)&&i[e]===t?e:hs(i,t,Rt(e,t),this._addedLabels),i.length-1)}},{key:"determineDataLimits",value:function(){var t=this.getUserBounds(),e=t.minDefined,i=t.maxDefined,n=this.getMinMax(!0),a=n.min,r=n.max;"ticks"===this.options.bounds&&(e||(a=0),i||(r=this.getLabels().length-1)),this.min=a,this.max=r}},{key:"buildTicks",value:function(){var t=this.min,e=this.max,i=this.options.offset,n=[],a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(var r=t;r<=e;r++)n.push({value:r});return n}},{key:"getLabelForValue",value:function(t){var e=this.getLabels();return t>=0&&t<e.length?e[t]:t}},{key:"configure",value:function(){B(e(r.prototype),"configure",this).call(this),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}},{key:"getPixelForValue",value:function(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}},{key:"getPixelForTick",value:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}},{key:"getValueForPixel",value:function(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}},{key:"getBasePixel",value:function(){return this.bottom}}]),r}();function fs(t,e){var i,n,a,r,o,s,l,u=[],h=t.bounds,c=t.step,f=t.min,d=t.max,v=t.precision,g=t.count,p=t.maxTicks,m=t.maxDigits,y=t.includeBounds,b=c||1,x=p-1,_=e.min,k=e.max,w=!Dt(f),M=!Dt(d),S=!Dt(g),P=(k-_)/(m+1),D=re((k-_)/x/b)*b;if(D<1e-14&&!w&&!M)return[{value:_},{value:k}];(r=Math.ceil(k/D)-Math.floor(_/D))>x&&(D=re(r*D/x/b)*b),Dt(v)||(i=Math.pow(10,v),D=Math.ceil(D*i)/i),"ticks"===h?(n=Math.floor(_/D)*D,a=Math.ceil(k/D)*D):(n=_,a=k),w&&M&&c&&(o=(d-f)/c,s=D/1e3,(l=Math.round(o))-s<=o&&l+s>=o)?(D=(d-f)/(r=Math.round(Math.min((d-f)/D,p))),n=f,a=d):S?D=((a=M?d:a)-(n=w?f:n))/(r=g-1):r=se(r=(a-n)/D,Math.round(r),D/1e3)?Math.round(r):Math.ceil(r);var O=Math.max(ce(D),ce(n));i=Math.pow(10,Dt(v)?O:v),n=Math.round(n*i)/i,a=Math.round(a*i)/i;var A=0;for(w&&(y&&n!==f?(u.push({value:f}),n<f&&A++,se(Math.round((n+A*D)*i)/i,f,ds(f,P,t))&&A++):n<f&&A++);A<r;++A)u.push({value:Math.round((n+A*D)*i)/i});return M&&y&&a!==d?u.length&&se(u[u.length-1].value,d,ds(d,P,t))?u[u.length-1].value=d:u.push({value:d}):M&&a!==d||u.push({value:a}),u}function ds(t,e,i){var n=i.horizontal,a=ue(i.minRotation),r=(n?Math.sin(a):Math.cos(a))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}cs.id="category",cs.defaults={ticks:{callback:cs.prototype.getLabelForValue}};var vs=function(i){t(r,kr);var a=Nn(r);function r(t){var e;return n(this,r),(e=a.call(this,t)).start=void 0,e.end=void 0,e._startValue=void 0,e._endValue=void 0,e._valueRange=0,e}return s(r,[{key:"parse",value:function(t,e){return Dt(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}},{key:"handleTickRangeOptions",value:function(){var t=this.options.beginAtZero,e=this.getUserBounds(),i=e.minDefined,n=e.maxDefined,a=this.min,r=this.max,o=function(t){return a=i?a:t},s=function(t){return r=n?r:t};if(t){var l=ae(a),u=ae(r);l<0&&u<0?s(0):l>0&&u>0&&o(0)}if(a===r){var h=1;(r>=Number.MAX_SAFE_INTEGER||a<=Number.MIN_SAFE_INTEGER)&&(h=Math.abs(.05*r)),s(r+h),t||o(a-h)}this.min=a,this.max=r}},{key:"getTickLimit",value:function(){var t,e=this.options.ticks,i=e.maxTicksLimit,n=e.stepSize;return n?(t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1)>1e3&&(console.warn("scales.".concat(this.id,".ticks.stepSize: ").concat(n," would result generating up to ").concat(t," ticks. Limiting to 1000.")),t=1e3):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}},{key:"computeTickLimit",value:function(){return Number.POSITIVE_INFINITY}},{key:"buildTicks",value:function(){var t=this.options,e=t.ticks,i=this.getTickLimit(),n=fs({maxTicks:i=Math.max(2,i),bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&le(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}},{key:"configure",value:function(){var t=this.ticks,i=this.min,n=this.max;if(B(e(r.prototype),"configure",this).call(this),this.options.offset&&t.length){var a=(n-i)/Math.max(t.length-1,1)/2;i-=a,n+=a}this._startValue=i,this._endValue=n,this._valueRange=n-i}},{key:"getLabelForValue",value:function(t){return Dn(t,this.chart.options.locale,this.options.ticks.format)}}]),r}(),gs=function(e){t(a,vs);var i=Nn(a);function a(){return n(this,a),i.apply(this,arguments)}return s(a,[{key:"determineDataLimits",value:function(){var t=this.getMinMax(!0),e=t.min,i=t.max;this.min=Ct(e)?e:0,this.max=Ct(i)?i:1,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){var t=this.isHorizontal(),e=t?this.width:this.height,i=ue(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/n))}},{key:"getPixelForValue",value:function(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}},{key:"getValueForPixel",value:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}]),a}();function ps(t){return 1===t/Math.pow(10,Math.floor(ne(t)))}gs.id="linear",gs.defaults={ticks:{callback:dr.formatters.numeric}};var ms=function(i){t(r,kr);var a=Nn(r);function r(t){var e;return n(this,r),(e=a.call(this,t)).start=void 0,e.end=void 0,e._startValue=void 0,e._valueRange=0,e}return s(r,[{key:"parse",value:function(t,e){var i=vs.prototype.parse.apply(this,[t,e]);if(0!==i)return Ct(i)&&i>0?i:null;this._zero=!0}},{key:"determineDataLimits",value:function(){var t=this.getMinMax(!0),e=t.min,i=t.max;this.min=Ct(e)?Math.max(0,e):null,this.max=Ct(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}},{key:"handleTickRangeOptions",value:function(){var t=this.getUserBounds(),e=t.minDefined,i=t.maxDefined,n=this.min,a=this.max,r=function(t){return n=e?n:t},o=function(t){return a=i?a:t},s=function(t,e){return Math.pow(10,Math.floor(ne(t))+e)};n===a&&(n<=0?(r(1),o(10)):(r(s(n,-1)),o(s(a,1)))),n<=0&&r(s(a,-1)),a<=0&&o(s(n,1)),this._zero&&this.min!==this._suggestedMin&&n===s(this.min,0)&&r(s(n,-1)),this.min=n,this.max=a}},{key:"buildTicks",value:function(){var t=this.options,e=function(t,e){var i=Math.floor(ne(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),a=[],r=Tt(t.min,Math.pow(10,Math.floor(ne(e.min)))),o=Math.floor(ne(r)),s=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{a.push({value:r,major:ps(r)}),10==++s&&(s=1,l=++o>=0?1:l),r=Math.round(s*Math.pow(10,o)*l)/l}while(o<i||o===i&&s<n);var u=Tt(t.max,r);return a.push({value:u,major:ps(r)}),a}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&le(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}},{key:"getLabelForValue",value:function(t){return void 0===t?"0":Dn(t,this.chart.options.locale,this.options.ticks.format)}},{key:"configure",value:function(){var t=this.min;B(e(r.prototype),"configure",this).call(this),this._startValue=ne(t),this._valueRange=ne(this.max)-ne(t)}},{key:"getPixelForValue",value:function(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ne(t)-this._startValue)/this._valueRange)}},{key:"getValueForPixel",value:function(t){var e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}]),r}();function ys(t){var e=t.ticks;if(e.display&&t.display){var i=Ri(e.backdropPadding);return Rt(e.font&&e.font.size,ci.font.size)+i.height}return 0}function bs(t,e,i,n,a){return t===n||t===a?{start:e-i/2,end:e+i/2}:t<n||t>a?{start:e-i,end:e}:{start:e,end:e+i}}function xs(t){for(var e,i,n,a={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},r=Object.assign({},a),o=[],s=[],l=t._pointLabels.length,u=t.options.pointLabels,h=u.centerPointLabels?Kt/l:0,c=0;c<l;c++){var f=u.setContext(t.getPointLabelContext(c));s[c]=f.padding;var d=t.getPointPosition(c,t.drawingArea+s[c],h),v=Li(f.font),g=(e=t.ctx,i=v,n=Ot(n=t._pointLabels[c])?n:[n],{w:di(e,i.string,n),h:n.length*i.lineHeight});o[c]=g;var p=ge(t.getIndexAngle(c)+h),m=Math.round(he(p));_s(r,a,p,bs(m,d.x,g.w,0,180),bs(m,d.y,g.h,90,270))}t.setCenterPoint(a.l-r.l,r.r-a.r,a.t-r.t,r.b-a.b),t._pointLabelItems=function(t,e,i){for(var n=[],a=t._pointLabels.length,r=t.options,o=ys(r)/2,s=t.drawingArea,l=r.pointLabels.centerPointLabels?Kt/a:0,u=0;u<a;u++){var h=t.getPointPosition(u,s+o+i[u],l),c=Math.round(he(ge(h.angle+te))),f=e[u],d=Ms(h.y,f.h,c),v=ks(c),g=ws(h.x,f.w,v);n.push({x:h.x,y:d,textAlign:v,left:g,top:d,right:g+f.w,bottom:d+f.h})}return n}(t,o,s)}function _s(t,e,i,n,a){var r=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i)),s=0,l=0;n.start<e.l?(s=(e.l-n.start)/r,t.l=Math.min(t.l,e.l-s)):n.end>e.r&&(s=(n.end-e.r)/r,t.r=Math.max(t.r,e.r+s)),a.start<e.t?(l=(e.t-a.start)/o,t.t=Math.min(t.t,e.t-l)):a.end>e.b&&(l=(a.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function ks(t){return 0===t||180===t?"center":t<180?"left":"right"}function ws(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function Ms(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function Ss(t,e,i,n){var a=t.ctx;if(i)a.arc(t.xCenter,t.yCenter,e,0,Gt);else{var r=t.getPointPosition(0,e);a.moveTo(r.x,r.y);for(var o=1;o<n;o++)r=t.getPointPosition(o,e),a.lineTo(r.x,r.y)}}ms.id="logarithmic",ms.defaults={ticks:{callback:dr.formatters.logarithmic,major:{enabled:!0}}};var Ps=function(e){t(a,vs);var i=Nn(a);function a(t){var e;return n(this,a),(e=i.call(this,t)).xCenter=void 0,e.yCenter=void 0,e.drawingArea=void 0,e._pointLabels=[],e._pointLabelItems=[],e}return s(a,[{key:"setDimensions",value:function(){var t=this._padding=Ri(ys(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}},{key:"determineDataLimits",value:function(){var t=this.getMinMax(!1),e=t.min,i=t.max;this.min=Ct(e)&&!isNaN(e)?e:0,this.max=Ct(i)&&!isNaN(i)?i:0,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){return Math.ceil(this.drawingArea/ys(this.options))}},{key:"generateTickLabels",value:function(t){var e=this;vs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((function(t,i){var n=Et(e.options.pointLabels.callback,[t,i],e);return n||0===n?n:""})).filter((function(t,i){return e.chart.getDataVisibility(i)}))}},{key:"fit",value:function(){var t=this.options;t.display&&t.pointLabels.display?xs(this):this.setCenterPoint(0,0,0,0)}},{key:"setCenterPoint",value:function(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}},{key:"getIndexAngle",value:function(t){return ge(t*(Gt/(this._pointLabels.length||1))+ue(this.options.startAngle||0))}},{key:"getDistanceFromCenterForValue",value:function(t){if(Dt(t))return NaN;var e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}},{key:"getValueForDistanceFromCenter",value:function(t){if(Dt(t))return NaN;var e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}},{key:"getPointLabelContext",value:function(t){var e=this._pointLabels||[];if(t>=0&&t<e.length){var i=e[t];return function(t,e,i){return Ii(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}},{key:"getPointPosition",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.getIndexAngle(t)-te+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}},{key:"getPointPositionForValue",value:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}},{key:"getBasePosition",value:function(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}},{key:"getPointLabelPosition",value:function(t){var e=this._pointLabelItems[t];return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}},{key:"drawBackground",value:function(){var t=this.options,e=t.backgroundColor,i=t.grid.circular;if(e){var n=this.ctx;n.save(),n.beginPath(),Ss(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}},{key:"drawGrid",value:function(){var t,e,i,n=this,a=this.ctx,r=this.options,o=r.angleLines,s=r.grid,l=this._pointLabels.length;if(r.pointLabels.display&&function(t,e){for(var i=t.ctx,n=t.options.pointLabels,a=e-1;a>=0;a--){var r=n.setContext(t.getPointLabelContext(a)),o=Li(r.font),s=t._pointLabelItems[a],l=s.x,u=s.y,h=s.textAlign,c=s.left,f=s.top,d=s.right,v=s.bottom,g=r.backdropColor;if(!Dt(g)){var p=Ti(r.borderRadius),m=Ri(r.backdropPadding);i.fillStyle=g;var y=c-m.left,b=f-m.top,x=d-c+m.width,_=v-f+m.height;Object.values(p).some((function(t){return 0!==t}))?(i.beginPath(),Si(i,{x:y,y:b,w:x,h:_,radius:p}),i.fill()):i.fillRect(y,b,x,_)}ki(i,t._pointLabels[a],l,u+o.lineHeight/2,o,{color:r.color,textAlign:h,textBaseline:"middle"})}}(this,l),s.display&&this.ticks.forEach((function(t,i){if(0!==i){e=n.getDistanceFromCenterForValue(t.value);var a=s.setContext(n.getContext(i-1));!function(t,e,i,n){var a=t.ctx,r=e.circular,o=e.color,s=e.lineWidth;!r&&!n||!o||!s||i<0||(a.save(),a.strokeStyle=o,a.lineWidth=s,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),Ss(t,i,r,n),a.closePath(),a.stroke(),a.restore())}(n,a,e,l)}})),o.display){for(a.save(),t=l-1;t>=0;t--){var u=o.setContext(this.getPointLabelContext(t)),h=u.color,c=u.lineWidth;c&&h&&(a.lineWidth=c,a.strokeStyle=h,a.setLineDash(u.borderDash),a.lineDashOffset=u.borderDashOffset,e=this.getDistanceFromCenterForValue(r.ticks.reverse?this.min:this.max),i=this.getPointPosition(t,e),a.beginPath(),a.moveTo(this.xCenter,this.yCenter),a.lineTo(i.x,i.y),a.stroke())}a.restore()}}},{key:"drawBorder",value:function(){}},{key:"drawLabels",value:function(){var t=this,e=this.ctx,i=this.options,n=i.ticks;if(n.display){var a,r,o=this.getIndexAngle(0);e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((function(o,s){if(0!==s||i.reverse){var l=n.setContext(t.getContext(s)),u=Li(l.font);if(a=t.getDistanceFromCenterForValue(t.ticks[s].value),l.showLabelBackdrop){e.font=u.string,r=e.measureText(o.label).width,e.fillStyle=l.backdropColor;var h=Ri(l.backdropPadding);e.fillRect(-r/2-h.left,-a-u.size/2-h.top,r+h.width,u.size+h.height)}ki(e,o.label,0,-a,u,{color:l.color})}})),e.restore()}}},{key:"drawTitle",value:function(){}}]),a}();Ps.id="radialLinear",Ps.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:dr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:function(t){return t},padding:5,centerPointLabels:!1}},Ps.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Ps.descriptors={angleLines:{_fallback:"grid"}};var Ds={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}},Os=Object.keys(Ds);function As(t,e){return t-e}function Cs(t,e){if(Dt(e))return null;var i=t._adapter,n=t._parseOpts,a=n.parser,r=n.round,o=n.isoWeekday,s=e;return"function"==typeof a&&(s=a(s)),Ct(s)||(s="string"==typeof a?i.parse(s,a):i.parse(s)),null===s?null:(r&&(s="week"!==r||!oe(o)&&!0!==o?i.startOf(s,r):i.startOf(s,"isoWeek",o)),+s)}function Ts(t,e,i,n){for(var a=Os.length,r=Os.indexOf(t);r<a-1;++r){var o=Ds[Os[r]],s=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((i-e)/(s*o.size))<=n)return Os[r]}return Os[a-1]}function Rs(t,e,i){if(i){if(i.length){var n=zi(i,e),a=n.lo,r=n.hi;t[i[a]>=e?i[a]:i[r]]=!0}}else t[e]=!0}function Ls(t,e,i){var n,a,r=[],o={},s=e.length;for(n=0;n<s;++n)o[a=e[n]]=n,r.push({value:a,major:!1});return 0!==s&&i?function(t,e,i,n){var a,r,o=t._adapter,s=+o.startOf(e[0].value,n),l=e[e.length-1].value;for(a=s;a<=l;a=+o.add(a,1,n))(r=i[a])>=0&&(e[r].major=!0);return e}(t,r,o,i):r}var Es=function(i){t(r,kr);var a=Nn(r);function r(t){var e;return n(this,r),(e=a.call(this,t))._cache={data:[],labels:[],all:[]},e._unit="day",e._majorUnit=void 0,e._offsets={},e._normalized=!1,e._parseOpts=void 0,e}return s(r,[{key:"init",value:function(t,i){var n=t.time||(t.time={}),a=this._adapter=new Sa._date(t.adapters.date);jt(n.displayFormats,a.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},B(e(r.prototype),"init",this).call(this,t),this._normalized=i.normalized}},{key:"parse",value:function(t,e){return void 0===t?null:Cs(this,t)}},{key:"beforeLayout",value:function(){B(e(r.prototype),"beforeLayout",this).call(this),this._cache={data:[],labels:[],all:[]}}},{key:"determineDataLimits",value:function(){var t=this.options,e=this._adapter,i=t.time.unit||"day",n=this.getUserBounds(),a=n.min,r=n.max,o=n.minDefined,s=n.maxDefined;function l(t){o||isNaN(t.min)||(a=Math.min(a,t.min)),s||isNaN(t.max)||(r=Math.max(r,t.max))}o&&s||(l(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||l(this.getMinMax(!1))),a=Ct(a)&&!isNaN(a)?a:+e.startOf(Date.now(),i),r=Ct(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(a,r-1),this.max=Math.max(a+1,r)}},{key:"_getLabelBounds",value:function(){var t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}},{key:"buildTicks",value:function(){var t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);var a=this.min,r=function(t,e,i){for(var n=0,a=t.length;n<a&&t[n]<e;)n++;for(;a>n&&t[a-1]>i;)a--;return n>0||a<t.length?t.slice(n,a):t}(n,a,this.max);return this._unit=e.unit||(i.autoSkip?Ts(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):function(t,e,i,n,a){for(var r=Os.length-1;r>=Os.indexOf(i);r--){var o=Os[r];if(Ds[o].common&&t._adapter.diff(a,n,o)>=e-1)return o}return Os[i?Os.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(var e=Os.indexOf(t)+1,i=Os.length;e<i;++e)if(Ds[Os[e]].common)return Os[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&r.reverse(),Ls(this,r,this._majorUnit)}},{key:"afterAutoSkip",value:function(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((function(t){return+t.value})))}},{key:"initOffsets",value:function(t){var e,i,n=0,a=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),a=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);var r=t.length<3?.5:.25;n=me(n,0,r),a=me(a,0,r),this._offsets={start:n,end:a,factor:1/(n+1+a)}}},{key:"_generate",value:function(){var t,e,i=this._adapter,n=this.min,a=this.max,r=this.options,o=r.time,s=o.unit||Ts(o.minUnit,n,a,this._getLabelCapacity(n)),l=Rt(o.stepSize,1),u="week"===s&&o.isoWeekday,h=oe(u)||!0===u,c={},f=n;if(h&&(f=+i.startOf(f,"isoWeek",u)),f=+i.startOf(f,h?"day":s),i.diff(a,n,s)>1e5*l)throw new Error(n+" and "+a+" are too far apart with stepSize of "+l+" "+s);var d="data"===r.ticks.source&&this.getDataTimestamps();for(t=f,e=0;t<a;t=+i.add(t,l,s),e++)Rs(c,t,d);return t!==a&&"ticks"!==r.bounds&&1!==e||Rs(c,t,d),Object.keys(c).sort((function(t,e){return t-e})).map((function(t){return+t}))}},{key:"getLabelForValue",value:function(t){var e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}},{key:"_tickFormatFunction",value:function(t,e,i,n){var a=this.options,r=a.time.displayFormats,o=this._unit,s=this._majorUnit,l=o&&r[o],u=s&&r[s],h=i[e],c=s&&u&&h&&h.major,f=this._adapter.format(t,n||(c?u:l)),d=a.ticks.callback;return d?Et(d,[f,e,i],this):f}},{key:"generateTickLabels",value:function(t){var e,i,n;for(e=0,i=t.length;e<i;++e)(n=t[e]).label=this._tickFormatFunction(n.value,e,t)}},{key:"getDecimalForValue",value:function(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}},{key:"getPixelForValue",value:function(t){var e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}},{key:"getValueForPixel",value:function(t){var e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}},{key:"_getLabelSize",value:function(t){var e=this.options.ticks,i=this.ctx.measureText(t).width,n=ue(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(n),r=Math.sin(n),o=this._resolveTickFontOptions(0).size;return{w:i*a+o*r,h:i*r+o*a}}},{key:"_getLabelCapacity",value:function(t){var e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,Ls(this,[t],this._majorUnit),n),r=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return o>0?o:1}},{key:"getDataTimestamps",value:function(){var t,e,i=this._cache.data||[];if(i.length)return i;var n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}},{key:"getLabelTimestamps",value:function(){var t,e,i=this._cache.labels||[];if(i.length)return i;var n=this.getLabels();for(t=0,e=n.length;t<e;++t)i.push(Cs(this,n[t]));return this._cache.labels=this._normalized?i:this.normalize(i)}},{key:"normalize",value:function(t){return ji(t.sort(As))}}]),r}();function Is(t,e,i){var n,a,r,o,s=0,l=t.length-1;if(i){if(e>=t[s].pos&&e<=t[l].pos){var u=Fi(t,"pos",e);s=u.lo,l=u.hi}var h=t[s];n=h.pos,r=h.time;var c=t[l];a=c.pos,o=c.time}else{if(e>=t[s].time&&e<=t[l].time){var f=Fi(t,"time",e);s=f.lo,l=f.hi}var d=t[s];n=d.time,r=d.pos;var v=t[l];a=v.time,o=v.pos}var g=a-n;return g?r+(o-r)*(e-n)/g:r}Es.id="time",Es.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};var zs=function(i){t(r,Es);var a=Nn(r);function r(t){var e;return n(this,r),(e=a.call(this,t))._table=[],e._minPos=void 0,e._tableRange=void 0,e}return s(r,[{key:"initOffsets",value:function(){var t=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(t);this._minPos=Is(i,this.min),this._tableRange=Is(i,this.max)-this._minPos,B(e(r.prototype),"initOffsets",this).call(this,t)}},{key:"buildLookupTable",value:function(t){var e,i,n,a,r,o=this.min,s=this.max,l=[],u=[];for(e=0,i=t.length;e<i;++e)(a=t[e])>=o&&a<=s&&l.push(a);if(l.length<2)return[{time:o,pos:0},{time:s,pos:1}];for(e=0,i=l.length;e<i;++e)r=l[e+1],n=l[e-1],a=l[e],Math.round((r+n)/2)!==a&&u.push({time:a,pos:e/(i-1)});return u}},{key:"_getTimestampsForTable",value:function(){var t=this._cache.all||[];if(t.length)return t;var e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t}},{key:"getDecimalForValue",value:function(t){return(Is(this._table,t)-this._minPos)/this._tableRange}},{key:"getValueForPixel",value:function(t){var e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Is(this._table,i*this._tableRange+this._minPos,!0)}}]),r}();zs.id="timeseries",zs.defaults=Es.defaults;var Fs=[ka,wo,us,Object.freeze({__proto__:null,CategoryScale:cs,LinearScale:gs,LogarithmicScale:ms,RadialLinearScale:Ps,TimeScale:Es,TimeSeriesScale:zs})];function Vs(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,r=e(t);if(n){var o=e(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return i(this,a)}}function Bs(t){for(var e,i=[t[1]],n={},a=0;a<i.length;a+=1)n=N(n,i[a]);return{c:function(){e=u("canvas"),this.h()},l:function(t){e=h(t,"CANVAS",{}),c(e).forEach(f),this.h()},h:function(){j(e,n)},m:function(i,n){d(i,e,n),t[6](e)},p:function(t,a){v(a,1)[0],j(e,n=W(i,[t[1]]))},i:C,o:C,d:function(i){i&&f(e),t[6](null)}}}function Ns(t,e,i){Gr.register.apply(Gr,F(Fs));var n,a=e.data,r=void 0===a?{labels:[],datasets:[{data:[]}],yMarkers:{},yRegions:[]}:a,o=e.type,s=void 0===o?"line":o,l=e.options,u=void 0===l?{}:l,h=e.plugins,c=void 0===h?[]:h,f=null,d=function(t,e){for(var i=["children","$$scope","$$slots"].concat(e),n={},a=0,r=Object.keys(t);a<r.length;a++){var o=r[a];i.includes(o)||(n[o]=t[o])}return n}(e,["data","type","options","plugins"]);return b((function(){f=new Gr(n,{type:s,data:r,options:u,plugins:c})})),H((function(){f&&(f.data=r,f.type=s,f.options=u,f.plugins=c,f.update())})),$((function(){f&&f.destroy(),f=null})),t.$$set=function(t){i(8,e=N(N({},e),Y(t))),"data"in t&&i(2,r=t.data),"type"in t&&i(3,s=t.type),"options"in t&&i(4,u=t.options),"plugins"in t&&i(5,c=t.plugins)},e=Y(e),[n,d,r,s,u,c,function(t){U[t?"unshift":"push"]((function(){i(0,n=t)}))}]}var js=function(e){t(u,l);var i=Vs(u);function u(t){var e;return n(this,u),e=i.call(this),a(o(e),t,Ns,Bs,r,{data:2,type:3,options:4,plugins:5}),e}return s(u)}();function Ws(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,r=e(t);if(n){var o=e(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return i(this,a)}}function Hs(t){for(var e,i,n=[t[0],{type:"line"}],a={},r=0;r<n.length;r+=1)a=N(a,n[r]);return e=new js({props:a}),{c:function(){T(e.$$.fragment)},l:function(t){R(e.$$.fragment,t)},m:function(t,n){L(e,t,n),i=!0},p:function(t,i){var a=1&v(i,1)[0]?W(n,[X(t[0]),n[1]]):{};e.$set(a)},i:function(t){i||(y(e.$$.fragment,t),i=!0)},o:function(t){p(e.$$.fragment,t),i=!1},d:function(t){E(e,t)}}}function $s(t,e,i){return t.$$set=function(t){i(0,e=N(N({},e),Y(t)))},[e=Y(e)]}var Ys=function(e){t(u,l);var i=Ws(u);function u(t){var e;return n(this,u),e=i.call(this),a(o(e),t,$s,Hs,r,{}),e}return s(u)}();function Us(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,r=e(t);if(n){var o=e(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return i(this,a)}}function Xs(t){var e,i,n,a,r,o=_.i18n.sevelDayResponseTime+"";return a=new Ys({props:{data:{labels:t[1],datasets:[{label:_.i18n.responseTimeMs,backgroundColor:_.graphBackgroundColor||"#89e0cf",borderColor:_.graphBorderColor||"#1abc9c",data:t[2]}]},width:t[3],height:400,options:{responsive:!0,maintainAspectRatio:!0,scales:{xAxes:[{display:!1,gridLines:{display:!1}}]}}}}),{c:function(){e=u("h2"),i=k(o),n=P(),T(a.$$.fragment)},l:function(t){e=h(t,"H2",{});var r=c(e);i=w(r,o),r.forEach(f),n=D(t),R(a.$$.fragment,t)},m:function(t,o){d(t,e,o),M(e,i),d(t,n,o),L(a,t,o),r=!0},p:function(t,e){var i={};6&e&&(i.data={labels:t[1],datasets:[{label:_.i18n.responseTimeMs,backgroundColor:_.graphBackgroundColor||"#89e0cf",borderColor:_.graphBorderColor||"#1abc9c",data:t[2]}]}),8&e&&(i.width=t[3]),a.$set(i)},i:function(t){r||(y(a.$$.fragment,t),r=!0)},o:function(t){p(a.$$.fragment,t),r=!1},d:function(t){t&&f(e),t&&f(n),E(a,t)}}}function qs(t){var e,i;return e=new J({}),{c:function(){T(e.$$.fragment)},l:function(t){R(e.$$.fragment,t)},m:function(t,n){L(e,t,n),i=!0},p:C,i:function(t){i||(y(e.$$.fragment,t),i=!0)},o:function(t){p(e.$$.fragment,t),i=!1},d:function(t){E(e,t)}}}function Ks(t){var e,i,n,a,r,o=[qs,Xs],s=[];function l(t,e){return t[0]?0:t[2].length?1:-1}return~(i=l(t))&&(n=s[i]=o[i](t)),{c:function(){e=u("section"),n&&n.c(),this.h()},l:function(t){e=h(t,"SECTION",{});var i=c(e);n&&n.l(i),i.forEach(f),this.h()},h:function(){q((function(){return t[5].call(e)}))},m:function(n,o){d(n,e,o),~i&&s[i].m(e,null),a=K(e,t[5].bind(e)),r=!0},p:function(t,a){var r=v(a,1)[0],u=i;(i=l(t))===u?~i&&s[i].p(t,r):(n&&(g(),p(s[u],1,1,(function(){s[u]=null})),m()),~i?((n=s[i])?n.p(t,r):(n=s[i]=o[i](t)).c(),y(n,1),n.m(e,null)):n=null)},i:function(t){r||(y(n),r=!0)},o:function(t){p(n),r=!1},d:function(t){t&&f(e),~i&&s[i].d(),a()}}}function Gs(t,e,i){var n=e.slug,a=!0,r=Q(),o=_.owner,s=_.repo,l=[],u=[],h=[],c=800;return b(G(x.mark((function t(){return x.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,tt("commits-".concat(o,"-").concat(s,"-").concat(n),(function(){return r.repos.listCommits({owner:o,repo:s,path:"history/".concat(n,".yml"),per_page:28})}));case 3:l=t.sent.data.reverse(),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),Z(t.t0);case 9:l=l.map((function(t,e){return t.showHeading=0===e||new Date(l[e-1].created_at).toLocaleDateString()!==new Date(t.created_at).toLocaleDateString(),t})),i(2,h=l.filter((function(t){return t.commit.message.includes("ms) [skip ci]")})).map((function(t){return parseInt(t.commit.message.split(" in ")[1].split("ms")[0])}))),i(1,u=l.filter((function(t){return t.commit.message.includes("ms) [skip ci]")})).map((function(t){return new Date(t.commit.committer.date).toLocaleString()}))),i(0,a=!1);case 13:case"end":return t.stop()}}),t,null,[[0,6]])})))),t.$$set=function(t){"slug"in t&&i(4,n=t.slug)},[a,u,h,c,n,function(){c=this.clientWidth,i(3,c)}]}var Zs=function(e){t(u,l);var i=Us(u);function u(t){var e;return n(this,u),e=i.call(this),a(o(e),t,Gs,Ks,r,{slug:4}),e}return s(u)}();function Js(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,r=e(t);if(n){var o=e(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return i(this,a)}}function Qs(t){var e,i,n,a,r,o;return e=new lt({props:{slug:t[0]}}),n=new Zs({props:{slug:t[0]}}),r=new mt({props:{slug:t[0]}}),{c:function(){T(e.$$.fragment),i=P(),T(n.$$.fragment),a=P(),T(r.$$.fragment)},l:function(t){R(e.$$.fragment,t),i=D(t),R(n.$$.fragment,t),a=D(t),R(r.$$.fragment,t)},m:function(t,s){L(e,t,s),d(t,i,s),L(n,t,s),d(t,a,s),L(r,t,s),o=!0},p:function(t,i){var a=v(i,1)[0],o={};1&a&&(o.slug=t[0]),e.$set(o);var s={};1&a&&(s.slug=t[0]),n.$set(s);var l={};1&a&&(l.slug=t[0]),r.$set(l)},i:function(t){o||(y(e.$$.fragment,t),y(n.$$.fragment,t),y(r.$$.fragment,t),o=!0)},o:function(t){p(e.$$.fragment,t),p(n.$$.fragment,t),p(r.$$.fragment,t),o=!1},d:function(t){E(e,t),t&&f(i),E(n,t),t&&f(a),E(r,t)}}}function tl(t){return el.apply(this,arguments)}function el(){return(el=G(x.mark((function t(e){var i;return x.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.params.number,t.abrupt("return",{slug:i});case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function il(t,e,i){var n=e.slug;return t.$$set=function(t){"slug"in t&&i(0,n=t.slug)},[n]}var nl=function(e){t(u,l);var i=Js(u);function u(t){var e;return n(this,u),e=i.call(this),a(o(e),t,il,Qs,r,{slug:0}),e}return s(u)}();export{nl as default,tl as preload};
|