1
0
This repository has been archived on 2025-11-01. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
contaminus/backend/target/classes/webroot/assets/chartjs-C6LAl0aW.js

17 lines
133 KiB
JavaScript

var qi=Object.defineProperty;var Gi=(s,t,e)=>t in s?qi(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var k=(s,t,e)=>Gi(s,typeof t!="symbol"?t+"":t,e);/*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
*/function Ut(s){return s+.5|0}const J=(s,t,e)=>Math.max(Math.min(s,e),t);function Lt(s){return J(Ut(s*2.55),0,255)}function et(s){return J(Ut(s*255),0,255)}function Z(s){return J(Ut(s/2.55)/100,0,1)}function es(s){return J(Ut(s*100),0,100)}const W={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ee=[..."0123456789ABCDEF"],Zi=s=>Ee[s&15],Qi=s=>Ee[(s&240)>>4]+Ee[s&15],qt=s=>(s&240)>>4===(s&15),Ji=s=>qt(s.r)&&qt(s.g)&&qt(s.b)&&qt(s.a);function tn(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&W[s[1]]*17,g:255&W[s[2]]*17,b:255&W[s[3]]*17,a:t===5?W[s[4]]*17:255}:(t===7||t===9)&&(e={r:W[s[1]]<<4|W[s[2]],g:W[s[3]]<<4|W[s[4]],b:W[s[5]]<<4|W[s[6]],a:t===9?W[s[7]]<<4|W[s[8]]:255})),e}const en=(s,t)=>s<255?t(s):"";function sn(s){var t=Ji(s)?Zi:Qi;return s?"#"+t(s.r)+t(s.g)+t(s.b)+en(s.a,t):void 0}const nn=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function pi(s,t,e){const i=t*Math.min(e,1-e),n=(o,r=(o+s/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function on(s,t,e){const i=(n,o=(n+s/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function rn(s,t,e){const i=pi(s,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function an(s,t,e,i,n){return s===n?(t-e)/i+(t<e?6:0):t===n?(e-s)/i+2:(s-t)/i+4}function Ve(s){const e=s.r/255,i=s.g/255,n=s.b/255,o=Math.max(e,i,n),r=Math.min(e,i,n),a=(o+r)/2;let c,l,h;return o!==r&&(h=o-r,l=a>.5?h/(2-o-r):h/(o+r),c=an(e,i,n,h,o),c=c*60+.5),[c|0,l||0,a]}function je(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(et)}function He(s,t,e){return je(pi,s,t,e)}function cn(s,t,e){return je(rn,s,t,e)}function ln(s,t,e){return je(on,s,t,e)}function mi(s){return(s%360+360)%360}function hn(s){const t=nn.exec(s);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Lt(+t[5]):et(+t[5]));const n=mi(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=cn(n,o,r):t[1]==="hsv"?i=ln(n,o,r):i=He(n,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function fn(s,t){var e=Ve(s);e[0]=mi(e[0]+t),e=He(e),s.r=e[0],s.g=e[1],s.b=e[2]}function un(s){if(!s)return;const t=Ve(s),e=t[0],i=es(t[1]),n=es(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${Z(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}const ss={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},is={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function dn(){const s={},t=Object.keys(is),e=Object.keys(ss);let i,n,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],n=0;n<e.length;n++)o=e[n],a=a.replace(o,ss[o]);o=parseInt(is[r],16),s[a]=[o>>16&255,o>>8&255,o&255]}return s}let Gt;function gn(s){Gt||(Gt=dn(),Gt.transparent=[0,0,0,0]);const t=Gt[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const pn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function mn(s){const t=pn.exec(s);let e=255,i,n,o;if(t){if(t[7]!==i){const r=+t[7];e=t[8]?Lt(r):J(r*255,0,255)}return i=+t[1],n=+t[3],o=+t[5],i=255&(t[2]?Lt(i):J(i,0,255)),n=255&(t[4]?Lt(n):J(n,0,255)),o=255&(t[6]?Lt(o):J(o,0,255)),{r:i,g:n,b:o,a:e}}}function _n(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${Z(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}const ve=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,bt=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function bn(s,t,e){const i=bt(Z(s.r)),n=bt(Z(s.g)),o=bt(Z(s.b));return{r:et(ve(i+e*(bt(Z(t.r))-i))),g:et(ve(n+e*(bt(Z(t.g))-n))),b:et(ve(o+e*(bt(Z(t.b))-o))),a:s.a+e*(t.a-s.a)}}function Zt(s,t,e){if(s){let i=Ve(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=He(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function _i(s,t){return s&&Object.assign(t||{},s)}function ns(s){var t={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(t={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(t.a=et(s[3]))):(t=_i(s,{r:0,g:0,b:0,a:1}),t.a=et(t.a)),t}function xn(s){return s.charAt(0)==="r"?mn(s):hn(s)}class Bt{constructor(t){if(t instanceof Bt)return t;const e=typeof t;let i;e==="object"?i=ns(t):e==="string"&&(i=tn(t)||gn(t)||xn(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=_i(this._rgb);return t&&(t.a=Z(t.a)),t}set rgb(t){this._rgb=ns(t)}rgbString(){return this._valid?_n(this._rgb):void 0}hexString(){return this._valid?sn(this._rgb):void 0}hslString(){return this._valid?un(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,c=i.a-n.a,l=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-l,i.r=255&l*i.r+o*n.r+.5,i.g=255&l*i.g+o*n.g+.5,i.b=255&l*i.b+o*n.b+.5,i.a=r*i.a+(1-r)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=bn(this._rgb,t._rgb,e)),this}clone(){return new Bt(this.rgb)}alpha(t){return this._rgb.a=et(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ut(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Zt(this._rgb,2,t),this}darken(t){return Zt(this._rgb,2,-t),this}saturate(t){return Zt(this._rgb,1,t),this}desaturate(t){return Zt(this._rgb,1,-t),this}rotate(t){return fn(this._rgb,t),this}}/*!
* Chart.js v4.4.8
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/const yn=(()=>{let s=0;return()=>s++})();function T(s){return s==null}function R(s){if(Array.isArray&&Array.isArray(s))return!0;const t=Object.prototype.toString.call(s);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function S(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function B(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function U(s,t){return B(s)?s:t}function P(s,t){return typeof s>"u"?t:s}const vn=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function E(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function N(s,t,e,i){let n,o,r;if(R(s))for(o=s.length,n=0;n<o;n++)t.call(e,s[n],n);else if(S(s))for(r=Object.keys(s),o=r.length,n=0;n<o;n++)t.call(e,s[r[n]],r[n])}function os(s,t){let e,i,n,o;if(!s||!t||s.length!==t.length)return!1;for(e=0,i=s.length;e<i;++e)if(n=s[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function fe(s){if(R(s))return s.map(fe);if(S(s)){const t=Object.create(null),e=Object.keys(s),i=e.length;let n=0;for(;n<i;++n)t[e[n]]=fe(s[e[n]]);return t}return s}function bi(s){return["__proto__","prototype","constructor"].indexOf(s)===-1}function kn(s,t,e,i){if(!bi(s))return;const n=t[s],o=e[s];S(n)&&S(o)?Vt(n,o,i):t[s]=fe(o)}function Vt(s,t,e){const i=R(t)?t:[t],n=i.length;if(!S(s))return s;e=e||{};const o=e.merger||kn;let r;for(let a=0;a<n;++a){if(r=i[a],!S(r))continue;const c=Object.keys(r);for(let l=0,h=c.length;l<h;++l)o(c[l],s,r,e)}return s}function Ft(s,t){return Vt(s,t,{merger:wn})}function wn(s,t,e){if(!bi(s))return;const i=t[s],n=e[s];S(i)&&S(n)?Ft(i,n):Object.prototype.hasOwnProperty.call(t,s)||(t[s]=fe(n))}const rs={"":s=>s,x:s=>s.x,y:s=>s.y};function Mn(s){const t=s.split("."),e=[];let i="";for(const n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Sn(s){const t=Mn(s);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function ue(s,t){return(rs[t]||(rs[t]=Sn(t)))(s)}function We(s){return s.charAt(0).toUpperCase()+s.slice(1)}const de=s=>typeof s<"u",st=s=>typeof s=="function",as=(s,t)=>{if(s.size!==t.size)return!1;for(const e of s)if(!t.has(e))return!1;return!0};function On(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}const j=Math.PI,q=2*j,Dn=q+j,ge=Number.POSITIVE_INFINITY,Pn=j/180,tt=j/2,ot=j/4,cs=j*2/3,xi=Math.log10,xt=Math.sign;function At(s,t,e){return Math.abs(s-t)<e}function ls(s){const t=Math.round(s);s=At(s,t,s/1e3)?t:s;const e=Math.pow(10,Math.floor(xi(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Tn(s){const t=[],e=Math.sqrt(s);let i;for(i=1;i<e;i++)s%i===0&&(t.push(i),t.push(s/i));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function In(s){return typeof s=="symbol"||typeof s=="object"&&s!==null&&!(Symbol.toPrimitive in s||"toString"in s||"valueOf"in s)}function jt(s){return!In(s)&&!isNaN(parseFloat(s))&&isFinite(s)}function Cn(s,t){const e=Math.round(s);return e-t<=s&&e+t>=s}function Ln(s,t,e){let i,n,o;for(i=0,n=s.length;i<n;i++)o=s[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ft(s){return s*(j/180)}function En(s){return s*(180/j)}function hs(s){if(!B(s))return;let t=1,e=0;for(;Math.round(s*t)/t!==s;)t*=10,e++;return e}function Fn(s,t){const e=t.x-s.x,i=t.y-s.y,n=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*j&&(o+=q),{angle:o,distance:n}}function fs(s,t){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function An(s,t){return(s-t+Dn)%q-j}function K(s){return(s%q+q)%q}function yi(s,t,e,i){const n=K(s),o=K(t),r=K(e),a=K(o-n),c=K(r-n),l=K(n-o),h=K(n-r);return n===o||n===r||i&&o===r||a>c&&l<h}function X(s,t,e){return Math.max(t,Math.min(e,s))}function zn(s){return X(s,-32768,32767)}function vi(s,t,e,i=1e-6){return s>=Math.min(t,e)-i&&s<=Math.max(t,e)+i}function $e(s,t,e){e=e||(r=>s[r]<t);let i=s.length-1,n=0,o;for(;i-n>1;)o=n+i>>1,e(o)?n=o:i=o;return{lo:n,hi:i}}const ut=(s,t,e,i)=>$e(s,e,i?n=>{const o=s[n][t];return o<e||o===e&&s[n+1][t]===e}:n=>s[n][t]<e),Rn=(s,t,e)=>$e(s,e,i=>s[i][t]>=e);function Nn(s,t,e){let i=0,n=s.length;for(;i<n&&s[i]<t;)i++;for(;n>i&&s[n-1]>e;)n--;return i>0||n<s.length?s.slice(i,n):s}const ki=["push","pop","shift","splice","unshift"];function Bn(s,t){if(s._chartjs){s._chartjs.listeners.push(t);return}Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ki.forEach(e=>{const i="_onData"+We(e),n=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return s._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function us(s,t){const e=s._chartjs;if(!e)return;const i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(ki.forEach(o=>{delete s[o]}),delete s._chartjs)}function Vn(s){const t=new Set(s);return t.size===s.length?s:Array.from(t)}const wi=function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame}();function Mi(s,t){let e=[],i=!1;return function(...n){e=n,i||(i=!0,wi.call(window,()=>{i=!1,s.apply(t,e)}))}}function jn(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}const Hn=s=>s==="start"?"left":s==="end"?"right":"center",ds=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2;function Wn(s,t,e){const i=t.length;let n=0,o=i;if(s._sorted){const{iScale:r,vScale:a,_parsed:c}=s,l=s.dataset&&s.dataset.options?s.dataset.options.spanGaps:null,h=r.axis,{min:f,max:u,minDefined:d,maxDefined:m}=r.getUserBounds();if(d){if(n=Math.min(ut(c,h,f).lo,e?i:ut(t,h,r.getPixelForValue(f)).lo),l){const g=c.slice(0,n+1).reverse().findIndex(p=>!T(p[a.axis]));n-=Math.max(0,g)}n=X(n,0,i-1)}if(m){let g=Math.max(ut(c,r.axis,u,!0).hi+1,e?0:ut(t,h,r.getPixelForValue(u),!0).hi+1);if(l){const p=c.slice(g-1).findIndex(_=>!T(_[a.axis]));g+=Math.max(0,p)}o=X(g,n,i)-n}else o=i-n}return{start:n,count:o}}function $n(s){const{xScale:t,yScale:e,_scaleRanges:i}=s,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return s._scaleRanges=n,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,n),o}const Qt=s=>s===0||s===1,gs=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*q/e)),ps=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*q/e)+1,zt={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*tt)+1,easeOutSine:s=>Math.sin(s*tt),easeInOutSine:s=>-.5*(Math.cos(j*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>Qt(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>Qt(s)?s:gs(s,.075,.3),easeOutElastic:s=>Qt(s)?s:ps(s,.075,.3),easeInOutElastic(s){return Qt(s)?s:s<.5?.5*gs(s*2,.1125,.45):.5+.5*ps(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let t=1.70158;return(s/=.5)<1?.5*(s*s*(((t*=1.525)+1)*s-t)):.5*((s-=2)*s*(((t*=1.525)+1)*s+t)+2)},easeInBounce:s=>1-zt.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?zt.easeInBounce(s*2)*.5:zt.easeOutBounce(s*2-1)*.5+.5};function Ue(s){if(s&&typeof s=="object"){const t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ms(s){return Ue(s)?s:new Bt(s)}function ke(s){return Ue(s)?s:new Bt(s).saturate(.5).darken(.1).hexString()}const Un=["x","y","borderWidth","radius","tension"],Yn=["color","borderColor","backgroundColor"];function Kn(s){s.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),s.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),s.set("animations",{colors:{type:"color",properties:Yn},numbers:{type:"number",properties:Un}}),s.describe("animations",{_fallback:"animation"}),s.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Xn(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const _s=new Map;function qn(s,t){t=t||{};const e=s+JSON.stringify(t);let i=_s.get(e);return i||(i=new Intl.NumberFormat(s,t),_s.set(e,i)),i}function Si(s,t,e){return qn(t,e).format(s)}const Gn={values(s){return R(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";const i=this.chart.options.locale;let n,o=s;if(e.length>1){const l=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(l<1e-4||l>1e15)&&(n="scientific"),o=Zn(s,e)}const r=xi(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),Si(s,i,c)}};function Zn(s,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&s!==Math.floor(s)&&(e=s-Math.floor(s)),e}var Oi={formatters:Gn};function Qn(s){s.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:Oi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.route("scale.ticks","color","","color"),s.route("scale.grid","color","","borderColor"),s.route("scale.border","color","","borderColor"),s.route("scale.title","color","","color"),s.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),s.describe("scales",{_fallback:"scale"}),s.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const pt=Object.create(null),Fe=Object.create(null);function Rt(s,t){if(!t)return s;const e=t.split(".");for(let i=0,n=e.length;i<n;++i){const o=e[i];s=s[o]||(s[o]=Object.create(null))}return s}function we(s,t,e){return typeof t=="string"?Vt(Rt(s,t),e):Vt(Rt(s,""),t)}class Jn{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=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,n)=>ke(n.backgroundColor),this.hoverBorderColor=(i,n)=>ke(n.borderColor),this.hoverColor=(i,n)=>ke(n.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 we(this,t,e)}get(t){return Rt(this,t)}describe(t,e){return we(Fe,t,e)}override(t,e){return we(pt,t,e)}route(t,e,i,n){const o=Rt(this,t),r=Rt(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const c=this[a],l=r[n];return S(c)?Object.assign({},l,c):P(c,l)},set(c){this[a]=c}}})}apply(t){t.forEach(e=>e(this))}}var F=new Jn({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Kn,Xn,Qn]);function to(s){return!s||T(s.size)||T(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function bs(s,t,e,i,n){let o=t[n];return o||(o=t[n]=s.measureText(n).width,e.push(n)),o>i&&(i=o),i}function rt(s,t,e){const i=s.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*i)/i+n}function xs(s,t){!t&&!s||(t=t||s.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,s.width,s.height),t.restore())}function eo(s,t,e,i){so(s,t,e,i)}function so(s,t,e,i,n){let o,r,a,c,l,h,f,u;const d=t.pointStyle,m=t.rotation,g=t.radius;let p=(m||0)*Pn;if(d&&typeof d=="object"&&(o=d.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){s.save(),s.translate(e,i),s.rotate(p),s.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),s.restore();return}if(!(isNaN(g)||g<=0)){switch(s.beginPath(),d){default:s.arc(e,i,g,0,q),s.closePath();break;case"triangle":h=g,s.moveTo(e+Math.sin(p)*h,i-Math.cos(p)*g),p+=cs,s.lineTo(e+Math.sin(p)*h,i-Math.cos(p)*g),p+=cs,s.lineTo(e+Math.sin(p)*h,i-Math.cos(p)*g),s.closePath();break;case"rectRounded":l=g*.516,c=g-l,r=Math.cos(p+ot)*c,f=Math.cos(p+ot)*c,a=Math.sin(p+ot)*c,u=Math.sin(p+ot)*c,s.arc(e-f,i-a,l,p-j,p-tt),s.arc(e+u,i-r,l,p-tt,p),s.arc(e+f,i+a,l,p,p+tt),s.arc(e-u,i+r,l,p+tt,p+j),s.closePath();break;case"rect":if(!m){c=Math.SQRT1_2*g,h=c,s.rect(e-h,i-c,2*h,2*c);break}p+=ot;case"rectRot":f=Math.cos(p)*g,r=Math.cos(p)*g,a=Math.sin(p)*g,u=Math.sin(p)*g,s.moveTo(e-f,i-a),s.lineTo(e+u,i-r),s.lineTo(e+f,i+a),s.lineTo(e-u,i+r),s.closePath();break;case"crossRot":p+=ot;case"cross":f=Math.cos(p)*g,r=Math.cos(p)*g,a=Math.sin(p)*g,u=Math.sin(p)*g,s.moveTo(e-f,i-a),s.lineTo(e+f,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r);break;case"star":f=Math.cos(p)*g,r=Math.cos(p)*g,a=Math.sin(p)*g,u=Math.sin(p)*g,s.moveTo(e-f,i-a),s.lineTo(e+f,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r),p+=ot,f=Math.cos(p)*g,r=Math.cos(p)*g,a=Math.sin(p)*g,u=Math.sin(p)*g,s.moveTo(e-f,i-a),s.lineTo(e+f,i+a),s.moveTo(e+u,i-r),s.lineTo(e-u,i+r);break;case"line":r=Math.cos(p)*g,a=Math.sin(p)*g,s.moveTo(e-r,i-a),s.lineTo(e+r,i+a);break;case"dash":s.moveTo(e,i),s.lineTo(e+Math.cos(p)*g,i+Math.sin(p)*g);break;case!1:s.closePath();break}s.fill(),t.borderWidth>0&&s.stroke()}}function Ht(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.x<t.right+e&&s.y>t.top-e&&s.y<t.bottom+e}function Ye(s,t){s.save(),s.beginPath(),s.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),s.clip()}function Ke(s){s.restore()}function io(s,t,e,i,n){if(!t)return s.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;s.lineTo(o,t.y),s.lineTo(o,e.y)}else n==="after"!=!!i?s.lineTo(t.x,e.y):s.lineTo(e.x,t.y);s.lineTo(e.x,e.y)}function no(s,t,e,i){if(!t)return s.lineTo(e.x,e.y);s.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function oo(s,t){t.translation&&s.translate(t.translation[0],t.translation[1]),T(t.rotation)||s.rotate(t.rotation),t.color&&(s.fillStyle=t.color),t.textAlign&&(s.textAlign=t.textAlign),t.textBaseline&&(s.textBaseline=t.textBaseline)}function ro(s,t,e,i,n){if(n.strikethrough||n.underline){const o=s.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,c=e-o.actualBoundingBoxAscent,l=e+o.actualBoundingBoxDescent,h=n.strikethrough?(c+l)/2:l;s.strokeStyle=s.fillStyle,s.beginPath(),s.lineWidth=n.decorationWidth||2,s.moveTo(r,h),s.lineTo(a,h),s.stroke()}}function ao(s,t){const e=s.fillStyle;s.fillStyle=t.color,s.fillRect(t.left,t.top,t.width,t.height),s.fillStyle=e}function ys(s,t,e,i,n,o={}){const r=R(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let c,l;for(s.save(),s.font=n.string,oo(s,o),c=0;c<r.length;++c)l=r[c],o.backdrop&&ao(s,o.backdrop),a&&(o.strokeColor&&(s.strokeStyle=o.strokeColor),T(o.strokeWidth)||(s.lineWidth=o.strokeWidth),s.strokeText(l,e,i,o.maxWidth)),s.fillText(l,e,i,o.maxWidth),ro(s,e,i,l,o),i+=Number(n.lineHeight);s.restore()}const co=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,lo=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ho(s,t){const e=(""+s).match(co);if(!e||e[1]==="normal")return t*1.2;switch(s=+e[2],e[3]){case"px":return s;case"%":s/=100;break}return t*s}const fo=s=>+s||0;function uo(s,t){const e={},i=S(t),n=i?Object.keys(t):t,o=S(s)?i?r=>P(s[r],s[t[r]]):r=>s[r]:()=>s;for(const r of n)e[r]=fo(o(r));return e}function go(s){return uo(s,{top:"y",right:"x",bottom:"y",left:"x"})}function Wt(s){const t=go(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ae(s,t){s=s||{},t=t||F.font;let e=P(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=P(s.style,t.style);i&&!(""+i).match(lo)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const n={family:P(s.family,t.family),lineHeight:ho(P(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:P(s.weight,t.weight),string:""};return n.string=to(n),n}function Jt(s,t,e,i){let n,o,r;for(n=0,o=s.length;n<o;++n)if(r=s[n],r!==void 0&&r!==void 0)return r}function po(s,t,e){const{min:i,max:n}=s,o=vn(t,(n-i)/2),r=(a,c)=>e&&a===0?0:a+c;return{min:r(i,-Math.abs(o)),max:r(n,o)}}function wt(s,t){return Object.assign(Object.create(s),t)}function Xe(s,t=[""],e,i,n=()=>s[0]){const o=e||s;typeof i>"u"&&(i=Ii("_fallback",s));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:o,_fallback:i,_getTarget:n,override:a=>Xe([a,...s],t,o,i)};return new Proxy(r,{deleteProperty(a,c){return delete a[c],delete a._keys,delete s[0][c],!0},get(a,c){return Pi(a,c,()=>wo(c,t,s,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(a,c){return ks(a).includes(c)},ownKeys(a){return ks(a)},set(a,c,l){const h=a._storage||(a._storage=n());return a[c]=h[c]=l,delete a._keys,!0}})}function yt(s,t,e,i){const n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:Di(s,i),setContext:o=>yt(s,o,e,i),override:o=>yt(s.override(o),t,e,i)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete s[r],!0},get(o,r,a){return Pi(o,r,()=>_o(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(s,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,r)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(o,r){return Reflect.has(s,r)},ownKeys(){return Reflect.ownKeys(s)},set(o,r,a){return s[r]=a,delete o[r],!0}})}function Di(s,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=s;return{allKeys:n,scriptable:e,indexable:i,isScriptable:st(e)?e:()=>e,isIndexable:st(i)?i:()=>i}}const mo=(s,t)=>s?s+We(t):t,qe=(s,t)=>S(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Pi(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t)||t==="constructor")return s[t];const i=e();return s[t]=i,i}function _o(s,t,e){const{_proxy:i,_context:n,_subProxy:o,_descriptors:r}=s;let a=i[t];return st(a)&&r.isScriptable(t)&&(a=bo(t,a,s,e)),R(a)&&a.length&&(a=xo(t,a,s,r.isIndexable)),qe(t,a)&&(a=yt(a,n,o&&o[t],r)),a}function bo(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);a.add(s);let c=t(o,r||i);return a.delete(s),qe(s,c)&&(c=Ge(n._scopes,n,s,c)),c}function xo(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(s))return t[o.index%t.length];if(S(t[0])){const c=t,l=n._scopes.filter(h=>h!==c);t=[];for(const h of c){const f=Ge(l,n,s,h);t.push(yt(f,o,r&&r[s],a))}}return t}function Ti(s,t,e){return st(s)?s(t,e):s}const yo=(s,t)=>s===!0?t:typeof s=="string"?ue(t,s):void 0;function vo(s,t,e,i,n){for(const o of t){const r=yo(e,o);if(r){s.add(r);const a=Ti(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function Ge(s,t,e,i){const n=t._rootScopes,o=Ti(t._fallback,e,i),r=[...s,...n],a=new Set;a.add(i);let c=vs(a,r,e,o||e,i);return c===null||typeof o<"u"&&o!==e&&(c=vs(a,r,o,c,i),c===null)?!1:Xe(Array.from(a),[""],n,o,()=>ko(t,e,i))}function vs(s,t,e,i,n){for(;e;)e=vo(s,t,e,i,n);return e}function ko(s,t,e){const i=s._getTarget();t in i||(i[t]={});const n=i[t];return R(n)&&S(e)?e:n||{}}function wo(s,t,e,i){let n;for(const o of t)if(n=Ii(mo(o,s),e),typeof n<"u")return qe(s,n)?Ge(e,i,s,n):n}function Ii(s,t){for(const e of t){if(!e)continue;const i=e[s];if(typeof i<"u")return i}}function ks(s){let t=s._keys;return t||(t=s._keys=Mo(s._scopes)),t}function Mo(s){const t=new Set;for(const e of s)for(const i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}const So=Number.EPSILON||1e-14,vt=(s,t)=>t<s.length&&!s[t].skip&&s[t],Ci=s=>s==="x"?"y":"x";function Oo(s,t,e,i){const n=s.skip?t:s,o=t,r=e.skip?t:e,a=fs(o,n),c=fs(r,o);let l=a/(a+c),h=c/(a+c);l=isNaN(l)?0:l,h=isNaN(h)?0:h;const f=i*l,u=i*h;return{previous:{x:o.x-f*(r.x-n.x),y:o.y-f*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function Do(s,t,e){const i=s.length;let n,o,r,a,c,l=vt(s,0);for(let h=0;h<i-1;++h)if(c=l,l=vt(s,h+1),!(!c||!l)){if(At(t[h],0,So)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=n*r*t[h],e[h+1]=o*r*t[h])}}function Po(s,t,e="x"){const i=Ci(e),n=s.length;let o,r,a,c=vt(s,0);for(let l=0;l<n;++l){if(r=a,a=c,c=vt(s,l+1),!a)continue;const h=a[e],f=a[i];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${i}`]=f-o*t[l]),c&&(o=(c[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${i}`]=f+o*t[l])}}function To(s,t="x"){const e=Ci(t),i=s.length,n=Array(i).fill(0),o=Array(i);let r,a,c,l=vt(s,0);for(r=0;r<i;++r)if(a=c,c=l,l=vt(s,r+1),!!c){if(l){const h=l[t]-c[t];n[r]=h!==0?(l[e]-c[e])/h:0}o[r]=a?l?xt(n[r-1])!==xt(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}Do(s,n,o),Po(s,o,t)}function te(s,t,e){return Math.max(Math.min(s,e),t)}function Io(s,t){let e,i,n,o,r,a=Ht(s[0],t);for(e=0,i=s.length;e<i;++e)r=o,o=a,a=e<i-1&&Ht(s[e+1],t),o&&(n=s[e],r&&(n.cp1x=te(n.cp1x,t.left,t.right),n.cp1y=te(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=te(n.cp2x,t.left,t.right),n.cp2y=te(n.cp2y,t.top,t.bottom)))}function Co(s,t,e,i,n){let o,r,a,c;if(t.spanGaps&&(s=s.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")To(s,n);else{let l=i?s[s.length-1]:s[0];for(o=0,r=s.length;o<r;++o)a=s[o],c=Oo(l,a,s[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,l=a}t.capBezierPoints&&Io(s,e)}function Ze(){return typeof window<"u"&&typeof document<"u"}function Qe(s){let t=s.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function pe(s,t,e){let i;return typeof s=="string"?(i=parseInt(s,10),s.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=s,i}const be=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function Lo(s,t){return be(s).getPropertyValue(t)}const Eo=["top","right","bottom","left"];function gt(s,t,e){const i={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Eo[n];i[o]=parseFloat(s[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Fo=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function Ao(s,t){const e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:o}=i;let r=!1,a,c;if(Fo(n,o,s.target))a=n,c=o;else{const l=t.getBoundingClientRect();a=i.clientX-l.left,c=i.clientY-l.top,r=!0}return{x:a,y:c,box:r}}function ct(s,t){if("native"in s)return s;const{canvas:e,currentDevicePixelRatio:i}=t,n=be(e),o=n.boxSizing==="border-box",r=gt(n,"padding"),a=gt(n,"border","width"),{x:c,y:l,box:h}=Ao(s,e),f=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:d,height:m}=t;return o&&(d-=r.width+a.width,m-=r.height+a.height),{x:Math.round((c-f)/d*e.width/i),y:Math.round((l-u)/m*e.height/i)}}function zo(s,t,e){let i,n;if(t===void 0||e===void 0){const o=s&&Qe(s);if(!o)t=s.clientWidth,e=s.clientHeight;else{const r=o.getBoundingClientRect(),a=be(o),c=gt(a,"border","width"),l=gt(a,"padding");t=r.width-l.width-c.width,e=r.height-l.height-c.height,i=pe(a.maxWidth,o,"clientWidth"),n=pe(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||ge,maxHeight:n||ge}}const ee=s=>Math.round(s*10)/10;function Ro(s,t,e,i){const n=be(s),o=gt(n,"margin"),r=pe(n.maxWidth,s,"clientWidth")||ge,a=pe(n.maxHeight,s,"clientHeight")||ge,c=zo(s,t,e);let{width:l,height:h}=c;if(n.boxSizing==="content-box"){const u=gt(n,"border","width"),d=gt(n,"padding");l-=d.width+u.width,h-=d.height+u.height}return l=Math.max(0,l-o.width),h=Math.max(0,i?l/i:h-o.height),l=ee(Math.min(l,r,c.maxWidth)),h=ee(Math.min(h,a,c.maxHeight)),l&&!h&&(h=ee(l/2)),(t!==void 0||e!==void 0)&&i&&c.height&&h>c.height&&(h=c.height,l=ee(Math.floor(h*i))),{width:l,height:h}}function ws(s,t,e){const i=t||1,n=Math.floor(s.height*i),o=Math.floor(s.width*i);s.height=Math.floor(s.height),s.width=Math.floor(s.width);const r=s.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${s.height}px`,r.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||r.height!==n||r.width!==o?(s.currentDevicePixelRatio=i,r.height=n,r.width=o,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}const No=function(){let s=!1;try{const t={get passive(){return s=!0,!1}};Ze()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return s}();function Ms(s,t){const e=Lo(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function lt(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:s.y+e*(t.y-s.y)}}function Bo(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:i==="middle"?e<.5?s.y:t.y:i==="after"?e<1?s.y:t.y:e>0?t.y:s.y}}function Vo(s,t,e,i){const n={x:s.cp2x,y:s.cp2y},o={x:t.cp1x,y:t.cp1y},r=lt(s,n,e),a=lt(n,o,e),c=lt(o,t,e),l=lt(r,a,e),h=lt(a,c,e);return lt(l,h,e)}function Li(s){return s==="angle"?{between:yi,compare:An,normalize:K}:{between:vi,compare:(t,e)=>t-e,normalize:t=>t}}function Ss({start:s,end:t,count:e,loop:i,style:n}){return{start:s%e,end:t%e,loop:i&&(t-s+1)%e===0,style:n}}function jo(s,t,e){const{property:i,start:n,end:o}=e,{between:r,normalize:a}=Li(i),c=t.length;let{start:l,end:h,loop:f}=s,u,d;if(f){for(l+=c,h+=c,u=0,d=c;u<d&&r(a(t[l%c][i]),n,o);++u)l--,h--;l%=c,h%=c}return h<l&&(h+=c),{start:l,end:h,loop:f,style:s.style}}function Ei(s,t,e){if(!e)return[s];const{property:i,start:n,end:o}=e,r=t.length,{compare:a,between:c,normalize:l}=Li(i),{start:h,end:f,loop:u,style:d}=jo(s,t,e),m=[];let g=!1,p=null,_,x,O;const D=()=>c(n,O,_)&&a(n,O)!==0,b=()=>a(o,_)===0||c(o,O,_),w=()=>g||D(),y=()=>!g||b();for(let v=h,M=h;v<=f;++v)x=t[v%r],!x.skip&&(_=l(x[i]),_!==O&&(g=c(_,n,o),p===null&&w()&&(p=a(_,n)===0?v:M),p!==null&&y()&&(m.push(Ss({start:p,end:v,loop:u,count:r,style:d})),p=null),M=v,O=_));return p!==null&&m.push(Ss({start:p,end:f,loop:u,count:r,style:d})),m}function Fi(s,t){const e=[],i=s.segments;for(let n=0;n<i.length;n++){const o=Ei(i[n],s.points,t);o.length&&e.push(...o)}return e}function Ho(s,t,e,i){let n=0,o=t-1;if(e&&!i)for(;n<t&&!s[n].skip;)n++;for(;n<t&&s[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&s[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Wo(s,t,e,i){const n=s.length,o=[];let r=t,a=s[t],c;for(c=t+1;c<=e;++c){const l=s[c%n];l.skip||l.stop?a.skip||(i=!1,o.push({start:t%n,end:(c-1)%n,loop:i}),t=r=l.stop?c:null):(r=c,a.skip&&(t=c)),a=l}return r!==null&&o.push({start:t%n,end:r%n,loop:i}),o}function $o(s,t){const e=s.points,i=s.options.spanGaps,n=e.length;if(!n)return[];const o=!!s._loop,{start:r,end:a}=Ho(e,n,o,i);if(i===!0)return Os(s,[{start:r,end:a,loop:o}],e,t);const c=a<r?a+n:a,l=!!s._fullLoop&&r===0&&a===n-1;return Os(s,Wo(e,r,c,l),e,t)}function Os(s,t,e,i){return!i||!i.setContext||!e?t:Uo(s,t,e,i)}function Uo(s,t,e,i){const n=s._chart.getContext(),o=Ds(s.options),{_datasetIndex:r,options:{spanGaps:a}}=s,c=e.length,l=[];let h=o,f=t[0].start,u=f;function d(m,g,p,_){const x=a?-1:1;if(m!==g){for(m+=c;e[m%c].skip;)m-=x;for(;e[g%c].skip;)g+=x;m%c!==g%c&&(l.push({start:m%c,end:g%c,loop:p,style:_}),h=_,f=g%c)}}for(const m of t){f=a?f:m.start;let g=e[f%c],p;for(u=f+1;u<=m.end;u++){const _=e[u%c];p=Ds(i.setContext(wt(n,{type:"segment",p0:g,p1:_,p0DataIndex:(u-1)%c,p1DataIndex:u%c,datasetIndex:r}))),Yo(p,h)&&d(f,u-1,m.loop,h),g=_,h=p}f<u-1&&d(f,u-1,m.loop,h)}return l}function Ds(s){return{backgroundColor:s.backgroundColor,borderCapStyle:s.borderCapStyle,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderJoinStyle:s.borderJoinStyle,borderWidth:s.borderWidth,borderColor:s.borderColor}}function Yo(s,t){if(!t)return!1;const e=[],i=function(n,o){return Ue(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(s,i)!==JSON.stringify(t,i)}/*!
* Chart.js v4.4.8
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/class Ko{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=wi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,c;for(;r>=0;--r)c=o[r],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let 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){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var G=new Ko;const Ps="transparent",Xo={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const i=ms(s||Ps),n=i.valid&&ms(t||Ps);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class qo{constructor(t,e,i,n){const o=e[i];n=Jt([t.to,n,o,t.from]);const r=Jt([t.from,o,n]);this._active=!0,this._fn=t.fn||Xo[t.type||typeof r],this._easing=zt[t.easing]||zt.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=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Jt([t.to,e,n,t.from]),this._from=Jt([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let c;if(this._active=o!==a&&(r||e<i),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}c=e/i%2,c=r&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[n]=this._fn(o,a,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}class Go{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!S(t))return;const e=Object.keys(F.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!S(o))return;const r={};for(const a of e)r[a]=o[a];(R(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){const i=e.options,n=Qo(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&Zo(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let c;for(c=r.length-1;c>=0;--c){const l=r[c];if(l.charAt(0)==="$")continue;if(l==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[l];let f=o[l];const u=i.get(l);if(f)if(u&&f.active()){f.update(u,h,a);continue}else f.cancel();if(!u||!u.duration){t[l]=h;continue}o[l]=f=new qo(u,t,l,h),n.push(f)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return G.add(this._chart,i),!0}}function Zo(s,t){const e=[],i=Object.keys(t);for(let n=0;n<i.length;n++){const o=s[i[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Qo(s,t){if(!t)return;let e=s.options;if(!e){s.options=t;return}return e.$shared&&(s.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Ts(s,t){const e=s&&s.options||{},i=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:n,end:i?n:o}}function Jo(s,t,e){if(e===!1)return!1;const i=Ts(s,e),n=Ts(t,e);return{top:n.end,right:i.end,bottom:n.start,left:i.start}}function tr(s){let t,e,i,n;return S(s)?(t=s.top,e=s.right,i=s.bottom,n=s.left):t=e=i=n=s,{top:t,right:e,bottom:i,left:n,disabled:s===!1}}function Ai(s,t){const e=[],i=s._getSortedDatasetMetas(t);let n,o;for(n=0,o=i.length;n<o;++n)e.push(i[n].index);return e}function Is(s,t,e,i={}){const n=s.keys,o=i.mode==="single";let r,a,c,l;if(t===null)return;let h=!1;for(r=0,a=n.length;r<a;++r){if(c=+n[r],c===e){if(h=!0,i.all)continue;break}l=s.values[c],B(l)&&(o||t===0||xt(t)===xt(l))&&(t+=l)}return!h&&!i.all?0:t}function er(s,t){const{iScale:e,vScale:i}=t,n=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(s),a=new Array(r.length);let c,l,h;for(c=0,l=r.length;c<l;++c)h=r[c],a[c]={[n]:h,[o]:s[h]};return a}function Me(s,t){const e=s&&s.options.stacked;return e||e===void 0&&t.stack!==void 0}function sr(s,t,e){return`${s.id}.${t.id}.${e.stack||e.type}`}function ir(s){const{min:t,max:e,minDefined:i,maxDefined:n}=s.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function nr(s,t,e){const i=s[t]||(s[t]={});return i[e]||(i[e]={})}function Cs(s,t,e,i){for(const n of t.getMatchingVisibleMetas(i).reverse()){const o=s[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Ls(s,t){const{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,c=o.axis,l=r.axis,h=sr(o,r,i),f=t.length;let u;for(let d=0;d<f;++d){const m=t[d],{[c]:g,[l]:p}=m,_=m._stacks||(m._stacks={});u=_[l]=nr(n,h,g),u[a]=p,u._top=Cs(u,r,!0,i.type),u._bottom=Cs(u,r,!1,i.type);const x=u._visualValues||(u._visualValues={});x[a]=p}}function Se(s,t){const e=s.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function or(s,t){return wt(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function rr(s,t,e){return wt(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Dt(s,t){const e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(const n of t){const o=n._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const Oe=s=>s==="reset"||s==="none",Es=(s,t)=>t?s:Object.assign({},s),ar=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:Ai(e,!0),values:null};class Nt{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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Me(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&&Dt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(f,u,d,m)=>f==="x"?u:f==="r"?m:d,o=e.xAxisID=P(i.xAxisID,Se(t,"x")),r=e.yAxisID=P(i.yAxisID,Se(t,"y")),a=e.rAxisID=P(i.rAxisID,Se(t,"r")),c=e.indexAxis,l=e.iAxisID=n(c,o,r,a),h=e.vAxisID=n(c,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),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){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&us(this._data,this),t._stacked&&Dt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(S(e)){const n=this._cachedMeta;this._data=er(e,n)}else if(i!==e){if(i){us(i,this);const n=this._cachedMeta;Dt(n),n._parsed=[]}e&&Object.isExtensible(e)&&Bn(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Me(e.vScale,e),e.stack!==i.stack&&(n=!0,Dt(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&(Ls(this,e._parsed),e._stacked=Me(e.vScale,e))}configure(){const 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){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:r}=i,a=o.axis;let c=t===0&&e===n.length?!0:i._sorted,l=t>0&&i._parsed[t-1],h,f,u;if(this._parsing===!1)i._parsed=n,i._sorted=!0,u=n;else{R(n[t])?u=this.parseArrayData(i,n,t,e):S(n[t])?u=this.parseObjectData(i,n,t,e):u=this.parsePrimitiveData(i,n,t,e);const d=()=>f[a]===null||l&&f[a]<l[a];for(h=0;h<e;++h)i._parsed[h+t]=f=u[h],c&&(d()&&(c=!1),l=f);i._sorted=c}r&&Ls(this,u)}parsePrimitiveData(t,e,i,n){const{iScale:o,vScale:r}=t,a=o.axis,c=r.axis,l=o.getLabels(),h=o===r,f=new Array(n);let u,d,m;for(u=0,d=n;u<d;++u)m=u+i,f[u]={[a]:h||o.parse(l[m],m),[c]:r.parse(e[m],m)};return f}parseArrayData(t,e,i,n){const{xScale:o,yScale:r}=t,a=new Array(n);let c,l,h,f;for(c=0,l=n;c<l;++c)h=c+i,f=e[h],a[c]={x:o.parse(f[0],h),y:r.parse(f[1],h)};return a}parseObjectData(t,e,i,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=new Array(n);let h,f,u,d;for(h=0,f=n;h<f;++h)u=h+i,d=e[u],l[h]={x:o.parse(ue(d,a),u),y:r.parse(ue(d,c),u)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Ai(n,!0),values:e._stacks[t.axis]._visualValues};return Is(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const o=i[e.axis];let r=o===null?NaN:o;const a=n&&i._stacks[e.axis];n&&a&&(n.values=a,r=Is(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&t===i.iScale,r=n.length,a=this._getOtherScale(t),c=ar(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:f}=ir(a);let u,d;function m(){d=n[u];const g=d[a.axis];return!B(d[t.axis])||h>g||f<g}for(u=0;u<r&&!(!m()&&(this.updateRangeFromParsed(l,t,d,c),o));++u);if(o){for(u=r-1;u>=0;--u)if(!m()){this.updateRangeFromParsed(l,t,d,c);break}}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],B(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=tr(P(this.options.clip,Jo(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,c=this._drawCount||n.length-a,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,a,c),h=a;h<a+c;++h){const f=n[h];f.hidden||(f.active&&l?r.push(f):f.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=rr(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=or(this.chart.getContext(),this.index)),o.dataset=n,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){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],c=this.enableOptionSharing&&de(i);if(a)return Es(a,c);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),f=n?[`${t}Hover`,"hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),h),d=Object.keys(F.elements[t]),m=()=>this.getContext(i,n,e),g=l.resolveNamedOptions(u,d,m,f);return g.$shared&&(g.$shared=c,o[r]=Object.freeze(Es(g,c))),g}_resolveAnimations(t,e,i){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let c;if(n.options.animation!==!1){const h=this.chart.config,f=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),f);c=h.createResolver(u,this.getContext(t,i,e))}const l=new Go(n,c&&c.animations);return c&&c._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||Oe(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,n){Oe(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Oe(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,c,l]of this._syncList)this[a](c,l);this._syncList=[];const n=i.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,i=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const c=l=>{for(l.length+=e,a=l.length-1;a>=r;a--)l[a]=l[a-e]};for(c(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&c(n._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&Dt(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}k(Nt,"defaults",{}),k(Nt,"datasetElementType",null),k(Nt,"dataElementType",null);class De extends Nt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:c}=Wn(e,n,r);this._drawStart=a,this._drawCount=c,$n(e)&&(a=0,c=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(n,a,c,t)}updateElements(t,e,i,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,n),u=r.axis,d=a.axis,{spanGaps:m,segment:g}=this.options,p=jt(m)?m:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||n==="none",x=e+i,O=t.length;let D=e>0&&this.getParsed(e-1);for(let b=0;b<O;++b){const w=t[b],y=_?w:{};if(b<e||b>=x){y.skip=!0;continue}const v=this.getParsed(b),M=T(v[d]),I=y[u]=r.getPixelForValue(v[u],b),C=y[d]=o||M?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,v,c):v[d],b);y.skip=isNaN(I)||isNaN(C)||M,y.stop=b>0&&Math.abs(v[u]-D[u])>p,g&&(y.parsed=v,y.raw=l.data[b]),f&&(y.options=h||this.resolveDataElementOptions(b,w.active?"active":n)),_||this.updateElement(w,b,y,n),D=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}k(De,"id","line"),k(De,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),k(De,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function at(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Je{constructor(t){k(this,"options");this.options=t||{}}static override(t){Object.assign(Je.prototype,t)}init(){}formats(){return at()}parse(){return at()}format(){return at()}add(){return at()}diff(){return at()}startOf(){return at()}endOf(){return at()}}var cr={_date:Je};function lr(s,t,e,i){const{controller:n,data:o,_sorted:r}=s,a=n._cachedMeta.iScale,c=s.dataset&&s.dataset.options?s.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Rn:ut;if(i){if(n._sharedOptions){const h=o[0],f=typeof h.getRange=="function"&&h.getRange(t);if(f){const u=l(o,t,e-f),d=l(o,t,e+f);return{lo:u.lo,hi:d.hi}}}}else{const h=l(o,t,e);if(c){const{vScale:f}=n._cachedMeta,{_parsed:u}=s,d=u.slice(0,h.lo+1).reverse().findIndex(g=>!T(g[f.axis]));h.lo-=Math.max(0,d);const m=u.slice(h.hi).findIndex(g=>!T(g[f.axis]));h.hi+=Math.max(0,m)}return h}}return{lo:0,hi:o.length-1}}function xe(s,t,e,i,n){const o=s.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,c=o.length;a<c;++a){const{index:l,data:h}=o[a],{lo:f,hi:u}=lr(o[a],t,r,n);for(let d=f;d<=u;++d){const m=h[d];m.skip||i(m,l,d)}}}function hr(s){const t=s.indexOf("x")!==-1,e=s.indexOf("y")!==-1;return function(i,n){const o=t?Math.abs(i.x-n.x):0,r=e?Math.abs(i.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Pe(s,t,e,i,n){const o=[];return!n&&!s.isPointInArea(t)||xe(s,e,t,function(a,c,l){!n&&!Ht(a,s.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:c,index:l})},!0),o}function fr(s,t,e,i){let n=[];function o(r,a,c){const{startAngle:l,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:f}=Fn(r,{x:t.x,y:t.y});yi(f,l,h)&&n.push({element:r,datasetIndex:a,index:c})}return xe(s,e,t,o),n}function ur(s,t,e,i,n,o){let r=[];const a=hr(e);let c=Number.POSITIVE_INFINITY;function l(h,f,u){const d=h.inRange(t.x,t.y,n);if(i&&!d)return;const m=h.getCenterPoint(n);if(!(!!o||s.isPointInArea(m))&&!d)return;const p=a(t,m);p<c?(r=[{element:h,datasetIndex:f,index:u}],c=p):p===c&&r.push({element:h,datasetIndex:f,index:u})}return xe(s,e,t,l),r}function Te(s,t,e,i,n,o){return!o&&!s.isPointInArea(t)?[]:e==="r"&&!i?fr(s,t,e,n):ur(s,t,e,i,n,o)}function Fs(s,t,e,i,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return xe(s,e,t,(c,l,h)=>{c[r]&&c[r](t[e],n)&&(o.push({element:c,datasetIndex:l,index:h}),a=a||c.inRange(t.x,t.y,n))}),i&&!a?[]:o}var dr={modes:{index(s,t,e,i){const n=ct(t,s),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Pe(s,n,o,i,r):Te(s,n,o,!1,i,r),c=[];return a.length?(s.getSortedVisibleDatasetMetas().forEach(l=>{const h=a[0].index,f=l.data[h];f&&!f.skip&&c.push({element:f,datasetIndex:l.index,index:h})}),c):[]},dataset(s,t,e,i){const n=ct(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Pe(s,n,o,i,r):Te(s,n,o,!1,i,r);if(a.length>0){const c=a[0].datasetIndex,l=s.getDatasetMeta(c).data;a=[];for(let h=0;h<l.length;++h)a.push({element:l[h],datasetIndex:c,index:h})}return a},point(s,t,e,i){const n=ct(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;return Pe(s,n,o,i,r)},nearest(s,t,e,i){const n=ct(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;return Te(s,n,o,e.intersect,i,r)},x(s,t,e,i){const n=ct(t,s);return Fs(s,n,"x",e.intersect,i)},y(s,t,e,i){const n=ct(t,s);return Fs(s,n,"y",e.intersect,i)}}};const zi=["left","top","right","bottom"];function Pt(s,t){return s.filter(e=>e.pos===t)}function As(s,t){return s.filter(e=>zi.indexOf(e.pos)===-1&&e.box.axis===t)}function Tt(s,t){return s.sort((e,i)=>{const n=t?i:e,o=t?e:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function gr(s){const t=[];let e,i,n,o,r,a;for(e=0,i=(s||[]).length;e<i;++e)n=s[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function pr(s){const t={};for(const e of s){const{stack:i,pos:n,stackWeight:o}=e;if(!i||!zi.includes(n))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function mr(s,t){const e=pr(s),{vBoxMaxWidth:i,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=s.length;o<r;++o){a=s[o];const{fullSize:c}=a.box,l=e[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*i:c&&t.availableWidth,a.height=n):(a.width=i,a.height=h?h*n:c&&t.availableHeight)}return e}function _r(s){const t=gr(s),e=Tt(t.filter(l=>l.box.fullSize),!0),i=Tt(Pt(t,"left"),!0),n=Tt(Pt(t,"right")),o=Tt(Pt(t,"top"),!0),r=Tt(Pt(t,"bottom")),a=As(t,"x"),c=As(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:n.concat(c).concat(r).concat(a),chartArea:Pt(t,"chartArea"),vertical:i.concat(n).concat(c),horizontal:o.concat(r).concat(a)}}function zs(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function Ri(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function br(s,t,e,i){const{pos:n,box:o}=e,r=s.maxPadding;if(!S(n)){e.size&&(s[n]-=e.size);const f=i[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?o.height:o.width),e.size=f.size/f.count,s[n]+=e.size}o.getPadding&&Ri(r,o.getPadding());const a=Math.max(0,t.outerWidth-zs(r,s,"left","right")),c=Math.max(0,t.outerHeight-zs(r,s,"top","bottom")),l=a!==s.w,h=c!==s.h;return s.w=a,s.h=c,e.horizontal?{same:l,other:h}:{same:h,other:l}}function xr(s){const t=s.maxPadding;function e(i){const n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function yr(s,t){const e=t.maxPadding;function i(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return i(s?["left","right"]:["top","bottom"])}function Et(s,t,e,i){const n=[];let o,r,a,c,l,h;for(o=0,r=s.length,l=0;o<r;++o){a=s[o],c=a.box,c.update(a.width||t.w,a.height||t.h,yr(a.horizontal,t));const{same:f,other:u}=br(t,e,a,i);l|=f&&n.length,h=h||u,c.fullSize||n.push(a)}return l&&Et(n,t,e,i)||h}function se(s,t,e,i,n){s.top=e,s.left=t,s.right=t+i,s.bottom=e+n,s.width=i,s.height=n}function Rs(s,t,e,i){const n=e.padding;let{x:o,y:r}=t;for(const a of s){const c=a.box,l=i[a.stack]||{placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){const f=t.w*h,u=l.size||c.height;de(l.start)&&(r=l.start),c.fullSize?se(c,n.left,r,e.outerWidth-n.right-n.left,u):se(c,t.left+l.placed,r,f,u),l.start=r,l.placed+=f,r=c.bottom}else{const f=t.h*h,u=l.size||c.width;de(l.start)&&(o=l.start),c.fullSize?se(c,o,n.top,u,e.outerHeight-n.bottom-n.top):se(c,o,t.top+l.placed,u,f),l.start=o,l.placed+=f,o=c.right}}t.x=o,t.y=r}var ie={addBox(s,t){s.boxes||(s.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},s.boxes.push(t)},removeBox(s,t){const e=s.boxes?s.boxes.indexOf(t):-1;e!==-1&&s.boxes.splice(e,1)},configure(s,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(s,t,e,i){if(!s)return;const n=Wt(s.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=_r(s.boxes),c=a.vertical,l=a.horizontal;N(s.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=c.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Ri(u,Wt(i));const d=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),m=mr(c.concat(l),f);Et(a.fullSize,d,f,m),Et(c,d,f,m),Et(l,d,f,m)&&Et(c,d,f,m),xr(d),Rs(a.leftAndTop,d,f,m),d.x+=d.w,d.y+=d.h,Rs(a.rightAndBottom,d,f,m),s.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},N(a.chartArea,g=>{const p=g.box;Object.assign(p,s.chartArea),p.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})})}};class Ni{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class vr extends Ni{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const le="$chartjs",kr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ns=s=>s===null||s==="";function wr(s,t){const e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[le]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ns(n)){const o=Ms(s,"width");o!==void 0&&(s.width=o)}if(Ns(i))if(s.style.height==="")s.height=s.width/(t||2);else{const o=Ms(s,"height");o!==void 0&&(s.height=o)}return s}const Bi=No?{passive:!0}:!1;function Mr(s,t,e){s&&s.addEventListener(t,e,Bi)}function Sr(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,Bi)}function Or(s,t){const e=kr[s.type]||s.type,{x:i,y:n}=ct(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function me(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function Dr(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||me(a.addedNodes,i),r=r&&!me(a.removedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Pr(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||me(a.removedNodes,i),r=r&&!me(a.addedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const $t=new Map;let Bs=0;function Vi(){const s=window.devicePixelRatio;s!==Bs&&(Bs=s,$t.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Tr(s,t){$t.size||window.addEventListener("resize",Vi),$t.set(s,t)}function Ir(s){$t.delete(s),$t.size||window.removeEventListener("resize",Vi)}function Cr(s,t,e){const i=s.canvas,n=i&&Qe(i);if(!n)return;const o=Mi((a,c)=>{const l=n.clientWidth;e(a,c),l<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const c=a[0],l=c.contentRect.width,h=c.contentRect.height;l===0&&h===0||o(l,h)});return r.observe(n),Tr(s,o),r}function Ie(s,t,e){e&&e.disconnect(),t==="resize"&&Ir(s)}function Lr(s,t,e){const i=s.canvas,n=Mi(o=>{s.ctx!==null&&e(Or(o,s))},s);return Mr(i,t,n),n}class Er extends Ni{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(wr(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[le])return!1;const i=e[le].initial;["height","width"].forEach(o=>{const r=i[o];T(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=i.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[le],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Dr,detach:Pr,resize:Cr}[e]||Lr;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Ie,detach:Ie,resize:Ie}[e]||Sr)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Ro(t,e,i,n)}isAttached(t){const e=t&&Qe(t);return!!(e&&e.isConnected)}}function Fr(s){return!Ze()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?vr:Er}class kt{constructor(){k(this,"x");k(this,"y");k(this,"active",!1);k(this,"options");k(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return jt(this.x)&&jt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(o=>{n[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),n}}k(kt,"defaults",{}),k(kt,"defaultRoutes");function Ar(s,t){const e=s.options.ticks,i=zr(s),n=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Nr(t):[],r=o.length,a=o[0],c=o[r-1],l=[];if(r>n)return Br(t,l,o,r/n),l;const h=Rr(o,t,n);if(r>0){let f,u;const d=r>1?Math.round((c-a)/(r-1)):null;for(ne(t,l,h,T(d)?0:a-d,a),f=0,u=r-1;f<u;f++)ne(t,l,h,o[f],o[f+1]);return ne(t,l,h,c,T(d)?t.length:c+d),l}return ne(t,l,h),l}function zr(s){const t=s.options.offset,e=s._tickSize(),i=s._length/e+(t?0:1),n=s._maxLength/e;return Math.floor(Math.min(i,n))}function Rr(s,t,e){const i=Vr(s),n=t.length/e;if(!i)return Math.max(n,1);const o=Tn(i);for(let r=0,a=o.length-1;r<a;r++){const c=o[r];if(c>n)return c}return Math.max(n,1)}function Nr(s){const t=[];let e,i;for(e=0,i=s.length;e<i;e++)s[e].major&&t.push(e);return t}function Br(s,t,e,i){let n=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<s.length;r++)r===o&&(t.push(s[r]),n++,o=e[n*i])}function ne(s,t,e,i,n){const o=P(i,0),r=Math.min(P(n,s.length),s.length);let a=0,c,l,h;for(e=Math.ceil(e),n&&(c=n-i,e=c/Math.floor(c/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(l=Math.max(o,0);l<r;l++)l===h&&(t.push(s[l]),a++,h=Math.round(o+a*e))}function Vr(s){const t=s.length;let e,i;if(t<2)return!1;for(i=s[0],e=1;e<t;++e)if(s[e]-s[e-1]!==i)return!1;return i}const jr=s=>s==="left"?"right":s==="right"?"left":s,Vs=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,js=(s,t)=>Math.min(t||s,s);function Hs(s,t){const e=[],i=s.length/t,n=s.length;let o=0;for(;o<n;o+=i)e.push(s[Math.floor(o)]);return e}function Hr(s,t,e){const i=s.ticks.length,n=Math.min(t,i-1),o=s._startPixel,r=s._endPixel,a=1e-6;let c=s.getPixelForTick(n),l;if(!(e&&(i===1?l=Math.max(c-o,r-c):t===0?l=(s.getPixelForTick(1)-c)/2:l=(c-s.getPixelForTick(n-1))/2,c+=n<t?l:-l,c<o-a||c>r+a)))return c}function Wr(s,t){N(s,e=>{const i=e.gc,n=i.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[i[o]];i.splice(0,n)}})}function It(s){return s.drawTicks?s.tickLength:0}function Ws(s,t){if(!s.display)return 0;const e=Ae(s.font,t),i=Wt(s.padding);return(R(s.text)?s.text.length:1)*e.lineHeight+i.height}function $r(s,t){return wt(s,{scale:t,type:"scale"})}function Ur(s,t,e){return wt(s,{tick:e,index:t,type:"tick"})}function Yr(s,t,e){let i=Hn(s);return(e&&t!=="right"||!e&&t==="right")&&(i=jr(i)),i}function Kr(s,t,e,i){const{top:n,left:o,bottom:r,right:a,chart:c}=s,{chartArea:l,scales:h}=c;let f=0,u,d,m;const g=r-n,p=a-o;if(s.isHorizontal()){if(d=ds(i,o,a),S(e)){const _=Object.keys(e)[0],x=e[_];m=h[_].getPixelForValue(x)+g-t}else e==="center"?m=(l.bottom+l.top)/2+g-t:m=Vs(s,e,t);u=a-o}else{if(S(e)){const _=Object.keys(e)[0],x=e[_];d=h[_].getPixelForValue(x)-p+t}else e==="center"?d=(l.left+l.right)/2-p+t:d=Vs(s,e,t);m=ds(i,r,n),f=e==="left"?-tt:tt}return{titleX:d,titleY:m,maxWidth:u,rotation:f}}class Mt extends kt{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:n}=this;return t=U(t,Number.POSITIVE_INFINITY),e=U(e,Number.NEGATIVE_INFINITY),i=U(i,Number.POSITIVE_INFINITY),n=U(n,Number.NEGATIVE_INFINITY),{min:U(t,i),max:U(e,n),minDefined:B(t),maxDefined:B(e)}}getMinMax(t){let{min:e,max:i,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let c=0,l=a.length;c<l;++c)r=a[c].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=n&&e>i?e:i,{min:U(e,U(i,e)),max:U(i,U(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const 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(){E(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.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=po(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?Hs(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Ar(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){E(this.options.afterUpdate,[this])}beforeSetDimensions(){E(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(){E(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),E(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){E(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,o;for(i=0,n=t.length;i<n;i++)o=t[i],o.label=E(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){E(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){E(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=js(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,c,l;if(!this._isVisible()||!e.display||n>=o||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),f=h.widest.width,u=h.highest.height,d=X(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/i:d/(i-1),f+6>a&&(a=d/(i-(t.offset?.5:1)),c=this.maxHeight-It(t.grid)-e.padding-Ws(t.title,this.chart.options.font),l=Math.sqrt(f*f+u*u),r=En(Math.min(Math.asin(X((h.highest.height+6)/a,-1,1)),Math.asin(X(c/l,-1,1))-Math.asin(X(u/l,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){E(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){E(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const c=Ws(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=It(o)+c):(t.height=this.maxHeight,t.width=It(o)+c),i.display&&this.ticks.length){const{first:l,last:h,widest:f,highest:u}=this._getLabelSizes(),d=i.padding*2,m=ft(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(a){const _=i.mirror?0:p*f.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+_+d)}else{const _=i.mirror?0:g*f.width+p*u.height;t.width=Math.min(this.maxWidth,t.width+_+d)}this._calculatePadding(l,h,p,g)}}this._handleMargins(),a?(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,n){const{ticks:{align:o,padding:r},position:a}=this.options,c=this.labelRotation!==0,l=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,d=0;c?l?(u=n*t.width,d=i*e.height):(u=i*t.height,d=n*e.width):o==="start"?d=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,d=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((d-f+r)*this.width/(this.width-f),0)}else{let h=e.height/2,f=t.height/2;o==="start"?(h=0,f=t.height):o==="end"&&(h=e.height,f=0),this.paddingTop=h+r,this.paddingBottom=f+r}}_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(){E(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)T(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Hs(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],c=Math.floor(e/js(e,i));let l=0,h=0,f,u,d,m,g,p,_,x,O,D,b;for(f=0;f<e;f+=c){if(m=t[f].label,g=this._resolveTickFontOptions(f),n.font=p=g.string,_=o[p]=o[p]||{data:{},gc:[]},x=g.lineHeight,O=D=0,!T(m)&&!R(m))O=bs(n,_.data,_.gc,O,m),D=x;else if(R(m))for(u=0,d=m.length;u<d;++u)b=m[u],!T(b)&&!R(b)&&(O=bs(n,_.data,_.gc,O,b),D+=x);r.push(O),a.push(D),l=Math.max(O,l),h=Math.max(D,h)}Wr(o,e);const w=r.indexOf(l),y=a.indexOf(h),v=M=>({width:r[M]||0,height:a[M]||0});return{first:v(0),last:v(e-1),widest:v(w),highest:v(y),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return zn(this._alignToPixels?rt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Ur(this.getContext(),t,i))}return this.$context||(this.$context=$r(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ft(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,c=o?o.highest.height+r:0;return this.isHorizontal()?c*i>a*n?a/i:c/n:c*n<a*i?c/i:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:r,border:a}=n,c=o.offset,l=this.isHorizontal(),f=this.ticks.length+(c?1:0),u=It(o),d=[],m=a.setContext(this.getContext()),g=m.display?m.width:0,p=g/2,_=function(z){return rt(i,z,g)};let x,O,D,b,w,y,v,M,I,C,A,$;if(r==="top")x=_(this.bottom),y=this.bottom-u,M=x-p,C=_(t.top)+p,$=t.bottom;else if(r==="bottom")x=_(this.top),C=t.top,$=_(t.bottom)-p,y=x+p,M=this.top+u;else if(r==="left")x=_(this.right),w=this.right-u,v=x-p,I=_(t.left)+p,A=t.right;else if(r==="right")x=_(this.left),I=t.left,A=_(t.right)-p,w=x+p,v=this.left+u;else if(e==="x"){if(r==="center")x=_((t.top+t.bottom)/2+.5);else if(S(r)){const z=Object.keys(r)[0],H=r[z];x=_(this.chart.scales[z].getPixelForValue(H))}C=t.top,$=t.bottom,y=x+p,M=y+u}else if(e==="y"){if(r==="center")x=_((t.left+t.right)/2);else if(S(r)){const z=Object.keys(r)[0],H=r[z];x=_(this.chart.scales[z].getPixelForValue(H))}w=x-p,v=w-u,I=t.left,A=t.right}const Q=P(n.ticks.maxTicksLimit,f),L=Math.max(1,Math.ceil(f/Q));for(O=0;O<f;O+=L){const z=this.getContext(O),H=o.setContext(z),Yt=a.setContext(z),Kt=H.lineWidth,mt=H.color,Xt=Yt.dash||[],_t=Yt.dashOffset,St=H.tickWidth,it=H.tickColor,Ot=H.tickBorderDash||[],nt=H.tickBorderDashOffset;D=Hr(this,O,c),D!==void 0&&(b=rt(i,D,Kt),l?w=v=I=A=b:y=M=C=$=b,d.push({tx1:w,ty1:y,tx2:v,ty2:M,x1:I,y1:C,x2:A,y2:$,width:Kt,color:mt,borderDash:Xt,borderDashOffset:_t,tickWidth:St,tickColor:it,tickBorderDash:Ot,tickBorderDashOffset:nt}))}return this._ticksLength=f,this._borderValue=x,d}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:l,padding:h,mirror:f}=o,u=It(i.grid),d=u+h,m=f?-h:d,g=-ft(this.labelRotation),p=[];let _,x,O,D,b,w,y,v,M,I,C,A,$="middle";if(n==="top")w=this.bottom-m,y=this._getXAxisLabelAlignment();else if(n==="bottom")w=this.top+m,y=this._getXAxisLabelAlignment();else if(n==="left"){const L=this._getYAxisLabelAlignment(u);y=L.textAlign,b=L.x}else if(n==="right"){const L=this._getYAxisLabelAlignment(u);y=L.textAlign,b=L.x}else if(e==="x"){if(n==="center")w=(t.top+t.bottom)/2+d;else if(S(n)){const L=Object.keys(n)[0],z=n[L];w=this.chart.scales[L].getPixelForValue(z)+d}y=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")b=(t.left+t.right)/2-d;else if(S(n)){const L=Object.keys(n)[0],z=n[L];b=this.chart.scales[L].getPixelForValue(z)}y=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(c==="start"?$="top":c==="end"&&($="bottom"));const Q=this._getLabelSizes();for(_=0,x=a.length;_<x;++_){O=a[_],D=O.label;const L=o.setContext(this.getContext(_));v=this.getPixelForTick(_)+o.labelOffset,M=this._resolveTickFontOptions(_),I=M.lineHeight,C=R(D)?D.length:1;const z=C/2,H=L.color,Yt=L.textStrokeColor,Kt=L.textStrokeWidth;let mt=y;r?(b=v,y==="inner"&&(_===x-1?mt=this.options.reverse?"left":"right":_===0?mt=this.options.reverse?"right":"left":mt="center"),n==="top"?l==="near"||g!==0?A=-C*I+I/2:l==="center"?A=-Q.highest.height/2-z*I+I:A=-Q.highest.height+I/2:l==="near"||g!==0?A=I/2:l==="center"?A=Q.highest.height/2-z*I:A=Q.highest.height-C*I,f&&(A*=-1),g!==0&&!L.showLabelBackdrop&&(b+=I/2*Math.sin(g))):(w=v,A=(1-C)*I/2);let Xt;if(L.showLabelBackdrop){const _t=Wt(L.backdropPadding),St=Q.heights[_],it=Q.widths[_];let Ot=A-_t.top,nt=0-_t.left;switch($){case"middle":Ot-=St/2;break;case"bottom":Ot-=St;break}switch(y){case"center":nt-=it/2;break;case"right":nt-=it;break;case"inner":_===x-1?nt-=it:_>0&&(nt-=it/2);break}Xt={left:nt,top:Ot,width:it+_t.width,height:St+_t.height,color:L.backdropColor}}p.push({label:D,font:M,textOffset:A,options:{rotation:g,color:H,strokeColor:Yt,strokeWidth:Kt,textAlign:mt,textBaseline:$,translation:[b,w],backdrop:Xt}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ft(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,c=r.widest.width;let l,h;return e==="left"?n?(h=this.right+o,i==="near"?l="left":i==="center"?(l="center",h+=c/2):(l="right",h+=c)):(h=this.right-a,i==="near"?l="right":i==="center"?(l="center",h-=c/2):(l="left",h=this.left)):e==="right"?n?(h=this.left+o,i==="near"?l="right":i==="center"?(l="center",h-=c/2):(l="left",h-=c)):(h=this.left+a,i==="near"?l="left":i==="center"?(l="center",h+=c/2):(l="right",h=this.right)):l="right",{textAlign:l,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(c,l,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(l.x,l.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const c=n[o];e.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),e.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let l,h,f,u;this.isHorizontal()?(l=rt(t,this.left,r)-r/2,h=rt(t,this.right,a)+a/2,f=u=c):(f=rt(t,this.top,r)-r/2,u=rt(t,this.bottom,a)+a/2,l=h=c),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(l,f),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,n=this._computeLabelArea();n&&Ye(i,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,c=r.font,l=r.label,h=r.textOffset;ys(i,l,0,h,c,a)}n&&Ke(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=Ae(i.font),r=Wt(i.padding),a=i.align;let c=o.lineHeight/2;e==="bottom"||e==="center"||S(e)?(c+=r.bottom,R(i.text)&&(c+=o.lineHeight*(i.text.length-1))):c+=r.top;const{titleX:l,titleY:h,maxWidth:f,rotation:u}=Kr(this,c,e,a);ys(t,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:u,textAlign:Yr(a,e,n),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=P(t.grid&&t.grid.z,-1),n=P(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Mt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[i]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Ae(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class oe{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){const e=Object.getPrototypeOf(t);let i;Gr(e)&&(i=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,Xr(t,r,i),this.override&&F.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in F[n]&&(delete F[n][i],this.override&&delete pt[i])}}function Xr(s,t,e){const i=Vt(Object.create(null),[e?F.get(e):{},F.get(t),s.defaults]);F.set(t,i),s.defaultRoutes&&qr(t,s.defaultRoutes),s.descriptors&&F.describe(t,s.descriptors)}function qr(s,t){Object.keys(t).forEach(e=>{const i=e.split("."),n=i.pop(),o=[s].concat(i).join("."),r=t[e].split("."),a=r.pop(),c=r.join(".");F.route(o,n,c,a)})}function Gr(s){return"id"in s&&"defaults"in s}class Zr{constructor(){this.controllers=new oe(Nt,"datasets",!0),this.elements=new oe(kt,"elements"),this.plugins=new oe(Object,"plugins"),this.scales=new oe(Mt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):N(n,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){const n=We(t);E(i["before"+n],[],i),e[t](i),E(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var Y=new Zr;class Qr{constructor(){this._init=[]}notify(t,e,i,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,i,n){n=n||{};for(const o of t){const r=o.plugin,a=r[i],c=[e,n,o.options];if(E(a,c,r)===!1&&n.cancelable)return!1}return!0}invalidate(){T(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=P(i.options&&i.options.plugins,{}),o=Jr(i);return n===!1&&!e?[]:ea(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(o,r)=>o.filter(a=>!r.some(c=>a.plugin.id===c.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Jr(s){const t={},e=[],i=Object.keys(Y.plugins.items);for(let o=0;o<i.length;o++)e.push(Y.getPlugin(i[o]));const n=s.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function ta(s,t){return!t&&s===!1?null:s===!0?{}:s}function ea(s,{plugins:t,localIds:e},i,n){const o=[],r=s.getContext();for(const a of t){const c=a.id,l=ta(i[c],n);l!==null&&o.push({plugin:a,options:sa(s.config,{plugin:a,local:e[c]},l,r)})}return o}function sa(s,{plugin:t,local:e},i,n){const o=s.pluginScopeKeys(t),r=s.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),s.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ze(s,t){const e=F.datasets[s]||{};return((t.datasets||{})[s]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function ia(s,t){let e=s;return s==="_index_"?e=t:s==="_value_"&&(e=t==="x"?"y":"x"),e}function na(s,t){return s===t?"_index_":"_value_"}function $s(s){if(s==="x"||s==="y"||s==="r")return s}function oa(s){if(s==="top"||s==="bottom")return"x";if(s==="left"||s==="right")return"y"}function Re(s,...t){if($s(s))return s;for(const e of t){const i=e.axis||oa(e.position)||s.length>1&&$s(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function Us(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function ra(s,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(e.length)return Us(s,"x",e[0])||Us(s,"y",e[0])}return{}}function aa(s,t){const e=pt[s.type]||{scales:{}},i=t.scales||{},n=ze(s.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!S(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const c=Re(r,a,ra(r,s),F.scales[a.type]),l=na(c,n),h=e.scales||{};o[r]=Ft(Object.create(null),[{axis:c},a,h[c],h[l]])}),s.data.datasets.forEach(r=>{const a=r.type||s.type,c=r.indexAxis||ze(a,t),h=(pt[a]||{}).scales||{};Object.keys(h).forEach(f=>{const u=ia(f,c),d=r[u+"AxisID"]||u;o[d]=o[d]||Object.create(null),Ft(o[d],[{axis:u},i[d],h[f]])})}),Object.keys(o).forEach(r=>{const a=o[r];Ft(a,[F.scales[a.type],F.scale])}),o}function ji(s){const t=s.options||(s.options={});t.plugins=P(t.plugins,{}),t.scales=aa(s,t)}function Hi(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function ca(s){return s=s||{},s.data=Hi(s.data),ji(s),s}const Ys=new Map,Wi=new Set;function re(s,t){let e=Ys.get(s);return e||(e=t(),Ys.set(s,e),Wi.add(e)),e}const Ct=(s,t,e)=>{const i=ue(t,e);i!==void 0&&s.add(i)};class la{constructor(t){this._config=ca(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=Hi(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ji(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return re(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return re(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return re(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return re(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const c=new Set;e.forEach(h=>{t&&(c.add(t),h.forEach(f=>Ct(c,t,f))),h.forEach(f=>Ct(c,n,f)),h.forEach(f=>Ct(c,pt[o]||{},f)),h.forEach(f=>Ct(c,F,f)),h.forEach(f=>Ct(c,Fe,f))});const l=Array.from(c);return l.length===0&&l.push(Object.create(null)),Wi.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,pt[e]||{},F.datasets[e]||{},{type:e},F,Fe]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Ks(this._resolverCache,t,n);let c=r;if(fa(r,e)){o.$shared=!1,i=st(i)?i():i;const l=this.createResolver(t,i,a);c=yt(r,i,l)}for(const l of e)o[l]=c[l];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Ks(this._resolverCache,t,i);return S(e)?yt(o,e,void 0,n):o}}function Ks(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));const n=e.join();let o=i.get(n);return o||(o={resolver:Xe(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,o)),o}const ha=s=>S(s)&&Object.getOwnPropertyNames(s).some(t=>st(s[t]));function fa(s,t){const{isScriptable:e,isIndexable:i}=Di(s);for(const n of t){const o=e(n),r=i(n),a=(r||o)&&s[n];if(o&&(st(a)||ha(a))||r&&R(a))return!0}return!1}var ua="4.4.8";const da=["top","bottom","left","right","chartArea"];function Xs(s,t){return s==="top"||s==="bottom"||da.indexOf(s)===-1&&t==="x"}function qs(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function Gs(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),E(e&&e.onComplete,[s],t)}function ga(s){const t=s.chart,e=t.options.animation;E(e&&e.onProgress,[s],t)}function $i(s){return Ze()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const he={},Zs=s=>{const t=$i(s);return Object.values(he).filter(e=>e.canvas===t).pop()};function pa(s,t,e){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=t){const r=s[n];delete s[n],(e>0||o>t)&&(s[o+e]=r)}}}function ma(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}function ae(s,t,e){return s.options.clip?s[e]:t[e]}function _a(s,t){const{xScale:e,yScale:i}=s;return e&&i?{left:ae(e,t,"left"),right:ae(e,t,"right"),top:ae(i,t,"top"),bottom:ae(i,t,"bottom")}:t}class ht{static register(...t){Y.add(...t),Qs()}static unregister(...t){Y.remove(...t),Qs()}constructor(t,e){const i=this.config=new la(e),n=$i(t),o=Zs(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Fr(n)),this.platform.updateConfig(i);const a=this.platform.acquireContext(n,r.aspectRatio),c=a&&a.canvas,l=c&&c.height,h=c&&c.width;if(this.id=yn(),this.ctx=a,this.canvas=c,this.width=h,this.height=l,this._options=r,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 Qr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=jn(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],he[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}G.listen(this,"complete",Gs),G.listen(this,"progress",ga),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return T(t)?e&&o?o:n?i/n: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 Y}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ws(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return xs(this.canvas,this.ctx),this}stop(){return G.stop(this),this}resize(t,e){G.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ws(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),E(i.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};N(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],c=Re(r,a),l=c==="r",h=c==="x";return{options:a,dposition:l?"chartArea":h?"bottom":"left",dtype:l?"radialLinear":h?"category":"linear"}}))),N(o,r=>{const a=r.options,c=a.id,l=Re(c,a),h=P(a.type,r.dtype);(a.position===void 0||Xs(a.position,l)!==Xs(r.dposition))&&(a.position=r.dposition),n[c]=!0;let f=null;if(c in i&&i[c].type===h)f=i[c];else{const u=Y.getScale(h);f=new u({id:c,type:h,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,t)}),N(n,(r,a)=>{r||delete i[a]}),N(i,r=>{ie.configure(this,r,r.options),ie.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,o)=>n.index-o.index),i>e){for(let n=e;n<i;++n)this._destroyDatasetMeta(n);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(qs("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const o=e[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||ze(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const c=Y.getController(a),{datasetElementType:l,dataElementType:h}=F.datasets[a];Object.assign(c,{dataElementType:Y.getElement(h),datasetElementType:l&&Y.getElement(l)}),r.controller=new c(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){N(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let l=0,h=this.data.datasets.length;l<h;l++){const{controller:f}=this.getDatasetMeta(l),u=!n&&o.indexOf(f)===-1;f.buildOrUpdateElements(u),r=Math.max(+f.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),n||N(o,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(qs("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){N(this.scales,t=>{ie.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!as(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of e){const r=i==="_removeElements"?-o:o;pa(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=i(0);for(let o=1;o<e;o++)if(!as(n,i(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ie.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],N(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,st(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(G.has(this)?this.attached&&!G.running(this)&&G.start(this):(this.draw(),Gs({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const 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){const e=this._sortedMetasets,i=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,o=_a(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Ye(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),n&&Ke(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Ht(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=dr.modes[e];return typeof o=="function"?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=wt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);de(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),G.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),xs(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete he[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};N(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(c,l)=>{e.addEventListener(this,c,l),t[c]=l},n=(c,l)=>{t[c]&&(e.removeEventListener(this,c,l),delete t[c])},o=(c,l)=>{this.canvas&&this.resize(c,l)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){N(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},N(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let o,r,a,c;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,c=t.length;a<c;++a){r=t[a];const l=r&&this.getDatasetMeta(r.datasetIndex).controller;l&&l[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!os(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 this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const n=this.options.hover,o=(c,l)=>c.filter(h=>!l.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.index)),r=o(e,t),a=i?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,i,r),c=On(t),l=ma(t,this._lastEvent,i,c);i&&(this._lastEvent=null,E(o.onHover,[t,a,this],this),c&&E(o.onClick,[t,a,this],this));const h=!os(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}k(ht,"defaults",F),k(ht,"instances",he),k(ht,"overrides",pt),k(ht,"registry",Y),k(ht,"version",ua),k(ht,"getChart",Zs);function Qs(){return N(ht.instances,s=>s._plugins.invalidate())}function Ui(s,t,e=t){s.lineCap=P(e.borderCapStyle,t.borderCapStyle),s.setLineDash(P(e.borderDash,t.borderDash)),s.lineDashOffset=P(e.borderDashOffset,t.borderDashOffset),s.lineJoin=P(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=P(e.borderWidth,t.borderWidth),s.strokeStyle=P(e.borderColor,t.borderColor)}function ba(s,t,e){s.lineTo(e.x,e.y)}function xa(s){return s.stepped?io:s.tension||s.cubicInterpolationMode==="monotone"?no:ba}function Yi(s,t,e={}){const i=s.length,{start:n=0,end:o=i-1}=e,{start:r,end:a}=t,c=Math.max(n,r),l=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;return{count:i,start:c,loop:t.loop,ilen:l<c&&!h?i+l-c:l-c}}function ya(s,t,e,i){const{points:n,options:o}=t,{count:r,start:a,loop:c,ilen:l}=Yi(n,e,i),h=xa(o);let{move:f=!0,reverse:u}=i||{},d,m,g;for(d=0;d<=l;++d)m=n[(a+(u?l-d:d))%r],!m.skip&&(f?(s.moveTo(m.x,m.y),f=!1):h(s,g,m,u,o.stepped),g=m);return c&&(m=n[(a+(u?l:0))%r],h(s,g,m,u,o.stepped)),!!c}function va(s,t,e,i){const n=t.points,{count:o,start:r,ilen:a}=Yi(n,e,i),{move:c=!0,reverse:l}=i||{};let h=0,f=0,u,d,m,g,p,_;const x=D=>(r+(l?a-D:D))%o,O=()=>{g!==p&&(s.lineTo(h,p),s.lineTo(h,g),s.lineTo(h,_))};for(c&&(d=n[x(0)],s.moveTo(d.x,d.y)),u=0;u<=a;++u){if(d=n[x(u)],d.skip)continue;const D=d.x,b=d.y,w=D|0;w===m?(b<g?g=b:b>p&&(p=b),h=(f*h+D)/++f):(O(),s.lineTo(D,b),m=w,f=0,g=p=b),_=b}O()}function Ne(s){const t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?va:ya}function ka(s){return s.stepped?Bo:s.tension||s.cubicInterpolationMode==="monotone"?Vo:lt}function wa(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),Ui(s,t.options),s.stroke(n)}function Ma(s,t,e,i){const{segments:n,options:o}=t,r=Ne(t);for(const a of n)Ui(s,o,a.style),s.beginPath(),r(s,t,a,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}const Sa=typeof Path2D=="function";function Oa(s,t,e,i){Sa&&!t.options.segment?wa(s,t,e,i):Ma(s,t,e,i)}class dt extends kt{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){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Co(this._points,i,t,n,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=$o(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,r=Fi(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],c=ka(i);let l,h;for(l=0,h=r.length;l<h;++l){const{start:f,end:u}=r[l],d=o[f],m=o[u];if(d===m){a.push(d);continue}const g=Math.abs((n-d[e])/(m[e]-d[e])),p=c(d,m,g,i.stepped);p[e]=t[e],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Ne(this)(t,this,e,i)}path(t,e,i){const n=this.segments,o=Ne(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Oa(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}k(dt,"id","line"),k(dt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),k(dt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),k(dt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Js(s,t,e,i){const n=s.options,{[e]:o}=s.getProps([e],i);return Math.abs(t-o)<n.radius+n.hitRadius}class Ce extends kt{constructor(e){super();k(this,"parsed");k(this,"skip");k(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,n){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],n);return Math.pow(e-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,i){return Js(this,e,"x",i)}inYRange(e,i){return Js(this,e,"y",i)}getCenterPoint(e){const{x:i,y:n}=this.getProps(["x","y"],e);return{x:i,y:n}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const n=i&&e.borderWidth||0;return(i+n)*2}draw(e,i){const n=this.options;this.skip||n.radius<.1||!Ht(this,i,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,eo(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}k(Ce,"id","point"),k(Ce,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),k(Ce,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Da(s,t,e){const i=s.segments,n=s.points,o=t.points,r=[];for(const a of i){let{start:c,end:l}=a;l=ts(c,l,n);const h=Be(e,n[c],n[l],a.loop);if(!t.segments){r.push({source:a,target:h,start:n[c],end:n[l]});continue}const f=Fi(t,h);for(const u of f){const d=Be(e,o[u.start],o[u.end],u.loop),m=Ei(a,n,d);for(const g of m)r.push({source:g,target:u,start:{[e]:ti(h,d,"start",Math.max)},end:{[e]:ti(h,d,"end",Math.min)}})}}return r}function Be(s,t,e,i){if(i)return;let n=t[s],o=e[s];return s==="angle"&&(n=K(n),o=K(o)),{property:s,start:n,end:o}}function Pa(s,t){const{x:e=null,y:i=null}=s||{},n=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=ts(r,a,n);const c=n[r],l=n[a];i!==null?(o.push({x:c.x,y:i}),o.push({x:l.x,y:i})):e!==null&&(o.push({x:e,y:c.y}),o.push({x:e,y:l.y}))}),o}function ts(s,t,e){for(;t>s;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function ti(s,t,e,i){return s&&t?i(s[e],t[e]):s?s[e]:t?t[e]:0}function Ki(s,t){let e=[],i=!1;return R(s)?(i=!0,e=s):e=Pa(s,t),e.length?new dt({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function ei(s){return s&&s.fill!==!1}function Ta(s,t,e){let n=s[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!B(n))return n;if(r=s[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function Ia(s,t,e){const i=Fa(s);if(S(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return B(n)&&Math.floor(n)===n?Ca(i[0],t,n,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Ca(s,t,e,i){return(s==="-"||s==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function La(s,t){let e=null;return s==="start"?e=t.bottom:s==="end"?e=t.top:S(s)?e=t.getPixelForValue(s.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Ea(s,t,e){let i;return s==="start"?i=e:s==="end"?i=t.options.reverse?t.min:t.max:S(s)?i=s.value:i=t.getBaseValue(),i}function Fa(s){const t=s.options,e=t.fill;let i=P(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Aa(s){const{scale:t,index:e,line:i}=s,n=[],o=i.segments,r=i.points,a=za(t,e);a.push(Ki({x:null,y:t.bottom},i));for(let c=0;c<o.length;c++){const l=o[c];for(let h=l.start;h<=l.end;h++)Ra(n,r[h],a)}return new dt({points:n,options:{}})}function za(s,t){const e=[],i=s.getMatchingVisibleMetas("line");for(let n=0;n<i.length;n++){const o=i[n];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Ra(s,t,e){const i=[];for(let n=0;n<e.length;n++){const o=e[n],{first:r,last:a,point:c}=Na(o,t,"x");if(!(!c||r&&a)){if(r)i.unshift(c);else if(s.push(c),!a)break}}s.push(...i)}function Na(s,t,e){const i=s.interpolate(t,e);if(!i)return{};const n=i[e],o=s.segments,r=s.points;let a=!1,c=!1;for(let l=0;l<o.length;l++){const h=o[l],f=r[h.start][e],u=r[h.end][e];if(vi(n,f,u)){a=n===f,c=n===u;break}}return{first:a,last:c,point:i}}class Xi{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:r}=this;return e=e||{start:0,end:q},t.arc(n,o,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:i+Math.sin(o)*n,angle:o}}}function Ba(s){const{chart:t,fill:e,line:i}=s;if(B(e))return Va(t,e);if(e==="stack")return Aa(s);if(e==="shape")return!0;const n=ja(s);return n instanceof Xi?n:Ki(n,i)}function Va(s,t){const e=s.getDatasetMeta(t);return e&&s.isDatasetVisible(t)?e.dataset:null}function ja(s){return(s.scale||{}).getPointPositionForValue?Wa(s):Ha(s)}function Ha(s){const{scale:t={},fill:e}=s,i=La(e,t);if(B(i)){const n=t.isHorizontal();return{x:n?i:null,y:n?null:i}}return null}function Wa(s){const{scale:t,fill:e}=s,i=t.options,n=t.getLabels().length,o=i.reverse?t.max:t.min,r=Ea(e,t,o),a=[];if(i.grid.circular){const c=t.getPointPositionForValue(0,o);return new Xi({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(r)})}for(let c=0;c<n;++c)a.push(t.getPointPositionForValue(c,r));return a}function Le(s,t,e){const i=Ba(t),{line:n,scale:o,axis:r}=t,a=n.options,c=a.fill,l=a.backgroundColor,{above:h=l,below:f=l}=c||{};i&&n.points.length&&(Ye(s,e),$a(s,{line:n,target:i,above:h,below:f,area:e,scale:o,axis:r}),Ke(s))}function $a(s,t){const{line:e,target:i,above:n,below:o,area:r,scale:a}=t,c=e._loop?"angle":t.axis;s.save(),c==="x"&&o!==n&&(si(s,i,r.top),ii(s,{line:e,target:i,color:n,scale:a,property:c}),s.restore(),s.save(),si(s,i,r.bottom)),ii(s,{line:e,target:i,color:o,scale:a,property:c}),s.restore()}function si(s,t,e){const{segments:i,points:n}=t;let o=!0,r=!1;s.beginPath();for(const a of i){const{start:c,end:l}=a,h=n[c],f=n[ts(c,l,n)];o?(s.moveTo(h.x,h.y),o=!1):(s.lineTo(h.x,e),s.lineTo(h.x,h.y)),r=!!t.pathSegment(s,a,{move:r}),r?s.closePath():s.lineTo(f.x,e)}s.lineTo(t.first().x,e),s.closePath(),s.clip()}function ii(s,t){const{line:e,target:i,property:n,color:o,scale:r}=t,a=Da(e,i,n);for(const{source:c,target:l,start:h,end:f}of a){const{style:{backgroundColor:u=o}={}}=c,d=i!==!0;s.save(),s.fillStyle=u,Ua(s,r,d&&Be(n,h,f)),s.beginPath();const m=!!e.pathSegment(s,c);let g;if(d){m?s.closePath():ni(s,i,f,n);const p=!!i.pathSegment(s,l,{move:m,reverse:!0});g=m&&p,g||ni(s,i,h,n)}s.closePath(),s.fill(g?"evenodd":"nonzero"),s.restore()}}function Ua(s,t,e){const{top:i,bottom:n}=t.chart.chartArea,{property:o,start:r,end:a}=e||{};o==="x"&&(s.beginPath(),s.rect(r,i,a-r,n-i),s.clip())}function ni(s,t,e,i){const n=t.interpolate(e,i);n&&s.lineTo(n.x,n.y)}var ec={id:"filler",afterDatasetsUpdate(s,t,e){const i=(s.data.datasets||[]).length,n=[];let o,r,a,c;for(r=0;r<i;++r)o=s.getDatasetMeta(r),a=o.dataset,c=null,a&&a.options&&a instanceof dt&&(c={visible:s.isDatasetVisible(r),index:r,fill:Ia(a,r,i),chart:s,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=c,n.push(c);for(r=0;r<i;++r)c=n[r],!(!c||c.fill===!1)&&(c.fill=Ta(n,r,e.propagate))},beforeDraw(s,t,e){const i=e.drawTime==="beforeDraw",n=s.getSortedVisibleDatasetMetas(),o=s.chartArea;for(let r=n.length-1;r>=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&Le(s.ctx,a,o))}},beforeDatasetsDraw(s,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=s.getSortedVisibleDatasetMetas();for(let n=i.length-1;n>=0;--n){const o=i[n].$filler;ei(o)&&Le(s.ctx,o,s.chartArea)}},beforeDatasetDraw(s,t,e){const i=t.meta.$filler;!ei(i)||e.drawTime!=="beforeDatasetDraw"||Le(s.ctx,i,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ya=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Ka(s,t,e,i){const n=s.indexOf(t);if(n===-1)return Ya(s,t,e,i);const o=s.lastIndexOf(t);return n!==o?e:n}const Xa=(s,t)=>s===null?null:X(Math.round(s),0,t);function oi(s){const t=this.getLabels();return s>=0&&s<t.length?t[s]:s}class ri extends Mt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:n,label:o}of e)i[n]===o&&i.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(T(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Ka(i,t,P(e,t),this._addedLabels),Xa(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return oi.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const 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}}k(ri,"id","category"),k(ri,"defaults",{ticks:{callback:oi}});function qa(s,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:c,count:l,maxTicks:h,maxDigits:f,includeBounds:u}=s,d=o||1,m=h-1,{min:g,max:p}=t,_=!T(r),x=!T(a),O=!T(l),D=(p-g)/(f+1);let b=ls((p-g)/m/d)*d,w,y,v,M;if(b<1e-14&&!_&&!x)return[{value:g},{value:p}];M=Math.ceil(p/b)-Math.floor(g/b),M>m&&(b=ls(M*b/m/d)*d),T(c)||(w=Math.pow(10,c),b=Math.ceil(b*w)/w),n==="ticks"?(y=Math.floor(g/b)*b,v=Math.ceil(p/b)*b):(y=g,v=p),_&&x&&o&&Cn((a-r)/o,b/1e3)?(M=Math.round(Math.min((a-r)/b,h)),b=(a-r)/M,y=r,v=a):O?(y=_?r:y,v=x?a:v,M=l-1,b=(v-y)/M):(M=(v-y)/b,At(M,Math.round(M),b/1e3)?M=Math.round(M):M=Math.ceil(M));const I=Math.max(hs(b),hs(y));w=Math.pow(10,T(c)?I:c),y=Math.round(y*w)/w,v=Math.round(v*w)/w;let C=0;for(_&&(u&&y!==r?(e.push({value:r}),y<r&&C++,At(Math.round((y+C*b)*w)/w,r,ai(r,D,s))&&C++):y<r&&C++);C<M;++C){const A=Math.round((y+C*b)*w)/w;if(x&&A>a)break;e.push({value:A})}return x&&u&&v!==a?e.length&&At(e[e.length-1].value,a,ai(a,D,s))?e[e.length-1].value=a:e.push({value:a}):(!x||v===a)&&e.push({value:v}),e}function ai(s,t,{horizontal:e,minRotation:i}){const n=ft(i),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+s).length;return Math.min(t/o,r)}class Ga extends Mt{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 T(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=c=>n=e?n:c,a=c=>o=i?o:c;if(t){const c=xt(n),l=xt(o);c<0&&l<0?a(0):c>0&&l>0&&r(0)}if(n===o){let c=o===0?1:Math.abs(o*.05);a(o+c),t||r(n-c)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks: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:e.includeBounds!==!1},o=this._range||this,r=qa(n,o);return t.bounds==="ticks"&&Ln(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Si(t,this.chart.options.locale,this.options.ticks.format)}}class ci extends Ga{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=B(t)?t:0,this.max=B(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=ft(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}k(ci,"id","linear"),k(ci,"defaults",{ticks:{callback:Oi.formatters.numeric}});const ye={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}},V=Object.keys(ye);function li(s,t){return s-t}function hi(s,t){if(T(t))return null;const e=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),B(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(jt(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function fi(s,t,e,i){const n=V.length;for(let o=V.indexOf(s);o<n-1;++o){const r=ye[V[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return V[o]}return V[n-1]}function Za(s,t,e,i,n){for(let o=V.length-1;o>=V.indexOf(e);o--){const r=V[o];if(ye[r].common&&s._adapter.diff(n,i,r)>=t-1)return r}return V[e?V.indexOf(e):0]}function Qa(s){for(let t=V.indexOf(s)+1,e=V.length;t<e;++t)if(ye[V[t]].common)return V[t]}function ui(s,t,e){if(!e)s[t]=!0;else if(e.length){const{lo:i,hi:n}=$e(e,t),o=e[i]>=t?e[i]:e[n];s[o]=!0}}function Ja(s,t,e,i){const n=s._adapter,o=+n.startOf(t[0].value,i),r=t[t.length-1].value;let a,c;for(a=o;a<=r;a=+n.add(a,1,i))c=e[a],c>=0&&(t[c].major=!0);return t}function di(s,t,e){const i=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,i.push({value:a,major:!1});return o===0||!e?i:Ja(s,i,n,e)}class _e extends Mt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new cr._date(t.adapters.date);n.init(e),Ft(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:hi(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function c(l){!r&&!isNaN(l.min)&&(n=Math.min(n,l.min)),!a&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!r||!a)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),n=B(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),o=B(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=Nn(n,o,r);return this._unit=e.unit||(i.autoSkip?fi(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Za(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Qa(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),di(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=X(e,0,r),i=X(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||fi(o.minUnit,e,i,this._getLabelCapacity(e)),a=P(n.ticks.stepSize,1),c=r==="week"?o.isoWeekday:!1,l=jt(c)||c===!0,h={};let f=e,u,d;if(l&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,l?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const m=n.ticks.source==="data"&&this.getDataTimestamps();for(u=f,d=0;u<i;u=+t.add(u,a,r),d++)ui(h,u,m);return(u===i||n.bounds==="ticks"||d===1)&&ui(h,u,m),Object.keys(h).sort(li).map(g=>+g)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,n){const o=this.options,r=o.ticks.callback;if(r)return E(r,[t,e,i],this);const a=o.time.displayFormats,c=this._unit,l=this._majorUnit,h=c&&a[c],f=l&&a[l],u=i[e],d=l&&f&&u&&u.major;return this._adapter.format(t,n||(d?f:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=ft(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,di(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e<i;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(hi(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Vn(t.sort(li))}}k(_e,"id","time"),k(_e,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ce(s,t,e){let i=0,n=s.length-1,o,r,a,c;e?(t>=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=ut(s,"pos",t)),{pos:o,time:a}=s[i],{pos:r,time:c}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=ut(s,"time",t)),{time:o,pos:a}=s[i],{time:r,pos:c}=s[n]);const l=r-o;return l?a+(c-a)*(t-o)/l:a}class gi extends _e{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ce(e,this.min),this._tableRange=ce(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let r,a,c,l,h;for(r=0,a=t.length;r<a;++r)l=t[r],l>=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],c=n[r-1],l=n[r],Math.round((h+c)/2)!==l&&o.push({time:l,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ce(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ce(this._table,i*this._tableRange+this._minPos,!0)}}k(gi,"id","timeseries"),k(gi,"defaults",_e.defaults);export{ht as C,De as L,Ce as P,dt as a,ci as b,ri as c,ec as i};