1"use strict";(self.rspackChunkcognito_spa=self.rspackChunkcognito_spa||[]).push([[8434],{52687(t,e,i){let s;i.d(e,{PP:()=>sp,t1:()=>iB,dN:()=>i7,s$:()=>se,ZT:()=>eE,No:()=>iK,kc:()=>sb,FN:()=>iG,m_:()=>sf});var n=i(97147);function o(){}let r=(s=0,()=>s++);function a(t){return null==t}function l(t){if(Array.isArray&&Array.isArray(t))return!0;let e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function h(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function d(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function c(t,e){return d(t)?t:e}function u(t,e){return void 0===t?e:t}function f(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function g(t,e,i,s){let n,o,r;if(l(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n<o;n++)e.call(i,t[n],n);else if(h(t))for(o=(r=Object.keys(t)).length,n=0;n<o;n++)e.call(i,t[r[n]],r[n])}function p(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function m(t){if(l(t))return t.map(m);if(h(t)){let e=Object.create(null),i=Object.keys(t),s=i.length,n=0;for(;n<s;++n)e[i[n]]=m(t[i[n]]);return e}return t}function x(t){return -1===["__proto__","prototype","constructor"].indexOf(t)}function b(t,e,i,s){if(!x(t))return;let n=e[t],o=i[t];h(n)&&h(o)?_(n,o,s):e[t]=m(o)}function _(t,e,i){let s,n=l(e)?e:[e],o=n.length;if(!h(t))return t;let r=(i=i||{}).merger||b;for(let e=0;e<o;++e){if(!h(s=n[e]))continue;let o=Object.keys(s);for(let e=0,n=o.length;e<n;++e)r(o[e],t,s,i)}return t}function y(t,e){return _(t,e,{merger:v})}function v(t,e,i){if(!x(t))return;let s=e[t],n=i[t];h(s)&&h(n)?y(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=m(n))}let w={"":t=>t,x:t=>t.x,y:t=>t.y};function M(t,e){let i;return(w[e]||(w[e]=(i=function(t){let e=t.split("."),i=[],s="";for(let t of e)(s+=t).endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(e),t=>{for(let e of i){if(""===e)break;t=t&&t[e]}return t})))(t)}function k(t){return t.charAt(0).toUpperCase()+t.slice(1)}let S=t=>void 0!==t,D=t=>"function"==typeof t,P=(t,e)=>{if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0},O=Math.PI,C=2*O,T=C+O,A=1/0,L=O/180,z=O/2,E=O/4,R=2*O/3,I=Math.log10,F=Math.sign;function B(t,e,i){return Math.abs(t-e)<i}function H(t){let e=Math.round(t),i=Math.pow(10,Math.floor(I(t=B(t,e,t/1e3)?e:t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function j(t){return"symbol"!=typeof t&&("object"!=typeof t||null===t||!!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t))&&!isNaN(parseFloat(t))&&isFinite(t)}function W(t){return O/180*t}function V(t){if(!d(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function $(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function N(t,e){return(t-e+T)%C-O}function U(t){return(t%C+C)%C}function q(t,e,i,s){let n=U(t),o=U(e),r=U(i),a=U(o-n),l=U(r-n),h=U(n-o),d=U(n-r);return n===o||n===r||s&&o===r||a>l&&h<d}function K(t,e,i){return Math.max(e,Math.min(i,t))}function Q(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function G(t,e,i){let s;i=i||(i=>t[i]<e);let n=t.length-1,o=0;for(;n-o>1;)i(s=o+n>>1)?o=s:n=s;return{lo:o,hi:n}}let X=(t,e,i,s)=>G(t,i,s?s=>{let n=t[s][e];return n<i||n===i&&t[s+1][e]===i}:s=>t[s][e]<i),J=(t,e,i)=>G(t,i,s=>t[s][e]>=i),Y=["push","pop","shift","splice","unshift"];function Z(t,e){let i=t._chartjs;if(!i)return;let s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(Y.forEach(e=>{delete t[e]}),delete t._chartjs)}let tt="u"<typeof window?function(t){return t()}:window.requestAnimationFrame;function te(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,tt.call(window,()=>{s=!1,t.apply(e,i)}))}}let ti=t=>"start"===t?"left":"end"===t?"right":"center",ts=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,tn=t=>0===t||1===t,to=(t,e,i)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*C/i)),tr=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*C/i)+1,ta={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*z)+1,easeOutSine:t=>Math.sin(t*z),easeInOutSine:t=>-.5*(Math.cos(O*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>tn(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(-Math.pow(2,-10*(2*t-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>tn(t)?t:to(t,.075,.3),easeOutElastic:t=>tn(t)?t:tr(t,.075,.3),easeInOutElastic:t=>tn(t)?t:t<.5?.5*to(2*t,.1125,.45):.5+.5*tr(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-ta.easeOutBounce(1-t),easeOutBounce:t=>t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375,easeInOutBounce:t=>t<.5?.5*ta.easeInBounce(2*t):.5*ta.easeOutBounce(2*t-1)+.5};function tl(t){if(t&&"object"==typeof t){let e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function th(t){return tl(t)?t:new n.Q1(t)}function td(t){return tl(t)?t:new n.Q1(t).saturate(.5).darken(.1).hexString()}let tc=["x","y","borderWidth","radius","tension"],tu=["color","borderColor","backgroundColor"],tf=new Map;function tg(t,e,i){var s;let n,o;return(n=e+JSON.stringify(s=(s=i)||{}),!(o=tf.get(n))&&(o=new Intl.NumberFormat(e,s),tf.set(n,o)),o).format(t)}let tp={values:t=>l(t)?t:""+t,numeric(t,e,i){let s;if(0===t)return"0";let n=this.chart.options.locale,o=t;if(i.length>1){var r,a;let e,n=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(n<1e-4||n>1e15)&&(s="scientific"),r=t,Math.abs(e=(a=i).length>3?a[2].value-a[1].value:a[1].value-a[0].value)>=1&&r!==Math.floor(r)&&(e=r-Math.floor(r)),o=e}let l=I(Math.abs(o)),h=isNaN(l)?1:Math.max(Math.min(-1*Math.floor(l),20),0),d={notation:s,minimumFractionDigits:h,maximumFractionDigits:h};return Object.assign(d,this.options.ticks.format),tg(t,n,d)},logarithmic(t,e,i){return 0===t?"0":[1,2,3,5,10,15].includes(i[e].significand||t/Math.pow(10,Math.floor(I(t))))||e>.8*i.length?tp.numeric.call(this,t,e,i):""}},tm=Object.create(null),tx=Object.create(null);function tb(t,e){if(!e)return t;let i=e.split(".");for(let e=0,s=i.length;e<s;++e){let s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function t_(t,e,i){return"string"==typeof e?_(tb(t,e),i):_(tb(t,""),e)}var ty=new class{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={}
vendor: 4,123 bytes, line 1
1,this.hoverBackgroundColor=(t,e)=>td(e.backgroundColor),this.hoverBorderColor=(t,e)=>td(e.borderColor),this.hoverColor=(t,e)=>td(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(t),this.apply(e)}set(t,e){return t_(this,t,e)}get(t){return tb(this,t)}describe(t,e){return t_(tx,t,e)}override(t,e){return t_(tm,t,e)}route(t,e,i,s){let n=tb(this,t),o=tb(this,i),r="_"+e;Object.defineProperties(n,{[r]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){let t=this[r],e=o[s];return h(t)?Object.assign({},e,t):u(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:tu},numbers:{type:"number",properties:tc}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:tp.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function tv(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function tw(t,e,i){let s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function tM(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function tk(t,e,i,s){tS(t,e,i,s,null)}function tS(t,e,i,s,n){let o,r,a,l,h,d,c,u,f=e.pointStyle,g=e.rotation,p=e.radius,m=(g||0)*L;if(f&&"object"==typeof f&&("[object HTMLImageElement]"===(o=f.toString())||"[object HTMLCanvasElement]"===o)){t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),t.restore();return}if(!isNaN(p)&&!(p<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,p,0,0,C):t.arc(i,s,p,0,C),t.closePath();break;case"triangle":d=n?n/2:p,t.moveTo(i+Math.sin(m)*d,s-Math.cos(m)*p),m+=R,t.lineTo(i+Math.sin(m)*d,s-Math.cos(m)*p),m+=R,t.lineTo(i+Math.sin(m)*d,s-Math.cos(m)*p),t.closePath();break;case"rectRounded":h=.516*p,r=Math.cos(m+E)*(l=p-h),c=Math.cos(m+E)*(n?n/2-h:l),a=Math.sin(m+E)*l,u=Math.sin(m+E)*(n?n/2-h:l),t.arc(i-c,s-a,h,m-O,m-z),t.arc(i+u,s-r,h,m-z,m),t.arc(i+c,s+a,h,m,m+z),t.arc(i-u,s+r,h,m+z,m+O),t.closePath();break;
1case"rect":if(!g){l=Math.SQRT1_2*p,d=n?n/2:l,t.rect(i-d,s-l,2*d,2*l);break}m+=E;case"rectRot":c=Math.cos(m)*(n?n/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-c,s-a),t.lineTo(i+u,s-r),t.lineTo(i+c,s+a),t.lineTo(i-u,s+r),t.closePath();break;case"crossRot":m+=E;case"cross":c=Math.cos(m)*(n?n/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-c,s-a),t.lineTo(i+c,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r);break;case"star":c=Math.cos(m)*(n?n/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-c,s-a),t.lineTo(i+c,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r),m+=E,c=Math.cos(m)*(n?n/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-c,s-a),t.lineTo(i+c,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r);break;case"line":r=n?n/2:Math.cos(m)*p,a=Math.sin(m)*p,t.moveTo(i-r,s-a),t.lineTo(i+r,s+a);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:p),s+Math.sin(m)*p);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function tD(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 tP(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function tO(t){t.restore()}function tC(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){let s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function tT(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function tA(t,e,i,s,n,o={}){let r,h,d=l(e)?e:[e],c=o.strokeWidth>0&&""!==o.strokeColor;for(t.save(),t.font=n.string,o.translation&&t.translate(o.translation[0],o.translation[1]),a(o.rotation)||t.rotate(o.rotation),o.color&&(t.fillStyle=o.color),o.textAlign&&(t.textAlign=o.textAlign),o.textBaseline&&(t.textBaseline=o.textBaseline),r=0;r<d.length;++r)h=d[r],o.backdrop&&function(t,e){let i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}(t,o.backdrop),c&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),a(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(h,i,s,o.maxWidth)),t.fillText(h,i,s,o.maxWidth),function(t,e,i,s,n){if(n.strikethrough||n.underline){let o=t.measureText(s),r=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,d=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(r,d),t.lineTo(a,d),t.stroke()}}(t,i,s,h,o),s+=Number(n.lineHeight);t.restore()}function tL(t,e){let{x:i,y:s,w:n,h:o,radius:r}=e;t.arc(i+r.topLeft,s+r.topLeft,r.topLeft,1.5*O,O,!0),t.lineTo(i,s+o-r.bottomLeft),t.arc(i+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,O,z,!0),t.lineTo(i+n-r.bottomRight,s+o),t.arc(i+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,z,0,!0),t.lineTo(i+n,s+r.topRight),t.arc(i+n-r.topRight,s+r.topRight,r.topRight,0,-z,!0),t.lineTo(i+r.topLeft,s)}let tz=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,tE=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/,tR=t=>+t||0;function tI(t,e){let i={},s=h(e),n=s?Object.keys(e):e,o=h(t)?s?i=>u(t[i],t[e[i]]):e=>t[e]:()=>t;for(let t of n)i[t]=tR(o(t));return i}function tF(t){return tI(t,["topLeft","topRight","bottomLeft","bottomRight"])}function tB(t){let e=tI(t,{top:"y",right:"x",bottom:"y",left:"x"});return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function tH(t,e){t=t||{},e=e||ty.font;let i=u(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=u(t.style,e.style);s&&!(""+s).match(tE)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);let n={family:u(t.family,e.family),lineHeight:function(t,e){let i=(""+t).match(tz);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}(u(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:u(t.weight,e.weight),string:""};return n.string=!n||a(n.size)||a(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family,n}function tj(t,e,i,s){let n,o,r,a=!0;for(n=0,o=t.length;n<o;++n)if(void 0!==(r=t[n])&&(void 0!==e&&"function"==typeof r&&(r=r(e),a=!1),void 0!==i&&l(r)&&(r=r[i%r.length],a=!1),void 0!==r))return s&&!a&&(s.cacheable=!1),r}function tW(t,e){return Object.assign(Object.create(t),e)}function tV(t,e=[""],i,s,n=()=>t[0]){let o=i||t;return void 0===s&&(s=tJ("_fallback",t)),new Proxy({[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>tV([i,...t],e,o,s)},{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>tK(i,s,()=>
1(function(t,e,i,s){let n;for(let o of e)if(void 0!==(n=tJ(tU(o,t),i)))return tq(t,n)?tG(i,s,t,n):n})(s,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>tY(t).includes(e),ownKeys:t=>tY(t),set(t,e,i){let s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function t$(t,e,i,s){return new Proxy({_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:tN(t,s),setContext:e=>t$(t,e,i,s),override:n=>t$(t.override(n),e,i,s)},{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>tK(t,e,()=>(function(t,e,i){let{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=t,a=s[e];return D(a)&&r.isScriptable(e)&&(a=function(t,e,i,s){let{_proxy:n,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||s);return a.delete(t),tq(t,l)&&(l=tG(n._scopes,n,t,l)),l}(e,a,t,i)),l(a)&&a.length&&(a=function(t,e,i,s){let{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(h(e[0])){let i=e,s=n._scopes.filter(t=>t!==i);for(let l of(e=[],i)){let i=tG(s,n,t,l);e.push(t$(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable)),tq(e,a)&&(a=t$(a,n,o&&o[e],r)),a})(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function tN(t,e={scriptable:!0,indexable:!0}){let{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:D(i)?i:()=>i,isIndexable:D(s)?s:()=>s}}let tU=(t,e)=>t?t+k(e):e,tq=(t,e)=>h(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function tK(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];let s=i();return t[e]=s,s}let tQ=(t,e)=>!0===t?e:"string"==typeof t?M(e,t):void 0;function tG(t,e,i,s){var n;let o=e._rootScopes,r=(n=e._fallback,D(n)?n(i,s):n),a=[...t,...o],d=new Set;d.add(s);let c=tX(d,a,i,r||i,s);return null!==c&&(void 0===r||r===i||null!==(c=tX(d,a,r,c,s)))&&tV(Array.from(d),[""],o,r,()=>{var t,n,o;let r,a;return t=e,n=i,o=s,n in(r=t._getTarget())||(r[n]={}),l(a=r[n])&&h(o)?o:a||{}})}function tX(t,e,i,s,n){for(;i;)i=function(t,e,i,s,n){for(let r of e){let e=tQ(i,r);if(e){var o;t.add(e);let r=(o=e._fallback,D(o)?o(i,n):o);if(void 0!==r&&r!==i&&r!==s)return r}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}(t,e,i,s,n);return i}function tJ(t,e){for(let i of e){if(!i)continue;let e=i[t];if(void 0!==e)return e}}function tY(t){let e=t._keys;return e||(e=t._keys=function(t){let e=new Set;for(let i of t)for(let t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}let tZ=Number.EPSILON||1e-14,t0=(t,e)=>e<t.length&&!t[e].skip&&t[e],t1=t=>"x"===t?"y":"x";function t2(t,e,i){return Math.max(Math.min(t,i),e)}function t5(){return"u">typeof window&&"u">typeof document}function t4(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function t3(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}let t6=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),t7=["top","right","bottom","left"];function t8(t,e,i){let s={};i=i?"-"+i:"";for(let n=0;n<4;n++){let o=t7[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function t9(t,e){if("native"in t)return t;let{canvas:i,currentDevicePixelRatio:s}=e,n=t6(i),o="border-box"===n.boxSizing,r=t8(n,"padding"),a=t8(n,"border","width"),{x:l,y:h,box:d}=function(t,e){let i,s,n,o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:l}=r,h=!1;if(n=t.target,(a>0||l>0)&&(!n||!n.shadowRoot))i=a,s=l;else{let t=e.getBoundingClientRect();i=r.clientX-t.left,s=r.clientY-t.top,h=!0}return{x:i,y:s,box:h}}(t,i),c=r.left+(d&&a.left),u=r.top+(d&&a.top),{width:f,height:g}=e;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-c)/f*i.width/s),y:Math.round((h-u)/g*i.height/s)}}let et=t=>Math.round(10*t)/10;function ee(t,e,i){let s=e||1,n=et(t.height*s),o=et(t.width*s);t.height=et(t.height),t.width=et(t.width);let r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||r.height!==n||r.width!==o)&&(t.currentDevicePixelRatio=s,r.height=n,r.width=o,t.ctx.setTransform(s,
10,0,s,0,0),!0)}let ei=function(){let t=!1;try{let e={get passive(){return t=!0,!1}};t5()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function es(t,e){let i=t6(t).getPropertyValue(e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function en(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function eo(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function er(t,e,i,s){let n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=en(t,n,i),a=en(n,o,i),l=en(o,e,i),h=en(r,a,i),d=en(a,l,i);return en(h,d,i)}function ea(t,e,i){var s;return t?(s=i,{x:t=>e+e+s-t,setWidth(t){s=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function el(t,e){let i,s;("ltr"===e||"rtl"===e)&&(s=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function eh(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function ed(t){return"angle"===t?{between:q,compare:N,normalize:U}:{between:Q,compare:(t,e)=>t-e,normalize:t=>t}}function ec({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function eu(t,e,i){let s,n,o;if(!i)return[t];let{property:r,start:a,end:l}=i,h=e.length,{compare:d,between:c,normalize:u}=ed(r),{start:f,end:g,loop:p,style:m}=function(t,e,i){let s,{property:n,start:o,end:r}=i,{between:a,normalize:l}=ed(n),h=e.length,{start:d,end:c,loop:u}=t;if(u){for(d+=h,c+=h,s=0;s<h&&a(l(e[d%h][n]),o,r);++s)d--,c--;d%=h,c%=h}return c<d&&(c+=h),{start:d,end:c,loop:u,style:t.style}}(t,e,i),x=[],b=!1,_=null,y=()=>b||c(a,o,s)&&0!==d(a,o),v=()=>!b||0===d(l,s)||c(l,o,s);for(let t=f,i=f;t<=g;++t)(n=e[t%h]).skip||(s=u(n[r]))!==o&&(b=c(s,a,l),null===_&&y()&&(_=0===d(s,a)?t:i),null!==_&&v()&&(x.push(ec({start:_,end:t,loop:p,count:h,style:m})),_=null),i=t,o=s);return null!==_&&x.push(ec({start:_,end:g,loop:p,count:h,style:m})),x}function ef(t,e){let i=[],s=t.segments;for(let n=0;n<s.length;n++){let o=eu(s[n],t.points,e);o.length&&i.push(...o)}return i}function eg(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){let n=t._chart.getContext(),o=ep(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,l=i.length,h=[],d=o,c=e[0].start,u=c;function f(t,e,s,n){let o=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),d=n,c=e%l)}}for(let t of e){let e,o=i[(c=a?c:t.start)%l];for(u=c+1;u<=t.end;u++){let a=i[u%l];(function(t,e){if(!e)return!1;let i=[],s=function(t,e){return tl(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,s)!==JSON.stringify(e,s)})(e=ep(s.setContext(tW(n,{type:"segment",p0:o,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),d)&&f(c,u-1,t.loop,d),o=a,d=e}c<u-1&&f(c,u-1,t.loop,d)}return h}(t,e,i,s):e}function ep(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function em(t,e,i){return t.options.clip?t[i]:e[i]}function ex(t,e){let i=e._clip;if(i.disabled)return!1;let s=function(t,e){let{xScale:i,yScale:s}=t;return i&&s?{left:em(i,e,"left"),right:em(i,e,"right"),top:em(s,e,"top"),bottom:em(s,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:s.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:s.right+(!0===i.right?0:i.right),top:!1===i.top?0:s.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:s.bottom+(!0===i.bottom?0:i.bottom)}}var eb=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){let n=e.listeners[s],o=e.duration;n.forEach(s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=tt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;
1this._charts.forEach((i,s)=>{let n;if(!i.running||!i.items.length)return;let o=i.items,r=o.length-1,a=!1;for(;r>=0;--r)(n=o[r])._active?(n._total>i.duration&&(i.duration=n._total),n.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!!e&&!!e.running&&!!e.items.length}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};let e_="transparent",ey={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let s=th(t||e_),n=s.valid&&th(e||e_);
1return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class ev{constructor(t,e,i,s){const n=e[i];s=tj([t.to,s,n,t.from]);const o=tj([t.from,n,s]);this._active=!0,this._fn=t.fn||ey[t.type||typeof o],this._easing=ta[t.easing]||ta.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=tj([t.to,e,s,t.from]),this._from=tj([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e,i=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;if(this._active=o!==a&&(r||i<s),!this._active){this._target[n]=a,this._notify(!0);return}if(i<0){this._target[n]=o;return}e=i/s%2,e=r&&e>1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[n]=this._fn(o,a,e)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class ew{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!h(t))return;let e=Object.keys(ty.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let n=t[s];if(!h(n))return;let o={};for(let t of e)o[t]=n[t];(l(n.properties)&&n.properties||[s]).forEach(t=>{t!==s&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){let i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i){t.options=e;return}return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!s)return[];let n=this._createAnimations(s,i);return i.$shared&&(function(t,e){let i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){let n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)})(t.options.$animations,i).then(()=>{t.options=i},()=>{}),n}_createAnimations(t,e){let i,s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();for(i=r.length-1;i>=0;--i){let l=r[i];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}let h=e[l],d=o[l],c=s.get(l);if(d)if(c&&d.active()){d.update(c,h,a);continue}else d.cancel();if(!c||!c.duration){t[l]=h;continue}o[l]=d=new ev(c,t,l,h),n.push(d)}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);let i=this._createAnimations(t,e);if(i.length)return eb.add(this._chart,i),!0}}function eM(t,e){let i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function ek(t,e){let i,s,n=[],o=t._getSortedDatasetMetas(e);for(i=0,s=o.length;i<s;++i)n.push(o[i].index);return n}function eS(t,e,i,s={}){let n,o,r,a,l=t.keys,h="single"===s.mode;if(null===e)return;let c=!1;for(n=0,o=l.length;n<o;++n){if((r=+l[n])===i){if(c=!0,s.all)continue;break}d(a=t.values[r])&&(h||0===e||F(e)===F(a))&&(e+=a)}return c||s.all?e:0}function eD(t,e){let i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function eP(t,e,i,s){for(let n of e.getMatchingVisibleMetas(s).reverse()){let e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function eO(t,e){let i,{chart:s,_cachedMeta:n}=t,o=s._stacks||(s._stacks={}),{iScale:r,vScale:a,index:l}=n,h=r.axis,d=a.axis,c=`${r.id}.${a.id}.${n.stack||n.type}`,u=e.length;for(let t=0;t<u;++t){let s=e[t],{[h]:r,[d]:u}=s;(i=(s._stacks||(s._stacks={}))[d]=function(t,e,i){let s=t[e]||(t[e]={});return s[i]||(s[i]={})}(o,c,r))[l]=u,i._top=eP(i,a,!0,n.type),i._bottom=eP(i,a,!1,n.type),(i._visualValues||(i._visualValues={}))[l]=u}}function eC(t,e){let i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function eT(t,e){let i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s)for(let n of e=e||t._parsed){let t=n._stacks;if(!t||void 0===t[s]||void 0===t[s][i])return;delete t[s][i],void 0!==t[s]._visualValues&&void 0!==t[s]._visualValues[i]&&delete t[s]._visualValues[i]}}let eA=t=>"reset"===t||"none"===t,eL=(t,e)=>e?t:Object.assign({},t);class ez{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=eD(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&eT(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=u(i.xAxisID,eC(t,"x")),o=e.yAxisID=u(i.yAxisID,eC(t,"y")),r=e.rAxisID=u(i.rAxisID,eC(t,"r")),a=e.indexAxis,l=e.iAxisID=s(a,n,o,r),h=e.vAxisID=s(a,o,n,r);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Z(this._data,this),t._stacked&&eT(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(h(e)){let t=this._cachedMeta;this._data=function(t,e){let i,s,n,{iScale:o,vScale:r}=e,a="x"===o.axis?"x":"y",l="x"===r.axis?"x":"y",h=Object.keys(t),d=Array(h.length);for(i=0,s=h.length;i<s;++i)n=h[i],d[i]={[a]:n,[l]:t[n]};return d}(e,t)}else if(i!==e){if(i){Z(i,this);let t=this._cachedMeta;eT(t),t._parsed=[]}
1e&&Object.isExtensible(e)&&(e._chartjs?e._chartjs.listeners.push(this):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),Y.forEach(t=>{let i="_onData"+k(t),s=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let n=s.apply(this,t);return e._chartjs.listeners.forEach(e=>{"function"==typeof e[i]&&e[i](...t)}),n}})}))),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let n=e._stacked;e._stacked=eD(e.vScale,e),e.stack!==i.stack&&(s=!0,eT(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(eO(this,e._parsed),e._stacked=eD(e.vScale,e))}configure(){let 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={}}parse(t,e){let i,s,n,{_cachedMeta:o,_data:r}=this,{iScale:a,_stacked:d}=o,c=a.axis,u=0===t&&e===r.length||o._sorted,f=t>0&&o._parsed[t-1];if(!1===this._parsing)o._parsed=r,o._sorted=!0,n=r;else{n=l(r[t])?this.parseArrayData(o,r,t,e):h(r[t])?this.parseObjectData(o,r,t,e):this.parsePrimitiveData(o,r,t,e);let a=()=>null===s[c]||f&&s[c]<f[c];for(i=0;i<e;++i)o._parsed[i+t]=s=n[i],u&&(a()&&(u=!1),f=s);o._sorted=u}d&&eO(this,n)}parsePrimitiveData(t,e,i,s){let n,o,{iScale:r,vScale:a}=t,l=r.axis,h=a.axis,d=r.getLabels(),c=r===a,u=Array(s);for(n=0;n<s;++n)o=n+i,u[n]={[l]:c||r.parse(d[o],o),[h]:a.parse(e[o],o)};return u}parseArrayData(t,e,i,s){let n,o,r,{xScale:a,yScale:l}=t,h=Array(s);for(n=0;n<s;++n)r=e[o=n+i],h[n]={x:a.parse(r[0],o),y:l.parse(r[1],o)};return h}parseObjectData(t,e,i,s){let n,o,r,{xScale:a,yScale:l}=t,{xAxisKey:h="x",yAxisKey:d="y"}=this._parsing,c=Array(s);for(n=0;n<s;++n)r=e[o=n+i],c[n]={x:a.parse(M(r,h),o),y:l.parse(M(r,d),o)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let s=this.chart,n=this._cachedMeta,o=e[t.axis];return eS({keys:ek(s,!0),values:e._stacks[t.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){let n=i[e.axis],o=null===n?NaN:n,r=s&&i._stacks[e.axis];s&&r&&(s.values=r,o=eS(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){let i,s,n,o=this._cachedMeta,r=o._parsed,a=o._sorted&&t===o.iScale,l=r.length,h=this._getOtherScale(t),c=(n=this.chart,e&&!o.hidden&&o._stacked&&{keys:ek(n,!0),values:null}),u={min:1/0,max:-1/0},{min:f,max:g}=function(t){let{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:-1/0,max:n?i:1/0}}(h);function p(){let e=(s=r[i])[h.axis];return!d(s[t.axis])||f>e||g<e}for(i=0;i<l&&(p()||(this.updateRangeFromParsed(u,t,s,c),!a));++i);if(a){for(i=l-1;i>=0;--i)if(!p()){this.updateRangeFromParsed(u,t,s,c);break}}return u}getAllParsedValues(t){let e,i,s,n=this._cachedMeta._parsed,o=[];for(e=0,i=n.length;e<i;++e)d(s=n[e][t.axis])&&o.push(s);return o}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){var e;let i,s,n,o,r=this._cachedMeta;this.update(t||"default"),h(e=u(this.options.clip,function(t,e,i){if(!1===i)return!1;let s=eM(t,i),n=eM(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(r.xScale,r.yScale,this.getMaxOverflow())))?(i=e.top,s=e.right,n=e.bottom,o=e.left):i=s=n=o=e,r._clip={top:i,right:s,bottom:n,left:o,disabled:!1===e}}update(t){}draw(){let t,e=this._ctx,i=this.chart,s=this._cachedMeta,n=s.data||[],o=i.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,h=this.options.drawActiveElementsOnTop;for(s.dataset&&s.dataset.draw(e,o,a,l),t=a;t<a+l;++t){let i=n[t];i.hidden||(i.active&&h?r.push(i):i.draw(e,o))}for(t=0;t<r.length;++t)r[t].draw(e,o)}getStyle(t,e){let i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){var s,n;let o,r=this.getDataset();if(t>=0&&t<this._cachedMeta.data.length){let e=this._cachedMeta.data[t];(o=e.$context||(s=this.getContext(),e.$context=tW(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"}))).parsed=this.getParsed(t),o.raw=r.data[t],o.index=o.dataIndex=t}else(o=this.$context||(this.$context=tW(this.chart.getContext(),{active:!1,dataset:void 0,datasetIndex:n=this.index,index:n,mode:"default",type:"dataset"}))).dataset=r,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){let s="active"===e,n=this._cachedDataOpts,o=t+"-"+e,r=n[o],a=this.enableOptionSharing&&S(i);if(r)return eL(r,a);let l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],c=l.getOptionScopes(this.getDataset(),h),u=Object.keys(ty.elements[t]),f=()=>this.getContext(i,s,e),g=l.resolveNamedOptions(c,u,f,d);return g.$shared&&(g.$shared=a,n[o]=Object.freeze(eL(g,a))),g}_resolveAnimations(t,e,i){let s,n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;
1if(!1!==n.options.animation){let n=this.chart.config,o=n.datasetAnimationScopeKeys(this._type,e),r=n.getOptionScopes(this.getDataset(),o);s=n.createResolver(r,this.getContext(t,i,e))}let l=new ew(n,s&&s.animations);return s&&s._cacheable&&(o[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||eA(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){eA(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!eA(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;let n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];let s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){let s,n=this._cachedMeta,o=n.data,r=t+e,a=t=>{for(t.length+=e,s=t.length-1;s>=r;s--)t[s]=t[s-e]};for(a(o),s=t;s<r;++s)o[s]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,e);i._stacked&&eT(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class eE extends ez{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled,{start:r,count:l}=function(t,e,i){let s=e.length,n=0,o=s;if(t._sorted){let{iScale:r,vScale:l,_parsed:h}=t,d=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,c=r.axis,{min:u,max:f,minDefined:g,maxDefined:p}=r.getUserBounds();if(g){if(n=Math.min(X(h,c,u).lo,i?s:X(e,c,r.getPixelForValue(u)).lo),d){let t=h.slice(0,n+1).reverse().findIndex(t=>!a(t[l.axis]));n-=Math.max(0,t)}n=K(n,0,s-1)}if(p){let t=Math.max(X(h,r.axis,f,!0).hi+1,i?0:X(e,c,r.getPixelForValue(f),!0).hi+1);if(d){let e=h.slice(t-1).findIndex(t=>!a(t[l.axis]));t+=Math.max(0,e)}o=K(t,n,s)-n}else o=s-n}return{start:n,count:o}}(e,s,o);this._drawStart=r,this._drawCount=l,function(t){let{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;let o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}(e)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;let 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(s,r,l,t)}updateElements(t,e,i,s){let n="reset"===s,{iScale:o,vScale:r,_stacked:l,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,f=r.axis,{spanGaps:g,segment:p}=this.options,m=j(g)?g:1/0,x=this.chart._animationsDisabled||n||"none"===s,b=e+i,_=t.length,y=e>0&&this.getParsed(e-1);for(let i=0;i<_;
1++i){let g=t[i],_=x?g:{};if(i<e||i>=b){_.skip=!0;continue}let v=this.getParsed(i),w=a(v[f]),M=_[u]=o.getPixelForValue(v[u],i),k=_[f]=n||w?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[f],i);_.skip=isNaN(M)||isNaN(k)||w,_.stop=i>0&&Math.abs(v[u]-y[u])>m,p&&(_.parsed=v,_.raw=h.data[i]),c&&(_.options=d||this.resolveDataElementOptions(i,g.active?"active":s)),x||this.updateElement(g,i,_,s),y=v}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];return s.length?Math.max(i,s[0].size(this.resolveDataElementOptions(0)),s[s.length-1].size(this.resolveDataElementOptions(s.length-1)))/2:i}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function eR(){throw Error("This method is not implemented: Check that a complete date adapter is provided.")}var eI=class t{static override(e){Object.assign(t.prototype,e)}options;constructor(t){this.options=t||{}}init(){}formats(){return eR()}parse(){return eR()}format(){return eR()}add(){return eR()}diff(){return eR()}startOf(){return eR()}endOf(){return eR()}};function eF(t,e,i,s,n){let o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t<i;++t){let{index:i,data:l}=o[t],{lo:h,hi:d}=function(t,e,i,s){let{controller:n,data:o,_sorted:r}=t,l=n._cachedMeta.iScale,h=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&e===l.axis&&"r"!==e&&r&&o.length){let r=l._reversePixels?J:X;if(s){if(n._sharedOptions){let t=o[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){let t=r(o,e,i-s),n=r(o,e,i+s);return{lo:t.lo,hi:n.hi}}}}else{let s=r(o,e,i);if(h){let{vScale:e}=n._cachedMeta,{_parsed:i}=t,o=i.slice(0,s.lo+1).reverse().findIndex(t=>!a(t[e.axis]));s.lo-=Math.max(0,o);let r=i.slice(s.hi).findIndex(t=>!a(t[e.axis]));s.hi+=Math.max(0,r)}return s}}return{lo:0,hi:o.length-1}}(o[t],e,r,n);for(let t=h;t<=d;++t){let e=l[t];e.skip||s(e,i,t)}}}function eB(t,e,i,s,n){let o=[];return(n||t.isPointInArea(e))&&eF(t,i,e,function(i,r,a){(n||tD(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&o.push({element:i,datasetIndex:r,index:a})},!0),o}function eH(t,e,i,s,n,o){let r,a,l,h,d,c;return o||t.isPointInArea(e)?"r"!==i||s?(r=[],a=-1!==i.indexOf("x"),l=-1!==i.indexOf("y"),h=function(t,e){return Math.sqrt(Math.pow(a?Math.abs(t.x-e.x):0,2)+Math.pow(l?Math.abs(t.y-e.y):0,2))},d=1/0,eF(t,i,e,function(i,a,l){let c=i.inRange(e.x,e.y,n);if(s&&!c)return;let u=i.getCenterPoint(n);if(!(o||t.isPointInArea(u))&&!c)return;let f=h(e,u);f<d?(r=[{element:i,datasetIndex:a,index:l}],d=f):f===d&&r.push({element:i,datasetIndex:a,index:l})}),r):(c=[],eF(t,i,e,function(t,i,s){var o;let r,a,l,h,{startAngle:d,endAngle:u}=t.getProps(["startAngle","endAngle"],n),{angle:f}=(r=(o={x:e.x,y:e.y}).x-t.x,l=Math.sqrt(r*r+(a=o.y-t.y)*a),(h=Math.atan2(a,r))<-.5*O&&(h+=C),{angle:h,distance:l});q(f,d,u)&&c.push({element:t,datasetIndex:i,index:s})}),c):[]}function ej(t,e,i,s,n){let o=[],r="x"===i?"inXRange":"inYRange",a=!1;return(eF(t,i,e,(t,s,l)=>{t[r]&&t[r](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),a=a||t.inRange(e.x,e.y,n))}),s&&!a)?[]:o}var eW={modes:{index(t,e,i,s){let n=t9(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?eB(t,n,o,s,r):eH(t,n,o,!1,s,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,s){let n=t9(e,t),o=i.axis||"xy",r=i.includeInvisible||!1,a=i.intersect?eB(t,n,o,s,r):eH(t,n,o,!1,s,r);if(a.length>0){let e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point(t,e,i,s){let n=t9(e,t);return eB(t,n,i.axis||"xy",s,i.includeInvisible||!1)},nearest(t,e,i,s){let n=t9(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return eH(t,n,o,i.intersect,s,r)},x(t,e,i,s){let n=t9(e,t);return ej(t,n,"x",i.intersect,s)},y(t,e,i,s){let n=t9(e,t);return ej(t,n,"y",i.intersect,s)}}};let eV=["left","top","right","bottom"];function e$(t,e){return t.filter(t=>t.pos===e)}function eN(t,e){return t.filter(t=>-1===eV.indexOf(t.pos)&&t.box.axis===e)}function eU(t,e){return t.sort((t,i)=>{let s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight})}function eq(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function eK(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 eQ(t,e,i,s){let n,o,r,a,l,d,c=[];for(n=0,o=t.length,l=0;n<o;++n){(a=(r=t[n]).box).update(r.width||e.w,r.height||e.h,function(t,e){let i=e.maxPadding;return function(t){let s={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{s[t]=Math.max(e[t],i[t])}),s}(t?["left","right"]:["top","bottom"])}(r.horizontal,e));let{same:o,other:u}
1=function(t,e,i,s){let{pos:n,box:o}=i,r=t.maxPadding;if(!h(n)){i.size&&(t[n]-=i.size);let e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&eK(r,o.getPadding());let a=Math.max(0,e.outerWidth-eq(r,t,"left","right")),l=Math.max(0,e.outerHeight-eq(r,t,"top","bottom")),d=a!==t.w,c=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:d,other:c}:{same:c,other:d}}(e,i,r,s);l|=o&&c.length,d=d||u,a.fullSize||c.push(r)}return l&&eQ(c,e,i,s)||d}function eG(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function eX(t,e,i,s){let n=i.padding,{x:o,y:r}=e;for(let a of t){let t=a.box,l=s[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){let s=e.w*h,o=l.size||t.height;S(l.start)&&(r=l.start),t.fullSize?eG(t,n.left,r,i.outerWidth-n.right-n.left,o):eG(t,e.left+l.placed,r,s,o),l.start=r,l.placed+=s,r=t.bottom}else{let s=e.h*h,r=l.size||t.width;S(l.start)&&(o=l.start),t.fullSize?eG(t,o,n.top,r,i.outerHeight-n.bottom-n.top):eG(t,o,e.top+l.placed,r,s),l.start=o,l.placed+=s,o=t.right}}e.x=o,e.y=r}var eJ={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){let n,o,r,a,l,h,d,c;if(!t)return;let u=tB(t.options.layout.padding),f=Math.max(e-u.width,0),p=Math.max(i-u.height,0),m=(o=eU((n=function(t){let e,i,s,n,o,r,a=[];for(e=0,i=(t||[]).length;e<i;++e)s=t[e],({position:n,options:{stack:o,stackWeight:r=1}}=s),a.push({index:e,box:s,pos:n,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&n+o,stackWeight:r});return a}(t.boxes)).filter(t=>t.box.fullSize),!0),r=eU(e$(n,"left"),!0),a=eU(e$(n,"right")),l=eU(e$(n,"top"),!0),h=eU(e$(n,"bottom")),d=eN(n,"x"),c=eN(n,"y"),{fullSize:o,leftAndTop:r.concat(l),rightAndBottom:a.concat(c).concat(h).concat(d),chartArea:e$(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:l.concat(h).concat(d)}),x=m.vertical,b=m.horizontal;g(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let _=Object.freeze({outerWidth:e,outerHeight:i,padding:u,availableWidth:f,availableHeight:p,vBoxMaxWidth:f/2/(x.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1),hBoxMaxHeight:p/2}),y=Object.assign({},u);eK(y,tB(s));let v=Object.assign({maxPadding:y,w:f,h:p,x:u.left,y:u.top},u),w=function(t,e){let i,s,n,o=function(t){let e={};for(let i of t){let{stack:t,pos:s,stackWeight:n}=i;if(!t||!eV.includes(s))continue;let o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=e;for(i=0,s=t.length;i<s;++i){let{fullSize:s}=(n=t[i]).box,l=o[n.stack],h=l&&n.stackWeight/l.weight;n.horizontal?(n.width=h?h*r:s&&e.availableWidth,n.height=a):(n.width=r,n.height=h?h*a:s&&e.availableHeight)}return o}(x.concat(b),_);eQ(m.fullSize,v,_,w),eQ(x,v,_,w),eQ(b,v,_,w)&&eQ(x,v,_,w);let M=v.maxPadding;function k(t){let e=Math.max(M[t]-v[t],0);return v[t]+=e,e}v.y+=k("top"),v.x+=k("left"),k("right"),k("bottom"),eX(m.leftAndTop,v,_,w),v.x+=v.w,v.y+=v.h,eX(m.rightAndBottom,v,_,w),t.chartArea={left:v.left,top:v.top,right:v.left+v.w,bottom:v.top+v.h,height:v.h,width:v.w},g(m.chartArea,e=>{let i=e.box;Object.assign(i,t.chartArea),i.update(v.w,v.h,{left:0,top:0,right:0,bottom:0})})}};class eY{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class eZ extends eY{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}let e0="$chartjs",e1={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mou
1semove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},e2=t=>null===t||""===t,e5=!!ei&&{passive:!0};function e4(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function e3(t,e,i){let s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||e4(i.addedNodes,s))&&!e4(i.removedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function e6(t,e,i){let s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||e4(i.removedNodes,s))&&!e4(i.addedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}let e7=new Map,e8=0;function e9(){let t=window.devicePixelRatio;t!==e8&&(e8=t,e7.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function it(t,e,i){let s=t.canvas,n=s&&t4(s);if(!n)return;let o=te((t,e)=>{let s=n.clientWidth;i(t,e),s<n.clientWidth&&i()},window),r=new ResizeObserver(t=>{let e=t[0],i=e.contentRect.width,s=e.contentRect.height;(0!==i||0!==s)&&o(i,s)});return r.observe(n),e7.size||window.addEventListener("resize",e9),e7.set(t,o),r}function ie(t,e,i){i&&i.disconnect(),"resize"===e&&(e7.delete(t),e7.size||window.removeEventListener("resize",e9))}function ii(t,e,i){let s=t.canvas,n=te(e=>{null!==t.ctx&&i(function(t,e){let i=e1[t.type]||t.type,{x:s,y:n}=t9(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))},t);return s&&s.addEventListener(e,n,e5),n}class is extends eY{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(!function(t,e){let i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[e0]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",e2(n)){let e=es(t,"width");void 0!==e&&(t.width=e)}if(e2(s))if(""===t.style.height)t.height=t.width/(e||2);else{let e=es(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[e0])return!1;let i=e[e0].initial;["height","width"].forEach(t=>{let s=i[t];a(s)?e.removeAttribute(t):e.setAttribute(t,s)});let s=i.style||{};return Object.keys(s).forEach(t=>{e.style[t]=s[t]}),e.width=e.width,delete e[e0],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),n={attach:e3,detach:e6,resize:it}[e]||ii;s[e]=n(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];s&&((({attach:ie,detach:ie,resize:ie})[e]||function(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,e5)})(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return function(t,e,i,s){let n=t6(t),o=t8(n,"margin"),r=t3(n.maxWidth,t,"clientWidth")||A,a=t3(n.maxHeight,t,"clientHeight")||A,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){let o=t&&t4(t);if(o){let t=o.getBoundingClientRect(),r=t6(o),a=t8(r,"border","width"),l=t8(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,s=t3(r.maxWidth,o,"clientWidth"),n=t3(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||A,maxHeight:n||A}}(t,e,i),{width:h,height:d}=l;if("content-box"===n.boxSizing){let t=t8(n,"border","width"),e=t8(n,"padding");h-=e.width+t.width,d-=e.height+t.height}return h=Math.max(0,h-o.width),d=Math.max(0,s?h/s:d-o.height),h=et(Math.min(h,r,l.maxWidth)),d=et(Math.min(d,a,l.maxHeight)),h&&!d&&(d=et(h/2)),(void 0!==e||void 0!==i)&&s&&l.height&&d>l.height&&(h=et(Math.floor((d=l.height)*s))),{width:h,height:d}}(t,e,i,s)}isAttached(t){let e=t&&t4(t);return!!(e&&e.isConnected)}}class io{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return j(this.x)&&j(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}function ir(t,e,i,s,n){let o,r,a,l=u(s,0),h=Math.min(u(n,t.length),t.length),d=0;for(i=Math.ceil(i),n&&(i=(o=n-s)/Math.floor(o/i)),a=l;a<0;)a=Math.round(l+ ++d*i);for(r=Math.max(l,0);r<h;r++)r===a&&(e.push(t[r]),a=Math.round(l+ ++d*i))}
1let ia=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,il=(t,e)=>Math.min(e||t,t);function ih(t,e){let i=[],s=t.length/e,n=t.length,o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function id(t){return t.drawTicks?t.tickLength:0}function ic(t,e){if(!t.display)return 0;let i=tH(t.font,e),s=tB(t.padding);return(l(t.text)?t.text.length:1)*i.lineHeight+s.height}class iu extends io{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=c(t,1/0),e=c(e,-1/0),i=c(i,1/0),s=c(s,-1/0),{min:c(t,i),max:c(e,s),minDefined:d(t),maxDefined:d(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};let r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;a<l;++a)e=r[a].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),o||(s=Math.max(s,e.max));return i=o&&i>s?s:i,s=n&&i>s?i:s,{min:c(i,c(s,i)),max:c(s,c(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){f(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:s,grace:n,ticks:o}=this.options,r=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){let s,n,{min:o,max:r}=t,a=(s=e,n=(r-o)/2,"string"==typeof s&&s.endsWith("%")?parseFloat(s)/100*n:+s),l=(t,e)=>i&&0===t?0:t+e;return{min:l(o,-Math.abs(a)),max:l(r,a)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=r<this.ticks.length;this._convertTicksToLabels(l?ih(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(t,e){var i;let s,n,o=t.options.ticks,r=(s=(i=t).options.offset,n=i._tickSize(),Math.floor(Math.min(i._length/n+ +!s,i._maxLength/n))),l=Math.min(o.maxTicksLimit||r,r),h=o.major.enabled?function(t){let e,i,s=[];for(e=0,i=t.length;e<i;e++)t[e].major&&s.push(e);return s}(e):[],d=h.length,c=h[0],u=h[d-1],f=[];if(d>l)return function(t,e,i,s){let n,o=0,r=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===r&&(e.push(t[n]),r=i[++o*s])}(e,f,h,d/l),f;
1let g=function(t,e,i){let s=function(t){let e,i,s=t.length;if(s<2)return!1;for(i=t[0],e=1;e<s;++e)if(t[e]-t[e-1]!==i)return!1;return i}(t),n=e.length/i;if(!s)return Math.max(n,1);let o=function(t){let e,i=[],s=Math.sqrt(t);for(e=1;e<s;e++)t%e==0&&(i.push(e),i.push(t/e));return s===(0|s)&&i.push(s),i.sort((t,e)=>t-e).pop(),i}(s);for(let t=0,e=o.length-1;t<e;t++){let e=o[t];if(e>n)return e}return Math.max(n,1)}(h,e,l);if(d>0){let t,i,s=d>1?Math.round((u-c)/(d-1)):null;for(ir(e,f,g,a(s)?0:c-s,c),t=0,i=d-1;t<i;t++)ir(e,f,g,h[t],h[t+1]);return ir(e,f,g,u,a(s)?e.length:u+s),f}return ir(e,f,g),f}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let 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}afterUpdate(){f(this.options.afterUpdate,[this])}beforeSetDimensions(){f(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){f(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),f(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){f(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e,i,s,n=this.options.ticks;for(e=0,i=t.length;e<i;e++)(s=t[e]).label=f(n.callback,[s.value,e,t],this)}afterTickToLabelConversion(){f(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){f(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t,e,i,s=this.options,n=s.ticks,o=il(this.ticks.length,s.ticks.maxTicksLimit),r=n.minRotation||0,a=n.maxRotation,l=r;if(!this._isVisible()||!n.display||r>=a||o<=1||!this.isHorizontal()){this.labelRotation=r;return}let h=this._getLabelSizes(),d=h.widest.width,c=h.highest.height,u=K(this.chart.width-d,0,this.maxWidth);d+6>(t=s.offset?this.maxWidth/o:u/(o-1))&&(t=u/(o-(s.offset?.5:1)),e=this.maxHeight-id(s.grid)-n.padding-ic(s.title,this.chart.options.font),i=Math.sqrt(d*d+c*c),l=Math.max(r,Math.min(a,l=180/O*Math.min(Math.asin(K((h.highest.height+6)/t,-1,1)),Math.asin(K(e/i,-1,1))-Math.asin(K(c/i,-1,1)))))),this.labelRotation=l}afterCalculateLabelRotation(){f(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){f(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){let o=ic(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=id(n)+o):(t.height=this.maxHeight,t.width=id(n)+o),i.display&&this.ticks.length){let{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),a=2*i.padding,l=W(this.labelRotation),h=Math.cos(l),d=Math.sin(l);if(r){let e=i.mirror?0:d*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{let e=i.mirror?0:h*n.width+d*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,s,d,h)}}this._handleMargins(),r?(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)}_calculatePadding(t,e,i,s){let{ticks:{align:n,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){let r=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),d=0,c=0;a?l?(d=s*t.width,c=i*e.height):(d=i*t.height,c=s*e.width):"start"===n?c=e.width:"end"===n?d=t.width:"inner"!==n&&(d=t.width/2,c=e.width/2),this.paddingLeft=Math.max((d-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((c-h+o)*this.width/(this.width-h),0)}
1else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){f(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)a(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=ih(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){let s,n,o,r,h,d,c,u,f,p,m,{ctx:x,_longestTextCache:b}=this,_=[],y=[],v=Math.floor(e/il(e,i)),w=0,M=0;for(s=0;s<e;s+=v){if(r=t[s].label,x.font=d=(h=this._resolveTickFontOptions(s)).string,c=b[d]=b[d]||{data:{},gc:[]},u=h.lineHeight,f=p=0,a(r)||l(r)){if(l(r))for(n=0,o=r.length;n<o;++n)a(m=r[n])||l(m)||(f=tv(x,c.data,c.gc,f,m),p+=u)}else f=tv(x,c.data,c.gc,f,r),p=u;_.push(f),y.push(p),w=Math.max(f,w),M=Math.max(p,M)}g(b,t=>{let i,s=t.gc,n=s.length/2;if(n>e){for(i=0;i<n;++i)delete t.data[s[i]];s.splice(0,n)}});let k=_.indexOf(w),S=y.indexOf(M),D=t=>({width:_[t]||0,height:y[t]||0});return{first:D(0),last:D(e-1),widest:D(k),highest:D(S),widths:_,heights:y}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return K(this._alignToPixels?tw(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){var e,i;let s=this.ticks||[];if(t>=0&&t<s.length){let i=s[t];return i.$context||(e=this.getContext(),i.$context=tW(e,{tick:i,index:t,type:"tick"}))}return this.$context||(this.$context=(i=this.chart.getContext(),tW(i,{scale:this,type:"scale"})))}_tickSize(){let t=this.options.ticks,e=W(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),o=t.autoSkipPadding||0,r=n?n.widest.width+o:0,a=n?n.highest.height+o:0;return this.isHorizontal()?a*i>r*s?r/i:a/s:a*s<r*i?a/i:r/s}_isVisible(){let t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e,i,s,n,o,r,a,l,d,c,f,g,p=this.axis,m=this.chart,x=this.options,{grid:b,position:_,border:y}=x,v=b.offset,w=this.isHorizontal(),M=this.ticks.length+ +!!v,k=id(b),S=[],D=y.setContext(this.getContext()),P=D.display?D.width:0,O=P/2,C=function(t){return tw(m,t,P)};if("top"===_)e=C(this.bottom),r=this.bottom-k,l=e-O,c=C(t.top)+O,g=t.bottom;else if("bottom"===_)e=C(this.top),c=t.top,g=C(t.bottom)-O,r=e+O,l=this.top+k;else if("left"===_)e=C(this.right),o=this.right-k,a=e-O,d=C(t.left)+O,f=t.right;else if("right"===_)e=C(this.left),d=t.left,f=C(t.right)-O,o=e+O,a=this.left+k;else if("x"===p){if("center"===_)e=C((t.top+t.bottom)/2+.5);else if(h(_)){let t=Object.keys(_)[0],i=_[t];e=C(this.chart.scales[t].getPixelForValue(i))}c=t.top,g=t.bottom,l=(r=e+O)+k}else if("y"===p){if("center"===_)e=C((t.left+t.right)/2);else if(h(_)){let t=Object.keys(_)[0],i=_[t];e=C(this.chart.scales[t].getPixelForValue(i))}a=(o=e-O)-k,d=t.left,f=t.right}let T=u(x.ticks.maxTicksLimit,M),A=Math.max(1,Math.ceil(M/T));for(i=0;i<M;i+=A){let t=this.getContext(i),e=b.setContext(t),h=y.setContext(t),u=e.lineWidth,p=e.color,x=h.dash||[],_=h.dashOffset,M=e.tickWidth,k=e.tickColor,D=e.tickBorderDash||[],P=e.tickBorderDashOffset;
1void 0!==(s=function(t,e,i){let s,n=t.ticks.length,o=Math.min(e,n-1),r=t._startPixel,a=t._endPixel,l=t.getPixelForTick(o);if(!i||(s=1===n?Math.max(l-r,a-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(o-1))/2,!((l+=o<e?s:-s)<r-1e-6)&&!(l>a+1e-6)))return l}(this,i,v))&&(n=tw(m,s,u),w?o=a=d=f=n:r=l=c=g=n,S.push({tx1:o,ty1:r,tx2:a,ty2:l,x1:d,y1:c,x2:f,y2:g,width:u,color:p,borderDash:x,borderDashOffset:_,tickWidth:M,tickColor:k,tickBorderDash:D,tickBorderDashOffset:P}))}return this._ticksLength=M,this._borderValue=e,S}_computeLabelItems(t){let e,i,s,n,o,r,a,d,c,u,f,g=this.axis,p=this.options,{position:m,ticks:x}=p,b=this.isHorizontal(),_=this.ticks,{align:y,crossAlign:v,padding:w,mirror:M}=x,k=id(p.grid),S=k+w,D=M?-w:S,P=-W(this.labelRotation),O=[],C="middle";if("top"===m)o=this.bottom-D,r=this._getXAxisLabelAlignment();else if("bottom"===m)o=this.top+D,r=this._getXAxisLabelAlignment();else if("left"===m){let t=this._getYAxisLabelAlignment(k);r=t.textAlign,n=t.x}else if("right"===m){let t=this._getYAxisLabelAlignment(k);r=t.textAlign,n=t.x}else if("x"===g){if("center"===m)o=(t.top+t.bottom)/2+S;else if(h(m)){let t=Object.keys(m)[0],e=m[t];o=this.chart.scales[t].getPixelForValue(e)+S}r=this._getXAxisLabelAlignment()}else if("y"===g){if("center"===m)n=(t.left+t.right)/2-S;else if(h(m)){let t=Object.keys(m)[0],e=m[t];n=this.chart.scales[t].getPixelForValue(e)}r=this._getYAxisLabelAlignment(k).textAlign}"y"===g&&("start"===y?C="top":"end"===y&&(C="bottom"));let T=this._getLabelSizes();for(e=0,i=_.length;e<i;++e){let t;s=_[e].label;let h=x.setContext(this.getContext(e));a=this.getPixelForTick(e)+x.labelOffset,c=(d=this._resolveTickFontOptions(e)).lineHeight;let g=(u=l(s)?s.length:1)/2,p=h.color,y=h.textStrokeColor,w=h.textStrokeWidth,k=r;if(b?(n=a,"inner"===r&&(k=e===i-1?this.options.reverse?"left":"right":0===e?this.options.reverse?"right":"left":"center"),f="top"===m?"near"===v||0!==P?-u*c+c/2:"center"===v?-T.highest.height/2-g*c+c:-T.highest.height+c/2:"near"===v||0!==P?c/2:"center"===v?T.highest.height/2-g*c:T.highest.height-u*c,M&&(f*=-1),0===P||h.showLabelBackdrop||(n+=c/2*Math.sin(P))):(o=a,f=(1-u)*c/2),h.showLabelBackdrop){let s=tB(h.backdropPadding),n=T.heights[e],o=T.widths[e],a=f-s.top,l=0-s.left;switch(C){case"middle":a-=n/2;break;case"bottom":a-=n}switch(r){case"center":l-=o/2;break;case"right":l-=o;break;case"inner":e===i-1?l-=o:e>0&&(l-=o/2)}t={left:l,top:a,width:o+s.width,height:n+s.height,color:h.backdropColor}}O.push({label:s,font:d,textOffset:f,options:{rotation:P,color:p,strokeColor:y,strokeWidth:w,textAlign:k,textBaseline:C,translation:[n,o],backdrop:t}})}return O}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-W(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){let e,i,{position:s,ticks:{crossAlign:n,mirror:o,padding:r}}=this.options,a=this._getLabelSizes(),l=t+r,h=a.widest.width;return"left"===s?o?(i=this.right+r,"near"===n?e="left":"center"===n?(e="center",i+=h/2):(e="right",i+=h)):(i=this.right-l,"near"===n?e="right":"center"===n?(e="center",i-=h/2):(e="left",i=this.left)):"right"===s?o?(i=this.left+r,"near"===n?e="right":"center"===n?(e="center",i-=h/2):(e="left",i-=h)):(i=this.left+l,"near"===n?e="left":"center"===n?(e="center",i+=h/2):(e="right",i=this.right)):e="right",{textAlign:e,x:i}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}
1:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){let{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let i=this.ticks.findIndex(e=>e.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){let e,i,s=this.options.grid,n=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(s.display)for(e=0,i=o.length;e<i;++e){let t=o[e];s.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),s.drawTicks&&r({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){let t,e,i,s,{chart:n,ctx:o,options:{border:r,grid:a}}=this,l=r.setContext(this.getContext()),h=r.display?l.width:0;
1if(!h)return;let d=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;this.isHorizontal()?(t=tw(n,this.left,h)-h/2,e=tw(n,this.right,d)+d/2,i=s=c):(i=tw(n,this.top,h)-h/2,s=tw(n,this.bottom,d)+d/2,t=e=c),o.save(),o.lineWidth=l.width,o.strokeStyle=l.color,o.beginPath(),o.moveTo(t,i),o.lineTo(e,s),o.stroke(),o.restore()}drawLabels(t){if(!this.options.ticks.display)return;let e=this.ctx,i=this._computeLabelArea();for(let s of(i&&tP(e,i),this.getLabelItems(t))){let t=s.options,i=s.font;tA(e,s.label,0,s.textOffset,i,t)}i&&tO(e)}drawTitle(){let t,e,{ctx:i,options:{position:s,title:n,reverse:o}}=this;if(!n.display)return;let r=tH(n.font),a=tB(n.padding),d=n.align,c=r.lineHeight/2;"bottom"===s||"center"===s||h(s)?(c+=a.bottom,l(n.text)&&(c+=r.lineHeight*(n.text.length-1))):c+=a.top;let{titleX:u,titleY:f,maxWidth:g,rotation:p}=function(t,e,i,s){let n,o,r,{top:a,left:l,bottom:d,right:c,chart:u}=t,{chartArea:f,scales:g}=u,p=0,m=d-a,x=c-l;if(t.isHorizontal()){if(o=ts(s,l,c),h(i)){let t=Object.keys(i)[0],s=i[t];r=g[t].getPixelForValue(s)+m-e}else r="center"===i?(f.bottom+f.top)/2+m-e:ia(t,i,e);n=c-l}else{if(h(i)){let t=Object.keys(i)[0],s=i[t];o=g[t].getPixelForValue(s)-x+e}else o="center"===i?(f.left+f.right)/2-x+e:ia(t,i,e);r=ts(s,d,a),p="left"===i?-z:z}return{titleX:o,titleY:r,maxWidth:n,rotation:p}}(this,c,s,d);tA(i,n.text,0,0,r,{color:n.color,maxWidth:g,rotation:p,textAlign:(t=ti(d),(o&&"right"!==s||!o&&"right"===s)&&(t="left"===(e=t)?"right":"right"===e?"left":e),t),textBaseline:"middle",translation:[u,f]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,e=t.ticks&&t.ticks.z||0,i=u(t.grid&&t.grid.z,-1),s=u(t.border&&t.border.z,0);return this._isVisible()&&this.draw===iu.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){let e,i,s=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",o=[];for(e=0,i=s.length;e<i;++e){let i=s[e];i[n]!==this.id||t&&i.type!==t||o.push(i)}return o}_resolveTickFontOptions(t){return tH(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ig{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){var e,i,s,n,o,r;let a,l,h=Object.getPrototypeOf(t);"id"in(e=h)&&"defaults"in e&&(l=this.register(h));let d=this.items,c=t.id,u=this.scope+"."+c;if(!c)throw Error("class does not have id: "+t);return c in d||(d[c]=t,i=t,s=u,n=l,a=_(Object.create(null),[n?ty.get(n):{},ty.get(s),i.defaults]),ty.set(s,a),i.defaultRoutes&&(o=s,Object.keys(r=i.defaultRoutes).forEach(t=>{let e=t.split("."),i=e.pop(),s=[o].concat(e).join("."),n=r[t].split("."),a=n.pop(),l=n.join(".");ty.route(s,i,l,a)})),i.descriptors&&ty.describe(s,i.descriptors),this.override&&ty.override(t.id,t.overrides)),u}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in ty[s]&&(delete ty[s][i],this.override&&delete tm[i])}}var ip=new class{constructor(){this.controllers=new ig(ez,"datasets",!0),this.elements=new ig(io,"elements"),this.plugins=new ig(Object,"plugins"),this.scales=new ig(iu,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}
1removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{let s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):g(e,e=>{let s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){let s=k(t);f(i["before"+s],[],i),e[t](i),f(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){let s=e.get(t);if(void 0===s)throw Error('"'+t+'" is not a registered '+i+".");return s}};class im{constructor(){this._init=void 0}notify(t,e,i,s){if("beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),void 0===this._init)return;let n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,e,i,s){for(let n of(s=s||{},t)){let t=n.plugin;if(!1===f(t[i],[e,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){a(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,s=u(i.options&&i.options.plugins,{}),n=function(t){let e={},i=[],s=Object.keys(ip.plugins.items);for(let t=0;t<s.length;t++)i.push(ip.getPlugin(s[t]));let n=t.plugins||[];for(let t=0;t<n.length;t++){let s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==s||e?function(t,{plugins:e,localIds:i},s,n){let o=[],r=t.getContext();for(let l of e){var a;let e=l.id,h=(a=s[e],n||!1!==a?!0===a?{}:a:null);null!==h&&o.push({plugin:l,options:function(t,{plugin:e,local:i},s,n){let o=t.pluginScopeKeys(e),r=t.getOptionScopes(s,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}(t.config,{plugin:l,local:i[e]},h,r)})}return o}(t,n,s,e):[]}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function ix(t,e){let i=ty.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function ib(t){if("x"===t||"y"===t||"r"===t)return t}function i_(t,...e){if(ib(t))return t;for(let s of e){var i;let e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&ib(t[0].toLowerCase());if(e)return e}throw Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function iy(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function iv(t){let e,i,s,n,o=t.options||(t.options={});o.plugins=u(o.plugins,{}),e=tm[t.type]||{scales:{}},i=o.scales||{}
1,s=ix(t.type,o),n=Object.create(null),Object.keys(i).forEach(o=>{let r=i[o];if(!h(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);let a=i_(o,r,function(t,e){if(e.data&&e.data.datasets){let i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return iy(t,"x",i[0])||iy(t,"y",i[0])}return{}}(o,t),ty.scales[r.type]),l=a===s?"_index_":"_value_",d=e.scales||{};n[o]=y(Object.create(null),[{axis:a},r,d[a],d[l]])}),t.data.datasets.forEach(e=>{let s=e.type||t.type,r=e.indexAxis||ix(s,o),a=(tm[s]||{}).scales||{};Object.keys(a).forEach(t=>{let s,o=(s=t,"_index_"===t?s=r:"_value_"===t&&(s="x"===r?"y":"x"),s),l=e[o+"AxisID"]||o;n[l]=n[l]||Object.create(null),y(n[l],[{axis:o},i[l],a[t]])})}),Object.keys(n).forEach(t=>{let e=n[t];y(e,[ty.scales[e.type],ty.scale])}),o.scales=n}function iw(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}let iM=new Map,ik=new Set;function iS(t,e){let i=iM.get(t);return i||(i=e(),iM.set(t,i),ik.add(i)),i}let iD=(t,e,i)=>{let s=M(e,i);void 0!==s&&t.add(s)};class iP{constructor(t){this._config=function(t){return(t=t||{}).data=iw(t.data),iv(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=iw(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),iv(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return iS(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return iS(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return iS(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return iS(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){let{options:s,type:n}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;let a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>iD(a,t,e))),e.forEach(t=>iD(a,s,t)),e.forEach(t=>iD(a,tm[n]||{},t)),e.forEach(t=>iD(a,ty,t)),e.forEach(t=>iD(a,tx,t))});let l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),ik.has(e)&&o.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,tm[e]||{},ty.datasets[e]||{},{type:e},ty,tx]}resolveNamedOptions(t,e,i,s=[""]){let n={$shared:!0},{resolver:o,subPrefixes:r}=iO(this._resolverCache,t,s),a=o;if(function(t,e){let{isScriptable:i,isIndexable:s}=tN(t);for(let n of e){let e=i(n),o=s(n),r=(o||e)&&t[n];if(e&&(D(r)||iC(r))||o&&l(r))return!0}return!1}(o,e)){n.$shared=!1,i=D(i)?i():i;let e=this.createResolver(t,i,r);a=t$(o,i,e)}for(let t of e)n[t]=a[t];return n}createResolver(t,e,i=[""],s){let{resolver:n}=iO(this._resolverCache,t,i);return h(e)?t$(n,e,void 0,s):n}}function iO(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));let n=i.join(),o=s.get(n);return o||(o={resolver:tV(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(n,o)),o}let iC=t=>h(t)&&Object.getOwnPropertyNames(t).some(e=>D(t[e])),iT=["top","bottom","left","right","chartArea"];function iA(t,e){return"top"===t||"bottom"===t||-1===iT.indexOf(t)&&"x"===e}function iL(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function iz(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),f(i&&i.onComplete,[t],e)}function iE(t){let e=t.chart,i=e.options.animation;f(i&&i.onProgress,[t],e)}function iR(t){return t5()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}let iI={},iF=t=>{let e=iR(t);return Object.values(iI).filter(t=>t.canvas===e).pop()};class iB{static defaults=ty;static instances=iI;static overrides=tm;static registry=ip;static version="4.5.1";static getChart=iF;static register(...t){ip.add(...t),iH()}static unregister(...t){ip.remove(...t),iH()}constructor(t,e){const i=this.config=new iP(e),s=iR(t),n=iF(s);if(n)throw Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!t5()||"u">typeof OffscreenCanvas&&t instanceof OffscreenCanvas?eZ:is}(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,h=l&&l.height,d=l&&l.width;if(this.id=r(),this.ctx=a,this.canvas=l,this.width=d,this.height=h,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new im,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],iI[this.id]=this,!a||!l)return void console.error("Failed to create chart: can't acquire context from the given item");eb.listen(this,"complete",iz),eb.listen(this,"progress",iE),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return a(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ip}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ee(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return tM(this.canvas,this.ctx),this}stop(){return eb.stop(this),this}resize(t,e){eb.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ee(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),f(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){g(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{}),n=[];e&&(n=n.concat(Object.keys(e).map(t=>{let i=e[t],s=i_(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),g(n,e=>{let n=e.options,o=n.id,r=i_(o,n),a=u(n.type,e.dtype);(void 0===n.position||iA(n.position,r)!==iA(e.dposition))&&(n.position=e.dposition),s[o]=!0;let l=null;o in i&&i[o].type===a?l=i[o]:i[(l=new(ip.getScale(a))({id:o,type:a,ctx:this.ctx,
1chart:this})).id]=l,l.init(n,t)}),g(s,(t,e)=>{t||delete i[e]}),g(i,t=>{eJ.configure(this,t,t.options),eJ.addBox(this,t)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(iL("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){let t,e,i=[],s=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=s.length;t<e;t++){let e=s[t],n=this.getDatasetMeta(t),o=e.type||this.config.type;if(n.type&&n.type!==o&&(this._destroyDatasetMeta(t),n=this.getDatasetMeta(t)),n.type=o,n.indexAxis=e.indexAxis||ix(o,this.options),n.order=e.order||0,n.index=t,n.label=""+e.label,n.visible=this.isDatasetVisible(t),n.controller)n.controller.updateIndex(t),n.controller.linkScales();else{let e=ip.getController(o),{datasetElementType:s,dataElementType:r}=ty.datasets[o];Object.assign(e,{dataElementType:ip.getElement(r),datasetElementType:s&&ip.getElement(s)}),n.controller=new e(this,t),i.push(n.controller)}}return this._updateMetasets(),i}_resetElements(){g(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;let n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){let{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||g(n,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(iL("z","_idx"));let{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){g(this.scales,t=>{eJ.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options;P(new Set(Object.keys(this._listeners)),new Set(t.events))&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this;for(let{method:i,start:s,count:n}of this._getUniformDataChanges()||[]){var e="_removeElements"===i?-n:n;for(let i of Object.keys(t)){let n=+i;if(n>=s){let o=t[i];delete t[i],(e>0||n>s)&&(t[n+e]=o)}}}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),s=i(0);for(let t=1;t<e;t++)if(!P(s,i(t)))return;return Array.from(s).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;eJ.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],g(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,D(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(eb.has(this)?this.attached&&!eb.running(this)&&eb.start(this):(this.draw(),iz({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0||!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;let e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let e,i,s=this._sortedMetasets,n=[];for(e=0,i=s.length;e<i;++e){let i=s[e];(!t||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=ex(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(s&&tP(e,s),t.controller.draw(),s&&tO(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return tD(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){let n=eW.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=tW(null,{chart:this,type:"chart"}))}
1getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);S(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update(e=>e.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),eb.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),tM(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete iI[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};g(this.options.events,t=>i(t,s))}bindResponsiveEvents(){let t;this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,i=this.platform,s=(t,s)=>{i.addEventListener(this,t,s),e[t]=s},n=(t,s)=>{e[t]&&(i.removeEventListener(this,t,s),delete e[t])},o=(t,e)=>{this.canvas&&this.resize(t,e)},r=()=>{n("attach",r),this.attached=!0,this.resize(),s("resize",o),s("detach",t)};t=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",r)},i.isAttached(this.canvas)?r():t()}unbindEvents(){g(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},g(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let s,n,o,r=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+r+"DatasetHoverStyle"](),n=0,o=t.length;n<o;++n){let e=(s=t[n])&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[r+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{let i=this.getDatasetMeta(t);if(!i)throw Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});p(i,e)||(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){let s=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=n(e,t),r=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;let n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){var s;let{_active:n=[],options:o}=this,r=this._getActiveElements(t,n,i,e),a="mouseup"===t.type||"click"===t.type||"contextmenu"===t.type,l=(s=this._lastEvent,i&&"mouseout"!==t.type?a?s:t:null);i&&(this._lastEvent=null,f(o.onHover,[t,r,this],this),a&&f(o.onClick,[t,r,this],this));let h=!p(r,n);
1return(h||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;let n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function iH(){return g(iB.instances,t=>t._plugins.invalidate())}function ij(t,e,i=e){t.lineCap=u(i.borderCapStyle,e.borderCapStyle),t.setLineDash(u(i.borderDash,e.borderDash)),t.lineDashOffset=u(i.borderDashOffset,e.borderDashOffset),t.lineJoin=u(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=u(i.borderWidth,e.borderWidth),t.strokeStyle=u(i.borderColor,e.borderColor)}function iW(t,e,i){t.lineTo(i.x,i.y)}function iV(t,e,i={}){let s=t.length,{start:n=0,end:o=s-1}=i,{start:r,end:a}=e,l=Math.max(n,r),h=Math.min(o,a);return{count:s,start:l,loop:e.loop,ilen:h<l&&!(n<r&&o<r||n>a&&o>a)?s+h-l:h-l}}function i$(t,e,i,s){let n,o,r,{points:a,options:l}=e,{count:h,start:d,loop:c,ilen:u}=iV(a,i,s),f=l.stepped?tC:l.tension||"monotone"===l.cubicInterpolationMode?tT:iW,{move:g=!0,reverse:p}=s||{};for(n=0;n<=u;++n)(o=a[(d+(p?u-n:n))%h]).skip||(g?(t.moveTo(o.x,o.y),g=!1):f(t,r,o,p,l.stepped),r=o);return c&&f(t,r,o=a[(d+(p?u:0))%h],p,l.stepped),!!c}function iN(t,e,i,s){let n,o,r,a,l,h,d=e.points,{count:c,start:u,ilen:f}=iV(d,i,s),{move:g=!0,reverse:p}=s||{},m=0,x=0,b=t=>(u+(p?f-t:t))%c,_=()=>{a!==l&&(t.lineTo(m,l),t.lineTo(m,a),t.lineTo(m,h))};for(g&&(o=d[b(0)],t.moveTo(o.x,o.y)),n=0;n<=f;++n){if((o=d[b(n)]).skip)continue;let e=o.x,i=o.y,s=0|e;s===r?(i<a?a=i:i>l&&(l=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),r=s,x=0,a=l=i),h=i}_()}function iU(t){let e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?i$:iN}let iq="function"==typeof Path2D;class iK extends io{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;!function(t,e,i,s,n){let o,r,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){let i,s,n,o=t1(e),r=t.length,a=Array(r).fill(0),l=Array(r),h=t0(t,0);for(i=0;i<r;++i)if(s=n,n=h,h=t0(t,i+1),n){if(h){let t=h[e]-n[e];a[i]=0!==t?(h[o]-n[o])/t:0}l[i]=s?h?F(a[i-1])!==F(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}!function(t,e,i){let s,n,o,r,a,l=t.length,h=t0(t,0);for(let d=0;d<l-1;++d)if(a=h,h=t0(t,d+1),a&&h){if(B(e[d],0,tZ)){i[d]=i[d+1]=0;continue}(r=Math.pow(s=i[d]/e[d],2)+Math.pow(n=i[d+1]/e[d],2))<=9||(o=3/Math.sqrt(r),i[d]=s*o*e[d],i[d+1]=n*o*e[d])}}(t,a,l),function(t,e,i="x"){let s,n,o,r=t1(i),a=t.length,l=t0(t,0);for(let h=0;h<a;++h){if(n=o,o=l,l=t0(t,h+1),!o)continue;let a=o[i],d=o[r];n&&(s=(a-n[i])/3,o[`cp1${i}`]=a-s,o[`cp1${r}`]=d-s*e[h]),l&&(s=(l[i]-a)/3,o[`cp2${i}`]=a+s,o[`cp2${r}`]=d+s*e[h])}}(t,l,e)}(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,r=t.length;o<r;++o)l=function(t,e,i,s){let n=t.skip?e:t,o=i.skip?e:i,r=$(e,n),a=$(o,e),l=r/(r+a),h=a/(r+a);l=isNaN(l)?0:l,h=isNaN(h)?0:h;let d=s*l,c=s*h;return{previous:{x:e.x-d*(o.x-n.x),y:e.y-d*(o.y-n.y)},next:{x:e.x+c*(o.x-n.x),y:e.y+c*(o.y-n.y)}}}(i,a=t[o],t[Math.min(o+1,r-!s)%r],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&function(t,e){let i,s,n,o,r,a=tD(t[0],e);for(i=0,s=t.length;i<s;++i)r=o,o=a,a=i<s-1&&tD(t[i+1],e),o&&(n=t[i],r&&(n.cp1x=t2(n.cp1x,e.left,e.right),n.cp1y=t2(n.cp1y,e.top,e.bottom)),a&&(n.cp2x=t2(n.cp2x,e.left,e.right),n.cp2y=t2(n.cp2y,e.top,e.bottom)))}(t,i)}(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){let i=t.points,s=t.o
1ptions.spanGaps,n=i.length;if(!n)return[];let o=!!t._loop,{start:r,end:a}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return{start:n,end:o%=e}}(i,n,o,s);if(!0===s)return eg(t,[{start:r,end:a,loop:o}],i,e);let l=a<r?a+n:a,h=!!t._fullLoop&&0===r&&a===n-1;return eg(t,function(t,e,i,s){let n,o=t.length,r=[],a=e,l=t[e];for(n=e+1;n<=i;++n){let i=t[n%o];i.skip||i.stop?l.skip||(s=!1,r.push({start:e%o,end:(n-1)%o,loop:s}),e=a=i.stop?n:null):(a=n,l.skip&&(e=n)),l=i}return null!==a&&r.push({start:e%o,end:a%o,loop:s}),r}(i,r,l,h),i,e)}(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i,s,n=this.options,o=t[e],r=this.points,a=ef(this,{property:e,start:o,end:o});if(!a.length)return;let l=[],h=n.stepped?eo:n.tension||"monotone"===n.cubicInterpolationMode?er:en;for(i=0,s=a.length;i<s;++i){let{start:s,end:d}=a[i],c=r[s],u=r[d];if(c===u){l.push(c);continue}let f=Math.abs((o-c[e])/(u[e]-c[e])),g=h(c,u,f,n.stepped);g[e]=t[e],l.push(g)}return 1===l.length?l[0]:l}pathSegment(t,e,i){return iU(this)(t,this,e,i)}path(t,e,i){let s=this.segments,n=iU(this),o=this._loop;for(let r of(e=e||0,i=i||this.points.length-e,s))o&=n(t,this,r,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){let n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),function(t,e,i,s){if(iq&&!e.options.segment){let n;(n=e._path)||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),ij(t,e.options),t.stroke(n)}else!function(t,e,i,s){let{segments:n,options:o}=e,r=iU(e);for(let a of n)ij(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function iQ(t,e,i,s){let n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}class iG extends io{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){let s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return iQ(this,t,"x",e)}inYRange(t,e){return iQ(this,t,"y",e)}getCenterPoint(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0,i=(e=Math.max(e,e&&t.hoverRadius||0))&&t.borderWidth||0;return(e+i)*2}draw(t,e){let i=this.options;!this.skip&&!(i.radius<.1)&&tD(this,e,this.size(i)/2)&&(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,tk(t,i,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}}function iX(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=U(n),o=U(o)),{property:t,start:n,end:o}}function iJ(t,e,i){for(;e>t;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function iY(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function iZ(t,e){let i=[],s=!1;return l(t)?(s=!0,i=t):i=function(t,e){let{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=iJ(t,e,n);let r=n[t],a=n[e];null!==s?(o.push({x:r.x,y:s}),o.push({x:a.x,y:s})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}(t,e),i.length?new iK({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function i0(t){return t&&!1!==t.fill}class i1{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){let{x:s,y:n,radius:o}=this;return e=e||{start:0,end:C},t.arc(s,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){let{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function i2(t,e,i){let s=function(t){var e,i,s;let{chart:n,fill:o,line:r}=t;if(d(o)){let t;return e=n,i=o,(t=e.getDatasetMeta(i))&&e.isDatasetVisible(i)?t.dataset:null}if("stack"===o)return function(t){let{scale:e,index:i,line:s}=t,n=[],o=s.segments,r=s.points,a=function(t,e){let i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){let n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);a.push(iZ({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){let e=o[t];for(let t=e.start;t<=e.end;
1t++)!function(t,e,i){let s=[];for(let n=0;n<i.length;n++){let{first:o,last:r,point:a}=function(t,e){let i=t.interpolate(e,"x");if(!i)return{};let s=i.x,n=t.segments,o=t.points,r=!1,a=!1;for(let t=0;t<n.length;t++){let e=n[t],i=o[e.start].x,l=o[e.end].x;if(Q(s,i,l)){r=s===i,a=s===l;break}}return{first:r,last:a,point:i}}(i[n],e);if(a&&(!o||!r)){if(o)s.unshift(a);else if(t.push(a),!r)break}}t.push(...s)}(n,r[t],a)}return new iK({points:n,options:{}})}(t);if("shape"===o)return!0;let a=((s=t).scale||{}).getPointPositionForValue?function(t){let{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,o=s.reverse?e.max:e.min,r="start"===i?o:"end"===i?e.options.reverse?e.min:e.max:h(i)?i.value:e.getBaseValue(),a=[];if(s.grid.circular){let t=e.getPointPositionForValue(0,o);return new i1({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<n;++t)a.push(e.getPointPositionForValue(t,r));return a}(s):function(t){let e,{scale:i={},fill:s}=t,n=(e=null,"start"===s?e=i.bottom:"end"===s?e=i.top:h(s)?e=i.getPixelForValue(s.value):i.getBasePixel&&(e=i.getBasePixel()),e);if(d(n)){let t=i.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(s);return a instanceof i1?a:iZ(a,r)}(e),{chart:n,index:o,line:r,scale:a,axis:l}=e,c=r.options,u=c.fill,f=c.backgroundColor,{above:g=f,below:p=f}=u||{},m=n.getDatasetMeta(o),x=ex(n,m);s&&r.points.length&&(tP(t,i),function(t,e){let{line:i,target:s,above:n,below:o,area:r,scale:a,clip:l}=e,h=i._loop?"angle":e.axis;t.save();let d=o;o!==n&&("x"===h?(i5(t,s,r.top),i3(t,{line:i,target:s,color:n,scale:a,property:h,clip:l}),t.restore(),t.save(),i5(t,s,r.bottom)):"y"===h&&(i4(t,s,r.left),i3(t,{line:i,target:s,color:o,scale:a,property:h,clip:l}),t.restore(),t.save(),i4(t,s,r.right),d=n)),i3(t,{line:i,target:s,color:d,scale:a,property:h,clip:l}),t.restore()}(t,{line:r,target:s,above:g,below:p,area:i,scale:a,axis:l,clip:x}),tO(t))}function i5(t,e,i){let{segments:s,points:n}=e,o=!0,r=!1;for(let a of(t.beginPath(),s)){let{start:s,end:l}=a,h=n[s],d=n[iJ(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),(r=!!e.pathSegment(t,a,{move:r}))?t.closePath():t.lineTo(d.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function i4(t,e,i){let{segments:s,points:n}=e,o=!0,r=!1;for(let a of(t.beginPath(),s)){let{start:s,end:l}=a,h=n[s],d=n[iJ(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(i,h.y),t.lineTo(h.x,h.y)),(r=!!e.pathSegment(t,a,{move:r}))?t.closePath():t.lineTo(i,d.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function i3(t,e){let{line:i,target:s,property:n,color:o,scale:r,clip:a}=e;for(let{source:e,target:l,start:h,end:d}of function(t,e,i){let s=t.segments,n=t.points,o=e.points,r=[];for(let t of s){let{start:s,end:a}=t;a=iJ(s,a,n);let l=iX(i,n[s],n[a],t.loop);if(!e.segments){r.push({source:t,target:l,start:n[s],end:n[a]});continue}for(let s of ef(e,l)){let e=iX(i,o[s.start],o[s.end],s.loop);for(let o of eu(t,n,e))r.push({source:o,target:s,start:{[i]:iY(l,e,"start",Math.max)},end:{[i]:iY(l,e,"end",Math.min)}})}}return r}(i,s,n)){let c,{style:{backgroundColor:u=o}={}}=e,f=!0!==s;t.save(),t.fillStyle=u,function(t,e,i,s){let n=e.chart.chartArea,{property:o,start:r,end:a}=s||{};if("x"===o||"y"===o){let e,s,l,h;"x"===o?(e=r,s=n.top,l=a,h=n.bottom):(e=n.left,s=r,l=n.right,h=a),t.beginPath(),i&&(e=Math.max(e,i.left),l=Math.min(l,i.right),s=Math.max(s,i.top),h=Math.min(h,i.bottom)),t.rect(e,s,l-e,h-s),t.clip()}}(t,r,a,f&&iX(n,h,d)),t.beginPath();let g=!!i.pathSegment(t,e);if(f){g?t.closePath():i6(t,s,d,n);let e=!!s.pathSegment(t,l,{move:g,reverse:!0});(c=g&&e)||i6(t,s,h,n)}t.closePath(),t.fill(c?"evenodd":"nonzero"),t.restore()}}function i6(t,e,i,s){let n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var i7={id:"filler",afterDatasetsUpdate(t,e,i){let s,n,o,r,a=(t.data.datasets||[]).length,l=[];for(n=0;n<a;++n)o=(s=t.getDatasetMeta(n)).dataset,r=null,o&&o.options&&o instanceof iK&&(r={visible:t.isDatasetVisible(n),index:n,fill:function(t,e,i){var s,n,o,r;let a=function(t){let e=t.options,i=e.fill,s=u(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}(t);if(h(a))return!isNaN(a.value)&&a;let l=parseFloat(a);return d(l)&&Math.floor(l)===l?(s=a[0],n=e,o=l,r=i,("-"===s||"+"===s)&&(o=n+o),o!==n&&!(o<0)&&!(o>=r)&&o):["origin","start","end","stack","shape"].indexOf(a)>=0&&a}(o,n,a),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:o}),s.$filler=r,l.push(r);for(n=0;n<a;
1++n)(r=l[n])&&!1!==r.fill&&(r.fill=function(t,e,i){let s,n=t[e].fill,o=[e];if(!i)return n;for(;!1!==n&&-1===o.indexOf(n);){if(!d(n))return n;if(!(s=t[n]))break;if(s.visible)return n;o.push(n),n=s.fill}return!1}(l,n,i.propagate))},beforeDraw(t,e,i){let s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){let i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&i2(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;let s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){let i=s[e].$filler;i0(i)&&i2(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){let s=e.meta.$filler;i0(s)&&"beforeDatasetDraw"===i.drawTime&&i2(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};let i8=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class i9 extends io{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=f(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let t,e,{options:i,ctx:s}=this;if(!i.display){this.width=this.height=0;return}let n=i.labels,o=tH(n.font),r=o.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:h}=i8(n,r);s.font=o.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(a,r,l,h)+10):(e=this.maxHeight,t=this._fitCols(a,o,l,h)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){let{ctx:n,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+r,d=t;n.textAlign="left",n.textBaseline="middle";let c=-1,u=-h;return this.legendItems.forEach((t,f)=>{let g=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+g+2*r>o)&&(d+=h,l[l.length-(f>0?0:1)]=0,u+=h,c++),a[f]={left:0,top:u,row:c,width:g,height:s},l[l.length-1]+=g+r}),d}_fitCols(t,e,i,s){let{ctx:n,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t,d=r,c=0,u=0,f=0,g=0;return this.legendItems.forEach((t,o)=>{var p,m,x,b,_,y,v,w,M,k,S,D;let P,O,{itemWidth:C,itemHeight:T}=(p=i,m=e,x=n,b=t,_=s,{itemWidth:(y=b,v=p,w=m,M=x,(P=y.text)&&"string"!=typeof P&&(P=P.reduce((t,e)=>t.length>e.length?t:e)),v+w.size/2+M.measureText(P).width),itemHeight:(k=_,S=b,D=m.lineHeight,O=k,"string"!=typeof S.text&&(O=st(S,D)),O)});o>0&&u+T+2*r>h&&(d+=c+r,l.push({width:c,height:u}),f+=c+r,g++,c=u=0),a[o]={left:f,top:u,col:g,width:C,height:T},c=Math.max(c,C),u+=T+r}),d+=c,l.push({width:c,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,o=ea(n,this.left,this.width);if(this.isHorizontal()){let n=0,r=ts(i,this.left+s,this.right-this.lineWidths[n]);for(let a of e)n!==a.row&&(n=a.row,r=ts(i,this.left+s,this.right-this.lineWidths[n])),a.top+=this.top+t+s,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+s}else{let n=0,r=ts(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(let a of e)a.col!==n&&(n=a.col,r=ts(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),a.top=r,a.left+=this.left+s,a.left
1=o.leftForLtr(o.x(a.left),a.width),r+=a.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let t=this.ctx;tP(t,this),this._draw(),tO(t)}}_draw(){let t,{options:e,columnSizes:i,lineWidths:s,ctx:n}=this,{align:o,labels:r}=e,a=ty.color,l=ea(e.rtl,this.left,this.width),h=tH(r.font),{padding:d}=r,c=h.size,f=c/2;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=h.string;let{boxWidth:g,boxHeight:p,itemHeight:m}=i8(r,c),x=function(t,e,i){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;n.save();let s=u(i.lineWidth,1);if(n.fillStyle=u(i.fillStyle,a),n.lineCap=u(i.lineCap,"butt"),n.lineDashOffset=u(i.lineDashOffset,0),n.lineJoin=u(i.lineJoin,"miter"),n.lineWidth=s,n.strokeStyle=u(i.strokeStyle,a),n.setLineDash(u(i.lineDash,[])),r.usePointStyle)tS(n,{radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},l.xPlus(t,g/2),e+f,r.pointStyleWidth&&g);else{let o=e+Math.max((c-p)/2,0),r=l.leftForLtr(t,g),a=tF(i.borderRadius);n.beginPath(),Object.values(a).some(t=>0!==t)?tL(n,{x:r,y:o,w:g,h:p,radius:a}):n.rect(r,o,g,p),n.fill(),0!==s&&n.stroke()}n.restore()},b=function(t,e,i){tA(n,i.text,t,e+m/2,h,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})},_=this.isHorizontal(),y=this._computeTitleHeight();t=_?{x:ts(o,this.left+d,this.right-s[0]),y:this.top+d+y,line:0}:{x:this.left+d,y:ts(o,this.top+y+d,this.bottom-i[0].height),line:0},el(this.ctx,e.textDirection);let v=m+d;this.legendItems.forEach((a,c)=>{var u,p;n.strokeStyle=a.fontColor,n.fillStyle=a.fontColor;let m=n.measureText(a.text).width,w=l.textAlign(a.textAlign||(a.textAlign=r.textAlign)),M=g+f+m,k=t.x,S=t.y;if(l.setWidth(this.width),_?c>0&&k+M+d>this.right&&(S=t.y+=v,t.line++,k=t.x=ts(o,this.left+d,this.right-s[t.line])):c>0&&S+v>this.bottom&&(k=t.x=k+i[t.line].width+d,t.line++,S=t.y=ts(o,this.top+y+d,this.bottom-i[t.line].height)),x(l.x(k),S,a),u=k+g+f,p=_?k+M:this.right,k=w===(e.rtl?"left":"right")?p:"center"===w?(u+p)/2:u,b(l.x(k),S,a),_)t.x+=M+d;else if("string"!=typeof a.text){let e=h.lineHeight;t.y+=st(a,e)+d}else t.y+=v}),eh(this.ctx,e.textDirection)}drawTitle(){let t,e=this.options,i=e.title,s=tH(i.font),n=tB(i.padding);if(!i.display)return;let o=ea(e.rtl,this.left,this.width),r=this.ctx,a=i.position,l=s.size/2,h=n.top+l,d=this.left,c=this.width;if(this.isHorizontal())c=Math.max(...this.lineWidths),t=this.top+h,d=ts(e.align,d,this.right-c);else{let i=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);t=h+ts(e.align,this.top,this.bottom-i-e.labels.padding-this._computeTitleHeight())}let u=ts(a,d,d+c);r.textAlign=o.textAlign(ti(a)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=s.string,tA(r,i.text,u,t,s)}_computeTitleHeight(){let t=this.options.title,e=tH(t.font),i=tB(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(Q(t,this.left,this.right)&&Q(e,this.top,this.bottom)){for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(Q(t,(s=n[i]).left,s.left+s.width)&&Q(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){var e,i;let s=this.options;if(e=t.type,i=s,("mousemove"!==e&&"mouseout"!==e||!i.onHover&&!i.onLeave)&&(!i.onClick||"click"!==e&&"mouseup"!==e))return;let n=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){let e=this._hoveredItem,i=null!==e&&null!==n&&e.datasetIndex===n.datasetIndex&&e.index===n.index;e&&!i&&f(s.onLeave,[t,e,this],this),this._hoveredItem=n,n&&!i&&f(s.onHover,[t,n,this],this)}else n&&f(s.onClick,[t,n,this],this)}}function st(t,e){return e*(t.text?t.text.length:0)}var se={id:"legend",_element:i9,start(t,e,i){let s=t.legend=new i9({ctx:t.ctx,options:i,chart:t});eJ.configure(t,s,i),eJ.addBox(t,s)},stop(t){eJ.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){let s=t.legend;eJ.configure(t,s,i),s.options=i},afterUpdate(t){let e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,
1i){let s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{let l=t.controller.getStyle(i?0:void 0),h=tB(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};new WeakMap;let si={average(t){let e,i;if(!t.length)return!1;let s=new Set,n=0,o=0;for(e=0,i=t.length;e<i;++e){let i=t[e].element;if(i&&i.hasValue()){let t=i.tooltipPosition();s.add(t.x),n+=t.y,++o}}return 0!==o&&0!==s.size&&{x:[...s].reduce((t,e)=>t+e)/s.size,y:n/o}},nearest(t,e){let i,s,n;if(!t.length)return!1;let o=e.x,r=e.y,a=1/0;for(i=0,s=t.length;i<s;++i){let s=t[i].element;if(s&&s.hasValue()){let t=$(e,s.getCenterPoint());t<a&&(a=t,n=s)}}if(n){let t=n.tooltipPosition();o=t.x,r=t.y}return{x:o,y:r}}};function ss(t,e){return e&&(l(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function sn(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function so(t,e){let i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=tH(e.bodyFont),h=tH(e.titleFont),d=tH(e.footerFont),c=o.length,u=n.length,f=s.length,p=tB(e.padding),m=p.height,x=0,b=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,c&&(m+=c*h.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),b&&(m+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(m+=e.footerMarginTop+u*d.lineHeight+(u-1)*e.footerSpacing);let _=0,y=function(t){x=Math.max(x,i.measureText(t).width+_)};return i.save(),i.font=h.string,g(t.title,y),i.font=l.string,g(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?r+2+e.boxPadding:0,g(s,t=>{g(t.before,y),g(t.lines,y),g(t.after,y)}),_=0,i.font=d.string,g(t.footer,y),i.restore(),{width:x+=p.width,height:m}}function sr(t,e,i){let s=i.yAlign||e.yAlign||function(t,e){let{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||function(t,e,i,s){let{x:n,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t,h="center";return"center"===s?h=n<=(a+l)/2?"left":"right":n<=o/2?h="left":n>=r-o/2&&(h="right"),function(t,e,i,s){let{x:n,width:o}=s,r=i.caretSize+i.caretPadding;if("left"===t&&n+o+r>e.width||"right"===t&&n-o-r<0)return!0}(h,t,e,i)&&(h="center"),h}(t,e,i,s),yAlign:s}}function sa(t,e,i,s){let{caretSize:n,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,h=n+o,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=tF(r),g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,a),p=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:"bottom"===e?s-=n+i:s-=n/2,s}(e,l,h);return"center"===l?"left"===a?g+=h:"right"===a&&(g-=h):"left"===a?g-=Math.max(d,u)+n:"right"===a&&(g+=Math.max(c,f)+n),{x:K(g,0,s.width-e.width),y:K(p,0,s.height-e.height)}}function sl(t,e,i){let s=tB(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function sh(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}let sd={beforeTitle:o,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:o,beforeBody:o,beforeLabel:o,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");let i=t.formattedValue;return a(i)||(e+=i),e},labelColor(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:o,afterBody:o,beforeFooter:o,footer:o,afterFooter:o};function sc(t,e,i,s){let n=t[e].call(i,s);return void 0===n?sd[e].call(i,s):n}class su extends io{static positioners=si;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new ew(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){var t;return this.$context||(this.$context=(t=this.chart.getContext(),tW(t,{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){let{callbacks:i}=e,s=sc(i,"beforeTitle",this,t),n=sc(i,"title",this,t),o=sc(i,"afterTitle",this,t),r=[];return r=ss(r,sn(s)),r=ss(r,sn(n)),r=ss(r,sn(o))}getBeforeBody(t,e){return ss([],sn(sc(e.callbacks,"beforeBody",this,t)))}getBody(t,e){let{callbacks:i}=e,s=[];return g(t,t=>{let e={before:[],lines:[],after:[]},n=sh(i,t);ss(e.before,sn(sc(n,"beforeLabel",this,t))),ss(e.lines,sc(n,"label",this,t)),ss(e.after,sn(sc(n,"afterLabel",this,t))),s.push(e)}),s}getAfterBody(t,e){return ss([],sn(sc(e.callbacks,"afterBody",this,t)))}getFooter(t,e){let{callbacks:i}=e,s=sc(i,"beforeFooter",this,t),n=sc(i,"footer",this,t),o=sc(i,"afterFooter",this,t),r=[];return r=ss(r,sn(s)),r=ss(r,sn(n)),r=ss(r,sn(o))}_createItems(t){let e,i,s=this._active,n=this.chart.data,o=[],r=[],a=[],l=[];for(e=0,i=s.length;e<i;++e)l.push(function(t,e){let{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:t,label:r,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}(this.chart,s[e]));return t.filter&&(l=l.filter((e,i,s)=>t.filter(e,i,s,n))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,n))),g(l,e=>{let i=sh(t.callbacks,e);o.push(sc(i,"labelColor",this,e)),r.push(sc(i,"labelPointStyle",this,e)),a.push(sc(i,"labelTextColor",this,e))}),this.labelColors=o,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){let i,s=this.options.setContext(this.getContext()),n=this._active,o=[];if(n.length){let t=si[s.position].call(this,n,this._eventPosition);o=this._createItems(s),this.title=this.getTitle(o,s),this.beforeBody=this.getBeforeBody(o,s),this.body=this.getBody(o,s),this.afterBody=this.getAfterBody(o,s),this.footer=this.getFooter(o,s);let e=this._size=so(this,s),r=Object.assign({},t,e),a=sr(this.chart,s,r),l=sa(s,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0}
1);this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){let n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){let s,n,o,r,a,l,{xAlign:h,yAlign:d}=this,{caretSize:c,cornerRadius:u}=i,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:m}=tF(u),{x:x,y:b}=t,{width:_,height:y}=e;return"center"===d?(a=b+y/2,"left"===h?(n=(s=x)-c,r=a+c,l=a-c):(n=(s=x+_)+c,r=a-c,l=a+c),o=s):(n="left"===h?x+Math.max(f,p)+c:"right"===h?x+_-Math.max(g,m)-c:this.caretX,"top"===d?(a=(r=b)-c,s=n-c,o=n+c):(a=(r=b+y)+c,s=n+c,o=n-c),l=r),{x1:s,x2:n,x3:o,y1:r,y2:a,y3:l}}drawTitle(t,e,i){let s,n,o,r=this.title,a=r.length;if(a){let l=ea(i.rtl,this.x,this.width);for(t.x=sl(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=tH(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,o=0;o<a;++o)e.fillText(r[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+n,o+1===a&&(t.y+=i.titleMarginBottom-n)}}_drawColorBox(t,e,i,s,n){let o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:l}=n,d=tH(n.bodyFont),c=sl(this,"left",n),u=s.x(c),f=a<d.lineHeight?(d.lineHeight-a)/2:0,g=e.y+f;if(n.usePointStyle){let e={radius:Math.min(l,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=s.leftForLtr(u,l)+l/2,h=g+a/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,tk(t,e,i,h),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,tk(t,e,i,h)}else{t.lineWidth=h(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;let e=s.leftForLtr(u,l),i=s.leftForLtr(s.xPlus(u,1),l-2),r=tF(o.borderRadius);Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,tL(t,{x:e,y:g,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),tL(t,{x:i,y:g+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,g,l,a),t.strokeRect(e,g,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,g+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let s,n,o,r,a,l,{body:h}=this,{bodySpacing:d,bodyAlign:c,displayColors:u,boxHeight:f,boxWidth:p,boxPadding:m}=i,x=tH(i.bodyFont),b=x.lineHeight,_=0,y=ea(i.rtl,this.x,this.width),v=function(i){e.fillText(i,y.x(t.x+_),t.y+b/2),t.y+=b+d},w=y.textAlign(c);for(e.textAlign=c,e.textBaseline="middle",e.font=x.string,t.x=sl(this,w,i),e.fillStyle=i.bodyColor,g(this.beforeBody,v),_=u&&"right"!==w?"center"===c?p/2+m:p+2+m:0,o=0,a=h.length;o<a;++o){for(s=h[o],e.fillStyle=this.labelTextColors[o],g(s.before,v),n=s.lines,u&&n.length&&(this._drawColorBox(e,t,o,y,i),b=Math.max(x.lineHeight,f)),r=0,l=n.length;r<l;++r)v(n[r]),b=x.lineHeight;g(s.after,v)}_=0,b=x.lineHeight,g(this.afterBody,v),t.y-=d}drawFooter(t,e,i){let s,n,o=this.footer,r=o.length;if(r){let a=ea(i.rtl,this.x,this.width);for(t.x=sl(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",s=tH(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,n=0;n<r;++n)e.fillText(o[n],a.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){let{xAlign:n,yAlign:o}=this,{x:r,y:a}=t,{width:l,height:h}=i,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=tF(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+d,a),"top"===o&&this.drawCaret(t,e,i,s),e.lineTo(r+l-c,a),e.quadraticCurveTo(r+l,a,r+l,a+c),"center"===o&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(r+l,a+h-f),e.quadraticCurveTo(r+l,a+h,r+l-f,a+h),"bottom"===o&&this.drawCaret(t,e,i,s),e.lineTo(r+u,a+h),e.quadraticCurveTo(r,a+h,r,a+h-u),"center"===o&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(r,a+d),e.quadraticCurveTo(r,a,r+d,a),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){let i=si[t.position].call(this,this._active,this._eventPosition);if(!i)return;let o=this._size=so(this,t),r=Object.assign({},i,this._size),a=sr(e,t,r),l=sa(t,r,a,e);
1(s._to!==l.x||n._to!==l.y)&&(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=.001>Math.abs(i)?0:i;let o=tB(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),el(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),eh(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,s=t.map(({datasetIndex:t,index:e})=>{let i=this.chart.getDatasetMeta(t);if(!i)throw Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),n=!p(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),r=this._positionChanged(o,t),a=e||!p(o,n)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,s){let n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));let o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){let{caretX:i,caretY:s,options:n}=this,o=si[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var sf={id:"tooltip",_element:su,positioners:si,afterInit(t,e,i){i&&(t.tooltip=new su({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){let e=t.tooltip;if(e&&e._willRender()){let i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){let 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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>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:sd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function sg(t){let e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class sp extends iu{static id="category";static defaults={ticks:{callback:sg}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let t=this.getLabels();for(let{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){let i,s;if(a(t))return null;let n=this.getLabels();return i=e=isFinite(e)&&n[e]===t?e:function(t,e,i,s){let n=t.indexOf(e);if(-1===n){var o;return o=i,"string"==typeof e?(o=t.push(e)-1,s.unshift({index:o,label:e})):isNaN(e)&&(o=null),o}return n!==t.lastIndexOf(e)?i:n}(n,t,u(e,t),this._addedLabels),s=n.length-1,null===i?null:K(Math.round(i),0,s)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,s=[],n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-!i,1),this._startValue=this.min-.5*!!i;for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return sg.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function sm(t,e,{horizontal:i,minRotation:s}){let n=W(s),o=(i?Math.sin(n):Math.cos(n))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class sx extends iu{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return a(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:s,max:n}=this,o=t=>s=e?s:t,r=t=>n=i?n:t;if(t){let t=F(s),e=F(n);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);r(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){let t,{maxTicksLimit:e,stepSize:i}=this.options.ticks;return i?(t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1)>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3):(t=this.computeTickLimit(),e=e||11),e&&(t=Math.min(e,t)),t}computeTickLimit(){return 1/0}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit(),s=function(t,e){var i,s;let n,o,r,l,h,d=[],{bounds:c,step:u,min:f,max:g,precision:p,count:m,maxTicks:x,maxDigits:b,includeBounds:_}=t,y=u||1,v=x-1,{min:w,max:M}=e,k=!a(f),S=!a(g),D=!a(m),P=(M-w)/(b+1),O=H((M-w)/v/y)*y;if(O<1e-14&&!k&&!S)return[{value:w},{value:M}];(l=Math.ceil(M/O)-Math.floor(w/O))>v&&(O=H(l*O/v/y)*y),a(p)||(O=Math.ceil(O*(n=Math.pow(10,p)))/n),"ticks"===c?(o=Math.floor(w/O)*O,r=Math.ceil(M/O)*O):(o=w,r=M),k&&S&&u&&(i=(g-f)/u,s=O/1e3,(h=Math.round(i))-s<=i&&h+s>=i)?(l=Math.round(Math.min((g-f)/O,x)),O=(g-f)/l,o=f,r=g):D?(o=k?f:o,O=((r=S?g:r)-o)/(l=m-1)):l=B(l=(r-o)/O,Math.round(l),O/1e3)?Math.round(l):Math.ceil(l);let C=Math.max(V(O),V(o));o=Math.round(o*(n=Math.pow(10,a(p)?C:p)))/n,r=Math.round(r*n)/n;let T=0;for(k&&(_&&o!==f?(d.push({value:f}),o<f&&T++,B(Math.round((o+T*O)*n)/n,f,sm(f,P,t))&&T++):o<f&&T++);T<l;++T){let t=Math.round((o+T*O)*n)/n;if(S&&t>g)break;d.push({value:t})}return S&&_&&r!==g?d.length&&B(d[d.length-1].value,g,sm(g,P,t))?d[d.length-1].value=g:d.push({value:g}):S&&r!==g||d.push({value:r}),d}({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);
1return"ticks"===t.bounds&&function(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)isNaN(o=t[s][i])||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return tg(t,this.chart.options.locale,this.options.ticks.format)}}class sb extends sx{static id="linear";static defaults={ticks:{callback:tp.numeric}};determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=d(t)?t:0,this.max=d(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=W(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001;return Math.ceil(e/Math.min(40,this._resolveTickFontOptions(0).lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}tp.logarithmic;tp.numeric;let s_={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}},sy=Object.keys(s_);function sv(t,e){return t-e}function sw(t,e){if(a(e))return null;let i=t._adapter,{parser:s,round:n,isoWeekday:o}=t._parseOpts,r=e;return("function"==typeof s&&(r=s(r)),d(r)||(r="string"==typeof s?i.parse(r,s):i.parse(r)),null===r)?null:(n&&(r="week"===n&&(j(o)||!0===o)?i.startOf(r,"isoWeek",o):i.startOf(r,n)),+r)}function sM(t,e,i,s){let n=sy.length;for(let o=sy.indexOf(t);o<n-1;++o){let t=s_[sy[o]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return sy[o]}return sy[n-1]}function sk(t,e,i){if(i){if(i.length){let{lo:s,hi:n}=G(i,e);t[i[s]>=e?i[s]:i[n]]=!0}}else t[e]=!0}function sS(t,e,i){let s,n,o=[],r={},a=e.length;for(s=0;s<a;++s)r[n=e[s]]=s,o.push({value:n,major:!1});return 0!==a&&i?function(t,e,i,s){let n,o,r=t._adapter,a=+r.startOf(e[0].value,s),l=e[e.length-1].value;for(n=a;n<=l;n=+r.add(n,1,s))(o=i[n])>=0&&(e[o].major=!0);return e}(t,o,r,i):o}(class t extends iu{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){let i=t.time||(t.time={}),s=this._adapter=new eI(t.adapters.date);s.init(e),y(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:sw(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:s,max:n,minDefined:o,maxDefined:r}=this.getUserBounds();function a(t){o||isNaN(t.min)||(s=Math.min(s,t.min)),r||isNaN(t.max)||(n=Math.max(n,t.max))}o&&r||(a(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&a(this.getMinMax(!1))),s=d(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=d(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=1/0,i=-1/0;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let n=this.min,o=function(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}(s,n,this.max);return this._unit=e.unit||(i.autoSkip?sM(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,
1i,s,n){for(let o=sy.length-1;o>=sy.indexOf(i);o--){let i=sy[o];if(s_[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return sy[i?sy.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=sy.indexOf(t)+1,i=sy.length;e<i;++e)if(s_[sy[e]].common)return sy[e]}(this._unit):void 0,this.initOffsets(s),t.reverse&&o.reverse(),sS(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;s=K(s,0,o),n=K(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){let t,e,i=this._adapter,s=this.min,n=this.max,o=this.options,r=o.time,a=r.unit||sM(r.minUnit,s,n,this._getLabelCapacity(s)),l=u(o.ticks.stepSize,1),h="week"===a&&r.isoWeekday,d=j(h)||!0===h,c={},f=s;if(d&&(f=+i.startOf(f,"isoWeek",h)),f=+i.startOf(f,d?"day":a),i.diff(n,s,a)>1e5*l)throw Error(s+" and "+n+" are too far apart with stepSize of "+l+" "+a);let g="data"===o.ticks.source&&this.getDataTimestamps();for(t=f,e=0;t<n;t=+i.add(t,l,a),e++)sk(c,t,g);return(t===n||"ticks"===o.bounds||1===e)&&sk(c,t,g),Object.keys(c).sort(sv).map(t=>+t)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let i=this.options.time.displayFormats,s=this._unit,n=e||i[s];return this._adapter.format(t,n)}_tickFormatFunction(t,e,i,s){let n=this.options,o=n.ticks.callback;if(o)return f(o,[t,e,i],this);let r=n.time.displayFormats,a=this._unit,l=this._majorUnit,h=a&&r[a],d=l&&r[l],c=i[e],u=l&&d&&c&&c.major;return this._adapter.format(t,s||(u?d:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)(s=t[e]).label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,i=this.ctx.measureText(t).width,s=W(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(s),o=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*n+r*o,h:i*o+r*n}}_getLabelCapacity(t){let e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,sS(this,[t],this._majorUnit),s),o=this._getLabelSize(n),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){let t,e,i=this._cache.labels||[];if(i.length)return i;let s=this.getLabels();for(t=0,e=s.length;t<e;++t)i.push(sw(this,s[t]));return this._cache.labels=this._normalized?i:this.normalize(i)}normalize(t){var e;let i;return(i=new Set(e=t.sort(sv))).size===e.length?e:Array.from(i)}}).defaults}}]); 2//# sourceMappingURL=npm.chart.js4.5.1.85d316aaa781c367.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.