Sindbad~EG File Manager
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,function(){"use strict";const r="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function l(e,i,t){const a=t||(t=>Array.prototype.slice.call(t));let n=!1,o;return function(...t){o=a(t),n||(n=!0,r.call(window,()=>{n=!1,e.apply(i,o)}))}}function s(t,e){let i;return function(){return e?(clearTimeout(i),i=setTimeout(t,e)):t(),e}}const f=t=>"start"===t?"left":"end"===t?"right":"center",T=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,R=(t,e,i)=>"right"===t?i:"center"===t?(e+i)/2:e;var h=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,i,a,t){const n=i.listeners[t],o=i.duration;n.forEach(t=>t({chart:e,initial:i.initial,numSteps:o,currentStep:Math.min(a-i.start,o)}))}_refresh(){const t=this;t._request||(t._running=!0,t._request=r.call(window,()=>{t._update(),t._request=null,t._running&&t._refresh()}))}_update(r=Date.now()){const s=this;let l=0;s._charts.forEach((a,n)=>{if(a.running&&a.items.length){const o=a.items;let t,e=o.length-1,i=!1;for(;0<=e;--e)t=o[e],t._active?(t._total>a.duration&&(a.duration=t._total),t.tick(r),i=!0):(o[e]=o[o.length-1],o.pop());i&&(n.draw(),s._notify(n,a,r,"progress")),o.length||(a.running=!1,s._notify(n,a,r,"complete"),a.initial=!1),l+=o.length}}),s._lastDate=r,0===l&&(s._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 0<this._getAnims(t).items.length}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;t=this._charts.get(t);return!!(t&&t.running&&t.items.length)}stop(e){const i=this._charts.get(e);if(i&&i.items.length){const a=i.items;let t=a.length-1;for(;0<=t;--t)a[t].cancel();i.items=[],this._notify(e,i,Date.now(),"complete")}}remove(t){return this._charts.delete(t)}};const o={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},e="0123456789ABCDEF",i=t=>e[15&t],a=t=>e[(240&t)>>4]+e[15&t],n=t=>(240&t)>>4==(15&t);function c(t){return t+.5|0}const d=(t,e,i)=>Math.max(Math.min(t,i),e);function u(t){return d(c(2.55*t),0,255)}function g(t){return d(c(255*t),0,255)}function p(t){return d(c(t/2.55)/100,0,1)}function m(t){return d(c(100*t),0,100)}const x=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,b=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function v(i,t,a){const n=t*Math.min(a,1-a),e=(t,e=(t+i/30)%12)=>a-n*Math.max(Math.min(e-3,9-e,1),-1);return[e(0),e(8),e(4)]}function _(i,a,n){i=(t,e=(t+i/60)%6)=>n-n*a*Math.max(Math.min(e,4-e,1),0);return[i(5),i(3),i(1)]}function y(t,e,i){const a=v(t,1,.5);let n;for(1<e+i&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)a[n]*=1-e-i,a[n]+=e;return a}function w(t){var e=t.r/255,i=t.g/255,a=t.b/255,n=Math.max(e,i,a),o=Math.min(e,i,a),t=(n+o)/2;let r,s,l;return n!==o&&(l=n-o,s=.5<t?l/(2-n-o):l/(n+o),r=n===e?(i-a)/l+(i<a?6:0):n===i?(a-e)/l+2:(e-i)/l+4,r=60*r+.5),[0|r,s||0,t]}function M(t,e,i,a){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,a)).map(g)}function k(t,e,i){return M(v,t,e,i)}function S(t){return(t%360+360)%360}const P={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"},D={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let C;function O(e,i,a){if(e){let t=w(e);t[i]=Math.max(0,Math.min(t[i]+t[i]*a,0===i?360:1)),t=k(t),e.r=t[0],e.g=t[1],e.b=t[2]}}function A(t,e){return t&&Object.assign(e||{},t)}function L(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?3<=t.length&&(e={r:t[0],g:t[1],b:t[2],a:255},3<t.length&&(e.a=g(t[3]))):(e=A(t,{r:0,g:0,b:0,a:1})).a=g(e.a),e}function E(t){return("r"===t.charAt(0)?function(t){t=x.exec(t);let e,i,a,n=255;if(t){if(t[7]!==e){const o=+t[7];n=255&(t[8]?u(o):255*o)}return e=+t[1],i=+t[3],a=+t[5],e=255&(t[2]?u(e):e),i=255&(t[4]?u(i):i),a=255&(t[6]?u(a):a),{r:e,g:i,b:a,a:n}}}:function(t){var e=b.exec(t);let i,a=255;if(e){void 0!==e[5]&&(a=(e[6]?u:g)(+e[5]));var n=S(+e[2]),o=+e[3]/100,t=+e[4]/100;return{r:(i="hwb"===e[1]?M(y,n,o,t):"hsv"===e[1]?M(_,n,o,t):k(n,o,t))[0],g:i[1],b:i[2],a:a}}})(t)}class I{constructor(t){if(t instanceof I)return t;var e,i,a=typeof t;let n;"object"==a?n=L(t):"string"==a&&(a=(e=t).length,"#"===e[0]&&(4===a||5===a?i={r:255&17*o[e[1]],g:255&17*o[e[2]],b:255&17*o[e[3]],a:5===a?17*o[e[4]]:255}:7!==a&&9!==a||(i={r:o[e[1]]<<4|o[e[2]],g:o[e[3]]<<4|o[e[4]],b:o[e[5]]<<4|o[e[6]],a:9===a?o[e[7]]<<4|o[e[8]]:255})),n=i||(i=t,C||(C=function(){const t={},e=Object.keys(D),i=Object.keys(P);let a,n,o,r,s;for(a=0;a<e.length;a++){for(r=s=e[a],n=0;n<i.length;n++)o=i[n],s=s.replace(o,P[o]);o=parseInt(D[r],16),t[s]=[o>>16&255,o>>8&255,255&o]}return t}(),C.transparent=[0,0,0,0]),(i=C[i.toLowerCase()])&&{r:i[0],g:i[1],b:i[2],a:4===i.length?i[3]:255})||E(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=A(this._rgb);return t&&(t.a=p(t.a)),t}set rgb(t){this._rgb=L(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${p(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=t,e=n(e.r)&&n(e.g)&&n(e.b)&&n(e.a)?i:a,t&&"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):"")):this._rgb;var t,e}hslString(){return this._valid?function(t){if(t){var e=w(t),i=e[0],a=m(e[1]),e=m(e[2]);return t.a<255?`hsla(${i}, ${a}%, ${e}%, ${p(t.a)})`:`hsl(${i}, ${a}%, ${e}%)`}}(this._rgb):this._rgb}mix(t,e){if(t){const a=this.rgb,n=t.rgb;var i=void 0===e?.5:e,t=2*i-1,e=a.a-n.a,t=(1+(t*e==-1?t:(t+e)/(1+t*e)))/2,e=1-t;a.r=255&t*a.r+e*n.r+.5,a.g=255&t*a.g+e*n.g+.5,a.b=255&t*a.b+e*n.b+.5,a.a=i*a.a+(1-i)*n.a,this.rgb=a}return this}clone(){return new I(this.rgb)}alpha(t){return this._rgb.a=g(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=c(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return O(this._rgb,2,t),this}darken(t){return O(this._rgb,2,-t),this}saturate(t){return O(this._rgb,1,t),this}desaturate(t){return O(this._rgb,1,-t),this}rotate(t){return e=this._rgb,i=t,(t=w(e))[0]=S(t[0]+i),t=k(t),e.r=t[0],e.g=t[1],e.b=t[2],this;var e,i}}function z(t){return new I(t)}const F=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function V(t){return F(t)?t:z(t)}function B(t){return F(t)?t:z(t).saturate(.5).darken(.1).hexString()}function t(){}const W=function(){let t=0;return function(){return t++}}();function H(t){return null==t}function N(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function j(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const Y=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function $(t,e){return Y(t)?t:e}function U(t,e){return void 0===t?e:t}const X=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,q=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function K(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function G(t,e,i,a){let n,o,r;if(N(t))if(o=t.length,a)for(n=o-1;0<=n;n--)e.call(i,t[n],n);else for(n=0;n<o;n++)e.call(i,t[n],n);else if(j(t))for(r=Object.keys(t),o=r.length,n=0;n<o;n++)e.call(i,t[r[n]],r[n])}function Z(t,e){let i,a,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,a=t.length;i<a;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Q(e){if(N(e))return e.map(Q);if(j(e)){const i=Object.create(null),a=Object.keys(e),n=a.length;let t=0;for(;t<n;++t)i[a[t]]=Q(e[a[t]]);return i}return e}function J(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function tt(t,e,i,a){var n;J(t)&&(n=e[t],i=i[t],j(n)&&j(i)?et(n,i,a):e[t]=Q(i))}function et(i,a,n){const e=N(a)?a:[a],o=e.length;if(!j(i))return i;const r=(n=n||{}).merger||tt;for(let t=0;t<o;++t)if(j(a=e[t])){const o=Object.keys(a);for(let t=0,e=o.length;t<e;++t)r(o[t],i,a,n)}return i}function it(t,e){return et(t,e,{merger:at})}function at(t,e,i){var a;J(t)&&(a=e[t],i=i[t],j(a)&&j(i)?it(a,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Q(i)))}function nt(t,e){e=t.indexOf(".",e);return-1===e?t.length:e}function ot(t,e){if(""===e)return t;let i=0,a=nt(e,i);for(;t&&a>i;)t=t[e.substr(i,a-i)],i=a+1,a=nt(e,i);return t}function rt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const st=t=>void 0!==t,lt=t=>"function"==typeof t,ht=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},ct=Object.create(null),dt=Object.create(null);function ut(i,t){if(!t)return i;var a=t.split(".");for(let t=0,e=a.length;t<e;++t){var n=a[t];i=i[n]||(i[n]=Object.create(null))}return i}function gt(t,e,i){return"string"==typeof e?et(ut(t,e),i):et(ut(t,""),e)}var ft=new class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>B(e.backgroundColor),this.hoverBorderColor=(t,e)=>B(e.borderColor),this.hoverColor=(t,e)=>B(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.describe(t)}set(t,e){return gt(this,t,e)}get(t){return ut(this,t)}describe(t,e){return gt(dt,t,e)}override(t,e){return gt(ct,t,e)}route(t,e,i,a){const n=ut(this,t),o=ut(this,i),r="_"+e;Object.defineProperties(n,{[r]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){var t=this[r],e=o[a];return j(t)?Object.assign({},e,t):U(t,e)},set(t){this[r]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});const pt=Math.PI,mt=2*pt,xt=mt+pt,bt=Number.POSITIVE_INFINITY,vt=pt/180,_t=pt/2,yt=pt/4,wt=2*pt/3,Mt=Math.log10,kt=Math.sign;function St(t){var e=Math.pow(10,Math.floor(Mt(t))),t=t/e;return(t<=1?1:t<=2?2:t<=5?5:10)*e}function Pt(t){const e=[],i=Math.sqrt(t);let a;for(a=1;a<i;a++)t%a==0&&(e.push(a),e.push(t/a));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}function Dt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Ct(t,e,i){return Math.abs(t-e)<i}function Ot(t,e){var i=Math.round(t);return i-e<=t&&t<=i+e}function At(t,e,i){let a,n,o;for(a=0,n=t.length;a<n;a++)o=t[a][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Tt(t){return t*(pt/180)}function Rt(t){return t*(180/pt)}function Lt(i){if(Y(i)){let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}}function Et(t,e){var i=e.x-t.x,e=e.y-t.y,t=Math.sqrt(i*i+e*e);let a=Math.atan2(e,i);return a<-.5*pt&&(a+=mt),{angle:a,distance:t}}function It(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function zt(t,e){return(t-e+xt)%mt-pt}function Ft(t){return(t%mt+mt)%mt}function Vt(t,e,i){var a=Ft(t),n=Ft(e),o=Ft(i),r=Ft(n-a),t=Ft(o-a),e=Ft(a-n),i=Ft(a-o);return a===n||a===o||t<r&&e<i}function Bt(t,e,i){return Math.max(e,Math.min(i,t))}function Wt(t){return Bt(t,-32768,32767)}function Ht(t){return!t||H(t.size)||H(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Nt(t,e,i,a,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),a=o>a?o:a}function jt(t,e,i,a){let n=(a=a||{}).data=a.data||{},o=a.garbageCollect=a.garbageCollect||[];a.font!==e&&(n=a.data={},o=a.garbageCollect=[],a.font=e),t.save(),t.font=e;let r=0;var s=i.length;let l,h,c,d,u;for(l=0;l<s;l++)if(null!=(d=i[l])&&!0!==N(d))r=Nt(t,n,o,r,d);else if(N(d))for(h=0,c=d.length;h<c;h++)null==(u=d[h])||N(u)||(r=Nt(t,n,o,r,u));t.restore();var g=o.length/2;if(g>i.length){for(l=0;l<g;l++)delete n[o[l]];o.splice(0,g)}return r}function Yt(t,e,i){t=t.currentDevicePixelRatio,i=0!==i?Math.max(i/2,.5):0;return Math.round((e-i)*t)/t+i}function $t(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Ut(t,e,i,a){let n,o,r,s,l;const h=e.pointStyle,c=e.rotation,d=e.radius;let u=(c||0)*vt;if(h&&"object"==typeof h&&("[object HTMLImageElement]"===(n=h.toString())||"[object HTMLCanvasElement]"===n))return t.save(),t.translate(i,a),t.rotate(u),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),h){default:t.arc(i,a,d,0,mt),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(u)*d,a-Math.cos(u)*d),u+=wt,t.lineTo(i+Math.sin(u)*d,a-Math.cos(u)*d),u+=wt,t.lineTo(i+Math.sin(u)*d,a-Math.cos(u)*d),t.closePath();break;case"rectRounded":l=.516*d,s=d-l,o=Math.cos(u+yt)*s,r=Math.sin(u+yt)*s,t.arc(i-o,a-r,l,u-pt,u-_t),t.arc(i+r,a-o,l,u-_t,u),t.arc(i+o,a+r,l,u,u+_t),t.arc(i-r,a+o,l,u+_t,u+pt),t.closePath();break;case"rect":if(!c){s=Math.SQRT1_2*d,t.rect(i-s,a-s,2*s,2*s);break}u+=yt;case"rectRot":o=Math.cos(u)*d,r=Math.sin(u)*d,t.moveTo(i-o,a-r),t.lineTo(i+r,a-o),t.lineTo(i+o,a+r),t.lineTo(i-r,a+o),t.closePath();break;case"crossRot":u+=yt;case"cross":o=Math.cos(u)*d,r=Math.sin(u)*d,t.moveTo(i-o,a-r),t.lineTo(i+o,a+r),t.moveTo(i+r,a-o),t.lineTo(i-r,a+o);break;case"star":o=Math.cos(u)*d,r=Math.sin(u)*d,t.moveTo(i-o,a-r),t.lineTo(i+o,a+r),t.moveTo(i+r,a-o),t.lineTo(i-r,a+o),u+=yt,o=Math.cos(u)*d,r=Math.sin(u)*d,t.moveTo(i-o,a-r),t.lineTo(i+o,a+r),t.moveTo(i+r,a-o),t.lineTo(i-r,a+o);break;case"line":o=Math.cos(u)*d,r=Math.sin(u)*d,t.moveTo(i-o,a-r),t.lineTo(i+o,a+r);break;case"dash":t.moveTo(i,a),t.lineTo(i+Math.cos(u)*d,a+Math.sin(u)*d)}t.fill(),0<e.borderWidth&&t.stroke()}}function Xt(t,e,i){return i=i||.5,t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function qt(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Kt(t){t.restore()}function Gt(t,e,i,a,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const a=(e.x+i.x)/2;t.lineTo(a,e.y),t.lineTo(a,i.y)}else"after"===n!=!!a?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Zt(t,e,i,a){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(a?e.cp1x:e.cp2x,a?e.cp1y:e.cp2y,a?i.cp2x:i.cp1x,a?i.cp2y:i.cp1y,i.x,i.y)}function Qt(t,e,i,a,n,o={}){const r=N(e)?e:[e],s=0<o.strokeWidth&&""!==o.strokeColor;let l,h;for(t.save(),o.translation&&t.translate(o.translation[0],o.translation[1]),H(o.rotation)||t.rotate(o.rotation),t.font=n.string,o.color&&(t.fillStyle=o.color),o.textAlign&&(t.textAlign=o.textAlign),o.textBaseline&&(t.textBaseline=o.textBaseline),l=0;l<r.length;++l){if(h=r[l],s&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),H(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(h,i,a,o.maxWidth)),t.fillText(h,i,a,o.maxWidth),o.strikethrough||o.underline){const e=t.measureText(h),n=i-e.actualBoundingBoxLeft,r=i+e.actualBoundingBoxRight,s=a-e.actualBoundingBoxAscent,l=a+e.actualBoundingBoxDescent,c=o.strikethrough?(s+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=o.decorationWidth||2,t.moveTo(n,c),t.lineTo(r,c),t.stroke()}a+=n.lineHeight}t.restore()}function Jt(t,e){var{x:i,y:a,w:n,h:o,radius:e}=e;t.arc(i+e.topLeft,a+e.topLeft,e.topLeft,-_t,pt,!0),t.lineTo(i,a+o-e.bottomLeft),t.arc(i+e.bottomLeft,a+o-e.bottomLeft,e.bottomLeft,pt,_t,!0),t.lineTo(i+n-e.bottomRight,a+o),t.arc(i+n-e.bottomRight,a+o-e.bottomRight,e.bottomRight,_t,0,!0),t.lineTo(i+n,a+e.topRight),t.arc(i+n-e.topRight,a+e.topRight,e.topRight,0,-_t,!0),t.lineTo(i+e.topLeft,a)}function te(e,i,t){t=t||(t=>e[t]<i);let a,n=e.length-1,o=0;for(;1<n-o;)t(a=o+n>>1)?o=a:n=a;return{lo:o,hi:n}}const ee=(e,i,a)=>te(e,a,t=>e[t][i]<a),ie=(e,i,a)=>te(e,a,t=>e[t][i]>=a);function ae(t,e,i){let a=0,n=t.length;for(;a<n&&t[a]<e;)a++;for(;n>a&&t[n-1]>i;)n--;return 0<a||n<t.length?t.slice(a,n):t}const ne=["push","pop","shift","splice","unshift"];function oe(n,t){n._chartjs?n._chartjs.listeners.push(t):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ne.forEach(t=>{const i="_onData"+rt(t),a=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...e){var t=a.apply(this,e);return n._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),t}})}))}function re(e,t){var i=e._chartjs;if(i){const a=i.listeners,n=a.indexOf(t);-1!==n&&a.splice(n,1),0<a.length||(ne.forEach(t=>{delete e[t]}),delete e._chartjs)}}function se(t){const e=new Set;let i,a;for(i=0,a=t.length;i<a;++i)e.add(t[i]);if(e.size===a)return t;const n=[];return e.forEach(t=>{n.push(t)}),n}function le(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function he(t,e,i){let a;return"string"==typeof t?(a=parseInt(t,10),-1!==t.indexOf("%")&&(a=a/100*e.parentNode[i])):a=t,a}const ce=t=>window.getComputedStyle(t,null);function de(t,e){return ce(t).getPropertyValue(e)}const ue=["top","right","bottom","left"];function ge(e,i,a){const n={};a=a?"-"+a:"";for(let t=0;t<4;t++){var o=ue[t];n[o]=parseFloat(e[i+"-"+o+a])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function fe(t,e){var{canvas:i,currentDevicePixelRatio:a}=e,n=ce(i),o="border-box"===n.boxSizing,r=ge(n,"padding"),s=ge(n,"border","width"),{x:l,y:h,box:n}=function(t,e){var i=t.native||t,a=i.touches,n=a&&a.length?a[0]:i,{offsetX:t,offsetY:a}=n;let o,r,s=!1;if(i=i.target,!(0<t||0<a)||i&&i.shadowRoot){const l=e.getBoundingClientRect();o=n.clientX-l.left,r=n.clientY-l.top,s=!0}else o=t,r=a;return{x:o,y:r,box:s}}(t,i),t=r.left+(n&&s.left),n=r.top+(n&&s.top);let{width:c,height:d}=e;return o&&(c-=r.width+s.width,d-=r.height+s.height),{x:Math.round((l-t)/c*i.width/a),y:Math.round((h-n)/d*i.height/a)}}const pe=t=>Math.round(10*t)/10;function me(t,e,i,a){var n=ce(t),o=ge(n,"margin"),r=he(n.maxWidth,t,"clientWidth")||bt,s=he(n.maxHeight,t,"clientHeight")||bt,i=function(t,e,i){let a,n;if(void 0===e||void 0===i){const o=le(t);if(o){const t=o.getBoundingClientRect(),r=ce(o),s=ge(r,"border","width"),l=ge(r,"padding");e=t.width-l.width-s.width,i=t.height-l.height-s.height,a=he(r.maxWidth,o,"clientWidth"),n=he(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:a||bt,maxHeight:n||bt}}(t,e,i);let{width:l,height:h}=i;if("content-box"===n.boxSizing){const t=ge(n,"border","width"),e=ge(n,"padding");l-=e.width+t.width,h-=e.height+t.height}return l=Math.max(0,l-o.width),h=Math.max(0,a?Math.floor(l/a):h-o.height),l=pe(Math.min(l,r,i.maxWidth)),h=pe(Math.min(h,s,i.maxHeight)),l&&!h&&(h=pe(l/2)),{width:l,height:h}}function xe(t,e,i){const a=t.currentDevicePixelRatio=e||1,{canvas:n,width:o,height:r}=t;n.height=r*a,n.width=o*a,t.ctx.setTransform(a,0,0,a,0,0),n.style&&(i||!n.style.height&&!n.style.width)&&(n.style.height=r+"px",n.style.width=o+"px")}var be=function(){let t=!1;try{var e={get passive(){return!(t=!0)}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function ve(t,e){const i=de(t,e),a=i&&i.match(/^(\d+)(\.\d+)?px$/);return a?+a[1]:void 0}function _e(t,e){return"native"in t?{x:t.x,y:t.y}:fe(t,e)}function ye(t,i,a,n,o){var r=t.getSortedVisibleDatasetMetas(),s=a[i];for(let t=0,e=r.length;t<e;++t){const{index:a,data:l}=r[t],{lo:h,hi:c}=function(t,e,i,a){const{controller:n,data:o,_sorted:r}=t,s=n._cachedMeta.iScale;if(s&&e===s.axis&&r&&o.length){const t=s._reversePixels?ie:ee;if(!a)return t(o,e,i);if(n._sharedOptions){const a=o[0],n="function"==typeof a.getRange&&a.getRange(e);if(n){const a=t(o,e,i-n),r=t(o,e,i+n);return{lo:a.lo,hi:r.hi}}}}return{lo:0,hi:o.length-1}}(r[t],i,s,o);for(let t=h;t<=c;++t){const i=l[t];i.skip||n(i,a,t)}}}function we(t,a,e,n){const o=[];return Xt(a,t.chartArea,t._minPadding)&&ye(t,e,a,function(t,e,i){t.inRange(a.x,a.y,n)&&o.push({element:t,datasetIndex:e,index:i})},!0),o}function Me(t,n,e,o,r){const s=function(t){const a=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,e){var i=a?Math.abs(t.x-e.x):0,e=n?Math.abs(t.y-e.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(e,2))}}(e);let l=Number.POSITIVE_INFINITY,h=[];return Xt(n,t.chartArea,t._minPadding)&&ye(t,e,n,function(t,e,i){var a;o&&!t.inRange(n.x,n.y,r)||(a=t.getCenterPoint(r),(a=s(n,a))<l?(h=[{element:t,datasetIndex:e,index:i}],l=a):a===l&&h.push({element:t,datasetIndex:e,index:i}))}),h}function ke(t,e,i,l){const h=_e(e,t),c=[],d=i.axis,u="x"===d?"inXRange":"inYRange";let g=!1;return function(){var i,a,n,o,r,s=t.getSortedVisibleDatasetMetas();for(let t=0,e=s.length;t<e;++t){({index:i,data:a}=s[t]);for(let t=0,e=a.length;t<e;++t)(r=a[t]).skip||(n=r,o=i,r=t,n[u](h[d],l)&&c.push({element:n,datasetIndex:o,index:r}),n.inRange(h.x,h.y,l)&&(g=!0))}}(),i.intersect&&!g?[]:c}var Se={modes:{index(t,e,i,a){const n=_e(e,t),o=i.axis||"x",r=i.intersect?we(t,n,o,a):Me(t,n,o,!1,a),s=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{var e=r[0].index,i=t.data[e];i&&!i.skip&&s.push({element:i,datasetIndex:t.index,index:e})}),s):[]},dataset(t,e,i,a){var n=_e(e,t),e=i.axis||"xy";let o=i.intersect?we(t,n,e,a):Me(t,n,e,!1,a);if(0<o.length){const r=o[0].datasetIndex,i=t.getDatasetMeta(r).data;o=[];for(let t=0;t<i.length;++t)o.push({element:i[t],datasetIndex:r,index:t})}return o},point:(t,e,i,a)=>we(t,_e(e,t),i.axis||"xy",a),nearest:(t,e,i,a)=>Me(t,_e(e,t),i.axis||"xy",i.intersect,a),x:(t,e,i,a)=>(i.axis="x",ke(t,e,i,a)),y:(t,e,i,a)=>(i.axis="y",ke(t,e,i,a))}};const Pe=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),De=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Ce(t,e){var i=(""+t).match(Pe);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function Oe(e,i){const t={},a=j(i),n=a?Object.keys(i):i,o=j(e)?a?t=>U(e[t],e[i[t]]):t=>e[t]:()=>e;for(const e of n)t[e]=+o(e)||0;return t}function Ae(t){return Oe(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Te(t){return Oe(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Re(t){const e=Ae(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Le(t,e){e=e||ft.font;let i=U((t=t||{}).size,e.size);"string"==typeof i&&(i=parseInt(i,10));let a=U(t.style,e.style);a&&!(""+a).match(De)&&(console.warn('Invalid font style specified: "'+a+'"'),a="");const n={family:U(t.family,e.family),lineHeight:Ce(U(t.lineHeight,e.lineHeight),i),size:i,style:a,weight:U(t.weight,e.weight),string:""};return n.string=Ht(n),n}function Ee(t,e,i,a){let n,o,r,s=!0;for(n=0,o=t.length;n<o;++n)if(r=t[n],void 0!==r&&(void 0!==e&&"function"==typeof r&&(r=r(e),s=!1),void 0!==i&&N(r)&&(r=r[i%r.length],s=!1),void 0!==r))return a&&!s&&(a.cacheable=!1),r}function Ie(t,e){var{min:i,max:t}=t;return{min:i-Math.abs(q(e,i)),max:t+q(e,t)}}const ze=["left","top","right","bottom"];function Fe(t,e){return t.filter(t=>t.pos===e)}function Ve(t,e){return t.filter(t=>-1===ze.indexOf(t.pos)&&t.box.axis===e)}function Be(t,a){return t.sort((t,e)=>{var i=a?e:t,e=a?t:e;return i.weight===e.weight?i.index-e.index:i.weight-e.weight})}function We(t,e,i,a){return Math.max(t[i],e[i])+Math.max(t[a],e[a])}function He(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Ne(t,i){const a=i.maxPadding;return function(t){const e={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{e[t]=Math.max(i[t],a[t])}),e}(t?["left","right"]:["top","bottom"])}function je(t,e,i){const a=[];let n,o,r,s,l,h;for(n=0,o=t.length,l=0;n<o;++n){r=t[n],s=r.box,s.update(r.width||e.w,r.height||e.h,Ne(r.horizontal,e));const{same:o,other:c}=function(t,e,i){const a=i.box,n=t.maxPadding;j(i.pos)||(i.size&&(t[i.pos]-=i.size),i.size=i.horizontal?a.height:a.width,t[i.pos]+=i.size),a.getPadding&&He(n,a.getPadding());var o=Math.max(0,e.outerWidth-We(n,t,"left","right")),r=Math.max(0,e.outerHeight-We(n,t,"top","bottom")),s=o!==t.w,e=r!==t.h;return t.w=o,t.h=r,i.horizontal?{same:s,other:e}:{same:e,other:s}}(e,i,r);l|=o&&a.length,h=h||c,s.fullSize||a.push(r)}return l&&je(a,e,i)||h}function Ye(t,e,i){var a=i.padding;let n,o,r,s,l=e.x,h=e.y;for(n=0,o=t.length;n<o;++n)r=t[n],s=r.box,r.horizontal?(s.left=(s.fullSize?a:e).left,s.right=s.fullSize?i.outerWidth-a.right:e.left+e.w,s.top=h,s.bottom=h+s.height,s.width=s.right-s.left,h=s.bottom):(s.left=l,s.right=l+s.width,s.top=(s.fullSize?a:e).top,s.bottom=s.fullSize?i.outerHeight-a.right:e.top+e.h,s.height=s.bottom-s.top,l=s.right);e.x=l,e.y=h}ft.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});var $e={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){e=t.boxes?t.boxes.indexOf(e):-1;-1!==e&&t.boxes.splice(e,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(l,t,e,i){if(l){const n=Re(l.options.layout.padding),o=t-n.width,r=e-n.height,s=function(){const t=function(t){const e=[];let i,a,n;for(i=0,a=(t||[]).length;i<a;++i)n=t[i],e.push({index:i,box:n,pos:n.position,horizontal:n.isHorizontal(),weight:n.weight});return e}(l.boxes),e=Be(t.filter(t=>t.box.fullSize),!0),i=Be(Fe(t,"left"),!0),a=Be(Fe(t,"right")),n=Be(Fe(t,"top"),!0),o=Be(Fe(t,"bottom")),r=Ve(t,"x"),s=Ve(t,"y");return{fullSize:e,leftAndTop:i.concat(n),rightAndBottom:a.concat(s).concat(o).concat(r),chartArea:Fe(t,"chartArea"),vertical:i.concat(a).concat(s),horizontal:n.concat(o).concat(r)}}(),h=s.vertical,c=s.horizontal;G(l.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});var a=h.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,e=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/a,hBoxMaxHeight:r/2}),a=Object.assign({},n);He(a,Re(i));const d=Object.assign({maxPadding:a,w:o,h:r,x:n.left,y:n.top},n);!function(t,e){let i,a,n;for(i=0,a=t.length;i<a;++i)n=t[i],n.horizontal?(n.width=n.box.fullSize&&e.availableWidth,n.height=e.hBoxMaxHeight):(n.width=e.vBoxMaxWidth,n.height=n.box.fullSize&&e.availableHeight)}(h.concat(c),e),je(s.fullSize,d,e),je(h,d,e),je(c,d,e)&&je(h,d,e),function(i){const a=i.maxPadding;function t(t){var e=Math.max(a[t]-i[t],0);return i[t]+=e,e}i.y+=t("top"),i.x+=t("left"),t("right"),t("bottom")}(d),Ye(s.leftAndTop,d,e),d.x+=d.w,d.y+=d.h,Ye(s.rightAndBottom,d,e),l.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},G(s.chartArea,t=>{const e=t.box;Object.assign(e,l.chartArea),e.update(d.w,d.h)})}}};class Ue{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,a){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,a?Math.floor(e/a):i)}}isAttached(t){return!0}}class Xe extends Ue{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}}const qe={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ke=t=>null===t||""===t,Ge=!!be&&{passive:!0};function Ze(t,e,n){const i=t.canvas,o=i&&le(i)||i,a=new MutationObserver(t=>{const a=le(o);t.forEach(e=>{for(let t=0;t<e.addedNodes.length;t++){var i=e.addedNodes[t];i!==o&&i!==a||n(e.target)}})});return a.observe(document,{childList:!0,subtree:!0}),a}function Qe(t,e,i){const a=t.canvas,n=a&&le(a);if(n){const o=new MutationObserver(t=>{t.forEach(e=>{for(let t=0;t<e.removedNodes.length;t++)if(e.removedNodes[t]===a){i();break}})});return o.observe(n,{childList:!0}),o}}const Je=new Map;let ti=0;function ei(){const i=window.devicePixelRatio;i!==ti&&(ti=i,Je.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function ii(t,e,a){const i=t.canvas,n=i&&le(i);if(n){const r=l((t,e)=>{var i=n.clientWidth;a(t,e),i<n.clientWidth&&a()},window),s=new ResizeObserver(t=>{var e=t[0],t=e.contentRect.width,e=e.contentRect.height;0===t&&0===e||r(t,e)});return s.observe(n),o=t,t=r,Je.size||window.addEventListener("resize",ei),Je.set(o,t),s;var o}}function ai(t,e,i){i&&i.disconnect(),"resize"===e&&(t=t,Je.delete(t),Je.size||window.removeEventListener("resize",ei))}function ni(e,t,i){var a=e.canvas,n=l(t=>{null!==e.ctx&&i(function(t,e){var i=qe[t.type]||t.type,{x:a,y:n}=fe(t,e);return{type:i,chart:e,native:t,x:void 0!==a?a:null,y:void 0!==n?n:null}}(t,e))},e,t=>{t=t[0];return[t,t.offsetX,t.offsetY]});return a.addEventListener(t,n,Ge),n}class oi extends Ue{acquireContext(t,e){var i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,a=t.getAttribute("height"),n=t.getAttribute("width");if(t.$chartjs={initial:{height:a,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Ke(n)){const e=ve(t,"width");void 0!==e&&(t.width=e)}if(Ke(a))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ve(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const i=t.canvas;if(!i.$chartjs)return!1;const a=i.$chartjs.initial;["height","width"].forEach(t=>{var e=a[t];H(e)?i.removeAttribute(t):i.setAttribute(t,e)});const e=a.style||{};return Object.keys(e).forEach(t=>{i.style[t]=e[t]}),i.width=i.width,delete i.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const a=t.$proxies||(t.$proxies={}),n={attach:Ze,detach:Qe,resize:ii}[e]||ni;a[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),a=i[e];a&&(({attach:ai,detach:ai,resize:ai}[e]||function(t,e,i){t.canvas.removeEventListener(e,i,Ge)})(t,e,a),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,a){return me(t,e,i,a)}isAttached(t){t=le(t);return!(!t||!le(t))}}var ri=Object.freeze({__proto__:null,BasePlatform:Ue,BasicPlatform:Xe,DomPlatform:oi});const si=t=>0===t||1===t,li=(t,e,i)=>-Math.pow(2,10*--t)*Math.sin((t-e)*mt/i),hi=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*mt/i)+1,ci={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-(--t*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>--t*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*_t),easeOutSine:t=>Math.sin(t*_t),easeInOutSine:t=>-.5*(Math.cos(pt*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>si(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>1<=t?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1- --t*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>si(t)?t:li(t,.075,.3),easeOutElastic:t=>si(t)?t:hi(t,.075,.3),easeInOutElastic(t){return si(t)?t:t<.5?.5*li(2*t,.1125,.45):.5+.5*hi(2*t-1,.1125,.45)},easeInBack(t){return t*t*(2.70158*t-1.70158)},easeOutBack(t){return--t*t*(2.70158*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ci.easeOutBounce(1-t),easeOutBounce(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ci.easeInBounce(2*t):.5*ci.easeOutBounce(2*t-1)+.5},di="transparent",ui={boolean:(t,e,i)=>.5<i?e:t,color(t,e,i){const a=V(t||di),n=a.valid&&V(e||di);return n&&n.valid?n.mix(a,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class gi{constructor(t,e,i,a){var n=e[i];a=Ee([t.to,a,n,t.from]);n=Ee([t.from,n,a]);this._active=!0,this._fn=t.fn||ui[t.type||typeof n],this._easing=ci[t.easing]||ci.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=n,this._to=a,this._promises=void 0}active(){return this._active}update(t,e,i){var a,n,o,r=this;r._active&&(r._notify(!1),a=r._target[r._prop],n=i-r._start,o=r._duration-n,r._start=i,r._duration=Math.floor(Math.max(o,t.duration)),r._total+=n,r._loop=!!t.loop,r._to=Ee([t.to,e,a,t.from]),r._from=Ee([t.from,a,e]))}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){var e=this,i=t-e._start,a=e._duration,n=e._prop,o=e._from,r=e._loop,t=e._to;let s;if(e._active=o!==t&&(r||i<a),!e._active)return e._target[n]=t,void e._notify(!0);i<0?e._target[n]=o:(s=i/a%2,s=r&&1<s?2-s:s,s=e._easing(Math.min(1,Math.max(0,s))),e._target[n]=e._fn(o,t,s))}wait(){const i=this._promises||(this._promises=[]);return new Promise((t,e)=>{i.push({res:t,rej:e})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}ft.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const fi=Object.keys(ft.animation);ft.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),ft.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),ft.describe("animations",{_fallback:"animation"}),ft.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class pi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(a){if(j(a)){const n=this._properties;Object.getOwnPropertyNames(a).forEach(e=>{const t=a[e];if(j(t)){const i={};for(const a of fi)i[a]=t[a];(N(t.properties)&&t.properties||[e]).forEach(t=>{t!==e&&n.has(t)||n.set(t,i)})}})}}_animateOptions(t,e){const i=e.options,a=function(e,i){if(i){let t=e.options;if(t)return t.$shared&&(e.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t;e.options=i}}(t,i);if(!a)return[];e=this._createAnimations(a,i);return i.$shared&&function(e,t){const i=[],a=Object.keys(t);for(let t=0;t<a.length;t++){const n=e[a[t]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),e}_createAnimations(e,i){const a=this._properties,n=[],o=e.$animations||(e.$animations={}),t=Object.keys(i),r=Date.now();let s;for(s=t.length-1;0<=s;--s){const c=t[s];if("$"!==c.charAt(0))if("options"!==c){var l=i[c];let t=o[c];var h=a.get(c);if(t){if(h&&t.active()){t.update(h,l,r);continue}t.cancel()}h&&h.duration?(o[c]=t=new gi(h,e,c,l),n.push(t)):e[c]=l}else n.push(...this._animateOptions(e,i))}return n}update(t,e){if(0!==this._properties.size){var i=this._createAnimations(t,e);return i.length?(h.add(this._chart,i),!0):void 0}Object.assign(t,e)}}function mi(t,e){var i=t&&t.options||{},a=i.reverse,t=void 0===i.min?e:0,e=void 0===i.max?e:0;return{start:a?e:t,end:a?t:e}}function xi(t,e){const i=[],a=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=a.length;n<o;++n)i.push(a[n].index);return i}function bi(t,e,i,a){var n=t.keys,o="single"===a.mode;let r,s,l,h;if(null!==e){for(r=0,s=n.length;r<s;++r){if((l=+n[r])===i){if(a.all)continue;break}h=t.values[l],Y(h)&&(o||0===e||kt(e)===kt(h))&&(e+=h)}return e}}function vi(t,e){t=t&&t.options.stacked;return t||void 0===t&&void 0!==e.stack}function _i(t,e,i){for(const a of e.getMatchingVisibleMetas("bar").reverse()){const e=t[a.index];if(i&&0<e||!i&&e<0)return a.index}return null}function yi(t,e){const{chart:i,_cachedMeta:a}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:s}=a,l=o.axis,h=r.axis,c=(u=o,t=a,`${u.id}.${r.id}.`+(t.stack||t.type)),d=e.length;var u;let g;for(let t=0;t<d;++t){const i=e[t],{[l]:a,[h]:o}=i;g=(i._stacks||(i._stacks={}))[h]=function(t,e,i){const a=t[e]||(t[e]={});return a[i]||(a[i]={})}(n,c,a),g[s]=o,g._top=_i(g,r,!0),g._bottom=_i(g,r,!1)}}function wi(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function Mi(t,e){for(const i of e=e||t._parsed){const e=i._stacks;if(!e||void 0===e[t.vScale.id]||void 0===e[t.vScale.id][t.index])return;delete e[t.vScale.id][t.index]}}const ki=t=>"reset"===t||"none"===t,Si=(t,e)=>e?t:Object.assign({},t);class Pi{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=vi(t.vScale,t),this.addElements()}updateIndex(t){this.index=t}linkScales(){const t=this,e=t.chart,i=t._cachedMeta,a=t.getDataset(),n=(t,e,i,a)=>"x"===t?e:"r"===t?a:i,o=i.xAxisID=U(a.xAxisID,wi(e,"x")),r=i.yAxisID=U(a.yAxisID,wi(e,"y")),s=i.rAxisID=U(a.rAxisID,wi(e,"r")),l=i.indexAxis,h=i.iAxisID=n(l,o,r,s),c=i.vAxisID=n(l,r,o,s);i.xScale=t.getScaleForId(o),i.yScale=t.getScaleForId(r),i.rScale=t.getScaleForId(s),i.iScale=t.getScaleForId(h),i.vScale=t.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){var e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){var t=this._cachedMeta;this._data&&re(this._data,this),t._stacked&&Mi(t)}_dataCheck(){const t=this,e=t.getDataset(),i=e.data||(e.data=[]);j(i)?t._data=function(t){const e=Object.keys(t),i=new Array(e.length);let a,n,o;for(a=0,n=e.length;a<n;++a)o=e[a],i[a]={x:o,y:t[o]};return i}(i):t._data!==i&&(t._data&&(re(t._data,t),Mi(t._cachedMeta)),i&&Object.isExtensible(i)&&oe(i,t),t._data=i)}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this,i=e._cachedMeta,a=e.getDataset();let n=!1;e._dataCheck(),i._stacked=vi(i.vScale,i),i.stack!==a.stack&&(n=!0,Mi(i),i.stack=a.stack),e._resyncElements(t),n&&yi(e,i._parsed)}configure(){const t=this,e=t.chart.config,i=e.datasetScopeKeys(t._type),a=e.getOptionScopes(t.getDataset(),i,!0);t.options=e.createResolver(a,t.getContext()),t._parsing=t.options.parsing}parse(t,e){const i=this,{_cachedMeta:a,_data:n}=i,{iScale:o,_stacked:r}=a,s=o.axis;let l,h,c,d=0===t&&e===n.length||a._sorted,u=0<t&&a._parsed[t-1];if(!1===i._parsing)a._parsed=n,a._sorted=!0,c=n;else{c=N(n[t])?i.parseArrayData(a,n,t,e):j(n[t])?i.parseObjectData(a,n,t,e):i.parsePrimitiveData(a,n,t,e);const o=()=>null===h[s]||u&&h[s]<u[s];for(l=0;l<e;++l)a._parsed[l+t]=h=c[l],d&&(o()&&(d=!1),u=h);a._sorted=d}r&&yi(i,c)}parsePrimitiveData(t,e,i,a){const{iScale:n,vScale:o}=t,r=n.axis,s=o.axis,l=n.getLabels(),h=n===o,c=new Array(a);let d,u,g;for(d=0,u=a;d<u;++d)g=d+i,c[d]={[r]:h||n.parse(l[g],g),[s]:o.parse(e[g],g)};return c}parseArrayData(t,e,i,a){const{xScale:n,yScale:o}=t,r=new Array(a);let s,l,h,c;for(s=0,l=a;s<l;++s)c=e[h=s+i],r[s]={x:n.parse(c[0],h),y:o.parse(c[1],h)};return r}parseObjectData(t,e,i,a){const{xScale:n,yScale:o}=t,{xAxisKey:r="x",yAxisKey:s="y"}=this._parsing,l=new Array(a);let h,c,d,u;for(h=0,c=a;h<c;++h)u=e[d=h+i],l[h]={x:n.parse(ot(u,r),d),y:o.parse(ot(u,s),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){var a=this.chart,n=this._cachedMeta,o=e[t.axis];return bi({keys:xi(a,!0),values:e._stacks[t.axis]},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,a){var n=i[e.axis];let o=null===n?NaN:n;e=a&&i._stacks[e.axis];a&&e&&(a.values=e,t.min=Math.min(t.min,o),t.max=Math.max(t.max,o),o=bi(a,n,this._cachedMeta.index,{all:!0})),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this,a=i._cachedMeta,n=a._parsed,o=a._sorted&&t===a.iScale,r=n.length,s=i._getOtherScale(t),l=e&&a._stacked&&{keys:xi(i.chart,!0),values:null},h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=function(){var{min:t,max:e,minDefined:i,maxDefined:a}=s.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:a?e:Number.POSITIVE_INFINITY}}();let u,g,f,p;function m(){return f=n[u],g=f[t.axis],p=f[s.axis],!Y(g)||c>p||d<p}for(u=0;u<r&&(m()||(i.updateRangeFromParsed(h,t,f,l),!o));++u);if(o)for(u=r-1;0<=u;--u)if(!m()){i.updateRangeFromParsed(h,t,f,l);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let a,n,o;for(a=0,n=e.length;a<n;++a)o=e[a][t.axis],Y(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,a=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:a?""+a.getLabelForValue(n[a.axis]):""}}_update(t){const e=this,i=e._cachedMeta;e.configure(),e._cachedDataOpts={},e.update(t||"default"),i._clip=function(t){let e,i,a,n;return j(t)?(e=t.top,i=t.right,a=t.bottom,n=t.left):e=i=a=n=t,{top:e,right:i,bottom:a,left:n}}(U(e.options.clip,function(t,e,i){if(!1===i)return!1;t=mi(t,i),i=mi(e,i);return{top:i.end,right:t.end,bottom:i.start,left:t.start}}(i.xScale,i.yScale,e.getMaxOverflow())))}update(t){}draw(){const t=this,e=t._ctx,i=t.chart,a=t._cachedMeta,n=a.data||[],o=i.chartArea,r=[],s=t._drawStart||0,l=t._drawCount||n.length-s;let h;for(a.dataset&&a.dataset.draw(e,o,s,l),h=s;h<s+l;++h){const t=n[h];t.active?r.push(t):t.draw(e,o)}for(h=0;h<r.length;++h)r[h].draw(e,o)}getStyle(t,e){e=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(e):this.resolveDataElementOptions(t||0,e)}getContext(t,e,i){var a,n,o,r=this,s=r.getDataset();let l;if(0<=t&&t<r._cachedMeta.data.length){const e=r._cachedMeta.data[t];l=e.$context||(e.$context=(a=r.getContext(),n=t,o=e,Object.assign(Object.create(a),{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"}))),l.parsed=r.getParsed(t),l.raw=s.data[t]}else l=r.$context||(r.$context=(t=r.chart.getContext(),r=r.index,Object.assign(Object.create(t),{active:!1,dataset:void 0,datasetIndex:r,index:r,mode:"default",type:"dataset"}))),l.dataset=s;return l.active=!!e,l.mode=i,l}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 a=this,n="active"===e,o=a._cachedDataOpts,r=t+"-"+e,s=o[r],l=a.enableOptionSharing&&st(i);if(s)return Si(s,l);const h=a.chart.config,c=h.datasetElementScopeKeys(a._type,t),d=n?[t+"Hover","hover",t,""]:[t,""],u=h.getOptionScopes(a.getDataset(),c),g=Object.keys(ft.elements[t]),f=h.resolveNamedOptions(u,g,()=>a.getContext(i,n),d);return f.$shared&&(f.$shared=l,o[r]=Object.freeze(Si(f,l))),f}_resolveAnimations(t,e,i){const a=this,n=a.chart,o=a._cachedDataOpts,r="animation-"+e,s=o[r];if(s)return s;let l;if(!1!==n.options.animation){const n=a.chart.config,o=n.datasetAnimationScopeKeys(a._type,e),r=n.getOptionScopes(a.getDataset(),o);l=n.createResolver(r,a.getContext(t,i,e))}e=new pi(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(e)),e}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,a){ki(a)?Object.assign(t,i):this._resolveAnimations(e,a).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,a){t.active=a;var n=this.getStyle(e,a);this._resolveAnimations(e,i,a).update(t,{options:!a&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){var e=this,i=e._cachedMeta.data.length,a=e._data.length;i<a?e._insertElements(i,a-i,t):a<i&&e._removeElements(a,i-a);i=Math.min(a,i);i&&e.parse(0,i)}_insertElements(t,e,i=!0){const a=this,n=a._cachedMeta,o=n.data,r=t+e;let s;var l=t=>{for(t.length+=e,s=t.length-1;s>=r;s--)t[s]=t[s-e]};for(l(o),s=t;s<r;++s)o[s]=new a.dataElementType;a._parsing&&l(n._parsed),a.parse(t,e),i&&a.updateElements(o,t,e,"reset")}updateElements(t,e,i,a){}_removeElements(t,e){const i=this._cachedMeta;var a;this._parsing&&(a=i._parsed.splice(t,e),i._stacked&&Mi(i,a)),i.data.splice(t,e)}_onDataPush(){var t=arguments.length;this._insertElements(this.getDataset().data.length-t,t)}_onDataPop(){this._removeElements(this._cachedMeta.data.length-1,1)}_onDataShift(){this._removeElements(0,1)}_onDataSplice(t,e){this._removeElements(t,e),this._insertElements(t,arguments.length-2)}_onDataUnshift(){this._insertElements(0,arguments.length)}}Pi.defaults={},Pi.prototype.datasetElementType=null,Pi.prototype.dataElementType=null;class Di{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){var{x:e,y:t}=this.getProps(["x","y"],t);return{x:e,y:t}}hasValue(){return Dt(this.x)&&Dt(this.y)}getProps(t,e){const i=this,a=this.$animations;if(!e||!a)return i;const n={};return t.forEach(t=>{n[t]=a[t]&&a[t].active()?a[t]._to:i[t]}),n}}Di.defaults={},Di.defaultRoutes=void 0;const Ci=new Map;function Oi(t,e,n){return function(t,e){e=n||{};var i=t+JSON.stringify(e);let a=Ci.get(i);return a||(a=new Intl.NumberFormat(t,e),Ci.set(i,a)),a}(e).format(t)}const Ai={values:t=>N(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";var a=this.chart.options.locale;let n,o=t;if(1<i.length){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||1e15<e)&&(n="scientific"),o=function(t){let e=3<i.length?i[2].value-i[1].value:i[1].value-i[0].value;return 1<Math.abs(e)&&t!==Math.floor(t)&&(e=t-Math.floor(t)),e}(t)}var r=Mt(Math.abs(o)),r=Math.max(Math.min(-1*Math.floor(r),20),0),r={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(r,this.options.ticks.format),Oi(t,a,r)},logarithmic(t,e,i){if(0===t)return"0";var a=t/Math.pow(10,Math.floor(Mt(t)));return 1==a||2==a||5==a?Ai.numeric.call(this,t,e,i):""}};var Ti={formatters:Ai};function Ri(t,i){const e=t.options.ticks,a=e.maxTicksLimit||(c=(h=t).options.offset,t=h._tickSize(),c=h._length/t+(c?0:1),t=h._maxLength/t,Math.floor(Math.min(c,t))),n=e.major.enabled?function(t){const e=[];let i,a;for(i=0,a=t.length;i<a;i++)t[i].major&&e.push(i);return e}(i):[],o=n.length,r=n[0],s=n[o-1],l=[];var h,c;if(o>a)return function(t,e,i,a){let n,o=0,r=i[0];for(a=Math.ceil(a),n=0;n<t.length;n++)n===r&&(e.push(t[n]),o++,r=i[o*a])}(i,l,n,o/a),l;var d=function(t,i,e){var t=function(t){var e=t.length;let i,a;if(e<2)return!1;for(a=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==a)return!1;return a}(t),a=i.length/e;if(!t)return Math.max(a,1);var n=Pt(t);for(let t=0,e=n.length-1;t<e;t++){const i=n[t];if(i>a)return i}return Math.max(a,1)}(n,i,a);if(0<o){let t,e;const a=1<o?Math.round((s-r)/(o-1)):null;for(Li(i,l,d,H(a)?0:r-a,r),t=0,e=o-1;t<e;t++)Li(i,l,d,n[t],n[t+1]);return Li(i,l,d,s,H(a)?i.length:s+a),l}return Li(i,l,d),l}function Li(t,e,i,a,n){var o=U(a,0),r=Math.min(U(n,t.length),t.length);let s,l,h,c=0;for(i=Math.ceil(i),n&&(i=(s=n-a)/Math.floor(s/i)),h=o;h<0;)c++,h=Math.round(o+c*i);for(l=Math.max(o,0);l<r;l++)l===h&&(e.push(t[l]),c++,h=Math.round(o+c*i))}ft.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ti.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ft.route("scale.ticks","color","","color"),ft.route("scale.grid","color","","borderColor"),ft.route("scale.grid","borderColor","","borderColor"),ft.route("scale.title","color","","color"),ft.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),ft.describe("scales",{_fallback:"scale"});const Ei=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Ii(t,e){const i=[],a=t.length/e,n=t.length;let o=0;for(;o<n;o+=a)i.push(t[Math.floor(o)]);return i}function zi(t){return t.drawTicks?t.tickLength:0}function Fi(t,e){if(!t.display)return 0;var i=Le(t.font,e),e=Re(t.padding);return(N(t.text)?t.text.length:1)*i.lineHeight+e.height}class Vi extends Di{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){var e=this;e.options=t.setContext(e.getContext()),e.axis=t.axis,e._userMin=e.parse(t.min),e._userMax=e.parse(t.max),e._suggestedMin=e.parse(t.suggestedMin),e._suggestedMax=e.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){var{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:a}=this,t=$(t,Number.POSITIVE_INFINITY),e=$(e,Number.NEGATIVE_INFINITY),i=$(i,Number.POSITIVE_INFINITY),a=$(a,Number.NEGATIVE_INFINITY);return{min:$(t,i),max:$(e,a),minDefined:Y(t),maxDefined:Y(e)}}getMinMax(i){let a,{min:n,max:o,minDefined:r,maxDefined:s}=this.getUserBounds();if(r&&s)return{min:n,max:o};const l=this.getMatchingVisibleMetas();for(let t=0,e=l.length;t<e;++t)a=l[t].controller.getMinMax(this,i),r||(n=Math.min(n,a.min)),s||(o=Math.max(o,a.max));return{min:$(n,$(o,n)),max:$(o,$(n,o))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){K(this.options.beforeUpdate,[this])}update(t,e,i){var a=this,n=a.options.ticks,o=n.sampleSize;a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),a.ticks=null,a._labelSizes=null,a._gridLineItems=null,a._labelItems=null,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a._maxLength=a.isHorizontal()?a.width+i.left+i.right:a.height+i.top+i.bottom,a._dataLimitsCached||(a.beforeDataLimits(),a.determineDataLimits(),a.afterDataLimits(),a._range=Ie(a,a.options.grace),a._dataLimitsCached=!0),a.beforeBuildTicks(),a.ticks=a.buildTicks()||[],a.afterBuildTicks();i=o<a.ticks.length;a._convertTicksToLabels(i?Ii(a.ticks,o):a.ticks),a.configure(),a.beforeCalculateLabelRotation(),a.calculateLabelRotation(),a.afterCalculateLabelRotation(),n.display&&(n.autoSkip||"auto"===n.source)&&(a.ticks=Ri(a,a.ticks),a._labelSizes=null),i&&a._convertTicksToLabels(a.ticks),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate()}configure(){var t=this;let e,i,a=t.options.reverse;t.isHorizontal()?(e=t.left,i=t.right):(e=t.top,i=t.bottom,a=!a),t._startPixel=e,t._endPixel=i,t._reversePixels=a,t._length=i-e,t._alignToPixels=t.options.alignToPixels}afterUpdate(){K(this.options.afterUpdate,[this])}beforeSetDimensions(){K(this.options.beforeSetDimensions,[this])}setDimensions(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0}afterSetDimensions(){K(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),K(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){K(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){var e=this.options.ticks;let i,a,n;for(i=0,a=t.length;i<a;i++)n=t[i],n.label=K(e.callback,[n.value,i,t],this);for(i=0;i<a;i++)H(t[i].label)&&(t.splice(i,1),a--,i--)}afterTickToLabelConversion(){K(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){K(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){var t,e,i,a,n=this,o=n.options,r=o.ticks,s=n.ticks.length,l=r.minRotation||0,h=r.maxRotation;let c,d,u,g=l;!n._isVisible()||!r.display||h<=l||s<=1||!n.isHorizontal()?n.labelRotation=l:(e=(t=n._getLabelSizes()).widest.width,i=t.highest.height,a=Bt(n.chart.width-e,0,n.maxWidth),(o.offset?n.maxWidth/s:a/(s-1))<e+6&&(c=a/(s-(o.offset?.5:1)),d=n.maxHeight-zi(o.grid)-r.padding-Fi(o.title,n.chart.options.font),u=Math.sqrt(e*e+i*i),g=Rt(Math.min(Math.asin(Math.min((t.highest.height+6)/c,1)),Math.asin(Math.min(d/u,1))-Math.asin(i/u))),g=Math.max(l,Math.min(h,g))),n.labelRotation=g)}afterCalculateLabelRotation(){K(this.options.afterCalculateLabelRotation,[this])}beforeFit(){K(this.options.beforeFit,[this])}fit(){const t=this,e={width:0,height:0},{chart:i,options:{ticks:a,title:n,grid:o}}=t,r=t._isVisible(),s=t.isHorizontal();if(r){const r=Fi(n,i.options.font);if(s?(e.width=t.maxWidth,e.height=zi(o)+r):(e.height=t.maxHeight,e.width=zi(o)+r),a.display&&t.ticks.length){const{first:i,last:n,widest:o,highest:r}=t._getLabelSizes(),l=2*a.padding,h=Tt(t.labelRotation),c=Math.cos(h),d=Math.sin(h);if(s){const i=a.mirror?0:d*o.width+c*r.height;e.height=Math.min(t.maxHeight,e.height+i+l)}else{const i=a.mirror?0:c*o.width+d*r.height;e.width=Math.min(t.maxWidth,e.width+i+l)}t._calculatePadding(i,n,d,c)}}t._handleMargins(),s?(t.width=t._length=i.width-t._margins.left-t._margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=i.height-t._margins.top-t._margins.bottom)}_calculatePadding(i,a,n,o){const r=this,{ticks:{align:s,padding:l},position:h}=r.options,c=0!==r.labelRotation,d="top"!==h&&"x"===r.axis;if(r.isHorizontal()){const h=r.getPixelForTick(0)-r.left,u=r.right-r.getPixelForTick(r.ticks.length-1);let t=0,e=0;c?e=d?(t=o*i.width,n*a.height):(t=n*i.height,o*a.width):"start"===s?e=a.width:"end"===s?t=i.width:(t=i.width/2,e=a.width/2),r.paddingLeft=Math.max((t-h+l)*r.width/(r.width-h),0),r.paddingRight=Math.max((e-u+l)*r.width/(r.width-u),0)}else{let t=a.height/2,e=i.height/2;"start"===s?(t=0,e=i.height):"end"===s&&(t=a.height,e=0),r.paddingTop=t+l,r.paddingBottom=e+l}}_handleMargins(){var t=this;t._margins&&(t._margins.left=Math.max(t.paddingLeft,t._margins.left),t._margins.top=Math.max(t.paddingTop,t._margins.top),t._margins.right=Math.max(t.paddingRight,t._margins.right),t._margins.bottom=Math.max(t.paddingBottom,t._margins.bottom))}afterFit(){K(this.options.afterFit,[this])}isHorizontal(){var{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t),this.afterTickToLabelConversion()}_getLabelSizes(){var e=this;let i=e._labelSizes;if(!i){var a=e.options.ticks.sampleSize;let t=e.ticks;a<t.length&&(t=Ii(t,a)),e._labelSizes=i=e._computeLabelSizes(t,t.length)}return i}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:a}=this,n=[],o=[];let r,s,l,h,c,d,u,g,f,p,m,x=0,b=0;for(r=0;r<e;++r){if(h=t[r].label,c=this._resolveTickFontOptions(r),i.font=d=c.string,u=a[d]=a[d]||{data:{},gc:[]},g=c.lineHeight,f=p=0,H(h)||N(h)){if(N(h))for(s=0,l=h.length;s<l;++s)H(m=h[s])||N(m)||(f=Nt(i,u.data,u.gc,f,m),p+=g)}else f=Nt(i,u.data,u.gc,f,h),p=g;n.push(f),o.push(p),x=Math.max(f,x),b=Math.max(p,b)}var v;w=a,v=e,G(w,t=>{const e=t.gc,i=e.length/2;let a;if(v<i){for(a=0;a<i;++a)delete t.data[e[a]];e.splice(0,i)}});var _=n.indexOf(x),y=o.indexOf(b),w=t=>({width:n[t]||0,height:o[t]||0});return{first:w(0),last:w(e-1),widest:w(_),highest:w(y),widths:n,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){var e=this;e._reversePixels&&(t=1-t);t=e._startPixel+t*e._length;return Wt(e._alignToPixels?Yt(e.chart,t,0):t)}getDecimalForPixel(t){t=(t-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){var{min:t,max:e}=this;return t<0&&e<0?e:0<t&&0<e?t:0}getContext(t){var e,i,a=this,n=a.ticks||[];if(0<=t&&t<n.length){const i=n[t];return i.$context||(i.$context=(e=a.getContext(),n=t,t=i,Object.assign(Object.create(e),{tick:t,index:n,type:"tick"})))}return a.$context||(a.$context=(i=a.chart.getContext(),a=a,Object.assign(Object.create(i),{scale:a,type:"scale"})))}_tickSize(){var t=this.options.ticks,e=Tt(this.labelRotation),i=Math.abs(Math.cos(e)),a=Math.abs(Math.sin(e)),n=this._getLabelSizes(),e=t.autoSkipPadding||0,t=n?n.widest.width+e:0,e=n?n.highest.height+e:0;return this.isHorizontal()?t*a<e*i?t/i:e/a:e*a<t*i?e/i:t/a}_isVisible(){var t=this.options.display;return"auto"!==t?!!t:0<this.getMatchingVisibleMetas().length}_computeGridLineItems(t){function e(t){return Yt(n,t,f)}const i=this,a=i.axis,n=i.chart,o=i.options,{grid:r,position:s}=o,l=r.offset,h=i.isHorizontal(),c=i.ticks.length+(l?1:0),d=zi(r),u=[],g=r.setContext(i.getContext()),f=g.drawBorder?g.borderWidth:0,p=f/2;let m,x,b,v,_,y,w,M,k,S,P,D;if("top"===s)m=e(i.bottom),y=i.bottom-d,M=m-p,S=e(t.top)+p,D=t.bottom;else if("bottom"===s)m=e(i.top),S=t.top,D=e(t.bottom)-p,y=m+p,M=i.top+d;else if("left"===s)m=e(i.right),_=i.right-d,w=m-p,k=e(t.left)+p,P=t.right;else if("right"===s)m=e(i.left),k=t.left,P=e(t.right)-p,_=m+p,w=i.left+d;else if("x"===a){if("center"===s)m=e((t.top+t.bottom)/2+.5);else if(j(s)){const t=Object.keys(s)[0],a=s[t];m=e(i.chart.scales[t].getPixelForValue(a))}S=t.top,D=t.bottom,y=m+p,M=y+d}else if("y"===a){if("center"===s)m=e((t.left+t.right)/2);else if(j(s)){const t=Object.keys(s)[0],a=s[t];m=e(i.chart.scales[t].getPixelForValue(a))}_=m-p,w=_-d,k=t.left,P=t.right}for(x=0;x<c;++x){const t=r.setContext(i.getContext(x)),a=t.lineWidth,o=t.color,s=r.borderDash||[],c=t.borderDashOffset,d=t.tickWidth,g=t.tickColor,f=t.tickBorderDash||[],p=t.tickBorderDashOffset;void 0!==(b=function(t,e,i){var a=t.ticks.length,n=Math.min(e,a-1),o=t._startPixel,r=t._endPixel;let s,l=t.getPixelForTick(n);if(!(i&&(s=1===a?Math.max(l-o,r-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(n-1))/2,l+=n<e?s:-s,l<o-1e-6||l>r+1e-6)))return l}(i,x,l))&&(v=Yt(n,b,a),h?_=w=k=P=v:y=M=S=D=v,u.push({tx1:_,ty1:y,tx2:w,ty2:M,x1:k,y1:S,x2:P,y2:D,width:a,color:o,borderDash:s,borderDashOffset:c,tickWidth:d,tickColor:g,tickBorderDash:f,tickBorderDashOffset:p}))}return i._ticksLength=c,i._borderValue=m,u}_computeLabelItems(a){const n=this,o=n.axis,r=n.options,{position:t,ticks:e}=r,s=n.isHorizontal(),l=n.ticks,{align:h,crossAlign:c,padding:d,mirror:u}=e,i=zi(r.grid),g=i+d,f=u?-d:g,p=-Tt(n.labelRotation),m=[];let x,b,v,_,y,w,M,k,S,P,D,C="middle";if("top"===t)y=n.bottom-f,w=n._getXAxisLabelAlignment();else if("bottom"===t)y=n.top+f,w=n._getXAxisLabelAlignment();else if("left"===t){const a=n._getYAxisLabelAlignment(i);w=a.textAlign,_=a.x}else if("right"===t){const a=n._getYAxisLabelAlignment(i);w=a.textAlign,_=a.x}else if("x"===o){if("center"===t)y=(a.top+a.bottom)/2+g;else if(j(t)){const a=Object.keys(t)[0],o=t[a];y=n.chart.scales[a].getPixelForValue(o)+g}w=n._getXAxisLabelAlignment()}else if("y"===o){if("center"===t)_=(a.left+a.right)/2-g;else if(j(t)){const a=Object.keys(t)[0],o=t[a];_=n.chart.scales[a].getPixelForValue(o)}w=n._getYAxisLabelAlignment(i).textAlign}"y"===o&&("start"===h?C="top":"end"===h&&(C="bottom"));var O=n._getLabelSizes();for(x=0,b=l.length;x<b;++x){v=l[x].label;const a=e.setContext(n.getContext(x));M=n.getPixelForTick(x)+e.labelOffset,S=(k=n._resolveTickFontOptions(x)).lineHeight;const o=(P=N(v)?v.length:1)/2,r=a.color,h=a.textStrokeColor,d=a.textStrokeWidth;let i;if(s?(_=M,D="top"===t?"near"===c||0!=p?-P*S+S/2:"center"===c?-O.highest.height/2-o*S+S:-O.highest.height+S/2:"near"===c||0!=p?S/2:"center"===c?O.highest.height/2-o*S:O.highest.height-P*S,u&&(D*=-1)):(y=M,D=(1-P)*S/2),a.showLabelBackdrop){const n=Re(a.backdropPadding),o=O.heights[x],r=O.widths[x];let t=y+D-n.top,e=_-n.left;switch(C){case"middle":t-=o/2;break;case"bottom":t-=o}switch(w){case"center":e-=r/2;break;case"right":e-=r}i={left:e,top:t,width:r+n.width,height:o+n.height,color:a.backdropColor}}m.push({rotation:p,label:v,font:k,color:r,strokeColor:h,strokeWidth:d,textOffset:D,textAlign:w,textBaseline:C,translation:[_,y],backdrop:i})}return m}_getXAxisLabelAlignment(){var{position:t,ticks:e}=this.options;if(-Tt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align&&(i="right"),i}_getYAxisLabelAlignment(t){var e=this,{position:i,ticks:{crossAlign:a,mirror:n,padding:o}}=e.options,r=t+o,t=e._getLabelSizes().widest.width;let s,l;return"left"===i?n?(s="left",l=e.right+o):(l=e.right-r,"near"===a?s="right":"center"===a?(s="center",l-=t/2):(s="left",l=e.left)):"right"===i?n?(s="right",l=e.left+o):(l=e.left+r,"near"===a?s="left":"center"===a?(s="center",l+=t/2):(s="right",l=e.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){var t=this;if(!t.options.ticks.mirror){var e=t.chart,i=t.options.position;return"left"===i||"right"===i?{top:0,left:t.left,bottom:e.height,right:t.right}:"top"===i||"bottom"===i?{top:t.top,left:0,bottom:t.bottom,right:e.width}:void 0}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:a,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,a,n,o),t.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;var i=this.ticks.findIndex(t=>t.value===e);return 0<=i?t.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this,i=e.options.grid,a=e.ctx,n=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));let o,r;var s=(t,e,i)=>{i.width&&i.color&&(a.save(),a.lineWidth=i.width,a.strokeStyle=i.color,a.setLineDash(i.borderDash||[]),a.lineDashOffset=i.borderDashOffset,a.beginPath(),a.moveTo(t.x,t.y),a.lineTo(e.x,e.y),a.stroke(),a.restore())};if(i.display)for(o=0,r=n.length;o<r;++o){const t=n[o];i.drawOnChartArea&&s({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),i.drawTicks&&s({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const n=this,{chart:o,ctx:r,options:{grid:s}}=n,l=s.setContext(n.getContext()),h=s.drawBorder?l.borderWidth:0;if(h){var c=s.setContext(n.getContext(0)).lineWidth,d=n._borderValue;let t,e,i,a;n.isHorizontal()?(t=Yt(o,n.left,h)-h/2,e=Yt(o,n.right,c)+c/2,i=a=d):(i=Yt(o,n.top,h)-h/2,a=Yt(o,n.bottom,c)+c/2,t=e=d),r.save(),r.lineWidth=l.borderWidth,r.strokeStyle=l.borderColor,r.beginPath(),r.moveTo(t,i),r.lineTo(e,a),r.stroke(),r.restore()}}drawLabels(i){const a=this;if(a.options.ticks.display){const o=a.ctx,r=a._computeLabelArea();r&&qt(o,r);var n=a._labelItems||(a._labelItems=a._computeLabelItems(i));let t,e;for(t=0,e=n.length;t<e;++t){const i=n[t],a=i.font,r=i.label;i.backdrop&&(o.fillStyle=i.backdrop.color,o.fillRect(i.backdrop.left,i.backdrop.top,i.backdrop.width,i.backdrop.height)),Qt(o,r,0,i.textOffset,a,i)}r&&Kt(o)}}drawTitle(){var{ctx:e,options:{position:i,title:a,reverse:n}}=this;if(a.display){var o=Le(a.font),r=Re(a.padding),s=a.align;let t=o.lineHeight/2;"bottom"===i?(t+=r.bottom,N(a.text)&&(t+=o.lineHeight*(a.text.length-1))):t+=r.top;var{titleX:l,titleY:h,maxWidth:c,rotation:r}=function(t,e,i,a){var{top:n,left:o,bottom:r,right:s}=t;let l,h,c,d=0;return t.isHorizontal()?(h=T(a,o,s),c=Ei(t,i,e),l=s-o):(h=Ei(t,i,e),c=T(a,r,n),d="left"===i?-_t:_t),{titleX:h,titleY:c,maxWidth:l,rotation:d}}(this,t,i,s);Qt(e,a.text,0,0,o,{color:a.color,maxWidth:c,rotation:r,textAlign:function(t,e,i){let a=f(t);return(i&&"right"!==e||!i&&"right"===e)&&(a="left"===(e=a)?"right":"right"===e?"left":e),a}(s,i,n),textBaseline:"middle",translation:[l,h]})}}draw(t){var e=this;e._isVisible()&&(e.drawBackground(),e.drawGrid(t),e.drawBorder(),e.drawTitle(),e.drawLabels(t))}_layers(){const e=this,t=e.options,i=t.ticks&&t.ticks.z||0,a=t.grid&&t.grid.z||0;return e._isVisible()&&e.draw===Vi.prototype.draw?[{z:a,draw(t){e.drawBackground(),e.drawGrid(t),e.drawTitle()}},{z:a+1,draw(){e.drawBorder()}},{z:i,draw(t){e.drawLabels(t)}}]:[{z:i,draw(t){e.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",a=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||a.push(o)}return a}_resolveTickFontOptions(t){return Le(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){var t=this._resolveTickFontOptions(0).lineHeight;return this.isHorizontal()?this.width/t/.7:this.height/t}}function Bi(i,o=[""],e=i,a,n=()=>i[0]){st(a)||(a=Ki("_fallback",i));var t={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:a,_getTarget:n,override:t=>Bi([t,...i],o,e,a)};return new Proxy(t,{deleteProperty:(t,e)=>(delete t[e],delete t._keys,delete i[0][e],!0),get:(t,e)=>Yi(t,e,()=>function(t,e,i){var a;for(const n of o)if(a=Ki(Ni(n,t),e),st(a))return ji(t,a)?Xi(e,i,t,a):a}(e,i,t)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(i[0]),has:(t,e)=>Gi(t).includes(e),ownKeys:t=>Gi(t),set:(t,e,i)=>((t._storage||(t._storage=n()))[e]=i,delete t[e],delete t._keys,!0)})}function Wi(a,e,i,n){var t={_cacheable:!1,_proxy:a,_context:e,_subProxy:i,_stack:new Set,_descriptors:Hi(a,n),setContext:t=>Wi(a,t,i,n),override:t=>Wi(a.override(t),e,i,n)};return new Proxy(t,{deleteProperty:(t,e)=>(delete t[e],delete a[e],!0),get:(t,e,i)=>Yi(t,e,()=>function(s,t,e){const{_proxy:i,_context:a,_subProxy:n,_descriptors:o}=s;let r=i[t];return lt(r)&&o.isScriptable(t)&&(r=function(t,e,i){const{_proxy:a,_context:n,_subProxy:o,_stack:r}=s;if(r.has(t))throw new Error("Recursion detected: "+[...r].join("->")+"->"+t);return r.add(t),e=e(n,o||i),r.delete(t),e=j(e)?Xi(a._scopes,a,t,e):e}(t,r,e)),N(r)&&r.length&&(r=function(t,e,i,a){const{_proxy:n,_context:o,_subProxy:r,_descriptors:s}=i;if(st(o.index)&&a(t))e=e[o.index%e.length];else if(j(e[0])){const i=e,a=n._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Xi(a,n,t,l);e.push(Wi(i,o,r&&r[t],s))}}return e}(t,r,s,o.isIndexable)),ji(t,r)&&(r=Wi(r,a,n&&n[t],o)),r}(t,e,i)),getOwnPropertyDescriptor:(t,e)=>t._descriptors.allKeys?Reflect.has(a,e)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(a,e),getPrototypeOf:()=>Reflect.getPrototypeOf(a),has:(t,e)=>Reflect.has(a,e),ownKeys:()=>Reflect.ownKeys(a),set:(t,e,i)=>(a[e]=i,delete t[e],!0)})}function Hi(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:a=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:a,isScriptable:lt(i)?i:()=>i,isIndexable:lt(a)?a:()=>a}}const Ni=(t,e)=>t?t+rt(e):e,ji=(t,e)=>j(e)&&"adapters"!==t;function Yi(t,e,i){let a=t[e];return st(a)||(a=i(),st(a)&&(t[e]=a)),a}function $i(t,e,i){return lt(t)?t(e,i):t}function Ui(t,e,i,a){for(const r of e){const e=(n=i,o=r,!0===n?o:"string"==typeof n?ot(o,n):void 0);if(e){t.add(e);n=$i(e._fallback,i,e);if(st(n)&&n!==i&&n!==a)return n}else if(!1===e&&st(a)&&i!==a)return null}var n,o;return!1}function Xi(t,e,i,a){const n=e._rootScopes,o=$i(e._fallback,i,a),r=[...t,...n],s=new Set;s.add(a);a=qi(s,r,i,o||i);return null!==a&&(!st(o)||o===i||null!==(a=qi(s,r,o,a)))&&Bi([...s],[""],n,o,()=>{const t=e._getTarget();return i in t||(t[i]={}),t[i]})}function qi(t,e,i,a){for(;i;)i=Ui(t,e,i,a);return i}function Ki(t,e){for(const i of e)if(i){const e=i[t];if(st(e))return e}}function Gi(t){let e=t._keys;return e=e||(t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return[...e]}(t._scopes)),e}const Zi=Number.EPSILON||1e-14,Qi=(t,e)=>e<t.length&&!t[e].skip&&t[e];function Ji(t,e,i,a){var n=t.skip?e:t,o=e,t=i.skip?e:i,e=It(o,n),i=It(t,o);let r=e/(e+i),s=i/(e+i);r=isNaN(r)?0:r,s=isNaN(s)?0:s;i=a*r,a*=s;return{previous:{x:o.x-i*(t.x-n.x),y:o.y-i*(t.y-n.y)},next:{x:o.x+a*(t.x-n.x),y:o.y+a*(t.y-n.y)}}}function ta(t){const e=t.length,i=Array(e).fill(0),a=Array(e);let n,o,r,s=Qi(t,0);for(n=0;n<e;++n)if(o=r,r=s,s=Qi(t,n+1),r){if(s){const t=s.x-r.x;i[n]=0!=t?(s.y-r.y)/t:0}a[n]=o?s?kt(i[n-1])!==kt(i[n])?0:(i[n-1]+i[n])/2:i[n-1]:i[n]}!function(e,i,a){var n=e.length;let o,r,s,l,h,c=Qi(e,0);for(let t=0;t<n-1;++t)h=c,c=Qi(e,t+1),h&&c&&(Ct(i[t],0,Zi)?a[t]=a[t+1]=0:(o=a[t]/i[t],r=a[t+1]/i[t],(l=Math.pow(o,2)+Math.pow(r,2))<=9||(s=3/Math.sqrt(l),a[t]=o*s*i[t],a[t+1]=r*s*i[t])))}(t,i,a),function(e,i){const a=e.length;let n,o,r,s=Qi(e,0);for(let t=0;t<a;++t)if(o=r,r=s,s=Qi(e,t+1),r){const{x:a,y:l}=r;o&&(n=(a-o.x)/3,r.cp1x=a-n,r.cp1y=l-n*i[t]),s&&(n=(s.x-a)/3,r.cp2x=a+n,r.cp2y=l+n*i[t])}}(t,a)}function ea(t,e,i){return Math.max(Math.min(t,i),e)}function ia(e,i,t,a){let n,o,r,s;if(i.spanGaps&&(e=e.filter(t=>!t.skip)),"monotone"===i.cubicInterpolationMode)ta(e);else{let t=a?e[e.length-1]:e[0];for(n=0,o=e.length;n<o;++n)r=e[n],s=Ji(t,r,e[Math.min(n+1,o-(a?0:1))%o],i.tension),r.cp1x=s.previous.x,r.cp1y=s.previous.y,r.cp2x=s.next.x,r.cp2y=s.next.y,t=r}i.capBezierPoints&&function(t,e){let i,a,n,o,r,s=Xt(t[0],e);for(i=0,a=t.length;i<a;++i)r=o,o=s,s=i<a-1&&Xt(t[i+1],e),o&&(n=t[i],r&&(n.cp1x=ea(n.cp1x,e.left,e.right),n.cp1y=ea(n.cp1y,e.top,e.bottom)),s&&(n.cp2x=ea(n.cp2x,e.left,e.right),n.cp2y=ea(n.cp2y,e.top,e.bottom)))}(e,t)}function aa(t,e,i,a){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function na(t,e,i,a){return{x:t.x+i*(e.x-t.x),y:("middle"===a?i<.5?t:e:"after"===a?i<1?t:e:0<i?e:t).y}}function oa(t,e,i,a){var n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},t=aa(t,n,i),n=aa(n,o,i),e=aa(o,e,i),t=aa(t,n,i),e=aa(n,e,i);return aa(t,e,i)}function ra(t,e,i){return t?(a=e,n=i,{x:t=>a+a+n-t,setWidth(t){n=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t};var a,n}function sa(t,e){let i,a;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,a=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=a)}function la(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function ha(t){return"angle"===t?{between:Vt,compare:zt,normalize:Ft}:{between:(t,e,i)=>t>=Math.min(e,i)&&t<=Math.max(i,e),compare:(t,e)=>t-e,normalize:t=>t}}function ca({start:t,end:e,count:i,loop:a,style:n}){return{start:t%i,end:e%i,loop:a&&(e-t+1)%i==0,style:n}}function da(t,i,g){if(!g)return[t];const{property:a,start:n,end:o}=g,r=i.length,{compare:s,between:l,normalize:h}=ha(a),{start:c,end:d,loop:u,style:f}=function(t,e){const{property:i,start:a,end:n}=g,{between:o,normalize:r}=ha(i),s=e.length;let l,h,{start:c,end:d,loop:u}=t;if(u){for(c+=s,d+=s,l=0,h=s;l<h&&o(r(e[c%s][i]),a,n);++l)c--,d--;c%=s,d%=s}return d<c&&(d+=s),{start:c,end:d,loop:u,style:t.style}}(t,i),p=[];let m,x,b,v,_=null;for(let t=c,e=c;t<=d;++t)(x=i[t%r]).skip||(m=h(x[a]),v=l(m,n,o),null===_&&(v||l(n,b,m)&&0!==s(n,b))&&(_=0===s(m,n)?t:e),null===_||v&&0!==s(o,m)&&!l(o,b,m)||(p.push(ca({start:_,end:t,loop:u,count:r,style:f})),_=null),e=t,b=m);return null!==_&&p.push(ca({start:_,end:d,loop:u,count:r,style:f})),p}function ua(e,i){const a=[],n=e.segments;for(let t=0;t<n.length;t++){var o=da(n[t],e.points,i);o.length&&a.push(...o)}return a}function ga(t,e){var i=t.points,o=t.options.spanGaps,a=i.length;if(!a)return[];var n=!!t._loop,{start:r,end:s}=function(t,e,i){let a=0,n=e-1;if(i&&!o)for(;a<e&&!t[a].skip;)a++;for(;a<e&&t[a].skip;)a++;for(a%=e,i&&(n+=a);n>a&&t[n%e].skip;)n--;return n%=e,{start:a,end:n}}(i,a,n);return fa(!0===o?[{start:r,end:s,loop:n}]:function(t,e,i,a){const n=t.length,o=[];let r,s=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%n];i.skip||i.stop?l.skip||(a=!1,o.push({start:e%n,end:(r-1)%n,loop:a}),e=s=i.stop?r:null):(s=r,l.skip&&(e=r)),l=i}return null!==s&&o.push({start:e%n,end:s%n,loop:a}),o}(i,r,s<r?s+a:s,!!t._fullLoop&&0===r&&s===a-1),i,e)}function fa(t,e,i){return i&&i.setContext&&e?function(a,n){const o=a.length,r=[];let s=t[0].start,l=s;for(const u of t){let t,e,i=a[s%o];for(l=s+1;l<=u.end;l++){var h=a[l%o];e={backgroundColor:(d=n.setContext({type:"segment",p0:i,p1:h})).backgroundColor,borderCapStyle:d.borderCapStyle,borderDash:d.borderDash,borderDashOffset:d.borderDashOffset,borderJoinStyle:d.borderJoinStyle,borderWidth:d.borderWidth,borderColor:d.borderColor},c=e,(d=t)&&JSON.stringify(c)!==JSON.stringify(d)&&(r.push({start:s,end:l-1,loop:u.loop,style:t}),t=e,s=l-1),i=h,t=e}s<l-1&&(r.push({start:s,end:l-1,loop:u.loop,style:e}),s=l-1)}var c,d;return r}(e,i):t}var pa=Object.freeze({__proto__:null,easingEffects:ci,color:V,getHoverColor:B,noop:t,uid:W,isNullOrUndef:H,isArray:N,isObject:j,isFinite:Y,finiteOrDefault:$,valueOrDefault:U,toPercentage:X,toDimension:q,callback:K,each:G,_elementsEqual:Z,clone:Q,_merger:tt,merge:et,mergeIf:it,_mergerIf:at,_deprecated:function(t,e,i,a){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+a+'" instead')},resolveObjectKey:ot,_capitalize:rt,defined:st,isFunction:lt,setsEqual:ht,toFontString:Ht,_measureText:Nt,_longestText:jt,_alignPixel:Yt,clearCanvas:$t,drawPoint:Ut,_isPointInArea:Xt,clipArea:qt,unclipArea:Kt,_steppedLineTo:Gt,_bezierCurveTo:Zt,renderText:Qt,addRoundedRectPath:Jt,_lookup:te,_lookupByKey:ee,_rlookupByKey:ie,_filterBetween:ae,listenArrayEvents:oe,unlistenArrayEvents:re,_arrayUnique:se,_createResolver:Bi,_attachContext:Wi,_descriptors:Hi,splineCurve:Ji,splineCurveMonotone:ta,_updateBezierControlPoints:ia,_getParentNode:le,getStyle:de,getRelativePosition:fe,getMaximumSize:me,retinaScale:xe,supportsEventListenerOptions:be,readUsedSize:ve,fontString:function(t,e,i){return e+" "+t+"px "+i},requestAnimFrame:r,throttled:l,debounce:s,_toLeftRightCenter:f,_alignStartEnd:T,_textX:R,_pointInLine:aa,_steppedInterpolation:na,_bezierInterpolation:oa,formatNumber:Oi,toLineHeight:Ce,_readValueToProps:Oe,toTRBL:Ae,toTRBLCorners:Te,toPadding:Re,toFont:Le,resolve:Ee,_addGrace:Ie,PI:pt,TAU:mt,PITAU:xt,INFINITY:bt,RAD_PER_DEG:vt,HALF_PI:_t,QUARTER_PI:yt,TWO_THIRDS_PI:wt,log10:Mt,sign:kt,niceNum:St,_factorize:Pt,isNumber:Dt,almostEquals:Ct,almostWhole:Ot,_setMinAndMaxByKey:At,toRadians:Tt,toDegrees:Rt,_decimalPlaces:Lt,getAngleFromPoint:Et,distanceBetweenPoints:It,_angleDiff:zt,_normalizeAngle:Ft,_angleBetween:Vt,_limitValue:Bt,_int16Range:Wt,getRtlAdapter:ra,overrideTextDirection:sa,restoreTextDirection:la,_boundSegment:da,_boundSegments:ua,_computeSegments:ga});class ma{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){var e,i,s,l,a=Object.getPrototypeOf(t);let n;"id"in(i=a)&&"defaults"in i&&(n=this.register(a));const o=this.items,r=t.id,h=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in o||(o[r]=t,e=t,i=h,a=n,a=et(Object.create(null),[a?ft.get(a):{},ft.get(i),e.defaults]),ft.set(i,a),e.defaultRoutes&&(s=i,l=e.defaultRoutes,Object.keys(l).forEach(t=>{const e=t.split("."),i=e.pop(),a=[s].concat(e).join("."),n=l[t].split("."),o=n.pop(),r=n.join(".");ft.route(a,i,r,o)})),e.descriptors&&ft.describe(i,e.descriptors),this.override&&ft.override(t.id,t.overrides)),h}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,a=this.scope;i in e&&delete e[i],a&&i in ft[a]&&(delete ft[a][i],this.override&&delete ct[i])}}var xa=new class{constructor(){this.controllers=new ma(Pi,"datasets",!0),this.elements=new ma(Di,"elements"),this.plugins=new ma(Object,"plugins"),this.scales=new ma(Vi,"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(i,t,a){const n=this;[...t].forEach(t=>{const e=a||n._getRegistryForType(t);a||e.isForType(t)||e===n.plugins&&t.id?n._exec(i,e,t):G(t,t=>{var e=a||n._getRegistryForType(t);n._exec(i,e,t)})})}_exec(t,e,i){var a=rt(t);K(i["before"+a],[],i),e[t](i),K(i["after"+a],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(t,e,i){e=e.get(t);if(void 0===e)throw new Error('"'+t+'" is not a registered '+i+".");return e}};class ba{constructor(){this._init=[]}notify(t,e,i,a){var n=this;"beforeInit"===e&&(n._init=n._createDescriptors(t,!0),n._notify(n._init,t,"install"));a=a?n._descriptors(t).filter(a):n._descriptors(t),i=n._notify(a,t,e,i);return"destroy"===e&&(n._notify(a,t,"stop"),n._notify(n._init,t,"uninstall")),i}_notify(t,e,i,a){a=a||{};for(const n of t){const t=n.plugin;if(!1===K(t[i],[e,a,n.options],t)&&a.cancelable)return!1}return!0}invalidate(){H(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;var e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){var i=t&&t.config,a=U(i.options&&i.options.plugins,{}),i=function(t){const e=[],i=Object.keys(xa.plugins.items);for(let t=0;t<i.length;t++)e.push(xa.getPlugin(i[t]));var a=t.plugins||[];for(let t=0;t<a.length;t++){const i=a[t];-1===e.indexOf(i)&&e.push(i)}return e}(i);return!1!==a||e?function(e,i,a,n){const o=[],r=e.getContext();for(let t=0;t<i.length;t++){var s=i[t],l=(l=a[s.id],n||!1!==l?!0===l?{}:l:null);null!==l&&o.push({plugin:s,options:function(t,e,i,a){e=t.pluginScopeKeys(e),e=t.getOptionScopes(i,e);return t.createResolver(e,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}(e.config,s,l,r)})}var l;return o}(t,i,a,e):[]}_notifyStateChanges(t){var e=this._oldCache||[],i=this._cache,a=(t,i)=>t.filter(e=>!i.some(t=>e.plugin.id===t.plugin.id));this._notify(a(e,i),t,"stop"),this._notify(a(i,e),t,"start")}}function va(t,e){var i=ft.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function _a(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(e=e.position)||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0)||t.charAt(0).toLowerCase()}function ya(t){const e=t.options||(t.options={});e.plugins=U(e.plugins,{}),e.scales=function(e,i){const o=ct[e.type]||{scales:{}},r=i.scales||{},s=va(e.type,i),l=Object.create(null),h=Object.create(null);return Object.keys(r).forEach(t=>{const e=r[t],i=_a(t,e),a=i===s?"_index_":"_value_",n=o.scales||{};l[i]=l[i]||t,h[t]=it(Object.create(null),[{axis:i},e,n[i],n[a]])}),e.data.datasets.forEach(a=>{const t=a.type||e.type,n=a.indexAxis||va(t,i),o=(ct[t]||{}).scales||{};Object.keys(o).forEach(t=>{var e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,n),i=a[e+"AxisID"]||l[e]||e;h[i]=h[i]||Object.create(null),it(h[i],[{axis:e},r[i],o[t]])})}),Object.keys(h).forEach(t=>{t=h[t];it(t,[ft.scales[t.type],ft.scale])}),h}(t,e)}function wa(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Ma=new Map,ka=new Set;function Sa(t,e){let i=Ma.get(t);return i||(i=e(),Ma.set(t,i),ka.add(i)),i}const Pa=(t,e,i)=>{i=ot(e,i);void 0!==i&&t.add(i)};class Da{constructor(t){this._config=((t=(t=t)||{}).data=wa(t.data),ya(t),t),this._scopeCache=new Map,this._resolverCache=new Map}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=wa(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){var t=this._config;this.clearCache(),ya(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Sa(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Sa(t+".transition."+e,()=>[[`datasets.${t}.transitions.`+e,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Sa(t+"-"+e,()=>[[`datasets.${t}.elements.`+e,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Sa(this.type+"-plugin-"+e,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let a=i.get(t);return a&&!e||(a=new Map,i.set(t,a)),a}getOptionScopes(e,t,i){const{options:a,type:n}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>Pa(s,e,t))),t.forEach(t=>Pa(s,a,t)),t.forEach(t=>Pa(s,ct[n]||{},t)),t.forEach(t=>Pa(s,ft,t)),t.forEach(t=>Pa(s,dt,t))});i=[...s];return ka.has(t)&&o.set(t,i),i}chartOptionScopes(){var{options:t,type:e}=this;return[t,ct[e]||{},ft.datasets[e]||{},{type:e},ft,dt]}resolveNamedOptions(t,e,i,a=[""]){const n={$shared:!0},{resolver:o,subPrefixes:r}=Ca(this._resolverCache,t,a);let s=o;!function(t,e){const{isScriptable:i,isIndexable:a}=Hi(t);for(const n of e)if(i(n)&<(t[n])||a(n)&&N(t[n]))return 1}(o,e)||(n.$shared=!1,s=Wi(o,i=lt(i)?i():i,this.createResolver(t,i,r)));for(const t of e)n[t]=s[t];return n}createResolver(t,e,i=[""],a){var i=Ca(this._resolverCache,t,i)["resolver"];return j(e)?Wi(i,e,void 0,a):i}}function Ca(t,e,i){let a=t.get(e);a||(a=new Map,t.set(e,a));t=i.join();let n=a.get(t);return n||(n={resolver:Bi(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},a.set(t,n)),n}const Oa=["top","bottom","left","right","chartArea"];function Aa(t,e){return"top"===t||"bottom"===t||-1===Oa.indexOf(t)&&"x"===e}function Ta(i,a){return function(t,e){return t[i]===e[i]?t[a]-e[a]:t[i]-e[i]}}function Ra(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),K(i&&i.onComplete,[t],e)}function La(t){var e=t.chart,i=e.options.animation;K(i&&i.onProgress,[t],e)}function Ea(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Ia(t){return Ea()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t=t&&t.canvas?t.canvas:t}const za={},Fa=t=>{const e=Ia(t);return Object.values(za).filter(t=>t.canvas===e).pop()};class Va{constructor(t,e){var i=this;this.config=e=new Da(e);var a=Ia(t),n=Fa(a);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas can be reused.");var o=e.createResolver(e.chartOptionScopes(),i.getContext());this.platform=i._initializePlatform(a,e);t=i.platform.acquireContext(a,o.aspectRatio),n=t&&t.canvas,e=n&&n.height,a=n&&n.width;this.id=W(),this.ctx=t,this.canvas=n,this.width=a,this.height=e,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._sortedMetasets=[],this.scales={},this.scale=void 0,this._plugins=new ba,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=s(()=>this.update("resize"),o.resizeDelay||0),za[i.id]=i,t&&n?(h.listen(i,"complete",Ra),h.listen(i,"progress",La),i._initialize(),i.attached&&i.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){var{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:a,_aspectRatio:n}=this;return H(t)?e&&n?n:a?i/a:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){var t=this;return t.notifyPlugins("beforeInit"),t.options.responsive?t.resize():xe(t,t.options.devicePixelRatio),t.bindEvents(),t.notifyPlugins("afterInit"),t}_initializePlatform(t,e){return new(e.platform||(!Ea()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Xe:oi))}clear(){return $t(this.canvas,this.ctx),this}stop(){return h.stop(this),this}resize(t,e){h.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){var i=this,a=i.options,n=i.canvas,o=a.maintainAspectRatio&&i.aspectRatio,t=i.platform.getMaximumSize(n,t,e,o),e=i.currentDevicePixelRatio,o=a.devicePixelRatio||i.platform.getDevicePixelRatio();i.width===t.width&&i.height===t.height&&e===o||(i.width=t.width,i.height=t.height,i._aspectRatio=i.aspectRatio,xe(i,o,!0),i.notifyPlugins("resize",{size:t}),K(a.onResize,[i,t],i),i.attached&&i._doResize()&&i.render())}ensureScalesHaveIDs(){G(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const r=this,s=r.options,a=s.scales,l=r.scales,h=Object.keys(l).reduce((t,e)=>(t[e]=!1,t),{});let t=[];a&&(t=t.concat(Object.keys(a).map(t=>{var e=a[t],i=_a(t,e),t="r"===i,i="x"===i;return{options:e,dposition:t?"chartArea":i?"bottom":"left",dtype:t?"radialLinear":i?"category":"linear"}}))),G(t,t=>{const e=t.options,i=e.id,a=_a(i,e),n=U(e.type,t.dtype);void 0!==e.position&&Aa(e.position,a)===Aa(t.dposition)||(e.position=t.dposition),h[i]=!0;let o=null;i in l&&l[i].type===n?o=l[i]:(o=new(xa.getScale(n))({id:i,type:n,ctx:r.ctx,chart:r}),l[o.id]=o),o.init(e,s)}),G(h,(t,e)=>{t||delete l[e]}),G(l,t=>{$e.configure(r,t,t.options),$e.addBox(r,t)})}_updateMetasetIndex(t,e){const i=this._metasets,a=t.index;a!==e&&(i[a]=i[e],(i[e]=t).index=e)}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(e<i){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Ta("order","index"))}_removeUnreferencedMetasets(){const i=this,{_metasets:t,data:{datasets:a}}=i;t.length>a.length&&delete i._stacks,t.forEach((e,t)=>{0===a.filter(t=>t===e._dataset).length&&i._destroyDatasetMeta(t)})}buildOrUpdateControllers(){const e=this,i=[],a=e.data.datasets;let n,o;for(e._removeUnreferencedMetasets(),n=0,o=a.length;n<o;n++){const o=a[n];let t=e.getDatasetMeta(n);var r=o.type||e.config.type;if(t.type&&t.type!==r&&(e._destroyDatasetMeta(n),t=e.getDatasetMeta(n)),t.type=r,t.indexAxis=o.indexAxis||va(r,e.options),t.order=o.order||0,e._updateMetasetIndex(t,n),t.label=""+o.label,t.visible=e.isDatasetVisible(n),t.controller)t.controller.updateIndex(n),t.controller.linkScales();else{const a=xa.getController(r),{datasetElementType:o,dataElementType:s}=ft.datasets[r];Object.assign(a.prototype,{dataElementType:xa.getElement(s),datasetElementType:o&&xa.getElement(o)}),t.controller=new a(e,n),i.push(t.controller)}}return e._updateMetasets(),i}_resetElements(){const i=this;G(i.data.datasets,(t,e)=>{i.getDatasetMeta(e).controller.reset()},i)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const a=this,n=a.config;n.update(),a._options=n.createResolver(n.chartOptionScopes(),a.getContext()),G(a.scales,t=>{$e.removeBox(a,t)});var o=a._animationsDisabled=!a.options.animation;a.ensureScalesHaveIDs(),a.buildOrUpdateScales();const r=new Set(Object.keys(a._listeners)),e=new Set(a.options.events);if(ht(r,e)||(a.unbindEvents(),a.bindEvents()),a._plugins.invalidate(),!1!==a.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})){const s=a.buildOrUpdateControllers();a.notifyPlugins("beforeElementsUpdate");let i=0;for(let t=0,e=a.data.datasets.length;t<e;t++){const n=a.getDatasetMeta(t)["controller"],r=!o&&-1===s.indexOf(n);n.buildOrUpdateElements(r),i=Math.max(+n.getMaxOverflow(),i)}a._minPadding=i,a._updateLayout(i),o||G(s,t=>{t.reset()}),a._updateDatasets(t),a.notifyPlugins("afterUpdate",{mode:t}),a._layers.sort(Ta("z","_idx")),a._lastEvent&&a._eventHandler(a._lastEvent,!0),a.render()}}_updateLayout(t){const e=this;if(!1!==e.notifyPlugins("beforeLayout",{cancelable:!0})){$e.update(e,e.width,e.height,t);const i=e.chartArea,a=i.width<=0||i.height<=0;e._layers=[],G(e.boxes,t=>{a&&"chartArea"===t.position||(t.configure&&t.configure(),e._layers.push(...t._layers()))},e),e._layers.forEach((t,e)=>{t._idx=e}),e.notifyPlugins("afterLayout")}}_updateDatasets(i){var a="function"==typeof i;if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:i,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this._updateDataset(t,a?i({datasetIndex:t}):i);this.notifyPlugins("afterDatasetsUpdate",{mode:i})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),a={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",a)&&(i.controller._update(e),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){var t=this;!1!==t.notifyPlugins("beforeRender",{cancelable:!0})&&(h.has(t)?t.attached&&!h.running(t)&&h.start(t):(t.draw(),Ra({chart:t})))}draw(){var t=this;let e;if(t._resizeBeforeDraw){const{width:e,height:i}=t._resizeBeforeDraw;t._resize(e,i),t._resizeBeforeDraw=null}if(t.clear(),!(t.width<=0||t.height<=0)&&!1!==t.notifyPlugins("beforeDraw",{cancelable:!0})){const i=t._layers;for(e=0;e<i.length&&i[e].z<=0;++e)i[e].draw(t.chartArea);for(t._drawDatasets();e<i.length;++e)i[e].draw(t.chartArea);t.notifyPlugins("afterDraw")}}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let a,n;for(a=0,n=e.length;a<n;++a){const n=e[a];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1!==this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){var e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;0<=t;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}}_drawDataset(t){const e=this,i=e.ctx,a=t._clip,n=e.chartArea,o={meta:t,index:t.index,cancelable:!0};!1!==e.notifyPlugins("beforeDatasetDraw",o)&&(qt(i,{left:!1===a.left?0:n.left-a.left,right:!1===a.right?e.width:n.right+a.right,top:!1===a.top?0:n.top-a.top,bottom:!1===a.bottom?e.height:n.bottom+a.bottom}),t.controller.draw(),Kt(i),o.cancelable=!1,e.notifyPlugins("afterDatasetDraw",o))}getElementsAtEventForMode(t,e,i,a){const n=Se.modes[e];return"function"==typeof n?n(this,t,i,a):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let a=i.filter(t=>t&&t._dataset===e).pop();return a=a||(i[t]={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}),a}getContext(){return this.$context||(this.$context={chart:this,type:"chart"})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){var e=this.data.datasets[t];if(!e)return!1;t=this.getDatasetMeta(t);return"boolean"==typeof t.hidden?!t.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateDatasetVisibility(e,t){const i=t?"show":"hide",a=this.getDatasetMeta(e),n=a.controller._resolveAnimations(void 0,i);this.setDatasetVisibility(e,t),n.update(a,{visible:t}),this.update(t=>t.datasetIndex===e?i:void 0)}hide(t){this._updateDatasetVisibility(t,!1)}show(t){this._updateDatasetVisibility(t,!0)}_destroyDatasetMeta(t){const e=this._metasets&&this._metasets[t];e&&e.controller&&(e.controller._destroy(),delete this._metasets[t])}destroy(){var t=this,{canvas:e,ctx:i}=t;let a,n;for(t.stop(),h.remove(t),a=0,n=t.data.datasets.length;a<n;++a)t._destroyDatasetMeta(a);t.config.clearCache(),e&&(t.unbindEvents(),$t(e,i),t.platform.releaseContext(i),t.canvas=null,t.ctx=null),t.notifyPlugins("destroy"),delete za[t.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){const a=this,i=a._listeners,n=a.platform,e=(t,e)=>{n.addEventListener(a,t,e),i[t]=e},o=(t,e)=>{i[t]&&(n.removeEventListener(a,t,e),delete i[t])};let r=function(t,e,i){t.offsetX=e,t.offsetY=i,a._eventHandler(t)};if(G(a.options.events,t=>e(t,r)),a.options.responsive){let t;r=(t,e)=>{a.canvas&&a.resize(t,e)};const s=()=>{o("attach",s),a.attached=!0,a.resize(),e("resize",r),e("detach",t)};t=()=>{a.attached=!1,o("resize",r),e("attach",s)},(n.isAttached(a.canvas)?s:t)()}else a.attached=!0}unbindEvents(){const i=this,t=i._listeners;t&&(i._listeners={},G(t,(t,e)=>{i.platform.removeEventListener(i,e,t)}))}updateHoverStyle(t,e,i){var a=i?"set":"remove";let n,o,r,s;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+a+"DatasetHoverStyle"]()),r=0,s=t.length;r<s;++r){const e=(o=t[r])&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[a+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const a=this,e=a._active||[],i=t.map(({datasetIndex:t,index:e})=>{var i=a.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});Z(i,e)||(a._active=i,a._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){var a=this.options.hover,n=(t,i)=>t.filter(e=>!i.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),o=n(e,t),e=i?t:n(t,e);o.length&&this.updateHoverStyle(o,a.mode,!1),e.length&&a.mode&&this.updateHoverStyle(e,a.mode,!0)}_eventHandler(e,t){const i=this,a={event:e,replay:t,cancelable:!0},n=t=>(t.options.events||this.options.events).includes(e.type);if(!1!==i.notifyPlugins("beforeEvent",a,n)){t=i._handleEvent(e,t);return a.cancelable=!1,i.notifyPlugins("afterEvent",a,n),(t||a.changed)&&i.render(),i}}_handleEvent(t,e){var i=this,{_active:a=[],options:n}=i,o=n.hover;let r=[],s,l=null;return"mouseout"!==t.type&&(r=i.getElementsAtEventForMode(t,o.mode,o,e),l="click"===t.type?i._lastEvent:t),i._lastEvent=null,Xt(t,i.chartArea,i._minPadding)&&(K(n.onHover,[t,r,i],i),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||K(n.onClick,[t,r,i],i)),((s=!Z(r,a))||e)&&(i._active=r,i._updateHoverStyles(r,a,e)),i._lastEvent=l,s}}const Ba=()=>G(Va.instances,t=>t._plugins.invalidate());function Wa(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}Object.defineProperties(Va,{defaults:{enumerable:!0,value:ft},instances:{enumerable:!0,value:za},overrides:{enumerable:!0,value:ct},registry:{enumerable:!0,value:xa},version:{enumerable:!0,value:"3.2.1"},getChart:{enumerable:!0,value:Fa},register:{enumerable:!0,value:(...t)=>{xa.add(...t),Ba()}},unregister:{enumerable:!0,value:(...t)=>{xa.remove(...t),Ba()}}});class Ha{constructor(t){this.options=t||{}}formats(){return Wa()}parse(t,e){return Wa()}format(t,e){return Wa()}add(t,e,i){return Wa()}diff(t,e,i){return Wa()}startOf(t,e,i){return Wa()}endOf(t,e){return Wa()}}Ha.override=function(t){Object.assign(Ha.prototype,t)};var Na={_date:Ha};function ja(t,e,i,a){return N(t)?function(t,e,i,a){var n=i.parse(t[0],a),o=i.parse(t[1],a),t=Math.min(n,o),a=Math.max(n,o);let r=t,s=a;Math.abs(t)>Math.abs(a)&&(r=a,s=t),e[i.axis]=s,e._custom={barStart:r,barEnd:s,start:n,end:o,min:t,max:a}}(t,e,i,a):e[i.axis]=i.parse(t,a),e}function Ya(t,e,i,a){const n=t.iScale,o=t.vScale,r=n.getLabels(),s=n===o,l=[];let h,c,d,u;for(c=(h=i)+a;h<c;++h)u=e[h],d={},d[n.axis]=s||n.parse(r[h],h),l.push(ja(u,d,o,h));return l}function $a(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}class Ua extends Pi{parsePrimitiveData(t,e,i,a){return Ya(t,e,i,a)}parseArrayData(t,e,i,a){return Ya(t,e,i,a)}parseObjectData(t,e,i,a){const{iScale:n,vScale:o}=t,{xAxisKey:r="x",yAxisKey:s="y"}=this._parsing,l="x"===n.axis?r:s,h="x"===o.axis?r:s,c=[];let d,u,g,f;for(u=(d=i)+a;d<u;++d)f=e[d],g={},g[n.axis]=n.parse(ot(f,l),d),c.push(ja(ot(f,h),g,o,d));return c}updateRangeFromParsed(t,e,i,a){super.updateRangeFromParsed(t,e,i,a);i=i._custom;i&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:a}=e,n=this.getParsed(t),o=n._custom,r=$a(o)?"["+o.start+", "+o.end+"]":""+a.getLabelForValue(n[a.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){var e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(e,i,a,n){const o=this,r="reset"===n,s=o._cachedMeta.vScale,l=s.getBasePixel(),h=s.isHorizontal(),c=o._getRuler(),t=o.resolveDataElementOptions(i,n),d=o.getSharedOptions(t),u=o.includeOptions(n,d);o.updateSharedOptions(d,n,t);for(let t=i;t<i+a;t++){const i=o.getParsed(t),a=r||H(i[s.axis])?{base:l,head:l}:o._calculateBarValuePixels(t),g=o._calculateBarIndexPixels(t,c),f=(i._stacks||{})[s.axis],p={horizontal:h,base:a.base,enableBorderRadius:!f||$a(i._custom)||o.index===f._top||o.index===f._bottom,x:h?a.head:g.center,y:h?g.center:a.head,height:h?g.size:void 0,width:h?void 0:g.size};u&&(p.options=d||o.resolveDataElementOptions(t,n)),o.updateElement(e[t],t,p,n)}}_getStacks(t,e){const i=this._cachedMeta.iScale,a=i.getMatchingVisibleMetas(this._type),n=i.options.stacked,o=a.length,r=[];let s,l;for(s=0;s<o;++s){if(l=a[s],void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(H(t)||isNaN(t))continue}if((!1===n||-1===r.indexOf(l.stack)||void 0===n&&void 0===l.stack)&&r.push(l.stack),l.index===t)break}return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const a=this._getStacks(t,i),n=void 0!==e?a.indexOf(e):-1;return-1===n?a.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,a=[];let n,o;for(n=0,o=e.data.length;n<o;++n)a.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));var r=t.barThickness;return{min:r||function(t){var e=function(a){if(!a._cache.$bar){const n=a.getMatchingVisibleMetas("bar");let i=[];for(let t=0,e=n.length;t<e;t++)i=i.concat(n[t].controller.getAllParsedValues(a));a._cache.$bar=se(i.sort((t,e)=>t-e))}return a._cache.$bar}(t);let i,a,n,o,r=t._length;var s=()=>{32767!==n&&-32768!==n&&(st(o)&&(r=Math.min(r,Math.abs(n-o)||r)),o=n)};for(i=0,a=e.length;i<a;++i)n=t.getPixelForValue(e[i]),s();for(o=void 0,i=0,a=t.ticks.length;i<a;++i)n=t.getPixelForTick(i),s();return r}(i),pixels:a,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{vScale:e,_stacked:i}=this._cachedMeta,{base:a,minBarLength:n}=this.options,o=this.getParsed(t),r=o._custom,s=$a(r);let l,h,c=o[e.axis],d=0,u=i?this.applyStack(e,o,i):c;u!==c&&(d=u-c,u=c),s&&(c=r.barStart,u=r.barEnd-r.barStart,0!==c&&kt(c)!==kt(r.barEnd)&&(d=0),d+=c);var g=H(a)||s?d:a;let f=e.getPixelForValue(g);l=this.chart.getDataVisibility(t)?e.getPixelForValue(d+u):f,h=l-f,void 0!==n&&Math.abs(h)<n&&(h=h<0?-n:n,0===c&&(f-=h/2),l=f+h);t=a||0;if(f===e.getPixelForValue(t)){const p=e.getLineWidthForValue(t)/2;0<h?(f+=p,h-=p):h<0&&(f-=p,h+=p)}return{size:h,base:f,head:l,center:l+h/2}}_calculateBarIndexPixels(t,e){const i=this,a=e.scale,n=i.options,o=n.skipNull,r=U(n.maxBarThickness,1/0);let s,l;if(e.grouped){const a=o?i._getStackCount(t):e.stackCount,h=("flex"===n.barThickness?function(t,e,i,a){var n=e.pixels,o=n[t];let r=0<t?n[t-1]:null,s=t<n.length-1?n[t+1]:null;t=i.categoryPercentage;null===r&&(r=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-r);o-=(o-Math.min(r,s))/2*t;return{chunk:Math.abs(s-r)/2*t/a,ratio:i.barPercentage,start:o}}:function(t,e,i,a){var n=i.barThickness;let o,r;return r=H(n)?(o=e.min*i.categoryPercentage,i.barPercentage):(o=n*a,1),{chunk:o/a,ratio:r,start:e.pixels[t]-o/2}})(t,e,n,a),c=i._getStackIndex(i.index,i._cachedMeta.stack,o?t:void 0);s=h.start+h.chunk*c+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else s=a.getPixelForValue(i.getParsed(t)[a.axis],t),l=Math.min(r,e.min*e.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this.chart,e=this._cachedMeta,i=e.vScale,a=e.data,n=a.length;let o=0;for(qt(t.ctx,t.chartArea);o<n;++o)null!==this.getParsed(o)[i.axis]&&a[o].draw(this._ctx);Kt(t.ctx)}}Ua.id="bar",Ua.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Ua.overrides={interaction:{mode:"index"},scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Xa extends Pi{initialize(){this.enableOptionSharing=!0,super.initialize()}parseObjectData(t,e,i,a){const{xScale:n,yScale:o}=t,{xAxisKey:r="x",yAxisKey:s="y"}=this._parsing,l=[];let h,c,d;for(c=(h=i)+a;h<c;++h)d=e[h],l.push({x:n.parse(ot(d,r),h),y:o.parse(ot(d,s),h),_custom:d&&d.r&&+d.r});return l}getMaxOverflow(){const{data:e,_parsed:i}=this._cachedMeta;let a=0;for(let t=e.length-1;0<=t;--t)a=Math.max(a,e[t].size()/2,i[t]._custom);return 0<a&&a}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:a}=e,n=this.getParsed(t),o=i.getLabelForValue(n.x),r=a.getLabelForValue(n.y),s=n._custom;return{label:e.label,value:"("+o+", "+r+(s?", "+s:"")+")"}}update(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(e,i,a,n){const o=this,r="reset"===n,{xScale:s,yScale:l}=o._cachedMeta,t=o.resolveDataElementOptions(i,n),h=o.getSharedOptions(t),c=o.includeOptions(n,h);for(let t=i;t<i+a;t++){const i=e[t],a=!r&&o.getParsed(t),h=r?s.getPixelForDecimal(.5):s.getPixelForValue(a.x),d=r?l.getBasePixel():l.getPixelForValue(a.y),u={x:h,y:d,skip:isNaN(h)||isNaN(d)};c&&(u.options=o.resolveDataElementOptions(t,n),r&&(u.options.radius=0)),o.updateElement(i,t,u,n)}o.updateSharedOptions(h,n,t)}resolveDataElementOptions(t,e){var i=this.getParsed(t);let a=super.resolveDataElementOptions(t,e);a.$shared&&(a=Object.assign({},a,{$shared:!1}));t=a.radius;return"active"!==e&&(a.radius=0),a.radius+=U(i&&i._custom,t),a}}Xa.id="bubble",Xa.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Xa.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class qa extends Pi{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,a=this._cachedMeta;let n,o;for(o=(n=t)+e;n<o;++n)a._parsed[n]=+i[n]}_getRotation(){return Tt(this.options.rotation-90)}_getCircumference(){return Tt(this.options.circumference)}_getRotationExtents(){let e=mt,i=-mt;for(let t=0;t<this.chart.data.datasets.length;++t)if(this.chart.isDatasetVisible(t)){const a=this.chart.getDatasetMeta(t).controller,n=a._getRotation(),o=a._getCircumference();e=Math.min(e,n),i=Math.max(i,n+o)}return{rotation:e,circumference:i-e}}update(t){const e=this,i=e.chart,a=i["chartArea"],n=e._cachedMeta,o=n.data,r=e.getMaxBorderWidth()+e.getMaxOffset(o),s=Math.max((Math.min(a.width,a.height)-r)/2,0),l=Math.min(X(e.options.cutout,s),1),h=e._getRingWeight(e.index),{circumference:c,rotation:d}=e._getRotationExtents(),{ratioX:u,ratioY:g,offsetX:f,offsetY:p}=function(t,e,a){let i=1,n=1,o=0,r=0;if(e<mt){const s=t,l=s+e,h=Math.cos(s),c=Math.sin(s),d=Math.cos(l),u=Math.sin(l),g=(t,e,i)=>Vt(t,s,l)?1:Math.max(e,e*a,i,i*a),f=(t,e,i)=>Vt(t,s,l)?-1:Math.min(e,e*a,i,i*a),p=g(0,h,d),m=g(_t,c,u),x=f(pt,h,d),b=f(pt+_t,c,u);i=(p-x)/2,n=(m-b)/2,o=-(p+x)/2,r=-(m+b)/2}return{ratioX:i,ratioY:n,offsetX:o,offsetY:r}}(d,c,l),m=(a.width-r)/u,x=(a.height-r)/g,b=Math.max(Math.min(m,x)/2,0),v=q(e.options.radius,b),_=(v-Math.max(v*l,0))/e._getVisibleDatasetWeightTotal();e.offsetX=f*v,e.offsetY=p*v,n.total=e.calculateTotal(),e.outerRadius=v-_*e._getRingWeightOffset(e.index),e.innerRadius=Math.max(e.outerRadius-_*h,0),e.updateElements(o,0,o.length,t)}_circumference(t,e){var i=this.options,a=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===a._parsed[t]?0:this.calculateCircumference(a._parsed[t]*n/mt)}updateElements(t,e,i,a){const n=this,o="reset"===a,r=n.chart,s=r.chartArea,l=r.options.animation,h=(s.left+s.right)/2,c=(s.top+s.bottom)/2,d=o&&l.animateScale,u=d?0:n.innerRadius,g=d?0:n.outerRadius,f=n.resolveDataElementOptions(e,a),p=n.getSharedOptions(f),m=n.includeOptions(a,p);let x,b=n._getRotation();for(x=0;x<e;++x)b+=n._circumference(x,o);for(x=e;x<e+i;++x){const e=n._circumference(x,o),i=t[x],r={x:h+n.offsetX,y:c+n.offsetY,startAngle:b,endAngle:b+e,circumference:e,outerRadius:g,innerRadius:u};m&&(r.options=p||n.resolveDataElementOptions(x,a)),b+=e,n.updateElement(i,x,r,a)}n.updateSharedOptions(p,a,f)}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,a=0;for(i=0;i<e.length;i++){const e=t._parsed[i];null!==e&&!isNaN(e)&&this.chart.getDataVisibility(i)&&(a+=Math.abs(e))}return a}calculateCircumference(t){var e=this._cachedMeta.total;return 0<e&&!isNaN(t)?mt*(Math.abs(t)/e):0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,a=i.data.labels||[],i=Oi(e._parsed[t],i.options.locale);return{label:a[t]||"",value:i}}getMaxBorderWidth(t){let e=0;const i=this.chart;let a,n,o,r,s;if(!t)for(a=0,n=i.data.datasets.length;a<n;++a)if(i.isDatasetVisible(a)){t=(o=i.getDatasetMeta(a)).data,r=o.controller,r!==this&&r.configure();break}if(!t)return 0;for(a=0,n=t.length;a<n;++a)"inner"!==(s=r.resolveDataElementOptions(a)).borderAlign&&(e=Math.max(e,s.borderWidth||0,s.hoverBorderWidth||0));return e}getMaxOffset(i){let a=0;for(let t=0,e=i.length;t<e;++t){const i=this.resolveDataElementOptions(t);a=Math.max(a,i.offset||0,i.hoverOffset||0)}return a}_getRingWeightOffset(e){let i=0;for(let t=0;t<e;++t)this.chart.isDatasetVisible(t)&&(i+=this._getRingWeight(t));return i}_getRingWeight(t){return Math.max(U(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}qa.id="doughnut",qa.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",indexAxis:"r"},qa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(a){const t=a.data;return t.labels.length&&t.datasets.length?t.labels.map((t,e)=>{var i=a.getDatasetMeta(0).controller.getStyle(e);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:!a.getDataVisibility(e),index:e}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;t=": "+t.formattedValue;return N(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Ka extends Pi{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this,i=e._cachedMeta,{dataset:a,data:n=[],_dataset:o}=i,r=e.chart._animationsDisabled;let{start:s,count:l}=function(t,e,i){var a=e.length;let n=0,o=a;if(t._sorted){const{iScale:r,_parsed:s}=t,l=r.axis,{min:h,max:c,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(n=Bt(Math.min(ee(s,r.axis,h).lo,i?a:ee(e,l,r.getPixelForValue(h)).lo),0,a-1)),o=u?Bt(Math.max(ee(s,r.axis,c).hi+1,i?0:ee(e,l,r.getPixelForValue(c)).hi+1),n,a)-n:a-n}return{start:n,count:o}}(i,n,r);e._drawStart=s,e._drawCount=l,function(t){var{xScale:e,yScale:i,_scaleRanges:a}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!a)return t._scaleRanges=n,1;i=a.xmin!==e.min||a.xmax!==e.max||a.ymin!==i.min||a.ymax!==i.max;return Object.assign(a,n),i}(i)&&(s=0,l=n.length),a._decimated=!!o._decimated,a.points=n;const h=e.resolveDatasetElementOptions(t);e.options.showLine||(h.borderWidth=0),h.segment=e.options.segment,e.updateElement(a,void 0,{animated:!r,options:h},t),e.updateElements(n,s,l,t)}updateElements(e,i,a,n){const o=this,r="reset"===n,{xScale:s,yScale:l,_stacked:h}=o._cachedMeta,t=o.resolveDataElementOptions(i,n),c=o.getSharedOptions(t),d=o.includeOptions(n,c),u=o.options.spanGaps,g=Dt(u)?u:Number.POSITIVE_INFINITY,f=o.chart._animationsDisabled||r||"none"===n;let p=0<i&&o.getParsed(i-1);for(let t=i;t<i+a;++t){const i=e[t],a=o.getParsed(t),u=f?i:{},m=H(a.y),x=u.x=s.getPixelForValue(a.x,t),b=u.y=r||m?l.getBasePixel():l.getPixelForValue(h?o.applyStack(l,a,h):a.y,t);u.skip=isNaN(x)||isNaN(b)||m,u.stop=0<t&&a.x-p.x>g,u.parsed=a,d&&(u.options=c||o.resolveDataElementOptions(t,n)),f||o.updateElement(i,t,u,n),p=a}o.updateSharedOptions(c,n,t)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,a=t.data||[];if(!a.length)return i;var n=a[0].size(this.resolveDataElementOptions(0)),o=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(i,n,o)/2}draw(){this._cachedMeta.dataset.updateControlPoints(this.chart.chartArea),super.draw()}}Ka.id="line",Ka.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Ka.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ga extends Pi{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}update(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this,e=t.chart,i=e.chartArea,a=e.options,n=Math.min(i.right-i.left,i.bottom-i.top),o=Math.max(n/2,0),r=(o-Math.max(a.cutoutPercentage?o/100*a.cutoutPercentage:1,0))/e.getVisibleDatasetCount();t.outerRadius=o-r*t.index,t.innerRadius=t.outerRadius-r}updateElements(a,n,t,o){const r=this,s="reset"===o,l=r.chart,h=r.getDataset(),c=l.options.animation,d=r._cachedMeta.rScale,u=d.xCenter,g=d.yCenter,f=d.getIndexAngle(0)-.5*pt;let p,m=f;var x=360/r.countVisibleElements();for(p=0;p<n;++p)m+=r._computeAngle(p,o,x);for(p=n;p<n+t;p++){const n=a[p];let t=m,e=m+r._computeAngle(p,o,x),i=l.getDataVisibility(p)?d.getDistanceFromCenterForValue(h.data[p]):0;m=e,s&&(c.animateScale&&(i=0),c.animateRotate&&(t=e=f));var b={x:u,y:g,innerRadius:0,outerRadius:i,startAngle:t,endAngle:e,options:r.resolveDataElementOptions(p,o)};r.updateElement(n,p,b,o)}}countVisibleElements(){const i=this.getDataset(),t=this._cachedMeta;let a=0;return t.data.forEach((t,e)=>{!isNaN(i.data[e])&&this.chart.getDataVisibility(e)&&a++}),a}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Tt(this.resolveDataElementOptions(t,e).angle||i):0}}Ga.id="polarArea",Ga.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Ga.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(a){const t=a.data;return t.labels.length&&t.datasets.length?t.labels.map((t,e)=>{var i=a.getDatasetMeta(0).controller.getStyle(e);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:!a.getDataVisibility(e),index:e}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Za extends qa{}Za.id="pie",Za.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Qa extends Pi{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this,i=e._cachedMeta,a=i.dataset,n=i.data||[],o=i.iScale.getLabels();if(a.points=n,"resize"!==t){const i=e.resolveDatasetElementOptions(t);e.options.showLine||(i.borderWidth=0);var r={_loop:!0,_fullLoop:o.length===n.length,options:i};e.updateElement(a,void 0,r,t)}e.updateElements(n,0,n.length,t)}updateElements(e,i,a,n){const o=this.getDataset(),r=this._cachedMeta.rScale,s="reset"===n;for(let t=i;t<i+a;t++){const i=e[t],a=this.resolveDataElementOptions(t,n),l=r.getPointPositionForValue(t,o.data[t]),h=s?r.xCenter:l.x,c=s?r.yCenter:l.y,d={x:h,y:c,angle:l.angle,skip:isNaN(h)||isNaN(c),options:a};this.updateElement(i,t,d,n)}}}Qa.id="radar",Qa.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Qa.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Ja extends Ka{}Ja.id="scatter",Ja.defaults={showLine:!1,fill:!1},Ja.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var tn=Object.freeze({__proto__:null,BarController:Ua,BubbleController:Xa,DoughnutController:qa,LineController:Ka,PolarAreaController:Ga,PieController:Za,RadarController:Qa,ScatterController:Ja});function en(t,e){var{startAngle:i,endAngle:a,pixelMargin:n,x:o,y:r,outerRadius:s,innerRadius:l}=e,e=n/s;t.beginPath(),t.arc(o,r,s,i-e,a+e),n<l?t.arc(o,r,l,a+(e=n/l),i-e,!0):t.arc(o,r,n,a+_t,i-_t),t.closePath(),t.clip()}function an(t,e,i,a){return{x:i+t*Math.cos(e),y:a+t*Math.sin(e)}}function nn(t,e){var{x:i,y:a,startAngle:n,endAngle:o,pixelMargin:r}=e,s=Math.max(e.outerRadius-r,0),l=e.innerRadius+r,{outerStart:h,outerEnd:c,innerStart:d,innerEnd:u}=function(t,e,i,a){t=Oe(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const n=(i-e)/2,o=Math.min(n,a*e/2),r=t=>{var e=(i-Math.min(n,t))*a/2;return Bt(t,0,Math.min(n,e))};return{outerStart:r(t.outerStart),outerEnd:r(t.outerEnd),innerStart:Bt(t.innerStart,0,o),innerEnd:Bt(t.innerEnd,0,o)}}(e,l,s,o-n),g=s-h,f=s-c,p=n+h/g,m=o-c/f,x=l+d,b=l+u,r=n+d/x,e=o-u/b;if(t.beginPath(),t.arc(i,a,s,p,m),0<c){const v=an(f,m,i,a);t.arc(v.x,v.y,c,m,o+_t)}m=an(b,o,i,a);if(t.lineTo(m.x,m.y),0<u){const v=an(b,e,i,a);t.arc(v.x,v.y,u,o+_t,e+Math.PI)}if(t.arc(i,a,l,o-u/l,n+d/l,!0),0<d){const v=an(x,r,i,a);t.arc(v.x,v.y,d,r+Math.PI,n-_t)}r=an(g,n,i,a);if(t.lineTo(r.x,r.y),0<h){const v=an(g,p,i,a);t.arc(v.x,v.y,h,n-_t,p)}t.closePath()}function on(t,e){var i=e["options"],a="inner"===i.borderAlign;i.borderWidth&&(a?(t.lineWidth=2*i.borderWidth,t.lineJoin="round"):(t.lineWidth=i.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,i){var{x:a,y:n,startAngle:o,endAngle:r,pixelMargin:s}=e,l=Math.max(e.outerRadius-s,0),s=e.innerRadius+s;let h;for(i&&(e.endAngle=e.startAngle+mt,en(t,e),e.endAngle=r,e.endAngle===e.startAngle&&(e.endAngle+=mt,e.fullCircles--)),t.beginPath(),t.arc(a,n,s,o+mt,o,!0),h=0;h<e.fullCircles;++h)t.stroke();for(t.beginPath(),t.arc(a,n,l,o,o+mt),h=0;h<e.fullCircles;++h)t.stroke()}(t,e,a),a&&en(t,e),nn(t,e),t.stroke())}class rn extends Di{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){var{angle:a,distance:n}=Et(this.getProps(["x","y"],i),{x:t,y:e}),{startAngle:o,endAngle:r,innerRadius:t,outerRadius:e,circumference:i}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i);return(i>=mt||Vt(a,o,r))&&t<=n&&n<=e}getCenterPoint(t){var{x:e,y:i,startAngle:a,endAngle:n,innerRadius:o,outerRadius:t}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),n=(a+n)/2,t=(o+t)/2;return{x:e+Math.cos(n)*t,y:i+Math.sin(n)*t}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const e=this,i=e.options,a=i.offset||0;if(e.pixelMargin="inner"===i.borderAlign?.33:0,e.fullCircles=Math.floor(e.circumference/mt),!(0===e.circumference||e.innerRadius<0||e.outerRadius<0)){if(t.save(),a&&e.circumference<mt){const i=(e.startAngle+e.endAngle)/2;t.translate(Math.cos(i)*a,Math.sin(i)*a)}t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor,function(e,i){if(i.fullCircles){i.endAngle=i.startAngle+mt,nn(e,i);for(let t=0;t<i.fullCircles;++t)e.fill()}isNaN(i.circumference)||(i.endAngle=i.startAngle+i.circumference%mt),nn(e,i),e.fill()}(t,e),on(t,e),t.restore()}}}function sn(t,e,i=e){t.lineCap=U(i.borderCapStyle,e.borderCapStyle),t.setLineDash(U(i.borderDash,e.borderDash)),t.lineDashOffset=U(i.borderDashOffset,e.borderDashOffset),t.lineJoin=U(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=U(i.borderWidth,e.borderWidth),t.strokeStyle=U(i.borderColor,e.borderColor)}function ln(t,e,i){t.lineTo(i.x,i.y)}function hn(t,e,i={}){var a=t.length,{start:n=0,end:o=a-1}=i,{start:r,end:s}=e,t=Math.max(n,r),i=Math.min(o,s);return{count:a,start:t,loop:e.loop,ilen:i<t&&!(n<r&&o<r||s<n&&s<o)?a+i-t:i-t}}function cn(t,e,i,a){const{points:n,options:o}=e,{count:r,start:s,loop:l,ilen:h}=hn(n,i,a),c=o.stepped?Gt:o.tension||"monotone"===o.cubicInterpolationMode?Zt:ln;let d,u,g,{move:f=!0,reverse:p}=a||{};for(d=0;d<=h;++d)u=n[(s+(p?h-d:d))%r],u.skip||(f?(t.moveTo(u.x,u.y),f=!1):c(t,g,u,p,o.stepped),g=u);return l&&(u=n[(s+(p?h:0))%r],c(t,g,u,p,o.stepped)),!!l}function dn(t,e,i,a){const n=e.points,{count:o,start:r,ilen:s}=hn(n,i,a),{move:l=!0,reverse:h}=a||{};let c,d,u,g,f,p,m=0,x=0;var b=t=>(r+(h?s-t:t))%o,v=()=>{g!==f&&(t.lineTo(m,f),t.lineTo(m,g),t.lineTo(m,p))};for(l&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=s;++c)if(d=n[b(c)],!d.skip){const e=d.x,i=d.y,a=0|e;a===u?(i<g?g=i:i>f&&(f=i),m=(x*m+e)/++x):(v(),t.lineTo(e,i),u=a,x=0,g=f=i),p=i}v()}function un(t){var e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?cn:dn}rn.id="arc",rn.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,angle:void 0},rn.defaultRoutes={backgroundColor:"backgroundColor"};const gn="function"==typeof Path2D;class fn extends Di{constructor(t){super(),this.animated=!0,this.options=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,t&&Object.assign(this,t)}updateControlPoints(t){var e,i=this.options;!i.tension&&"monotone"!==i.cubicInterpolationMode||i.stepped||this._pointsUpdated||(e=i.spanGaps?this._loop:this._fullLoop,ia(this._points,i,t,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=ga(this,this.options.segment))}first(){var t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){var t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(i,a){const n=this,o=n.options,r=i[a],s=n.points,l=ua(n,{property:a,start:r,end:r});if(l.length){const h=[],c=o.stepped?na:o.tension||"monotone"===o.cubicInterpolationMode?oa:aa;let e,t;for(e=0,t=l.length;e<t;++e){const{start:n,end:t}=l[e],d=s[n],u=s[t];if(d!==u){const g=c(d,u,Math.abs((r-d[a])/(u[a]-d[a])),o.stepped);g[a]=i[a],h.push(g)}else h.push(d)}return 1===h.length?h[0]:h}}pathSegment(t,e,i){return un(this)(t,this,e,i)}path(t,e,i){const a=this.segments,n=un(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const r of a)o&=n(t,this,r,{start:e,end:e+i-1});return!!o}draw(t,e,i,a){var n,o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),n=t,o=this,i=i,a=a,(gn&&1===o.segments.length?function(t,e,i,a){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,a)&&n.closePath()),sn(t,e.options),t.stroke(n)}:function(t,e,i,a){const{segments:n,options:o}=e,r=un(e);for(const s of n)sn(t,o,s.style),t.beginPath(),r(t,e,s,{start:i,end:i+a-1})&&t.closePath(),t.stroke()})(n,o,i,a),t.restore(),this.animated&&(this._pointsUpdated=!1,this._path=void 0))}}function pn(t,e,i,a){var n=t.options,{[i]:i}=t.getProps([i],a);return Math.abs(e-i)<n.radius+n.hitRadius}fn.id="line",fn.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},fn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},fn.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class mn extends Di{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){var a=this.options,{x:n,y:i}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-i,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(t,e){return pn(this,t,"x",e)}inYRange(t,e){return pn(this,t,"y",e)}getCenterPoint(t){var{x:e,y:t}=this.getProps(["x","y"],t);return{x:e,y:t}}size(t){var e=(t=t||this.options||{}).radius||0;return 2*((e=Math.max(e,e&&t.hoverRadius||0))+(e&&t.borderWidth||0))}draw(t){var e=this.options;this.skip||e.radius<.1||(t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,Ut(t,e,this.x,this.y))}getRange(){var t=this.options||{};return t.radius+t.hitRadius}}function xn(t,e){var{x:i,y:a,base:n,width:o,height:e}=t.getProps(["x","y","base","width","height"],e);let r,s,l,h,c;return h=t.horizontal?(c=e/2,r=Math.min(i,n),s=Math.max(i,n),l=a-c,a+c):(c=o/2,r=i-c,s=i+c,l=Math.min(a,n),Math.max(a,n)),{left:r,top:l,right:s,bottom:h}}function bn(t){let e=t.options.borderSkipped;const i={};return e&&(e=t.horizontal?vn(e,"left","right",t.base>t.x):vn(e,"bottom","top",t.base<t.y),i[e]=!0),i}function vn(t,e,i,a){return t=a?_n(t=t===e?i:t===i?e:t,i,e):_n(t,e,i)}function _n(t,e,i){return"start"===t?e:"end"===t?i:t}function yn(t,e,i,a){return t?0:Math.max(Math.min(e,a),i)}function wn(t,e,i,a){var n=null===e,o=null===i,a=t&&!(n&&o)&&xn(t,a);return a&&(n||e>=a.left&&e<=a.right)&&(o||i>=a.top&&i<=a.bottom)}function Mn(t,e){t.rect(e.x,e.y,e.w,e.h)}mn.id="point",mn.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},mn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class kn extends Di{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const e=this.options,{inner:i,outer:a}=(c=xn(o=this),d=c.right-c.left,u=c.bottom-c.top,l=d/2,g=u/2,h=(s=o).options.borderWidth,s=bn(s),h=Ae(h),f={t:yn(s.top,h.top,0,g),r:yn(s.right,h.right,0,l),b:yn(s.bottom,h.bottom,0,g),l:yn(s.left,h.left,0,l)},r=d/2,g=u/2,h=(s=o).getProps(["enableBorderRadius"]).enableBorderRadius,l=s.options.borderRadius,o=Te(l),g=Math.min(r,g),s=bn(s),g={topLeft:yn(!(l=h||j(l))||s.top||s.left,o.topLeft,0,g),topRight:yn(!l||s.top||s.right,o.topRight,0,g),bottomLeft:yn(!l||s.bottom||s.left,o.bottomLeft,0,g),bottomRight:yn(!l||s.bottom||s.right,o.bottomRight,0,g)},{outer:{x:c.left,y:c.top,w:d,h:u,radius:g},inner:{x:c.left+f.l,y:c.top+f.t,w:d-f.l-f.r,h:u-f.t-f.b,radius:{topLeft:Math.max(0,g.topLeft-Math.max(f.t,f.l)),topRight:Math.max(0,g.topRight-Math.max(f.t,f.r)),bottomLeft:Math.max(0,g.bottomLeft-Math.max(f.b,f.l)),bottomRight:Math.max(0,g.bottomRight-Math.max(f.b,f.r))}}}),n=(f=a.radius).topLeft||f.topRight||f.bottomLeft||f.bottomRight?Jt:Mn;var o,r,s,l,h,c,d,u,g,f;t.save(),a.w===i.w&&a.h===i.h||(t.beginPath(),n(t,a),t.clip(),n(t,i),t.fillStyle=e.borderColor,t.fill("evenodd")),t.beginPath(),n(t,i),t.fillStyle=e.backgroundColor,t.fill(),t.restore()}inRange(t,e,i){return wn(this,t,e,i)}inXRange(t,e){return wn(this,t,null,e)}inYRange(t,e){return wn(this,null,t,e)}getCenterPoint(t){var{x:e,y:i,base:a,horizontal:t}=this.getProps(["x","y","base","horizontal"],t);return{x:t?(e+a)/2:e,y:t?i:(i+a)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}kn.id="bar",kn.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},kn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Sn=Object.freeze({__proto__:null,ArcElement:rn,LineElement:fn,PointElement:mn,BarElement:kn});function Pn(t){var e;t._decimated&&(e=t._data,delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e}))}function Dn(t){t.data.datasets.forEach(t=>{Pn(t)})}var Cn={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,w)=>{if(w.enabled){const r=i.width;i.data.datasets.forEach((a,t)=>{var{_data:n,indexAxis:e}=a,h=i.getDatasetMeta(t),o=n||a.data;if("y"!==Ee([e,i.options.indexAxis])&&"line"===h.type){e=i.scales[h.xAxisID];if(("linear"===e.type||"time"===e.type)&&!i.options.parsing){let t,{start:e,count:i}=function(t){var e=t.length;let i,a=0;const n=h["iScale"],{min:o,max:r,minDefined:s,maxDefined:l}=n.getUserBounds();return s&&(a=Bt(ee(t,n.axis,o).lo,0,e-1)),i=l?Bt(ee(t,n.axis,r).hi+1,a,e)-a:e-a,{start:a,count:i}}(o);if(i<=4*r)Pn(a);else{switch(H(n)&&(a._data=o,delete a.data,Object.defineProperty(a,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),w.algorithm){case"lttb":t=function(a,n,o,t){var e=w.samples||t;if(o<=e)return a.slice(n,n+o);const r=[],s=(o-2)/(e-2);let l=0;const h=n+o-1;let c,d,u,g,f,p=n;for(r[l++]=a[p],c=0;c<e-2;c++){let t,e=0,i=0;const h=Math.floor((c+1)*s)+1+n,_=Math.min(Math.floor((c+2)*s)+1,o)+n,y=_-h;for(t=h;t<_;t++)e+=a[t].x,i+=a[t].y;e/=y,i/=y;var m=Math.floor(c*s)+1+n,x=Math.floor((c+1)*s)+1+n,{x:b,y:v}=a[p];for(u=-1,t=m;t<x;t++)(g=.5*Math.abs((b-e)*(a[t].y-v)-(b-a[t].x)*(i-v)))>u&&(u=g,d=a[t],f=t);r[l++]=d,p=f}return r[l++]=a[h],r}(o,e,i,r);break;case"min-max":t=function(t,e,i,a){let n,o,r,s,l,h,c,d,u,g,f=0,p=0;const m=[],x=e+i-1,b=t[e].x,v=t[x].x-b;for(n=e;n<e+i;++n){r=((o=t[n]).x-b)/v*a,s=o.y;const e=0|r;if(e===l)s<u?(u=s,h=n):s>g&&(g=s,c=n),f=(p*f+o.x)/++p;else{const i=n-1;if(!H(h)&&!H(c)){const e=Math.min(h,c),a=Math.max(h,c);e!==d&&e!==i&&m.push({...t[e],x:f}),a!==d&&a!==i&&m.push({...t[a],x:f})}0<n&&i!==d&&m.push(t[i]),m.push(o),l=e,p=0,u=g=s,h=c=d=n}}return m}(o,e,i,r);break;default:throw new Error(`Unsupported decimation algorithm '${w.algorithm}'`)}a._decimated=t}}}})}else Dn(i)},destroy(t){Dn(t)}};class On{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){var{x:a,y:n,radius:o}=this;return e=e||{start:0,end:mt},t.arc(a,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){var{x:e,y:i,radius:a}=this,t=t.angle;return{x:e+Math.cos(t)*a,y:i+Math.sin(t)*a,angle:t}}}function An(t){const{chart:e,scale:i,index:a,line:n}=t,o=[],r=n.segments,s=n.points,l=function(t,e){const i=[],a=t.getSortedVisibleDatasetMetas();for(let t=0;t<a.length;t++){var n=a[t];if(n.index===e)break;Tn(n)&&i.unshift(n.dataset)}return i}(e,a);l.push(Rn({x:null,y:i.bottom},n));for(let t=0;t<r.length;t++){const e=r[t];for(let t=e.start;t<=e.end;t++)!function(e,i,a){const n=[];for(let t=0;t<a.length;t++){var{first:o,last:r,point:s}=function(t,e,i){const a=t.interpolate(e,i);if(!a)return{};var n=a[i],o=t.segments,r=t.points;let s=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],a=r[e.start][i],h=r[e.end][i];if(n>=a&&n<=h){s=n===a,l=n===h;break}}return{first:s,last:l,point:a}}(a[t],i,"x");if(!(!s||o&&r))if(o)n.unshift(s);else if(e.push(s),!r)break}e.push(...n)}(o,s[t],l)}return new fn({points:o,options:{}})}const Tn=t=>"line"===t.type&&!t.hidden;function Rn(e,t){let i=[],a=!1;return i=N(e)?(a=!0,e):function(t){const{x:i=null,y:a=null}=e||{},n=t.points,o=[];return t.segments.forEach(t=>{var e=n[t.start],t=n[t.end];null!==a?(o.push({x:e.x,y:a}),o.push({x:t.x,y:a})):null!==i&&(o.push({x:i,y:e.y}),o.push({x:i,y:t.y}))}),o}(t),i.length?new fn({points:i,options:{tension:0},_loop:a,_fullLoop:a}):null}function Ln(t,e,i){t.beginPath(),e.path(t),t.lineTo(e.last().x,i),t.lineTo(e.first().x,i),t.closePath(),t.clip()}function En(i,a,n,t){if(!t){let t=a[i],e=n[i];return"angle"===i&&(t=Ft(t),e=Ft(e)),{property:i,start:t,end:e}}}function In(t,e,i,a){return t&&e?a(t[i],e[i]):t?t[i]:e?e[i]:0}function zn(t,e,i,a){a=e.interpolate(i,a);a&&t.lineTo(a.x,a.y)}function Fn(t,e){const{line:i,target:a,property:n,color:o,scale:r}=e,s=function(t,e,i){const a=t.segments,n=t.points,o=e.points,r=[];for(const t of a){const a=En(i,n[t.start],n[t.end],t.loop);if(e.segments){var s=ua(e,a);for(const e of s){var l=En(i,o[e.start],o[e.end],e.loop),h=da(t,n,l);for(const t of h)r.push({source:t,target:e,start:{[i]:In(a,l,"start",Math.max)},end:{[i]:In(a,l,"end",Math.min)}})}}else r.push({source:t,target:a,start:n[t.start],end:n[t.end]})}return r}(i,a,n);for(const{source:e,target:c,start:d,end:u}of s){const{style:{backgroundColor:s=o}={}}=e;t.save(),t.fillStyle=s,function(t,e,i){var{top:a,bottom:n}=e.chart.chartArea,{property:o,start:e,end:i}=i||{};"x"===o&&(t.beginPath(),t.rect(e,a,i-e,n-a),t.clip())}(t,r,En(n,d,u)),t.beginPath();var l=!!i.pathSegment(t,e);l?t.closePath():zn(t,a,u,n);var h=!!a.pathSegment(t,c,{move:l,reverse:!0}),h=l&&h;h||zn(t,a,d,n),t.closePath(),t.fill(h?"evenodd":"nonzero"),t.restore()}}function Vn(t,e,i){var a=function(t){var e,i,{chart:a,fill:n,line:o}=t;if(Y(n))return i=n,(a=(e=a).getDatasetMeta(i))&&e.isDatasetVisible(i)?a.dataset:null;if("stack"===n)return An(t);var c,t=(((c=t).scale||{}).getPointPositionForValue?function(){const{scale:t,fill:e}=c,i=t.options,a=t.getLabels().length,n=[],o=i.reverse?t.max:t.min,r=i.reverse?t.min:t.max;let s,l,h;if(h="start"===e?o:"end"===e?r:j(e)?e.value:t.getBaseValue(),i.grid.circular)return l=t.getPointPositionForValue(0,o),new On({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(h)});for(s=0;s<a;++s)n.push(t.getPointPositionForValue(s,h));return n}:function(){const{scale:t={},fill:e}=c;let i,a=null;return"start"===e?a=t.bottom:"end"===e?a=t.top:j(e)?a=t.getPixelForValue(e.value):t.getBasePixel&&(a=t.getBasePixel()),Y(a)?{x:(i=t.isHorizontal())?a:null,y:i?null:a}:null})();return t instanceof On?t:Rn(t,o)}(e),{line:n,scale:o,axis:r}=e,s=n.options,e=s.fill,s=s.backgroundColor,{above:e=s,below:s=s}=e||{};a&&n.points.length&&(qt(t,i),function(t,e){var{line:i,target:a,above:n,below:o,area:r,scale:s}=e,e=i._loop?"angle":e.axis;t.save(),"x"===e&&o!==n&&(Ln(t,a,r.top),Fn(t,{line:i,target:a,color:n,scale:s,property:e}),t.restore(),t.save(),Ln(t,a,r.bottom)),Fn(t,{line:i,target:a,color:o,scale:s,property:e}),t.restore()}(t,{line:n,target:a,above:e,below:s,area:i,scale:o,axis:r}),Kt(t))}var Bn={id:"filler",afterDatasetsUpdate(t,e,i){const a=(t.data.datasets||[]).length,n=[];let o,r,s,l;for(r=0;r<a;++r)o=t.getDatasetMeta(r),s=o.dataset,l=null,s&&s.options&&s instanceof fn&&(l={visible:t.isDatasetVisible(r),index:r,fill:function(a,t,e){var i=function(){var t=a.options,e=t.fill;let i=U(e&&e.target,e);return void 0===i&&(i=!!t.backgroundColor),!1!==i&&null!==i&&(!0===i?"origin":i)}();if(j(i))return!isNaN(i.value)&&i;let n=parseFloat(i);return Y(n)&&Math.floor(n)===n?("-"!==i[0]&&"+"!==i[0]||(n=t+n),!(n===t||n<0||n>=e)&&n):0<=["origin","start","end","stack"].indexOf(i)&&i}(s,r,a),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:s}),o.$filler=l,n.push(l);for(r=0;r<a;++r)l=n[r],l&&!1!==l.fill&&(l.fill=function(t,e,i){let a=t[e].fill;const n=[e];var o;if(!i)return a;for(;!1!==a&&-1===n.indexOf(a);){if(!Y(a))return a;if(!(o=t[a]))return!1;if(o.visible)return a;n.push(a),a=o.fill}return!1}(n,r,i.propagate))},beforeDraw(e,t,i){var a="beforeDraw"===i.drawTime,n=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let t=n.length-1;0<=t;--t){const i=n[t].$filler;i&&(i.line.updateControlPoints(o),a&&Vn(e.ctx,i,o))}},beforeDatasetsDraw(e,t,i){if("beforeDatasetsDraw"===i.drawTime){var a=e.getSortedVisibleDatasetMetas();for(let t=a.length-1;0<=t;--t){const i=a[t].$filler;i&&Vn(e.ctx,i,e.chartArea)}}},beforeDatasetDraw(t,e,i){e=e.meta.$filler;e&&!1!==e.fill&&"beforeDatasetDraw"===i.drawTime&&Vn(t.ctx,e,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Wn=(t,e)=>{let{boxHeight:i=e,boxWidth:a=e}=t;return t.usePointStyle&&(i=Math.min(i,e),a=Math.min(a,e)),{boxWidth:a,boxHeight:i,itemHeight:Math.max(e,i)}};class Hn extends Di{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height)}buildLabels(){const i=this,a=i.options.labels||{};let t=K(a.generateLabels,[i.chart],i)||[];a.filter&&(t=t.filter(t=>a.filter(t,i.chart.data))),a.sort&&(t=t.sort((t,e)=>a.sort(t,e,i.chart.data))),i.options.reverse&&t.reverse(),i.legendItems=t}fit(){const i=this,{options:a,ctx:n}=i;if(a.display){var o=a.labels,r=Le(o.font),s=r.size,l=i._computeTitleHeight(),{boxWidth:h,itemHeight:o}=Wn(o,s);let t,e;n.font=r.string,i.isHorizontal()?(t=i.maxWidth,e=i._fitRows(l,s,h,o)+10):(e=i.maxHeight,t=i._fitCols(l,s,h,o)+10),i.width=Math.min(t,a.maxWidth||i.maxWidth),i.height=Math.min(e,a.maxHeight||i.maxHeight)}else i.width=i.height=0}_fitRows(t,i,a,n){const{ctx:o,maxWidth:r,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],h=this.lineWidths=[0],c=n+s;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,g=-c;return this.legendItems.forEach((t,e)=>{t=a+i/2+o.measureText(t.text).width;(0===e||h[h.length-1]+t+2*s>r)&&(d+=c,h[h.length-(0<e?0:1)]=0,g+=c,u++),l[e]={left:0,top:g,row:u,width:t,height:n},h[h.length-1]+=t+s}),d}_fitCols(t,i,a,n){const{ctx:o,maxHeight:e,options:{labels:{padding:r}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],h=e-t;let c=r,d=0,u=0,g=0,f=0,p=0;return this.legendItems.forEach((t,e)=>{t=a+i/2+o.measureText(t.text).width;0<e&&u+i+2*r>h&&(c+=d+r,l.push({width:d,height:u}),g+=d+r,p++,f=0,d=u=0),d=Math.max(d,t),u+=i+r,s[e]={left:g,top:f,col:p,width:t,height:n},f+=n+r}),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){var i=this;if(i.options.display){var a=i._computeTitleHeight(),{legendHitBoxes:n,options:{align:o,labels:{padding:r}}}=i;if(this.isHorizontal()){let t=0,e=T(o,i.left+r,i.right-i.lineWidths[t]);for(const s of n)t!==s.row&&(t=s.row,e=T(o,i.left+r,i.right-i.lineWidths[t])),s.top+=i.top+a+r,s.left=e,e+=s.width+r}else{let t=0,e=T(o,i.top+a+r,i.bottom-i.columnSizes[t].height);for(const l of n)l.col!==t&&(t=l.col,e=T(o,i.top+a+r,i.bottom-i.columnSizes[t].height)),l.top=e,l.left+=i.left+r,e+=l.height+r}}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){var t;this.options.display&&(qt(t=this.ctx,this),this._draw(),Kt(t))}_draw(){const d=this,{options:t,columnSizes:u,lineWidths:g,ctx:f}=d,{align:p,labels:m}=t,x=ft.color,b=ra(t.rtl,d.left,d.width),v=Le(m.font),{color:_,padding:y}=m,w=v.size,M=w/2;let k;d.drawTitle(),f.textAlign=b.textAlign("left"),f.textBaseline="middle",f.lineWidth=.5,f.font=v.string;const{boxWidth:S,boxHeight:P,itemHeight:D}=Wn(m,w),C=d.isHorizontal(),O=this._computeTitleHeight();k=C?{x:T(p,d.left+y,d.right-g[0]),y:d.top+y+O,line:0}:{x:d.left+y,y:T(p,d.top+O+y,d.bottom-u[0].height),line:0},sa(d.ctx,t.textDirection);const A=D+y;d.legendItems.forEach((t,e)=>{f.strokeStyle=t.fontColor||_,f.fillStyle=t.fontColor||_;var i,a,n,o,r=f.measureText(t.text).width,s=b.textAlign(t.textAlign||(t.textAlign=m.textAlign)),l=S+w/2+r;let h=k.x,c=k.y;b.setWidth(d.width),C?0<e&&h+l+y>d.right&&(c=k.y+=A,k.line++,h=k.x=T(p,d.left+y,d.right-g[k.line])):0<e&&c+A>d.bottom&&(h=k.x=h+u[k.line].width+y,k.line++,c=k.y=T(p,d.top+O+y,d.bottom-u[k.line].height)),i=b.x(h),a=c,n=t,isNaN(S)||S<=0||isNaN(P)||P<0||(f.save(),o=U(n.lineWidth,1),f.fillStyle=U(n.fillStyle,x),f.lineCap=U(n.lineCap,"butt"),f.lineDashOffset=U(n.lineDashOffset,0),f.lineJoin=U(n.lineJoin,"miter"),f.lineWidth=o,f.strokeStyle=U(n.strokeStyle,x),f.setLineDash(U(n.lineDash,[])),m.usePointStyle?(r={radius:S*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},e=b.xPlus(i,S/2),Ut(f,r,e,a+M)):(a=a+Math.max((w-P)/2,0),i=b.leftForLtr(i,S),n=Te(n.borderRadius),f.beginPath(),Object.values(n).some(t=>0!==t)?Jt(f,{x:i,y:a,w:S,h:P,radius:n}):f.rect(i,a,S,P),f.fill(),0!==o&&f.stroke()),f.restore()),h=R(s,h+S+M,d.right),o=b.x(h),s=c,t=t,Qt(f,t.text,o,s+D/2,v,{strikethrough:t.hidden,textAlign:t.textAlign}),C?k.x+=l+y:k.y+=A}),la(d.ctx,t.textDirection)}drawTitle(){const a=this,n=a.options,o=n.title,r=Le(o.font),s=Re(o.padding);if(o.display){const h=ra(n.rtl,a.left,a.width),c=a.ctx,d=o.position,u=r.size/2,g=s.top+u;let t,e=a.left,i=a.width;if(this.isHorizontal())i=Math.max(...a.lineWidths),t=a.top+g,e=T(n.align,e,a.right-i);else{const o=a.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);t=g+T(n.align,a.top,a.bottom-o-n.labels.padding-a._computeTitleHeight())}var l=T(d,e,e+i);c.textAlign=h.textAlign(f(d)),c.textBaseline="middle",c.strokeStyle=o.color,c.fillStyle=o.color,c.font=r.string,Qt(c,o.text,l,t,r)}}_computeTitleHeight(){var t=this.options.title,e=Le(t.font),i=Re(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,a,n;if(t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom)for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(t>=(a=n[i]).left&&t<=a.left+a.width&&e>=a.top&&e<=a.top+a.height)return this.legendItems[i];return null}handleEvent(t){var e,i,a,n=this,o=n.options;("mousemove"===(a=t.type)&&(o.onHover||o.onLeave)||o.onClick&&("click"===a||"mouseup"===a))&&(e=n._getLegendItemAt(t.x,t.y),"mousemove"===t.type?(a=null!==(i=n._hoveredItem)&&null!==e&&i.datasetIndex===e.datasetIndex&&i.index===e.index,i&&!a&&K(o.onLeave,[t,i,n],n),(n._hoveredItem=e)&&!a&&K(o.onHover,[t,e,n],n)):e&&K(o.onClick,[t,e,n],n))}}var Nn={id:"legend",_element:Hn,start(t,e,i){var a=t.legend=new Hn({ctx:t.ctx,options:i,chart:t});$e.configure(t,a,i),$e.addBox(t,a)},stop(t){$e.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const a=t.legend;$e.configure(t,a,i),a.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const a=e.datasetIndex,n=i.chart;n.isDatasetVisible(a)?(n.hide(a),e.hidden=!0):(n.show(a),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const a=t.data.datasets,{labels:{usePointStyle:n,pointStyle:o,textAlign:r,color:s}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{var e=t.controller.getStyle(n?0:void 0),i=Re(e.borderWidth);return{text:a[t.index].label,fillStyle:e.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:(i.width+i.height)/4,strokeStyle:e.borderColor,pointStyle:o||e.pointStyle,rotation:e.rotation,textAlign:r||e.textAlign,borderRadius:0,datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class jn extends Di{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){var i=this,a=i.options;i.left=0,i.top=0,a.display?(i.width=i.right=t,i.height=i.bottom=e,e=N(a.text)?a.text.length:1,i._padding=Re(a.padding),a=e*Le(a.font).lineHeight+i._padding.height,i.isHorizontal()?i.height=a:i.width=a):i.width=i.height=i.right=i.bottom=0}isHorizontal(){var t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){var{top:e,left:i,bottom:a,right:n,options:o}=this,r=o.align;let s,l,h,c=0;return s=this.isHorizontal()?(l=T(r,i,n),h=e+t,n-i):(c="left"===o.position?(l=i+t,h=T(r,a,e),-.5*pt):(l=n-t,h=T(r,e,a),.5*pt),a-e),{titleX:l,titleY:h,maxWidth:s,rotation:c}}draw(){var t,e,i,a,n,o=this.ctx,r=this.options;r.display&&(n=(t=Le(r.font)).lineHeight/2+this._padding.top,{titleX:e,titleY:i,maxWidth:a,rotation:n}=this._drawArgs(n),Qt(o,r.text,0,0,t,{color:r.color,maxWidth:a,rotation:n,textAlign:f(r.align),textBaseline:"middle",translation:[e,i]}))}}var Yn={id:"title",_element:jn,start(t,e,i){var a;a=t,t=i,i=new jn({ctx:a.ctx,options:t,chart:a}),$e.configure(a,i,t),$e.addBox(a,i),a.titleBlock=i},stop(t){var e=t.titleBlock;$e.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const a=t.titleBlock;$e.configure(t,a,i),a.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const $n={average(t){if(!t.length)return!1;let e,i,a=0,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();a+=t.x,n+=t.y,++o}}return{x:a/o,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,a,n,o=e.x,r=e.y,s=Number.POSITIVE_INFINITY;for(i=0,a=t.length;i<a;++i){const a=t[i].element;if(a&&a.hasValue()){const t=It(e,a.getCenterPoint());t<s&&(s=t,n=a)}}if(n){const t=n.tooltipPosition();o=t.x,r=t.y}return{x:o,y:r}}};function Un(t,e){return e&&(N(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Xn(t){return("string"==typeof t||t instanceof String)&&-1<t.indexOf("\n")?t.split("\n"):t}function qn(t,e){const i=t._chart.ctx,{body:a,footer:n,title:o}=t,{boxWidth:r,boxHeight:s}=e,l=Le(e.bodyFont),h=Le(e.titleFont),c=Le(e.footerFont),d=o.length,u=n.length,g=a.length,f=Re(e.padding);let p=f.height,m=0,x=a.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);x+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x&&(p+=g*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(x-g)*l.lineHeight+(x-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let b=0;function v(t){m=Math.max(m,i.measureText(t).width+b)}return i.save(),i.font=h.string,G(t.title,v),i.font=l.string,G(t.beforeBody.concat(t.afterBody),v),b=e.displayColors?r+2:0,G(a,t=>{G(t.before,v),G(t.lines,v),G(t.after,v)}),b=0,i.font=c.string,G(t.footer,v),i.restore(),m+=f.width,{width:m,height:p}}function Kn(i,t,a){var e=t.yAlign||function(){var{y:t,height:e}=a;return t<e/2?"top":t>i.height-e/2?"bottom":"center"}();return{xAlign:t.xAlign||function(n,o,r,t){var{x:e,width:i}=r,{width:a,chartArea:{left:s,right:l}}=n;let h="center";return"center"===t?h=e<=(s+l)/2?"left":"right":e<=i/2?h="left":a-i/2<=e&&(h="right"),function(t){var{x:e,width:i}=r,a=o.caretSize+o.caretPadding;return"left"===t&&e+i+a>n.width||"right"===t&&e-i-a<0}(h)&&(h="center"),h}(i,t,a,e),yAlign:e}}function Gn(t,i,e,a){var{caretSize:n,caretPadding:o,cornerRadius:t}=t,{xAlign:r,yAlign:s}=e,l=n+o,t=t+o;let h=function(){let{x:t,width:e}=i;return"right"===r?t-=e:"center"===r&&(t-=e/2),t}();o=function(){let{y:t,height:e}=i;return"top"===s?t+=l:t-="bottom"===s?e+l:e/2,t}();return"center"===s?"left"===r?h+=l:"right"===r&&(h-=l):"left"===r?h-=t:"right"===r&&(h+=t),{x:Bt(h,0,a.width-i.width),y:Bt(o,0,a.height-i.height)}}function Zn(t,e,i){i=Re(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function Qn(t){return Un([],Xn(t))}function Jn(t,e){e=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return e?t.override(e):t}class to extends Di{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){var t=this._cachedAnimations;if(t)return t;var e=this._chart,t=this.options.setContext(this.getContext()),e=t.enabled&&e.options.animation&&t.animations,t=new pi(this._chart,e);return e._cacheable&&(this._cachedAnimations=Object.freeze(t)),t}getContext(){var t,e;return this.$context||(this.$context=(t=this._chart.getContext(),e=this._tooltipItems,Object.assign(Object.create(t),{tooltip:this,tooltipItems:e,type:"tooltip"})))}getTitle(t,e){const i=e["callbacks"],a=i.beforeTitle.apply(this,[t]),n=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);t=Un(t=[],Xn(a));return t=Un(t,Xn(n)),t=Un(t,Xn(o))}getBeforeBody(t,e){return Qn(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const a=this,n=e["callbacks"],o=[];return G(t,t=>{const e={before:[],lines:[],after:[]},i=Jn(n,t);Un(e.before,Xn(i.beforeLabel.call(a,t))),Un(e.lines,i.label.call(a,t)),Un(e.after,Xn(i.afterLabel.call(a,t))),o.push(e)}),o}getAfterBody(t,e){return Qn(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const i=e["callbacks"],a=i.beforeFooter.apply(this,[t]),n=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);t=Un(t=[],Xn(a));return t=Un(t,Xn(n)),t=Un(t,Xn(o))}_createItems(a){const i=this,t=i._active,n=i._chart.data,o=[],r=[],s=[];let e,l,h=[];for(e=0,l=t.length;e<l;++e)h.push(function(t,e){const{element:i,datasetIndex:a,index:n}=e,o=t.getDatasetMeta(a).controller,{label:r,value:s}=o.getLabelAndValue(n);return{chart:t,label:r,parsed:o.getParsed(n),raw:t.data.datasets[a].data[n],formattedValue:s,dataset:o.getDataset(),dataIndex:n,datasetIndex:a,element:i}}(i._chart,t[e]));return a.filter&&(h=h.filter((t,e,i)=>a.filter(t,e,i,n))),a.itemSort&&(h=h.sort((t,e)=>a.itemSort(t,e,n))),G(h,t=>{const e=Jn(a.callbacks,t);o.push(e.labelColor.call(i,t)),r.push(e.labelPointStyle.call(i,t)),s.push(e.labelTextColor.call(i,t))}),i.labelColors=o,i.labelPointStyles=r,i.labelTextColors=s,i.dataPoints=h,h}update(t,e){const i=this,a=i.options.setContext(i.getContext()),n=i._active;let o,r=[];if(n.length){const t=$n[a.position].call(i,n,i._eventPosition);r=i._createItems(a),i.title=i.getTitle(r,a),i.beforeBody=i.getBeforeBody(r,a),i.body=i.getBody(r,a),i.afterBody=i.getAfterBody(r,a),i.footer=i.getFooter(r,a);const e=i._size=qn(i,a),s=Object.assign({},t,e),l=Kn(i._chart,a,s),h=Gn(a,s,l,i._chart);i.xAlign=l.xAlign,i.yAlign=l.yAlign,o={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==i.opacity&&(o={opacity:0});i._tooltipItems=r,i.$context=void 0,o&&i._resolveAnimations().update(i,o),t&&a.external&&a.external.call(i,{chart:i._chart,tooltip:i,replay:e})}drawCaret(t,e,i,a){a=this.getCaretPosition(t,i,a);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){var{xAlign:a,yAlign:n}=this,{cornerRadius:o,caretSize:r}=i,{x:s,y:i}=t,{width:t,height:e}=e;let l,h,c,d,u,g;return"center"===n?(u=i+e/2,g="left"===a?(l=s,h=l-r,d=u+r,u-r):(l=s+t,h=l+r,d=u-r,u+r),c=l):(h="left"===a?s+o+r:"right"===a?s+t-o-r:this.caretX,c="top"===n?(d=i,u=d-r,l=h-r,h+r):(d=i+e,u=d+r,l=h+r,h-r),g=d),{x1:l,x2:h,x3:c,y1:d,y2:u,y3:g}}drawTitle(t,e,i){var a=this.title,n=a.length;let o,r,s;if(n){const l=ra(i.rtl,this.x,this.width);for(t.x=Zn(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=Le(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,s=0;s<n;++s)e.fillText(a[s],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r,s+1===n&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,a,n){const o=this,r=o.labelColors[i],s=o.labelPointStyles[i],{boxHeight:l,boxWidth:h}=n,c=Le(n.bodyFont),d=Zn(o,"left",n),u=a.x(d),g=l<c.lineHeight?(c.lineHeight-l)/2:0,f=e.y+g;if(n.usePointStyle){const e={radius:Math.min(h,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},i=a.leftForLtr(u,h)+h/2,o=f+l/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,Ut(t,e,i,o),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Ut(t,e,i,o)}else{t.lineWidth=r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const e=a.leftForLtr(u,h),i=a.leftForLtr(a.xPlus(u,1),h-2),o=Te(r.borderRadius);Object.values(o).some(t=>0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,Jt(t,{x:e,y:f,w:h,h:l,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Jt(t,{x:i,y:f+1,w:h-2,h:l-2,radius:o}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,h,l),t.strokeRect(e,f,h,l),t.fillStyle=r.backgroundColor,t.fillRect(i,f+1,h-2,l-2))}t.fillStyle=o.labelTextColors[i]}drawBody(e,i,t){const a=this["body"],{bodySpacing:n,bodyAlign:o,displayColors:r,boxHeight:s,boxWidth:l}=t,h=Le(t.bodyFont);let c=h.lineHeight,d=0;function u(t){i.fillText(t,g.x(e.x+d),e.y+c/2),e.y+=c+n}const g=ra(t.rtl,this.x,this.width),f=g.textAlign(o);let p,m,x,b,v,_,y;for(i.textAlign=o,i.textBaseline="middle",i.font=h.string,e.x=Zn(this,f,t),i.fillStyle=t.bodyColor,G(this.beforeBody,u),d=r&&"right"!==f?"center"===o?l/2+1:l+2:0,b=0,_=a.length;b<_;++b){for(p=a[b],m=this.labelTextColors[b],i.fillStyle=m,G(p.before,u),x=p.lines,r&&x.length&&(this._drawColorBox(i,e,b,g,t),c=Math.max(h.lineHeight,s)),v=0,y=x.length;v<y;++v)u(x[v]),c=h.lineHeight;G(p.after,u)}d=0,c=h.lineHeight,G(this.afterBody,u),e.y-=n}drawFooter(t,e,i){var a=this.footer,n=a.length;let o,r;if(n){const s=ra(i.rtl,this.x,this.width);for(t.x=Zn(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=s.textAlign(i.footerAlign),e.textBaseline="middle",o=Le(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,r=0;r<n;++r)e.fillText(a[r],s.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,a){var{xAlign:n,yAlign:o}=this,{x:r,y:s}=t,{width:l,height:h}=i,c=a.cornerRadius;e.fillStyle=a.backgroundColor,e.strokeStyle=a.borderColor,e.lineWidth=a.borderWidth,e.beginPath(),e.moveTo(r+c,s),"top"===o&&this.drawCaret(t,e,i,a),e.lineTo(r+l-c,s),e.quadraticCurveTo(r+l,s,r+l,s+c),"center"===o&&"right"===n&&this.drawCaret(t,e,i,a),e.lineTo(r+l,s+h-c),e.quadraticCurveTo(r+l,s+h,r+l-c,s+h),"bottom"===o&&this.drawCaret(t,e,i,a),e.lineTo(r+c,s+h),e.quadraticCurveTo(r,s+h,r,s+h-c),"center"===o&&"left"===n&&this.drawCaret(t,e,i,a),e.lineTo(r,s+c),e.quadraticCurveTo(r,s,r+c,s),e.closePath(),e.fill(),0<a.borderWidth&&e.stroke()}_updateAnimationTarget(t){const e=this,i=e._chart,a=e.$animations,n=a&&a.x,o=a&&a.y;if(n||o){const a=$n[t.position].call(e,e._active,e._eventPosition);var r,s;a&&(r=e._size=qn(e,t),s=Gn(t,s=Object.assign({},a,e._size),t=Kn(i,t,s),i),n._to===s.x&&o._to===s.y||(e.xAlign=t.xAlign,e.yAlign=t.yAlign,e.width=r.width,e.height=r.height,e.caretX=a.x,e.caretY=a.y,e._resolveAnimations().update(e,s)))}}draw(t){var e=this,i=e.options.setContext(e.getContext());let a=e.opacity;if(a){e._updateAnimationTarget(i);const r={width:e.width,height:e.height},s={x:e.x,y:e.y};a=Math.abs(a)<.001?0:a;var n=Re(i.padding),o=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;i.enabled&&o&&(t.save(),t.globalAlpha=a,e.drawBackground(s,t,r,i),sa(t,i.textDirection),s.y+=n.top,e.drawTitle(s,t,i),e.drawBody(s,t,i),e.drawFooter(s,t,i),la(t,i.textDirection),t.restore())}}getActiveElements(){return this._active||[]}setActiveElements(t,e){const a=this,i=a._active,n=t.map(({datasetIndex:t,index:e})=>{var i=a._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),o=!Z(i,n),r=a._positionChanged(n,e);(o||r)&&(a._active=n,a._eventPosition=e,a.update(!0))}handleEvent(t,e){var i=this.options,a=this._active||[];let n,o=[];"mouseout"!==t.type&&(o=this._chart.getElementsAtEventForMode(t,i.mode,i,e),i.reverse&&o.reverse());var r=this._positionChanged(o,t);return(n=e||!Z(o,a)||r)&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),n}_positionChanged(t,e){var{caretX:i,caretY:a,options:n}=this,e=$n[n.position].call(this,t,e);return!1!==e&&(i!==e.x||a!==e.y)}}to.positioners=$n;be={id:"tooltip",_element:to,positioners:$n,afterInit(t,e,i){i&&(t.tooltip=new to({_chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){var i;t.tooltip&&(i=e.replay,t.tooltip.handleEvent(e.event,i)&&(e.changed=!0))},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:t,title(t){if(0<t.length){var e=t[0],i=e.chart.data.labels,t=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(0<t&&e.dataIndex<t)return i[e.dataIndex]}return""},afterTitle:t,beforeBody:t,beforeLabel:t,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");t=t.formattedValue;return H(t)||(e+=t),e},labelColor(t){t=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){t=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:t,afterBody:t,beforeFooter:t,footer:t,afterFooter:t}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Yn=Object.freeze({__proto__:null,Decimation:Cn,Filler:Bn,Legend:Nn,Title:Yn,Tooltip:be});class eo extends Vi{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(t,e){if(H(t))return null;var i,a,n,o,r,s=this.getLabels();return e=e=isFinite(e)&&s[e]===t?e:(n=U(e,a=t),-1===(r=(i=s).indexOf(a))?(o=n,"string"==typeof(t=a)?i.push(t)-1:isNaN(t)?null:o):r!==i.lastIndexOf(a)?n:r),s=s.length-1,null===e?null:Bt(Math.round(e),0,s)}determineDataLimits(){var{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:a}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(a=this.getLabels().length-1)),this.min=i,this.max=a}buildTicks(){const e=this.min,i=this.max,t=this.options.offset,a=[];let n=this.getLabels();n=0===e&&i===n.length-1?n:n.slice(e,i+1),this._valueRange=Math.max(n.length-(t?0:1),1),this._startValue=this.min-(t?.5:0);for(let t=e;t<=i;t++)a.push({value:t});return a}getLabelForValue(t){var e=this.getLabels();return 0<=t&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return null===(t="number"!=typeof t?this.parse(t):t)?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){var 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}}eo.id="category",eo.defaults={ticks:{callback:eo.prototype.getLabelForValue}};class io extends Vi{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 H(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const t=this,{beginAtZero:e,stacked:i}=t.options,{minDefined:a,maxDefined:n}=t.getUserBounds();let{min:o,max:r}=t;var s=t=>o=a?o:t,l=t=>r=n?r:t;if(e||i){const t=kt(o),e=kt(r);t<0&&e<0?l(0):0<t&&0<e&&s(0)}o===r&&(l(r+1),e||s(o-1)),t.min=o,t.max=r}getTickLimit(){let t,{maxTicksLimit:e,stepSize:i}=this.options.ticks;return i?t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1:(t=this.computeTickLimit(),e=e||11),e&&(t=Math.min(e,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){var M=this,k=M.options,S=k.ticks,P=M.getTickLimit(),P=Math.max(2,P);const t=function(){const t=[],{step:e,min:i,max:a,precision:n,count:o,maxTicks:r,maxDigits:s,horizontal:l}={maxTicks:P,min:k.min,max:k.max,precision:S.precision,step:S.stepSize,count:S.count,maxDigits:M._maxDigits(),horizontal:M.isHorizontal()},h=e||1,c=r-1,{min:d,max:u}=M._range||M,g=!H(i),f=!H(a),p=!H(o),m=(u-d)/s;let x,b,v,_,y=St((u-d)/c/h)*h;if(y<1e-14&&!g&&!f)return[{value:d},{value:u}];_=Math.ceil(u/y)-Math.floor(d/y),_>c&&(y=St(_*y/c/h)*h),H(n)||(x=Math.pow(10,n),y=Math.ceil(y*x)/x),b=Math.floor(d/y)*y,v=Math.ceil(u/y)*y,g&&f&&e&&Ot((a-i)/e,y/1e3)?(_=Math.min((a-i)/y,r),y=(a-i)/_,b=i,v=a):p?(b=g?i:b,v=f?a:v,_=o-1,y=(v-b)/_):(_=(v-b)/y,_=Ct(_,Math.round(_),y/1e3)?Math.round(_):Math.ceil(_)),x=Math.pow(10,H(n)?Lt(y):n),b=Math.round(b*x)/x,v=Math.round(v*x)/x;let w=0;for(g&&(t.push({value:i}),b<=i&&w++,Ct(Math.round((b+w*y)*x)/x,i,m*(l?(""+i).length:1))&&w++);w<_;++w)t.push({value:Math.round((b+w*y)*x)/x});return f?Ct(t[t.length-1].value,a,m*(l?(""+a).length:1))?t[t.length-1].value=a:t.push({value:a}):t.push({value:v}),t}();return"ticks"===k.bounds&&At(t,M,"value"),k.reverse?(t.reverse(),M.start=M.max,M.end=M.min):(M.start=M.min,M.end=M.max),t}configure(){const t=this,e=t.ticks;let i=t.min,a=t.max;if(super.configure(),t.options.offset&&e.length){const t=(a-i)/Math.max(e.length-1,1)/2;i-=t,a+=t}t._startValue=i,t._endValue=a,t._valueRange=a-i}getLabelForValue(t){return Oi(t,this.chart.options.locale)}}class ao extends io{determineDataLimits(){var{min:t,max:e}=this.getMinMax(!0);this.min=Y(t)?t:0,this.max=Y(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){if(this.isHorizontal())return Math.ceil(this.width/40);var t=this._resolveTickFontOptions(0);return Math.ceil(this.height/t.lineHeight)}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function no(t){return 1==t/Math.pow(10,Math.floor(Mt(t)))}ao.id="linear",ao.defaults={ticks:{callback:Ti.formatters.numeric}};class oo extends Vi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){e=io.prototype.parse.apply(this,[t,e]);if(0!==e)return Y(e)&&0<e?e:null;this._zero=!0}determineDataLimits(){var{min:t,max:e}=this.getMinMax(!0);this.min=Y(t)?Math.max(0,t):null,this.max=Y(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:i}=this.getUserBounds();let a=this.min,n=this.max;var t=t=>a=e?a:t,o=t=>n=i?n:t,r=(t,e)=>Math.pow(10,Math.floor(Mt(t))+e);a===n&&(a<=0?(t(1),o(10)):(t(r(a,-1)),o(r(n,1)))),a<=0&&t(r(n,-1)),n<=0&&o(r(a,1)),this._zero&&this.min!==this._suggestedMin&&a===r(this.min,0)&&t(r(a,-1)),this.min=a,this.max=n}buildTicks(){const t=this,e=t.options,i=function(t,e){const i=Math.floor(Mt(e.max)),a=Math.ceil(e.max/Math.pow(10,i)),n=[];let o=$(t.min,Math.pow(10,Math.floor(Mt(e.min)))),r=Math.floor(Mt(o)),s=Math.floor(o/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;for(;n.push({value:o,major:no(o)}),++s,10===s&&(s=1,++r,l=0<=r?1:l),o=Math.round(s*Math.pow(10,r)*l)/l,r<i||r===i&&s<a;);t=$(t.max,o);return n.push({value:t,major:no(o)}),n}({min:t._userMin,max:t._userMax},t);return"ticks"===e.bounds&&At(i,t,"value"),e.reverse?(i.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),i}getLabelForValue(t){return void 0===t?"0":Oi(t,this.chart.options.locale)}configure(){var t=this.min;super.configure(),this._startValue=Mt(t),this._valueRange=Mt(this.max)-Mt(t)}getPixelForValue(t){return null===(t=void 0===t||0===t?this.min:t)||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Mt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){t=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+t*this._valueRange)}}function ro(t){var e=t.ticks;if(e.display&&t.display){const t=Re(e.backdropPadding);return U(e.font&&e.font.size,ft.font.size)+t.height}return 0}function so(t,e,i,a,n){return t===a||t===n?{start:e-i/2,end:e+i/2}:t<a||n<t?{start:e-i,end:e}:{start:e,end:e+i}}function lo(e,i,t,a){const n=e["ctx"];if(t)n.arc(e.xCenter,e.yCenter,i,0,mt);else{var o=e.getPointPosition(0,i);n.moveTo(o.x,o.y);for(let t=1;t<a;t++)o=e.getPointPosition(t,i),n.lineTo(o.x,o.y)}}function ho(t){return Dt(t)?t:0}oo.id="logarithmic",oo.defaults={ticks:{callback:Ti.formatters.logarithmic,major:{enabled:!0}}};class co extends io{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=ro(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2}determineDataLimits(){var{min:t,max:e}=this.getMinMax(!1);this.min=Y(t)&&!isNaN(t)?t:0,this.max=Y(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ro(this.options))}generateTickLabels(t){const i=this;io.prototype.generateTickLabels.call(i,t),i._pointLabels=i.getLabels().map((t,e)=>{e=K(i.options.pointLabels.callback,[t,e],i);return e||0===e?e:""})}fit(){var t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},i={};let a,n,o;const r=[],s=[],l=t.getLabels().length;for(a=0;a<l;a++){const l=t.options.pointLabels.setContext(t.getContext(a));s[a]=l.padding,o=t.getPointPosition(a,t.drawingArea+s[a]);const f=Le(l.font);t.ctx.font=f.string,h=t.ctx,c=f.lineHeight,n=N(d=t._pointLabels[a])?{w:jt(h,h.font,d),h:d.length*c}:{w:h.measureText(d).width,h:c},r[a]=n;const p=t.getIndexAngle(a),m=Rt(p),b=so(m,o.x,n.w,0,180),v=so(m,o.y,n.h,90,270);b.start<e.l&&(e.l=b.start,i.l=p),b.end>e.r&&(e.r=b.end,i.r=p),v.start<e.t&&(e.t=v.start,i.t=p),v.end>e.b&&(e.b=v.end,i.b=p)}var h,c,d,u,g;t._setReductions(t.drawingArea,e,i),t._pointLabelItems=[];const f=t.options,p=ro(f),m=t.getDistanceFromCenterForValue(f.ticks.reverse?t.min:t.max);for(a=0;a<l;a++){const e=0===a?p/2:0,i=t.getPointPosition(a,m+e+s[a]),n=Rt(t.getIndexAngle(a)),o=r[a];u=n,x=o,g=i,90===u||270===u?g.y-=x.h/2:(270<u||u<90)&&(g.y-=x.h);const l=0===(x=n)||180===x?"center":x<180?"left":"right";var x="left"==l?i.x:"center"==l?i.x-o.w/2:i.x-o.w;const c=x+o.w;t._pointLabelItems[a]={x:i.x,y:i.y,textAlign:l,left:x,top:i.y,right:c,bottom:i.y+o.h}}}(this):this.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){var a=e.l/Math.sin(i.l),n=Math.max(e.r-this.width,0)/Math.sin(i.r),o=-e.t/Math.cos(i.t),i=-Math.max(e.b-(this.height-this.paddingTop),0)/Math.cos(i.b),a=ho(a),n=ho(n),o=ho(o),i=ho(i);this.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(a+n)/2),Math.floor(t-(o+i)/2))),this.setCenterPoint(a,n,o,i)}setCenterPoint(t,e,i,a){var n=this,e=n.width-e-n.drawingArea,t=t+n.drawingArea,i=i+n.drawingArea,a=n.height-n.paddingTop-a-n.drawingArea;n.xCenter=Math.floor((t+e)/2+n.left),n.yCenter=Math.floor((i+a)/2+n.top+n.paddingTop)}getIndexAngle(t){return Ft(t*(mt/this.getLabels().length)+Tt(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(H(t))return NaN;var e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(H(t))return NaN;t/=this.drawingArea/(this.max-this.min);return this.options.reverse?this.max-t:this.min+t}getPointPosition(t,e){t=this.getIndexAngle(t)-_t;return{x:Math.cos(t)*e+this.xCenter,y:Math.sin(t)*e+this.yCenter,angle:t}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){var{left:e,top:i,right:a,bottom:t}=this._pointLabelItems[t];return{left:e,top:i,right:a,bottom:t}}drawBackground(){var{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),lo(this,this.getDistanceFromCenterForValue(this._endValue),e,this.getLabels().length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const i=this,t=i.ctx,e=i.options,{angleLines:a,grid:n}=e,o=i.getLabels().length;let r,s,l;if(e.pointLabels.display&&function(e,i){const{ctx:a,options:{pointLabels:n}}=e;for(let t=i-1;0<=t;t--){const i=n.setContext(e.getContext(t)),o=Le(i.font),{x:r,y:s,textAlign:l,left:h,top:c,right:d,bottom:u}=e._pointLabelItems[t],g=i["backdropColor"];if(!H(g)){const e=Re(i.backdropPadding);a.fillStyle=g,a.fillRect(h-e.left,c-e.top,d-h+e.width,u-c+e.height)}Qt(a,e._pointLabels[t],r,s+o.lineHeight/2,o,{color:i.color,textAlign:l,textBaseline:"middle"})}}(i,o),n.display&&i.ticks.forEach((t,e)=>{0!==e&&(s=i.getDistanceFromCenterForValue(t.value),e=n.setContext(i.getContext(e-1)),function(t,e,i,a){const n=t.ctx,o=e.circular,{color:r,lineWidth:s}=e;!o&&!a||!r||!s||i<0||(n.save(),n.strokeStyle=r,n.lineWidth=s,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.beginPath(),lo(t,i,o,a),n.closePath(),n.stroke(),n.restore())}(i,e,s,o))}),a.display){for(t.save(),r=i.getLabels().length-1;0<=r;r--){const n=a.setContext(i.getContext(r)),{color:o,lineWidth:h}=n;h&&o&&(t.lineWidth=h,t.strokeStyle=o,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,s=i.getDistanceFromCenterForValue(e.ticks.reverse?i.min:i.max),l=i.getPointPosition(r,s),t.beginPath(),t.moveTo(i.xCenter,i.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const r=this,s=r.ctx,l=r.options,h=l.ticks;if(h.display){var t=r.getIndexAngle(0);let n,o;s.save(),s.translate(r.xCenter,r.yCenter),s.rotate(t),s.textAlign="center",s.textBaseline="middle",r.ticks.forEach((t,e)=>{if(0!==e||l.reverse){var i=h.setContext(r.getContext(e)),a=Le(i.font);if(n=r.getDistanceFromCenterForValue(r.ticks[e].value),i.showLabelBackdrop){o=s.measureText(t.label).width,s.fillStyle=i.backdropColor;const r=Re(i.backdropPadding);s.fillRect(-o/2-r.left,-n-a.size/2-r.top,o+r.width,a.size+r.height)}Qt(s,t.label,0,-n,a,{color:i.color})}}),s.restore()}}drawTitle(){}}co.id="radialLinear",co.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ti.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},co.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};const uo={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:!(co.descriptors={angleLines:{_fallback:"grid"}}),size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},go=Object.keys(uo);function fo(t,e){return t-e}function po(t,e){if(H(e))return null;const i=t._adapter,{parser:a,round:n,isoWeekday:o}=t._parseOpts;let r=e;return"function"==typeof a&&(r=a(r)),Y(r)||(r="string"==typeof a?i.parse(r,a):i.parse(r)),null===r?null:(n&&(r="week"!==n||!Dt(o)&&!0!==o?i.startOf(r,n):i.startOf(r,"isoWeek",o)),+r)}function mo(e,i,a,n){const o=go.length;for(let t=go.indexOf(e);t<o-1;++t){const e=uo[go[t]],o=e.steps||Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((a-i)/(o*e.size))<=n)return go[t]}return go[o-1]}function xo(t,e,i){var a,n;i?i.length&&({lo:a,hi:n}=te(i,e),t[i[a]>=e?i[a]:i[n]]=!0):t[e]=!0}function bo(t,e,i){const a=[],n={},o=e.length;let r,s;for(r=0;r<o;++r)s=e[r],n[s]=r,a.push({value:s,major:!1});return 0!==o&&i?function(t,e,i,a){const n=t._adapter,o=+n.startOf(e[0].value,a),r=e[e.length-1].value;let s,l;for(s=o;s<=r;s=+n.add(s,1,a))0<=(l=i[s])&&(e[l].major=!0);return e}(t,a,n,i):a}class vo extends Vi{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={}),a=this._adapter=new Na._date(t.adapters.date);it(i.displayFormats,a.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:po(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:a,max:n,minDefined:o,maxDefined:r}=this.getUserBounds();function s(t){o||isNaN(t.min)||(a=Math.min(a,t.min)),r||isNaN(t.max)||(n=Math.max(n,t.max))}o&&r||(s(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||s(this.getMinMax(!1))),a=Y(a)&&!isNaN(a)?a:+e.startOf(Date.now(),i),n=Y(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(a,n-1),this.max=Math.max(a+1,n)}_getLabelBounds(){var 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(){var t=this,e=t.options,i=e.time,a=e.ticks,n="labels"===a.source?t.getLabelTimestamps():t._generate();"ticks"===e.bounds&&n.length&&(t.min=t._userMin||n[0],t.max=t._userMax||n[n.length-1]);const o=t.min,r=ae(n,o,t.max);return t._unit=i.unit||(a.autoSkip?mo(i.minUnit,t.min,t.max,t._getLabelCapacity(o)):function(e,i,a,n,o){for(let t=go.length-1;t>=go.indexOf(a);t--){const a=go[t];if(uo[a].common&&e._adapter.diff(o,n,a)>=i-1)return a}return go[a?go.indexOf(a):0]}(t,r.length,i.minUnit,t.min,t.max)),t._majorUnit=a.major.enabled&&"year"!==t._unit?function(i){for(let t=go.indexOf(i)+1,e=go.length;t<e;++t)if(uo[go[t]].common)return go[t]}(t._unit):void 0,t.initOffsets(n),e.reverse&&r.reverse(),bo(t,r,t._majorUnit)}initOffsets(t){let e,i,a=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),a=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);t=t.length<3?.5:.25;a=Bt(a,0,t),n=Bt(n,0,t),this._offsets={start:a,end:n,factor:1/(a+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,a=this.options,n=a.time,o=n.unit||mo(n.minUnit,e,i,this._getLabelCapacity(e)),r=U(n.stepSize,1),s="week"===o&&n.isoWeekday,l=Dt(s)||!0===s,h={};let c,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",s)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+o);var g="data"===a.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c<i;c=+t.add(c,r,o),d++)xo(h,c,g);return c!==i&&"ticks"!==a.bounds&&1!==d||xo(h,c,g),Object.keys(h).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,a){var n=this.options,o=n.time.displayFormats,r=this._unit,s=this._majorUnit,l=r&&o[r],r=s&&o[s],o=i[e],o=s&&r&&o&&o.major,l=this._adapter.format(t,a||(o?r:l)),n=n.ticks.callback;return n?K(n,[l,e,i],this):l}generateTickLabels(t){let e,i,a;for(e=0,i=t.length;e<i;++e)a=t[e],a.label=this._tickFormatFunction(a.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){var e=this._offsets,t=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+t)*e.factor)}getValueForPixel(t){var e=this._offsets,e=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+e*(this.max-this.min)}_getLabelSize(t){var e=this.options.ticks,i=this.ctx.measureText(t).width,a=Tt(this.isHorizontal()?e.maxRotation:e.minRotation),t=Math.cos(a),e=Math.sin(a),a=this._resolveTickFontOptions(0).size;return{w:i*t+a*e,h:i*e+a*t}}_getLabelCapacity(t){var e=this.options.time,i=e.displayFormats,i=i[e.unit]||i.millisecond,i=this._tickFormatFunction(t,0,bo(this,[t],this._majorUnit),i),i=this._getLabelSize(i),i=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return 0<i?i:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(t=0,e=a.length;t<e;++t)i=i.concat(a[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;var a=this.getLabels();for(e=0,i=a.length;e<i;++e)t.push(po(this,a[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return se(t.sort(fo))}}function _o(t,e,i){let a,n,o,r;if(i)a=Math.floor(e),n=Math.ceil(e),o=t[a],r=t[n];else{const i=te(t,e);o=i.lo,r=i.hi,a=t[o],n=t[r]}t=n-a;return t?o+(r-o)*(e-a)/t:o}vo.id="time",vo.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class yo extends vo{constructor(t){super(t),this._table=[],this._maxIndex=void 0}initOffsets(){var t=this._getTimestampsForTable();this._table=this.buildLookupTable(t),this._maxIndex=this._table.length-1,super.initOffsets(t)}buildLookupTable(t){var{min:e,max:i}=this;if(!t.length)return[{time:e,pos:0},{time:i,pos:1}];const a=[e];let n,o,r;for(n=0,o=t.length;n<o;++n)e<(r=t[n])&&r<i&&a.push(r);return a.push(i),a}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getPixelForValue(t,e){var i=this._offsets,t=this._normalized&&0<this._maxIndex&&!H(e)?e/this._maxIndex:this.getDecimalForValue(t);return this.getPixelForDecimal((i.start+t)*i.factor)}getDecimalForValue(t){return _o(this._table,t)/this._maxIndex}getValueForPixel(t){var e=this._offsets,e=this.getDecimalForPixel(t)/e.factor-e.end;return _o(this._table,e*this._maxIndex,!0)}}yo.id="timeseries",yo.defaults=vo.defaults;be=Object.freeze({__proto__:null,CategoryScale:eo,LinearScale:ao,LogarithmicScale:oo,RadialLinearScale:co,TimeScale:vo,TimeSeriesScale:yo});return Va.register(tn,be,Sn,Yn),Va.helpers={...pa},Va._adapters=Na,Va.Animation=gi,Va.Animations=pi,Va.animator=h,Va.controllers=xa.controllers.items,Va.DatasetController=Pi,Va.Element=Di,Va.elements=Sn,Va.Interaction=Se,Va.layouts=$e,Va.platforms=ri,Va.Scale=Vi,Va.Ticks=Ti,Object.assign(Va,tn,be,Sn,Yn,ri),Va.Chart=Va,"undefined"!=typeof window&&(window.Chart=Va),Va});
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists