15 lines
202 KiB
JavaScript
15 lines
202 KiB
JavaScript
(()=>{var Er=Object.create;var qo=Object.defineProperty;var Rr=Object.getOwnPropertyDescriptor;var Ir=Object.getOwnPropertyNames;var zr=Object.getPrototypeOf,Fr=Object.prototype.hasOwnProperty;var Vr=(G,W)=>()=>(W||G((W={exports:{}}).exports,W),W.exports);var Br=(G,W,ht,I)=>{if(W&&typeof W=="object"||typeof W=="function")for(let F of Ir(W))!Fr.call(G,F)&&F!==ht&&qo(G,F,{get:()=>W[F],enumerable:!(I=Rr(W,F))||I.enumerable});return G};var Wr=(G,W,ht)=>(ht=G!=null?Er(zr(G)):{},Br(W||!G||!G.__esModule?qo(ht,"default",{value:G,enumerable:!0}):ht,G));var Ko=Vr((fs,gs)=>{(function(G,W){typeof fs=="object"&&typeof gs<"u"?gs.exports=W():typeof define=="function"&&define.amd?define(W):(G=typeof globalThis<"u"?globalThis:G||self).Chart=W()})(fs,function(){"use strict";var G=Object.freeze({__proto__:null,get Colors(){return xr},get Decimation(){return _r},get Filler(){return Pr},get Legend(){return Dr},get SubTitle(){return Or},get Title(){return Cr},get Tooltip(){return Lr}});function W(){}let ht=(()=>{let i=0;return()=>i++})();function I(i){return i==null}function F(i){if(Array.isArray&&Array.isArray(i))return!0;let t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function z(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function L(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function X(i,t){return L(i)?i:t}function E(i,t){return i===void 0?t:i}let j=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Z=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function N(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function B(i,t,e,s){let n,o,a;if(F(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;n<o;n++)t.call(e,i[n],n);else if(z(i))for(a=Object.keys(i),o=a.length,n=0;n<o;n++)t.call(e,i[a[n]],a[n])}function Ht(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function jt(i){if(F(i))return i.map(jt);if(z(i)){let t=Object.create(null),e=Object.keys(i),s=e.length,n=0;for(;n<s;++n)t[e[n]]=jt(i[e[n]]);return t}return i}function Ce(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function ps(i,t,e,s){if(!Ce(i))return;let n=t[i],o=e[i];z(n)&&z(o)?Zt(n,o,s):t[i]=jt(o)}function Zt(i,t,e){let s=F(t)?t:[t],n=s.length;if(!z(i))return i;let o=(e=e||{}).merger||ps,a;for(let r=0;r<n;++r){if(a=s[r],!z(a))continue;let l=Object.keys(a);for(let h=0,d=l.length;h<d;++h)o(l[h],i,a,e)}return i}function Jt(i,t){return Zt(i,t,{merger:ms})}function ms(i,t,e){if(!Ce(i))return;let s=t[i],n=e[i];z(s)&&z(n)?Jt(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=jt(n))}let bs={"":i=>i,x:i=>i.x,y:i=>i.y};function xs(i){let t=i.split("."),e=[],s="";for(let n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function St(i,t){return(bs[t]||(bs[t]=function(s){let n=xs(s);return o=>{for(let a of n){if(a==="")break;o=o&&o[a]}return o}}(t)))(i)}function Oe(i){return i.charAt(0).toUpperCase()+i.slice(1)}let Qt=i=>i!==void 0,Pt=i=>typeof i=="function",ci=(i,t)=>{if(i.size!==t.size)return!1;for(let e of i)if(!t.has(e))return!1;return!0};function _s(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}let $=Math.PI,Y=2*$,ys=Y+$,he=Number.POSITIVE_INFINITY,vs=$/180,q=$/2,Lt=$/4,di=2*$/3,Dt=Math.log10,ft=Math.sign;function te(i,t,e){return Math.abs(i-t)<e}function ui(i){let t=Math.round(i);i=te(i,t,i/1e3)?t:i;let e=Math.pow(10,Math.floor(Dt(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function ws(i){let t=[],e=Math.sqrt(i),s;for(s=1;s<e;s++)i%s==0&&(t.push(s),t.push(i/s));return e===(0|e)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function $t(i){return!function(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function Ms(i,t){let e=Math.round(i);return e-t<=i&&e+t>=i}function fi(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ct(i){return i*($/180)}function Ae(i){return i*(180/$)}function gi(i){if(!L(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function pi(i,t){let e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s),o=Math.atan2(s,e);return o<-.5*$&&(o+=Y),{angle:o,distance:n}}function Te(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function ks(i,t){return(i-t+ys)%Y-$}function nt(i){return(i%Y+Y)%Y}function ee(i,t,e,s){let n=nt(i),o=nt(t),a=nt(e),r=nt(o-n),l=nt(a-n),h=nt(n-o),d=nt(n-a);return n===o||n===a||s&&o===a||r>l&&h<d}function Q(i,t,e){return Math.max(t,Math.min(e,i))}function Ss(i){return Q(i,-32768,32767)}function _t(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Le(i,t,e){e=e||(a=>i[a]<t);let s,n=i.length-1,o=0;for(;n-o>1;)s=o+n>>1,e(s)?o=s:n=s;return{lo:o,hi:n}}let yt=(i,t,e,s)=>Le(i,e,s?n=>{let o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),Ps=(i,t,e)=>Le(i,e,s=>i[s][t]>=e);function Ds(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}let Cs=["push","pop","shift","splice","unshift"];function Os(i,t){i._chartjs?i._chartjs.listeners.push(t):(Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Cs.forEach(e=>{let s="_onData"+Oe(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){let a=n.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})}))}function mi(i,t){let e=i._chartjs;if(!e)return;let s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),s.length>0||(Cs.forEach(o=>{delete i[o]}),delete i._chartjs)}function bi(i){let t=new Set(i);return t.size===i.length?i:Array.from(t)}let xi=typeof window>"u"?function(i){return i()}:window.requestAnimationFrame;function _i(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,xi.call(window,()=>{s=!1,i.apply(t,e)}))}}function As(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}let Ee=i=>i==="start"?"left":i==="end"?"right":"center",tt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Ts=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function yi(i,t,e){let s=t.length,n=0,o=s;if(i._sorted){let{iScale:a,vScale:r,_parsed:l}=i,h=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,d=a.axis,{min:c,max:u,minDefined:f,maxDefined:p}=a.getUserBounds();if(f){if(n=Math.min(yt(l,d,c).lo,e?s:yt(t,d,a.getPixelForValue(c)).lo),h){let g=l.slice(0,n+1).reverse().findIndex(m=>!I(m[r.axis]));n-=Math.max(0,g)}n=Q(n,0,s-1)}if(p){let g=Math.max(yt(l,a.axis,u,!0).hi+1,e?0:yt(t,d,a.getPixelForValue(u),!0).hi+1);if(h){let m=l.slice(g-1).findIndex(b=>!I(b[r.axis]));g+=Math.max(0,m)}o=Q(g,n,s)-n}else o=s-n}return{start:n,count:o}}function vi(i){let{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;let o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}class Go{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){let o=e.listeners[n],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=xi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;let o=s.items,a,r=o.length-1,l=!1;for(;r>=0;--r)a=o[r],a._active?(a._total>s.duration&&(s.duration=a._total),a.tick(t),l=!0):(o[r]=o[o.length-1],o.pop());l&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let s=e.items,n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var vt=new Go;function ce(i){return i+.5|0}let Et=(i,t,e)=>Math.max(Math.min(i,e),t);function de(i){return Et(ce(2.55*i),0,255)}function Rt(i){return Et(ce(255*i),0,255)}function Ct(i){return Et(ce(i/2.55)/100,0,1)}function Ls(i){return Et(ce(100*i),0,100)}let dt={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},wi=[..."0123456789ABCDEF"],Zo=i=>wi[15&i],Jo=i=>wi[(240&i)>>4]+wi[15&i],Re=i=>(240&i)>>4==(15&i);function Qo(i){var t=(e=>Re(e.r)&&Re(e.g)&&Re(e.b)&&Re(e.a))(i)?Zo:Jo;return i?"#"+t(i.r)+t(i.g)+t(i.b)+((e,s)=>e<255?s(e):"")(i.a,t):void 0}let ta=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Es(i,t,e){let s=t*Math.min(e,1-e),n=(o,a=(o+i/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function ea(i,t,e){let s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function ia(i,t,e){let s=Es(i,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Mi(i){let t=i.r/255,e=i.g/255,s=i.b/255,n=Math.max(t,e,s),o=Math.min(t,e,s),a=(n+o)/2,r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(d,c,u,f,p){return d===p?(c-u)/f+(c<u?6:0):c===p?(u-d)/f+2:(d-c)/f+4}(t,e,s,h,n),r=60*r+.5),[0|r,l||0,a]}function ki(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Rt)}function Si(i,t,e){return ki(Es,i,t,e)}function Rs(i){return(i%360+360)%360}function sa(i){let t=ta.exec(i),e,s=255;if(!t)return;t[5]!==e&&(s=t[6]?de(+t[5]):Rt(+t[5]));let n=Rs(+t[2]),o=+t[3]/100,a=+t[4]/100;return e=t[1]==="hwb"?function(r,l,h){return ki(ia,r,l,h)}(n,o,a):t[1]==="hsv"?function(r,l,h){return ki(ea,r,l,h)}(n,o,a):Si(n,o,a),{r:e[0],g:e[1],b:e[2],a:s}}let Is={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"},zs={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"},Ie;function na(i){Ie||(Ie=function(){let e={},s=Object.keys(zs),n=Object.keys(Is),o,a,r,l,h;for(o=0;o<s.length;o++){for(l=h=s[o],a=0;a<n.length;a++)r=n[a],h=h.replace(r,Is[r]);r=parseInt(zs[l],16),e[h]=[r>>16&255,r>>8&255,255&r]}return e}(),Ie.transparent=[0,0,0,0]);let t=Ie[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}let oa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Pi=i=>i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055,ie=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ze(i,t,e){if(i){let s=Mi(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Si(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function Fs(i,t){return i&&Object.assign(t||{},i)}function Vs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Rt(i[3]))):(t=Fs(i,{r:0,g:0,b:0,a:1})).a=Rt(t.a),t}function aa(i){return i.charAt(0)==="r"?function(t){let e=oa.exec(t),s,n,o,a=255;if(e){if(e[7]!==s){let r=+e[7];a=e[8]?de(r):Et(255*r,0,255)}return s=+e[1],n=+e[3],o=+e[5],s=255&(e[2]?de(s):Et(s,0,255)),n=255&(e[4]?de(n):Et(n,0,255)),o=255&(e[6]?de(o):Et(o,0,255)),{r:s,g:n,b:o,a}}}(i):sa(i)}class ue{constructor(t){if(t instanceof ue)return t;let e=typeof t,s;var n,o,a;e==="object"?s=Vs(t):e==="string"&&(a=(n=t).length,n[0]==="#"&&(a===4||a===5?o={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:a===5?17*dt[n[4]]:255}:a!==7&&a!==9||(o={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:a===9?dt[n[7]]<<4|dt[n[8]]:255})),s=o||na(t)||aa(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=Fs(this._rgb);return t&&(t.a=Ct(t.a)),t}set rgb(t){this._rgb=Vs(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Ct(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?Qo(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;let e=Mi(t),s=e[0],n=Ls(e[1]),o=Ls(e[2]);return t.a<255?`hsla(${s}, ${n}%, ${o}%, ${Ct(t.a)})`:`hsl(${s}, ${n}%, ${o}%)`}(this._rgb):void 0}mix(t,e){if(t){let s=this.rgb,n=t.rgb,o,a=e===o?.5:e,r=2*a-1,l=s.a-n.a,h=((r*l==-1?r:(r+l)/(1+r*l))+1)/2;o=1-h,s.r=255&h*s.r+o*n.r+.5,s.g=255&h*s.g+o*n.g+.5,s.b=255&h*s.b+o*n.b+.5,s.a=a*s.a+(1-a)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=function(s,n,o){let a=ie(Ct(s.r)),r=ie(Ct(s.g)),l=ie(Ct(s.b));return{r:Rt(Pi(a+o*(ie(Ct(n.r))-a))),g:Rt(Pi(r+o*(ie(Ct(n.g))-r))),b:Rt(Pi(l+o*(ie(Ct(n.b))-l))),a:s.a+o*(n.a-s.a)}}(this._rgb,t._rgb,e)),this}clone(){return new ue(this.rgb)}alpha(t){return this._rgb.a=Rt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){let t=this._rgb,e=ce(.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(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ze(this._rgb,2,t),this}darken(t){return ze(this._rgb,2,-t),this}saturate(t){return ze(this._rgb,1,t),this}desaturate(t){return ze(this._rgb,1,-t),this}rotate(t){return function(e,s){var n=Mi(e);n[0]=Rs(n[0]+s),n=Si(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,t),this}}function Fe(i){if(i&&typeof i=="object"){let t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Di(i){return Fe(i)?i:new ue(i)}function Ve(i){return Fe(i)?i:new ue(i).saturate(.5).darken(.1).hexString()}let ra=["x","y","borderWidth","radius","tension"],la=["color","borderColor","backgroundColor"],Bs=new Map;function se(i,t,e){return function(s,n){n=n||{};let o=s+JSON.stringify(n),a=Bs.get(o);return a||(a=new Intl.NumberFormat(s,n),Bs.set(o,a)),a}(t,e).format(i)}let Ws={values:i=>F(i)?i:""+i,numeric(i,t,e){if(i===0)return"0";let s=this.chart.options.locale,n,o=i;if(e.length>1){let h=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(h<1e-4||h>1e15)&&(n="scientific"),o=function(d,c){let u=c.length>3?c[2].value-c[1].value:c[1].value-c[0].value;return Math.abs(u)>=1&&d!==Math.floor(d)&&(u=d-Math.floor(d)),u}(i,e)}let a=Dt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),se(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";let s=e[t].significand||i/Math.pow(10,Math.floor(Dt(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?Ws.numeric.call(this,i,t,e):""}};var fe={formatters:Ws};let Yt=Object.create(null),Ci=Object.create(null);function ge(i,t){if(!t)return i;let e=t.split(".");for(let s=0,n=e.length;s<n;++s){let o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Oi(i,t,e){return typeof t=="string"?Zt(ge(i,t),e):Zt(ge(i,""),t)}class ha{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.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=(s,n)=>Ve(n.backgroundColor),this.hoverBorderColor=(s,n)=>Ve(n.borderColor),this.hoverColor=(s,n)=>Ve(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Oi(this,t,e)}get(t){return ge(this,t)}describe(t,e){return Oi(Ci,t,e)}override(t,e){return Oi(Yt,t,e)}route(t,e,s,n){let o=ge(this,t),a=ge(this,s),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[r],h=a[n];return z(l)?Object.assign({},h,l):E(l,h)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var U=new ha({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:la},numbers:{type:"number",properties:ra}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:fe.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}]);function Be(){return typeof window<"u"&&typeof document<"u"}function We(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ne(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}let He=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Ns(i,t){return He(i).getPropertyValue(t)}let ca=["top","right","bottom","left"];function Ut(i,t,e){let s={};e=e?"-"+e:"";for(let n=0;n<4;n++){let o=ca[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}let da=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function It(i,t){if("native"in i)return i;let{canvas:e,currentDevicePixelRatio:s}=t,n=He(e),o=n.boxSizing==="border-box",a=Ut(n,"padding"),r=Ut(n,"border","width"),{x:l,y:h,box:d}=function(g,m){let b=g.touches,y=b&&b.length?b[0]:g,{offsetX:_,offsetY:x}=y,v,w,M=!1;if(da(_,x,g.target))v=_,w=x;else{let k=m.getBoundingClientRect();v=y.clientX-k.left,w=y.clientY-k.top,M=!0}return{x:v,y:w,box:M}}(i,e),c=a.left+(d&&r.left),u=a.top+(d&&r.top),{width:f,height:p}=t;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-c)/f*e.width/s),y:Math.round((h-u)/p*e.height/s)}}let je=i=>Math.round(10*i)/10;function Hs(i,t,e,s){let n=He(i),o=Ut(n,"margin"),a=Ne(n.maxWidth,i,"clientWidth")||he,r=Ne(n.maxHeight,i,"clientHeight")||he,l=function(c,u,f){let p,g;if(u===void 0||f===void 0){let m=c&&We(c);if(m){let b=m.getBoundingClientRect(),y=He(m),_=Ut(y,"border","width"),x=Ut(y,"padding");u=b.width-x.width-_.width,f=b.height-x.height-_.height,p=Ne(y.maxWidth,m,"clientWidth"),g=Ne(y.maxHeight,m,"clientHeight")}else u=c.clientWidth,f=c.clientHeight}return{width:u,height:f,maxWidth:p||he,maxHeight:g||he}}(i,t,e),{width:h,height:d}=l;if(n.boxSizing==="content-box"){let c=Ut(n,"border","width"),u=Ut(n,"padding");h-=u.width+c.width,d-=u.height+c.height}return h=Math.max(0,h-o.width),d=Math.max(0,s?h/s:d-o.height),h=je(Math.min(h,a,l.maxWidth)),d=je(Math.min(d,r,l.maxHeight)),h&&!d&&(d=je(h/2)),(t!==void 0||e!==void 0)&&s&&l.height&&d>l.height&&(d=l.height,h=je(Math.floor(d*s))),{width:h,height:d}}function Ai(i,t,e){let s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);let a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),(i.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(i.currentDevicePixelRatio=s,a.height=n,a.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0)}let js=function(){let i=!1;try{let t={get passive(){return i=!0,!1}};Be()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Ti(i,t){let e=Ns(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function $s(i){return!i||I(i.size)||I(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function pe(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Ys(i,t,e,s){let n=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let a=0,r=e.length,l,h,d,c,u;for(l=0;l<r;l++)if(c=e[l],c==null||F(c)){if(F(c))for(h=0,d=c.length;h<d;h++)u=c[h],u==null||F(u)||(a=pe(i,n,o,a,u))}else a=pe(i,n,o,a,c);i.restore();let f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete n[o[l]];o.splice(0,f)}return a}function zt(i,t,e){let s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function Li(i,t){(t||i)&&((t=t||i.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function $e(i,t,e,s){Ei(i,t,e,s,null)}function Ei(i,t,e,s,n){let o,a,r,l,h,d,c,u,f=t.pointStyle,p=t.rotation,g=t.radius,m=(p||0)*vs;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]"))return i.save(),i.translate(e,s),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void i.restore();if(!(isNaN(g)||g<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,g,0,0,Y):i.arc(e,s,g,0,Y),i.closePath();break;case"triangle":d=n?n/2:g,i.moveTo(e+Math.sin(m)*d,s-Math.cos(m)*g),m+=di,i.lineTo(e+Math.sin(m)*d,s-Math.cos(m)*g),m+=di,i.lineTo(e+Math.sin(m)*d,s-Math.cos(m)*g),i.closePath();break;case"rectRounded":h=.516*g,l=g-h,a=Math.cos(m+Lt)*l,c=Math.cos(m+Lt)*(n?n/2-h:l),r=Math.sin(m+Lt)*l,u=Math.sin(m+Lt)*(n?n/2-h:l),i.arc(e-c,s-r,h,m-$,m-q),i.arc(e+u,s-a,h,m-q,m),i.arc(e+c,s+r,h,m,m+q),i.arc(e-u,s+a,h,m+q,m+$),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,d=n?n/2:l,i.rect(e-d,s-l,2*d,2*l);break}m+=Lt;case"rectRot":c=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-c,s-r),i.lineTo(e+u,s-a),i.lineTo(e+c,s+r),i.lineTo(e-u,s+a),i.closePath();break;case"crossRot":m+=Lt;case"cross":c=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-c,s-r),i.lineTo(e+c,s+r),i.moveTo(e+u,s-a),i.lineTo(e-u,s+a);break;case"star":c=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-c,s-r),i.lineTo(e+c,s+r),i.moveTo(e+u,s-a),i.lineTo(e-u,s+a),m+=Lt,c=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-c,s-r),i.lineTo(e+c,s+r),i.moveTo(e+u,s-a),i.lineTo(e-u,s+a);break;case"line":a=n?n/2:Math.cos(m)*g,r=Math.sin(m)*g,i.moveTo(e-a,s-r),i.lineTo(e+a,s+r);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:i.closePath()}i.fill(),t.borderWidth>0&&i.stroke()}}function wt(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function me(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function be(i){i.restore()}function Us(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){let o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function Xs(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function ua(i,t,e,s,n){if(n.strikethrough||n.underline){let o=i.measureText(s),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,h=e+o.actualBoundingBoxDescent,d=n.strikethrough?(l+h)/2:h;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(a,d),i.lineTo(r,d),i.stroke()}}function fa(i,t){let e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Ft(i,t,e,s,n,o={}){let a=F(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="",l,h;for(i.save(),i.font=n.string,function(d,c){c.translation&&d.translate(c.translation[0],c.translation[1]),I(c.rotation)||d.rotate(c.rotation),c.color&&(d.fillStyle=c.color),c.textAlign&&(d.textAlign=c.textAlign),c.textBaseline&&(d.textBaseline=c.textBaseline)}(i,o),l=0;l<a.length;++l)h=a[l],o.backdrop&&fa(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),I(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(h,e,s,o.maxWidth)),i.fillText(h,e,s,o.maxWidth),ua(i,e,s,h,o),s+=Number(n.lineHeight);i.restore()}function ne(i,t){let{x:e,y:s,w:n,h:o,radius:a}=t;i.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*$,$,!0),i.lineTo(e,s+o-a.bottomLeft),i.arc(e+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,$,q,!0),i.lineTo(e+n-a.bottomRight,s+o),i.arc(e+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,q,0,!0),i.lineTo(e+n,s+a.topRight),i.arc(e+n-a.topRight,s+a.topRight,a.topRight,0,-q,!0),i.lineTo(e+a.topLeft,s)}function Ye(i,t=[""],e,s,n=()=>i[0]){let o=e||i;s===void 0&&(s=Zs("_fallback",i));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:r=>Ye([r,...i],t,o,s)};return new Proxy(a,{deleteProperty:(r,l)=>(delete r[l],delete r._keys,delete i[0][l],!0),get:(r,l)=>qs(r,l,()=>function(h,d,c,u){let f;for(let p of d)if(f=Zs(ga(p,h),c),f!==void 0)return Ii(h,f)?zi(c,u,h,f):f}(l,t,i,r)),getOwnPropertyDescriptor:(r,l)=>Reflect.getOwnPropertyDescriptor(r._scopes[0],l),getPrototypeOf:()=>Reflect.getPrototypeOf(i[0]),has:(r,l)=>Js(r).includes(l),ownKeys:r=>Js(r),set(r,l,h){let d=r._storage||(r._storage=n());return r[l]=d[l]=h,delete r._keys,!0}})}function Xt(i,t,e,s){let n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ri(i,s),setContext:o=>Xt(i,o,e,s),override:o=>Xt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty:(o,a)=>(delete o[a],delete i[a],!0),get:(o,a,r)=>qs(o,a,()=>function(l,h,d){let{_proxy:c,_context:u,_subProxy:f,_descriptors:p}=l,g=c[h];return Pt(g)&&p.isScriptable(h)&&(g=function(m,b,y,_){let{_proxy:x,_context:v,_subProxy:w,_stack:M}=y;if(M.has(m))throw new Error("Recursion detected: "+Array.from(M).join("->")+"->"+m);M.add(m);let k=b(v,w||_);return M.delete(m),Ii(m,k)&&(k=zi(x._scopes,x,m,k)),k}(h,g,l,d)),F(g)&&g.length&&(g=function(m,b,y,_){let{_proxy:x,_context:v,_subProxy:w,_descriptors:M}=y;if(v.index!==void 0&&_(m))return b[v.index%b.length];if(z(b[0])){let k=b,D=x._scopes.filter(S=>S!==k);b=[];for(let S of k){let T=zi(D,x,m,S);b.push(Xt(T,v,w&&w[m],M))}}return b}(h,g,l,p.isIndexable)),Ii(h,g)&&(g=Xt(g,u,f&&f[h],p)),g}(o,a,r)),getOwnPropertyDescriptor:(o,a)=>o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a),getPrototypeOf:()=>Reflect.getPrototypeOf(i),has:(o,a)=>Reflect.has(i,a),ownKeys:()=>Reflect.ownKeys(i),set:(o,a,r)=>(i[a]=r,delete o[a],!0)})}function Ri(i,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Pt(e)?e:()=>e,isIndexable:Pt(s)?s:()=>s}}let ga=(i,t)=>i?i+Oe(t):t,Ii=(i,t)=>z(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function qs(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];let s=e();return i[t]=s,s}function Ks(i,t,e){return Pt(i)?i(t,e):i}let pa=(i,t)=>i===!0?t:typeof i=="string"?St(t,i):void 0;function ma(i,t,e,s,n){for(let o of t){let a=pa(e,o);if(a){i.add(a);let r=Ks(a._fallback,e,n);if(r!==void 0&&r!==e&&r!==s)return r}else if(a===!1&&s!==void 0&&e!==s)return null}return!1}function zi(i,t,e,s){let n=t._rootScopes,o=Ks(t._fallback,e,s),a=[...i,...n],r=new Set;r.add(s);let l=Gs(r,a,e,o||e,s);return l!==null&&(o===void 0||o===e||(l=Gs(r,a,o,l,s),l!==null))&&Ye(Array.from(r),[""],n,o,()=>function(h,d,c){let u=h._getTarget();d in u||(u[d]={});let f=u[d];return F(f)&&z(c)?c:f||{}}(t,e,s))}function Gs(i,t,e,s,n){for(;e;)e=ma(i,t,e,s,n);return e}function Zs(i,t){for(let e of t){if(!e)continue;let s=e[i];if(s!==void 0)return s}}function Js(i){let t=i._keys;return t||(t=i._keys=function(e){let s=new Set;for(let n of e)for(let o of Object.keys(n).filter(a=>!a.startsWith("_")))s.add(o);return Array.from(s)}(i._scopes)),t}function Fi(i,t,e,s){let{iScale:n}=i,{key:o="r"}=this._parsing,a=new Array(s),r,l,h,d;for(r=0,l=s;r<l;++r)h=r+e,d=t[h],a[r]={r:n.parse(St(d,o),h)};return a}let ba=Number.EPSILON||1e-14,oe=(i,t)=>t<i.length&&!i[t].skip&&i[t],Qs=i=>i==="x"?"y":"x";function tn(i,t,e,s){let n=i.skip?t:i,o=t,a=e.skip?t:e,r=Te(o,n),l=Te(a,o),h=r/(r+l),d=l/(r+l);h=isNaN(h)?0:h,d=isNaN(d)?0:d;let c=s*h,u=s*d;return{previous:{x:o.x-c*(a.x-n.x),y:o.y-c*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function en(i,t="x"){let e=Qs(t),s=i.length,n=Array(s).fill(0),o=Array(s),a,r,l,h=oe(i,0);for(a=0;a<s;++a)if(r=l,l=h,h=oe(i,a+1),l){if(h){let d=h[t]-l[t];n[a]=d!==0?(h[e]-l[e])/d:0}o[a]=r?h?ft(n[a-1])!==ft(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}(function(d,c,u){let f=d.length,p,g,m,b,y,_=oe(d,0);for(let x=0;x<f-1;++x)y=_,_=oe(d,x+1),y&&_&&(te(c[x],0,ba)?u[x]=u[x+1]=0:(p=u[x]/c[x],g=u[x+1]/c[x],b=Math.pow(p,2)+Math.pow(g,2),b<=9||(m=3/Math.sqrt(b),u[x]=p*m*c[x],u[x+1]=g*m*c[x])))})(i,n,o),function(d,c,u="x"){let f=Qs(u),p=d.length,g,m,b,y=oe(d,0);for(let _=0;_<p;++_){if(m=b,b=y,y=oe(d,_+1),!b)continue;let x=b[u],v=b[f];m&&(g=(x-m[u])/3,b[`cp1${u}`]=x-g,b[`cp1${f}`]=v-g*c[_]),y&&(g=(y[u]-x)/3,b[`cp2${u}`]=x+g,b[`cp2${f}`]=v+g*c[_])}}(i,o,t)}function Ue(i,t,e){return Math.max(Math.min(i,e),t)}function sn(i,t,e,s,n){let o,a,r,l;if(t.spanGaps&&(i=i.filter(h=>!h.skip)),t.cubicInterpolationMode==="monotone")en(i,n);else{let h=s?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],l=tn(h,r,i[Math.min(o+1,a-(s?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,h=r}t.capBezierPoints&&function(h,d){let c,u,f,p,g,m=wt(h[0],d);for(c=0,u=h.length;c<u;++c)g=p,p=m,m=c<u-1&&wt(h[c+1],d),p&&(f=h[c],g&&(f.cp1x=Ue(f.cp1x,d.left,d.right),f.cp1y=Ue(f.cp1y,d.top,d.bottom)),m&&(f.cp2x=Ue(f.cp2x,d.left,d.right),f.cp2y=Ue(f.cp2y,d.top,d.bottom)))}(i,e)}let Xe=i=>i===0||i===1,nn=(i,t,e)=>-Math.pow(2,10*(i-=1))*Math.sin((i-t)*Y/e),on=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*Y/e)+1,ae={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>1-Math.cos(i*q),easeOutSine:i=>Math.sin(i*q),easeInOutSine:i=>-.5*(Math.cos($*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:1-Math.pow(2,-10*i),easeInOutExpo:i=>Xe(i)?i:i<.5?.5*Math.pow(2,10*(2*i-1)):.5*(2-Math.pow(2,-10*(2*i-1))),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Xe(i)?i:nn(i,.075,.3),easeOutElastic:i=>Xe(i)?i:on(i,.075,.3),easeInOutElastic(i){return Xe(i)?i:i<.5?.5*nn(2*i,.1125,.45):.5+.5*on(2*i-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?i*i*((1+(t*=1.525))*i-t)*.5:.5*((i-=2)*i*((1+(t*=1.525))*i+t)+2)},easeInBounce:i=>1-ae.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?.5*ae.easeInBounce(2*i):.5*ae.easeOutBounce(2*i-1)+.5};function Vt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function an(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function rn(i,t,e,s){let n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=Vt(i,n,e),r=Vt(n,o,e),l=Vt(o,t,e),h=Vt(a,r,e),d=Vt(r,l,e);return Vt(h,d,e)}let xa=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,_a=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ln(i,t){let e=(""+i).match(xa);if(!e||e[1]==="normal")return 1.2*t;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100}return t*i}let ya=i=>+i||0;function qe(i,t){let e={},s=z(t),n=s?Object.keys(t):t,o=z(i)?s?a=>E(i[a],i[t[a]]):a=>i[a]:()=>i;for(let a of n)e[a]=ya(o(a));return e}function Vi(i){return qe(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Bt(i){return qe(i,["topLeft","topRight","bottomLeft","bottomRight"])}function et(i){let t=Vi(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function J(i,t){i=i||{},t=t||U.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=E(i.style,t.style);s&&!(""+s).match(_a)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);let n={family:E(i.family,t.family),lineHeight:ln(E(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:E(i.weight,t.weight),string:""};return n.string=$s(n),n}function re(i,t,e,s){let n,o,a,r=!0;for(n=0,o=i.length;n<o;++n)if(a=i[n],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),r=!1),e!==void 0&&F(a)&&(a=a[e%a.length],r=!1),a!==void 0))return s&&!r&&(s.cacheable=!1),a}function hn(i,t,e){let{min:s,max:n}=i,o=Z(t,(n-s)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function Ot(i,t){return Object.assign(Object.create(i),t)}function qt(i,t,e){return i?function(s,n){return{x:o=>s+s+n-o,setWidth(o){n=o},textAlign:o=>o==="center"?o:o==="right"?"left":"right",xPlus:(o,a)=>o-a,leftForLtr:(o,a)=>o-a}}(t,e):{x:s=>s,setWidth(s){},textAlign:s=>s,xPlus:(s,n)=>s+n,leftForLtr:(s,n)=>s}}function Bi(i,t){let e,s;t!=="ltr"&&t!=="rtl"||(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Wi(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function cn(i){return i==="angle"?{between:ee,compare:ks,normalize:nt}:{between:_t,compare:(t,e)=>t-e,normalize:t=>t}}function dn({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e==0,style:n}}function Ni(i,t,e){if(!e)return[i];let{property:s,start:n,end:o}=e,a=t.length,{compare:r,between:l,normalize:h}=cn(s),{start:d,end:c,loop:u,style:f}=function(w,M,k){let{property:D,start:S,end:T}=k,{between:A,normalize:P}=cn(D),O=M.length,C,R,{start:H,end:V,loop:st}=w;if(st){for(H+=O,V+=O,C=0,R=O;C<R&&A(P(M[H%O][D]),S,T);++C)H--,V--;H%=O,V%=O}return V<H&&(V+=O),{start:H,end:V,loop:st,style:w.style}}(i,t,e),p=[],g,m,b,y=!1,_=null,x=()=>y||l(n,b,g)&&r(n,b)!==0,v=()=>!y||r(o,g)===0||l(o,b,g);for(let w=d,M=d;w<=c;++w)m=t[w%a],m.skip||(g=h(m[s]),g!==b&&(y=l(g,n,o),_===null&&x()&&(_=r(g,n)===0?w:M),_!==null&&v()&&(p.push(dn({start:_,end:w,loop:u,count:a,style:f})),_=null),M=w,b=g));return _!==null&&p.push(dn({start:_,end:c,loop:u,count:a,style:f})),p}function Hi(i,t){let e=[],s=i.segments;for(let n=0;n<s.length;n++){let o=Ni(s[n],i.points,t);o.length&&e.push(...o)}return e}function un(i,t){let e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];let o=!!i._loop,{start:a,end:r}=function(l,h,d,c){let u=0,f=h-1;if(d&&!c)for(;u<h&&!l[u].skip;)u++;for(;u<h&&l[u].skip;)u++;for(u%=h,d&&(f+=u);f>u&&l[f%h].skip;)f--;return f%=h,{start:u,end:f}}(e,n,o,s);return s===!0?fn(i,[{start:a,end:r,loop:o}],e,t):fn(i,function(l,h,d,c){let u=l.length,f=[],p,g=h,m=l[h];for(p=h+1;p<=d;++p){let b=l[p%u];b.skip||b.stop?m.skip||(c=!1,f.push({start:h%u,end:(p-1)%u,loop:c}),h=g=b.stop?p:null):(g=p,m.skip&&(h=p)),m=b}return g!==null&&f.push({start:h%u,end:g%u,loop:c}),f}(e,a,r<a?r+n:r,!!i._fullLoop&&a===0&&r===n-1),e,t)}function fn(i,t,e,s){return s&&s.setContext&&e?function(n,o,a,r){let l=n._chart.getContext(),h=gn(n.options),{_datasetIndex:d,options:{spanGaps:c}}=n,u=a.length,f=[],p=h,g=o[0].start,m=g;function b(y,_,x,v){let w=c?-1:1;if(y!==_){for(y+=u;a[y%u].skip;)y-=w;for(;a[_%u].skip;)_+=w;y%u!=_%u&&(f.push({start:y%u,end:_%u,loop:x,style:v}),p=v,g=_%u)}}for(let y of o){g=c?g:y.start;let _,x=a[g%u];for(m=g+1;m<=y.end;m++){let v=a[m%u];_=gn(r.setContext(Ot(l,{type:"segment",p0:x,p1:v,p0DataIndex:(m-1)%u,p1DataIndex:m%u,datasetIndex:d}))),va(_,p)&&b(g,m-1,y.loop,p),x=v,p=_}g<m-1&&b(g,m-1,y.loop,p)}return f}(i,t,e,s):t}function gn(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function va(i,t){if(!t)return!1;let e=[],s=function(n,o){return Fe(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}var wa=Object.freeze({__proto__:null,HALF_PI:q,INFINITY:he,PI:$,PITAU:ys,QUARTER_PI:Lt,RAD_PER_DEG:vs,TAU:Y,TWO_THIRDS_PI:di,_addGrace:hn,_alignPixel:zt,_alignStartEnd:tt,_angleBetween:ee,_angleDiff:ks,_arrayUnique:bi,_attachContext:Xt,_bezierCurveTo:Xs,_bezierInterpolation:rn,_boundSegment:Ni,_boundSegments:Hi,_capitalize:Oe,_computeSegments:un,_createResolver:Ye,_decimalPlaces:gi,_deprecated:function(i,t,e,s){t!==void 0&&console.warn(i+': "'+e+'" is deprecated. Please use "'+s+'" instead')},_descriptors:Ri,_elementsEqual:Ht,_factorize:ws,_filterBetween:Ds,_getParentNode:We,_getStartAndCountOfVisiblePoints:yi,_int16Range:Ss,_isBetween:_t,_isClickEvent:_s,_isDomSupported:Be,_isPointInArea:wt,_limitValue:Q,_longestText:Ys,_lookup:Le,_lookupByKey:yt,_measureText:pe,_merger:ps,_mergerIf:ms,_normalizeAngle:nt,_parseObjectDataRadialScale:Fi,_pointInLine:Vt,_readValueToProps:qe,_rlookupByKey:Ps,_scaleRangesChanged:vi,_setMinAndMaxByKey:fi,_splitKey:xs,_steppedInterpolation:an,_steppedLineTo:Us,_textX:Ts,_toLeftRightCenter:Ee,_updateBezierControlPoints:sn,addRoundedRectPath:ne,almostEquals:te,almostWhole:Ms,callback:N,clearCanvas:Li,clipArea:me,clone:jt,color:Di,createContext:Ot,debounce:As,defined:Qt,distanceBetweenPoints:Te,drawPoint:$e,drawPointLegend:Ei,each:B,easingEffects:ae,finiteOrDefault:X,fontString:function(i,t,e){return t+" "+i+"px "+e},formatNumber:se,getAngleFromPoint:pi,getHoverColor:Ve,getMaximumSize:Hs,getRelativePosition:It,getRtlAdapter:qt,getStyle:Ns,isArray:F,isFinite:L,isFunction:Pt,isNullOrUndef:I,isNumber:$t,isObject:z,isPatternOrGradient:Fe,listenArrayEvents:Os,log10:Dt,merge:Zt,mergeIf:Jt,niceNum:ui,noop:W,overrideTextDirection:Bi,readUsedSize:Ti,renderText:Ft,requestAnimFrame:xi,resolve:re,resolveObjectKey:St,restoreTextDirection:Wi,retinaScale:Ai,setsEqual:ci,sign:ft,splineCurve:tn,splineCurveMonotone:en,supportsEventListenerOptions:js,throttled:_i,toDegrees:Ae,toDimension:Z,toFont:J,toFontString:$s,toLineHeight:ln,toPadding:et,toPercentage:j,toRadians:ct,toTRBL:Vi,toTRBLCorners:Bt,uid:ht,unclipArea:be,unlistenArrayEvents:mi,valueOrDefault:E});function Ma(i,t,e,s){let{controller:n,data:o,_sorted:a}=i,r=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){let h=r._reversePixels?Ps:yt;if(!s){let d=h(o,t,e);if(l){let{vScale:c}=n._cachedMeta,{_parsed:u}=i,f=u.slice(0,d.lo+1).reverse().findIndex(g=>!I(g[c.axis]));d.lo-=Math.max(0,f);let p=u.slice(d.hi).findIndex(g=>!I(g[c.axis]));d.hi+=Math.max(0,p)}return d}if(n._sharedOptions){let d=o[0],c=typeof d.getRange=="function"&&d.getRange(t);if(c){let u=h(o,t,e-c),f=h(o,t,e+c);return{lo:u.lo,hi:f.hi}}}}return{lo:0,hi:o.length-1}}function xe(i,t,e,s,n){let o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){let{index:h,data:d}=o[r],{lo:c,hi:u}=Ma(o[r],t,a,n);for(let f=c;f<=u;++f){let p=d[f];p.skip||s(p,h,f)}}}function ji(i,t,e,s,n){let o=[];return!n&&!i.isPointInArea(t)||xe(i,e,t,function(a,r,l){(n||wt(a,i.chartArea,0))&&a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:r,index:l})},!0),o}function ka(i,t,e,s,n,o){let a=[],r=function(h){let d=h.indexOf("x")!==-1,c=h.indexOf("y")!==-1;return function(u,f){let p=d?Math.abs(u.x-f.x):0,g=c?Math.abs(u.y-f.y):0;return Math.sqrt(Math.pow(p,2)+Math.pow(g,2))}}(e),l=Number.POSITIVE_INFINITY;return xe(i,e,t,function(h,d,c){let u=h.inRange(t.x,t.y,n);if(s&&!u)return;let f=h.getCenterPoint(n);if(!(o||i.isPointInArea(f))&&!u)return;let p=r(t,f);p<l?(a=[{element:h,datasetIndex:d,index:c}],l=p):p===l&&a.push({element:h,datasetIndex:d,index:c})}),a}function $i(i,t,e,s,n,o){return o||i.isPointInArea(t)?e!=="r"||s?ka(i,t,e,s,n,o):function(a,r,l,h){let d=[];return xe(a,l,r,function(c,u,f){let{startAngle:p,endAngle:g}=c.getProps(["startAngle","endAngle"],h),{angle:m}=pi(c,{x:r.x,y:r.y});ee(m,p,g)&&d.push({element:c,datasetIndex:u,index:f})}),d}(i,t,e,n):[]}function pn(i,t,e,s,n){let o=[],a=e==="x"?"inXRange":"inYRange",r=!1;return xe(i,e,t,(l,h,d)=>{l[a]&&l[a](t[e],n)&&(o.push({element:l,datasetIndex:h,index:d}),r=r||l.inRange(t.x,t.y,n))}),s&&!r?[]:o}var mn={evaluateInteractionItems:xe,modes:{index(i,t,e,s){let n=It(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?ji(i,n,o,s,a):$i(i,n,o,!1,s,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(h=>{let d=r[0].index,c=h.data[d];c&&!c.skip&&l.push({element:c,datasetIndex:h.index,index:d})}),l):[]},dataset(i,t,e,s){let n=It(t,i),o=e.axis||"xy",a=e.includeInvisible||!1,r=e.intersect?ji(i,n,o,s,a):$i(i,n,o,!1,s,a);if(r.length>0){let l=r[0].datasetIndex,h=i.getDatasetMeta(l).data;r=[];for(let d=0;d<h.length;++d)r.push({element:h[d],datasetIndex:l,index:d})}return r},point:(i,t,e,s)=>ji(i,It(t,i),e.axis||"xy",s,e.includeInvisible||!1),nearest(i,t,e,s){let n=It(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return $i(i,n,o,e.intersect,s,a)},x:(i,t,e,s)=>pn(i,It(t,i),"x",e.intersect,s),y:(i,t,e,s)=>pn(i,It(t,i),"y",e.intersect,s)}};let bn=["left","top","right","bottom"];function _e(i,t){return i.filter(e=>e.pos===t)}function xn(i,t){return i.filter(e=>bn.indexOf(e.pos)===-1&&e.box.axis===t)}function ye(i,t){return i.sort((e,s)=>{let n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Sa(i,t){let e=function(l){let h={};for(let d of l){let{stack:c,pos:u,stackWeight:f}=d;if(!c||!bn.includes(u))continue;let p=h[c]||(h[c]={count:0,placed:0,weight:0,size:0});p.count++,p.weight+=f}return h}(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t,o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];let{fullSize:l}=r.box,h=e[r.stack],d=h&&r.stackWeight/h.weight;r.horizontal?(r.width=d?d*s:l&&t.availableWidth,r.height=n):(r.width=s,r.height=d?d*n:l&&t.availableHeight)}return e}function _n(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function yn(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Pa(i,t,e,s){let{pos:n,box:o}=e,a=i.maxPadding;if(!z(n)){e.size&&(i[n]-=e.size);let c=s[e.stack]||{size:0,count:1};c.size=Math.max(c.size,e.horizontal?o.height:o.width),e.size=c.size/c.count,i[n]+=e.size}o.getPadding&&yn(a,o.getPadding());let r=Math.max(0,t.outerWidth-_n(a,i,"left","right")),l=Math.max(0,t.outerHeight-_n(a,i,"top","bottom")),h=r!==i.w,d=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:h,other:d}:{same:d,other:h}}function Da(i,t){let e=t.maxPadding;function s(n){let o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return s(i?["left","right"]:["top","bottom"])}function ve(i,t,e,s){let n=[],o,a,r,l,h,d;for(o=0,a=i.length,h=0;o<a;++o){r=i[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Da(r.horizontal,t));let{same:c,other:u}=Pa(t,e,r,s);h|=c&&n.length,d=d||u,l.fullSize||n.push(r)}return h&&ve(n,t,e,s)||d}function Ke(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function vn(i,t,e,s){let n=e.padding,{x:o,y:a}=t;for(let r of i){let l=r.box,h=s[r.stack]||{count:1,placed:0,weight:1},d=r.stackWeight/h.weight||1;if(r.horizontal){let c=t.w*d,u=h.size||l.height;Qt(h.start)&&(a=h.start),l.fullSize?Ke(l,n.left,a,e.outerWidth-n.right-n.left,u):Ke(l,t.left+h.placed,a,c,u),h.start=a,h.placed+=c,a=l.bottom}else{let c=t.h*d,u=h.size||l.width;Qt(h.start)&&(o=h.start),l.fullSize?Ke(l,o,n.top,u,e.outerHeight-n.bottom-n.top):Ke(l,o,t.top+h.placed,u,c),h.start=o,h.placed+=c,o=l.right}}t.x=o,t.y=a}var it={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){let e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;let n=et(i.options.layout.padding),o=Math.max(t-n.width,0),a=Math.max(e-n.height,0),r=function(g){let m=function(k){let D=[],S,T,A,P,O,C;for(S=0,T=(k||[]).length;S<T;++S)A=k[S],{position:P,options:{stack:O,stackWeight:C=1}}=A,D.push({index:S,box:A,pos:P,horizontal:A.isHorizontal(),weight:A.weight,stack:O&&P+O,stackWeight:C});return D}(g),b=ye(m.filter(k=>k.box.fullSize),!0),y=ye(_e(m,"left"),!0),_=ye(_e(m,"right")),x=ye(_e(m,"top"),!0),v=ye(_e(m,"bottom")),w=xn(m,"x"),M=xn(m,"y");return{fullSize:b,leftAndTop:y.concat(x),rightAndBottom:_.concat(M).concat(v).concat(w),chartArea:_e(m,"chartArea"),vertical:y.concat(_).concat(M),horizontal:x.concat(v).concat(w)}}(i.boxes),l=r.vertical,h=r.horizontal;B(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});let d=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,c=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),u=Object.assign({},n);yn(u,et(s));let f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),p=Sa(l.concat(h),c);ve(r.fullSize,f,c,p),ve(l,f,c,p),ve(h,f,c,p)&&ve(l,f,c,p),function(g){let m=g.maxPadding;function b(y){let _=Math.max(m[y]-g[y],0);return g[y]+=_,_}g.y+=b("top"),g.x+=b("left"),b("right"),b("bottom")}(f),vn(r.leftAndTop,f,c,p),f.x+=f.w,f.y+=f.h,vn(r.rightAndBottom,f,c,p),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},B(r.chartArea,g=>{let m=g.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Yi{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class wn extends Yi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}let Ge="$chartjs",Ca={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Mn=i=>i===null||i==="",kn=!!js&&{passive:!0};function Oa(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,kn)}function Ze(i,t){for(let e of i)if(e===t||e.contains(t))return!0}function Aa(i,t,e){let s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||Ze(r.addedNodes,s),a=a&&!Ze(r.removedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Ta(i,t,e){let s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||Ze(r.removedNodes,s),a=a&&!Ze(r.addedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}let we=new Map,Sn=0;function Pn(){let i=window.devicePixelRatio;i!==Sn&&(Sn=i,we.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function La(i,t,e){let s=i.canvas,n=s&&We(s);if(!n)return;let o=_i((r,l)=>{let h=n.clientWidth;e(r,l),h<n.clientWidth&&e()},window),a=new ResizeObserver(r=>{let l=r[0],h=l.contentRect.width,d=l.contentRect.height;h===0&&d===0||o(h,d)});return a.observe(n),function(r,l){we.size||window.addEventListener("resize",Pn),we.set(r,l)}(i,o),a}function Ui(i,t,e){e&&e.disconnect(),t==="resize"&&function(s){we.delete(s),we.size||window.removeEventListener("resize",Pn)}(i)}function Ea(i,t,e){let s=i.canvas,n=_i(o=>{i.ctx!==null&&e(function(a,r){let l=Ca[a.type]||a.type,{x:h,y:d}=It(a,r);return{type:l,chart:r,native:a,x:h!==void 0?h:null,y:d!==void 0?d:null}}(o,i))},i);return function(o,a,r){o&&o.addEventListener(a,r,kn)}(s,t,n),n}class Dn extends Yi{acquireContext(t,e){let s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(function(n,o){let a=n.style,r=n.getAttribute("height"),l=n.getAttribute("width");if(n[Ge]={initial:{height:r,width:l,style:{display:a.display,height:a.height,width:a.width}}},a.display=a.display||"block",a.boxSizing=a.boxSizing||"border-box",Mn(l)){let h=Ti(n,"width");h!==void 0&&(n.width=h)}if(Mn(r))if(n.style.height==="")n.height=n.width/(o||2);else{let h=Ti(n,"height");h!==void 0&&(n.height=h)}}(t,e),s):null}releaseContext(t){let e=t.canvas;if(!e[Ge])return!1;let s=e[Ge].initial;["height","width"].forEach(o=>{let a=s[o];I(a)?e.removeAttribute(o):e.setAttribute(o,a)});let n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Ge],!0}addEventListener(t,e,s){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),o={attach:Aa,detach:Ta,resize:La}[e]||Ea;n[e]=o(t,e,s)}removeEventListener(t,e){let s=t.$proxies||(t.$proxies={}),n=s[e];n&&(({attach:Ui,detach:Ui,resize:Ui}[e]||Oa)(t,e,n),s[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Hs(t,e,s,n)}isAttached(t){let e=t&&We(t);return!(!e||!e.isConnected)}}function Cn(i){return!Be()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?wn:Dn}var On=Object.freeze({__proto__:null,BasePlatform:Yi,BasicPlatform:wn,DomPlatform:Dn,_detectPlatform:Cn});let An="transparent",Ra={boolean:(i,t,e)=>e>.5?t:i,color(i,t,e){let s=Di(i||An),n=s.valid&&Di(t||An);return n&&n.valid?n.mix(s,e).hexString():t},number:(i,t,e)=>i+(t-i)*e};class Tn{constructor(t,e,s,n){let o=e[s];n=re([t.to,n,o,t.from]);let a=re([t.from,o,n]);this._active=!0,this._fn=t.fn||Ra[t.type||typeof a],this._easing=ae[t.easing]||ae.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=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);let n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=re([t.to,e,n,t.from]),this._from=re([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to,l;if(this._active=o!==r&&(a||e<s),!this._active)return this._target[n]=r,void this._notify(!0);e<0?this._target[n]=o:(l=e/s%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,r,l))}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){let e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class Xi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!z(t))return;let e=Object.keys(U.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{let o=t[n];if(!z(o))return;let a={};for(let r of e)a[r]=o[r];(F(o.properties)&&o.properties||[n]).forEach(r=>{r!==n&&s.has(r)||s.set(r,a)})})}_animateOptions(t,e){let s=e.options,n=function(a,r){if(!r)return;let l=a.options;return l?(l.$shared&&(a.options=l=Object.assign({},l,{$shared:!1,$animations:{}})),l):void(a.options=r)}(t,s);if(!n)return[];let o=this._createAnimations(n,s);return s.$shared&&function(a,r){let l=[],h=Object.keys(r);for(let d=0;d<h.length;d++){let c=a[h[d]];c&&c.active()&&l.push(c.wait())}return Promise.all(l)}(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){let s=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now(),l;for(l=a.length-1;l>=0;--l){let h=a[l];if(h.charAt(0)==="$")continue;if(h==="options"){n.push(...this._animateOptions(t,e));continue}let d=e[h],c=o[h],u=s.get(h);if(c){if(u&&c.active()){c.update(u,d,r);continue}c.cancel()}u&&u.duration?(o[h]=c=new Tn(u,t,h,d),n.push(c)):t[h]=d}return n}update(t,e){if(this._properties.size===0)return void Object.assign(t,e);let s=this._createAnimations(t,e);return s.length?(vt.add(this._chart,s),!0):void 0}}function Ln(i,t){let e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function En(i,t){let e=[],s=i._getSortedDatasetMetas(t),n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function Rn(i,t,e,s={}){let n=i.keys,o=s.mode==="single",a,r,l,h;if(t===null)return;let d=!1;for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===e){if(d=!0,s.all)continue;break}h=i.values[l],L(h)&&(o||t===0||ft(t)===ft(h))&&(t+=h)}return d||s.all?t:0}function qi(i,t){let e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Ia(i,t,e){let s=i[t]||(i[t]={});return s[e]||(s[e]={})}function In(i,t,e,s){for(let n of t.getMatchingVisibleMetas(s).reverse()){let o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function zn(i,t){let{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,d=function(f,p,g){return`${f.id}.${p.id}.${g.stack||g.type}`}(o,a,s),c=t.length,u;for(let f=0;f<c;++f){let p=t[f],{[l]:g,[h]:m}=p;u=(p._stacks||(p._stacks={}))[h]=Ia(n,d,g),u[r]=m,u._top=In(u,a,!0,s.type),u._bottom=In(u,a,!1,s.type),(u._visualValues||(u._visualValues={}))[r]=m}}function Ki(i,t){let e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Me(i,t){let e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(let n of t){let o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}let Gi=i=>i==="reset"||i==="none",Fn=(i,t)=>t?i:Object.assign({},i);class At{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=qi(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Me(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(c,u,f,p)=>c==="x"?u:c==="r"?p:f,o=e.xAxisID=E(s.xAxisID,Ki(t,"x")),a=e.yAxisID=E(s.yAxisID,Ki(t,"y")),r=e.rAxisID=E(s.rAxisID,Ki(t,"r")),l=e.indexAxis,h=e.iAxisID=n(l,o,a,r),d=e.vAxisID=n(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&mi(this._data,this),t._stacked&&Me(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(z(e)){let n=this._cachedMeta;this._data=function(o,a){let{iScale:r,vScale:l}=a,h=r.axis==="x"?"x":"y",d=l.axis==="x"?"x":"y",c=Object.keys(o),u=new Array(c.length),f,p,g;for(f=0,p=c.length;f<p;++f)g=c[f],u[f]={[h]:g,[d]:o[g]};return u}(e,n)}else if(s!==e){if(s){mi(s,this);let n=this._cachedMeta;Me(n),n._parsed=[]}e&&Object.isExtensible(e)&&Os(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,s=this.getDataset(),n=!1;this._dataCheck();let o=e._stacked;e._stacked=qi(e.vScale,e),e.stack!==s.stack&&(n=!0,Me(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(zn(this,e._parsed),e._stacked=qi(e.vScale,e))}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:a}=s,r=o.axis,l,h,d,c=t===0&&e===n.length||s._sorted,u=t>0&&s._parsed[t-1];if(this._parsing===!1)s._parsed=n,s._sorted=!0,d=n;else{d=F(n[t])?this.parseArrayData(s,n,t,e):z(n[t])?this.parseObjectData(s,n,t,e):this.parsePrimitiveData(s,n,t,e);let f=()=>h[r]===null||u&&h[r]<u[r];for(l=0;l<e;++l)s._parsed[l+t]=h=d[l],c&&(f()&&(c=!1),u=h);s._sorted=c}a&&zn(this,d)}parsePrimitiveData(t,e,s,n){let{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,h=o.getLabels(),d=o===a,c=new Array(n),u,f,p;for(u=0,f=n;u<f;++u)p=u+s,c[u]={[r]:d||o.parse(h[p],p),[l]:a.parse(e[p],p)};return c}parseArrayData(t,e,s,n){let{xScale:o,yScale:a}=t,r=new Array(n),l,h,d,c;for(l=0,h=n;l<h;++l)d=l+s,c=e[d],r[l]={x:o.parse(c[0],d),y:a.parse(c[1],d)};return r}parseObjectData(t,e,s,n){let{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,h=new Array(n),d,c,u,f;for(d=0,c=n;d<c;++d)u=d+s,f=e[u],h[d]={x:o.parse(St(f,r),u),y:a.parse(St(f,l),u)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){let n=this.chart,o=this._cachedMeta,a=e[t.axis];return Rn({keys:En(n,!0),values:e._stacks[t.axis]._visualValues},a,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){let o=s[e.axis],a=o===null?NaN:o,r=n&&s._stacks[e.axis];n&&r&&(n.values=r,a=Rn(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){let s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,a=n.length,r=this._getOtherScale(t),l=((g,m,b)=>g&&!m.hidden&&m._stacked&&{keys:En(b,!0),values:null})(e,s,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:c}=function(g){let{min:m,max:b,minDefined:y,maxDefined:_}=g.getUserBounds();return{min:y?m:Number.NEGATIVE_INFINITY,max:_?b:Number.POSITIVE_INFINITY}}(r),u,f;function p(){f=n[u];let g=f[r.axis];return!L(f[t.axis])||d>g||c<g}for(u=0;u<a&&(p()||(this.updateRangeFromParsed(h,t,f,l),!o));++u);if(o){for(u=a-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(h,t,f,l);break}}return h}getAllParsedValues(t){let e=this._cachedMeta._parsed,s=[],n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],L(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){let e=this._cachedMeta;this.update(t||"default"),e._clip=function(s){let n,o,a,r;return z(s)?(n=s.top,o=s.right,a=s.bottom,r=s.left):n=o=a=r=s,{top:n,right:o,bottom:a,left:r,disabled:s===!1}}(E(this.options.clip,function(s,n,o){if(o===!1)return!1;let a=Ln(s,o),r=Ln(n,o);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||n.length-r,h=this.options.drawActiveElementsOnTop,d;for(s.dataset&&s.dataset.draw(t,o,r,l),d=r;d<r+l;++d){let c=n[d];c.hidden||(c.active&&h?a.push(c):c.draw(t,o))}for(d=0;d<a.length;++d)a[d].draw(t,o)}getStyle(t,e){let s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){let n=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let a=this._cachedMeta.data[t];o=a.$context||(a.$context=function(r,l,h){return Ot(r,{active:!1,dataIndex:l,parsed:void 0,raw:void 0,element:h,index:l,mode:"default",type:"data"})}(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=function(a,r){return Ot(a,{active:!1,dataset:void 0,datasetIndex:r,index:r,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){let n=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&Qt(s);if(r)return Fn(r,l);let h=this.chart.config,d=h.datasetElementScopeKeys(this._type,t),c=n?[`${t}Hover`,"hover",t,""]:[t,""],u=h.getOptionScopes(this.getDataset(),d),f=Object.keys(U.elements[t]),p=h.resolveNamedOptions(u,f,()=>this.getContext(s,n,e),c);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(Fn(p,l))),p}_resolveAnimations(t,e,s){let n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(n.options.animation!==!1){let d=this.chart.config,c=d.datasetAnimationScopeKeys(this._type,e),u=d.getOptionScopes(this.getDataset(),c);l=d.createResolver(u,this.getContext(t,s,e))}let h=new Xi(n,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Gi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,n){Gi(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Gi(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;let o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,s=this._cachedMeta.data;for(let[r,l,h]of this._syncList)this[r](l,h);this._syncList=[];let n=s.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){let n=this._cachedMeta,o=n.data,a=t+e,r,l=h=>{for(h.length+=e,r=h.length-1;r>=a;r--)h[r]=h[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){let s=this._cachedMeta;if(this._parsing){let n=s._parsed.splice(t,e);s._stacked&&Me(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);let s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class Mt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){let{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return $t(this.x)&&$t(this.y)}getProps(t,e){let s=this.$animations;if(!e||!s)return this;let n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}function za(i,t){let e=i.options.ticks,s=function(c){let u=c.options.offset,f=c._tickSize(),p=c._length/f+(u?0:1),g=c._maxLength/f;return Math.floor(Math.min(p,g))}(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?function(c){let u=[],f,p;for(f=0,p=c.length;f<p;f++)c[f].major&&u.push(f);return u}(t):[],a=o.length,r=o[0],l=o[a-1],h=[];if(a>n)return function(c,u,f,p){let g,m=0,b=f[0];for(p=Math.ceil(p),g=0;g<c.length;g++)g===b&&(u.push(c[g]),m++,b=f[m*p])}(t,h,o,a/n),h;let d=function(c,u,f){let p=function(b){let y=b.length,_,x;if(y<2)return!1;for(x=b[0],_=1;_<y;++_)if(b[_]-b[_-1]!==x)return!1;return x}(c),g=u.length/f;if(!p)return Math.max(g,1);let m=ws(p);for(let b=0,y=m.length-1;b<y;b++){let _=m[b];if(_>g)return _}return Math.max(g,1)}(o,t,n);if(a>0){let c,u,f=a>1?Math.round((l-r)/(a-1)):null;for(Je(t,h,d,I(f)?0:r-f,r),c=0,u=a-1;c<u;c++)Je(t,h,d,o[c],o[c+1]);return Je(t,h,d,l,I(f)?t.length:l+f),h}return Je(t,h,d),h}function Je(i,t,e,s,n){let o=E(s,0),a=Math.min(E(n,i.length),i.length),r,l,h,d=0;for(e=Math.ceil(e),n&&(r=n-s,e=r/Math.floor(r/e)),h=o;h<0;)d++,h=Math.round(o+d*e);for(l=Math.max(o,0);l<a;l++)l===h&&(t.push(i[l]),d++,h=Math.round(o+d*e))}let Vn=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Bn=(i,t)=>Math.min(t||i,i);function Wn(i,t){let e=[],s=i.length/t,n=i.length,o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function Fa(i,t,e){let s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,a=i._endPixel,r=1e-6,l,h=i.getPixelForTick(n);if(!(e&&(l=s===1?Math.max(h-o,a-h):t===0?(i.getPixelForTick(1)-h)/2:(h-i.getPixelForTick(n-1))/2,h+=n<t?l:-l,h<o-r||h>a+r)))return h}function ke(i){return i.drawTicks?i.tickLength:0}function Nn(i,t){if(!i.display)return 0;let e=J(i.font,t),s=et(i.padding);return(F(i.text)?i.text.length:1)*e.lineHeight+s.height}function Va(i,t,e){let s=Ee(i);return(e&&t!=="right"||!e&&t==="right")&&(s=(n=>n==="left"?"right":n==="right"?"left":n)(s)),s}class Wt extends Mt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=X(t,Number.POSITIVE_INFINITY),e=X(e,Number.NEGATIVE_INFINITY),s=X(s,Number.POSITIVE_INFINITY),n=X(n,Number.NEGATIVE_INFINITY),{min:X(t,s),max:X(e,n),minDefined:L(t),maxDefined:L(e)}}getMinMax(t){let e,{min:s,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();if(o&&a)return{min:s,max:n};let r=this.getMatchingVisibleMetas();for(let l=0,h=r.length;l<h;++l)e=r[l].controller.getMinMax(this,t),o||(s=Math.min(s,e.min)),a||(n=Math.max(n,e.max));return s=a&&s>n?n:s,n=o&&s>n?s:n,{min:X(s,X(n,s)),max:X(n,X(s,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){N(this.options.beforeUpdate,[this])}update(t,e,s){let{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=hn(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=r<this.ticks.length;this._convertTicksToLabels(l?Wn(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=za(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,s=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,s=!s),this._startPixel=t,this._endPixel=e,this._reversePixels=s,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){N(this.options.afterUpdate,[this])}beforeSetDimensions(){N(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){N(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),N(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){N(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e=this.options.ticks,s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=N(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){N(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){N(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,e=t.ticks,s=Bn(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation,a,r,l,h=n;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal())return void(this.labelRotation=n);let d=this._getLabelSizes(),c=d.widest.width,u=d.highest.height,f=Q(this.chart.width-c,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),c+6>a&&(a=f/(s-(t.offset?.5:1)),r=this.maxHeight-ke(t.grid)-e.padding-Nn(t.title,this.chart.options.font),l=Math.sqrt(c*c+u*u),h=Ae(Math.min(Math.asin(Q((d.highest.height+6)/a,-1,1)),Math.asin(Q(r/l,-1,1))-Math.asin(Q(u/l,-1,1)))),h=Math.max(n,Math.min(o,h))),this.labelRotation=h}afterCalculateLabelRotation(){N(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){N(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){let l=Nn(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=ke(o)+l):(t.height=this.maxHeight,t.width=ke(o)+l),s.display&&this.ticks.length){let{first:h,last:d,widest:c,highest:u}=this._getLabelSizes(),f=2*s.padding,p=ct(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(r){let b=s.mirror?0:m*c.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=s.mirror?0:g*c.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(h,d,m,g)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){let{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,h=r!=="top"&&this.axis==="x";if(this.isHorizontal()){let d=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;l?h?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((f-c+a)*this.width/(this.width-c),0)}else{let d=e.height/2,c=t.height/2;o==="start"?(d=0,c=t.height):o==="end"&&(d=e.height,c=0),this.paddingTop=d+a,this.paddingBottom=c+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){N(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,s;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,s=t.length;e<s;e++)I(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,s=this.ticks;e<s.length&&(s=Wn(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){let{ctx:n,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Bn(e,s)),h,d,c,u,f,p,g,m,b,y,_,x=0,v=0;for(h=0;h<e;h+=l){if(u=t[h].label,f=this._resolveTickFontOptions(h),n.font=p=f.string,g=o[p]=o[p]||{data:{},gc:[]},m=f.lineHeight,b=y=0,I(u)||F(u)){if(F(u))for(d=0,c=u.length;d<c;++d)_=u[d],I(_)||F(_)||(b=pe(n,g.data,g.gc,b,_),y+=m)}else b=pe(n,g.data,g.gc,b,u),y=m;a.push(b),r.push(y),x=Math.max(b,x),v=Math.max(y,v)}(function(D,S){B(D,T=>{let A=T.gc,P=A.length/2,O;if(P>S){for(O=0;O<P;++O)delete T.data[A[O]];A.splice(0,P)}})})(o,e);let w=a.indexOf(x),M=r.indexOf(v),k=D=>({width:a[D]||0,height:r[D]||0});return{first:k(0),last:k(e-1),widest:k(w),highest:k(M),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return Ss(this._alignToPixels?zt(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let s=e[t];return s.$context||(s.$context=function(n,o,a){return Ot(n,{tick:a,index:o,type:"tick"})}(this.getContext(),t,s))}return this.$context||(this.$context=Ot(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){let t=this.options.ticks,e=ct(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*s>r*n?r/s:l/n:l*n<r*s?l/s:r/n}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e=this.axis,s=this.chart,n=this.options,{grid:o,position:a,border:r}=n,l=o.offset,h=this.isHorizontal(),d=this.ticks.length+(l?1:0),c=ke(o),u=[],f=r.setContext(this.getContext()),p=f.display?f.width:0,g=p/2,m=function(C){return zt(s,C,p)},b,y,_,x,v,w,M,k,D,S,T,A;if(a==="top")b=m(this.bottom),w=this.bottom-c,k=b-g,S=m(t.top)+g,A=t.bottom;else if(a==="bottom")b=m(this.top),S=t.top,A=m(t.bottom)-g,w=b+g,k=this.top+c;else if(a==="left")b=m(this.right),v=this.right-c,M=b-g,D=m(t.left)+g,T=t.right;else if(a==="right")b=m(this.left),D=t.left,T=m(t.right)-g,v=b+g,M=this.left+c;else if(e==="x"){if(a==="center")b=m((t.top+t.bottom)/2+.5);else if(z(a)){let C=Object.keys(a)[0],R=a[C];b=m(this.chart.scales[C].getPixelForValue(R))}S=t.top,A=t.bottom,w=b+g,k=w+c}else if(e==="y"){if(a==="center")b=m((t.left+t.right)/2);else if(z(a)){let C=Object.keys(a)[0],R=a[C];b=m(this.chart.scales[C].getPixelForValue(R))}v=b-g,M=v-c,D=t.left,T=t.right}let P=E(n.ticks.maxTicksLimit,d),O=Math.max(1,Math.ceil(d/P));for(y=0;y<d;y+=O){let C=this.getContext(y),R=o.setContext(C),H=r.setContext(C),V=R.lineWidth,st=R.color,rt=H.dash||[],lt=H.dashOffset,ut=R.tickWidth,pt=R.tickColor,mt=R.tickBorderDash||[],bt=R.tickBorderDashOffset;_=Fa(this,y,l),_!==void 0&&(x=zt(s,_,V),h?v=M=D=T=x:w=k=S=A=x,u.push({tx1:v,ty1:w,tx2:M,ty2:k,x1:D,y1:S,x2:T,y2:A,width:V,color:st,borderDash:rt,borderDashOffset:lt,tickWidth:ut,tickColor:pt,tickBorderDash:mt,tickBorderDashOffset:bt}))}return this._ticksLength=d,this._borderValue=b,u}_computeLabelItems(t){let e=this.axis,s=this.options,{position:n,ticks:o}=s,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:h,padding:d,mirror:c}=o,u=ke(s.grid),f=u+d,p=c?-d:f,g=-ct(this.labelRotation),m=[],b,y,_,x,v,w,M,k,D,S,T,A,P="middle";if(n==="top")w=this.bottom-p,M=this._getXAxisLabelAlignment();else if(n==="bottom")w=this.top+p,M=this._getXAxisLabelAlignment();else if(n==="left"){let C=this._getYAxisLabelAlignment(u);M=C.textAlign,v=C.x}else if(n==="right"){let C=this._getYAxisLabelAlignment(u);M=C.textAlign,v=C.x}else if(e==="x"){if(n==="center")w=(t.top+t.bottom)/2+f;else if(z(n)){let C=Object.keys(n)[0],R=n[C];w=this.chart.scales[C].getPixelForValue(R)+f}M=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")v=(t.left+t.right)/2-f;else if(z(n)){let C=Object.keys(n)[0],R=n[C];v=this.chart.scales[C].getPixelForValue(R)}M=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?P="top":l==="end"&&(P="bottom"));let O=this._getLabelSizes();for(b=0,y=r.length;b<y;++b){_=r[b],x=_.label;let C=o.setContext(this.getContext(b));k=this.getPixelForTick(b)+o.labelOffset,D=this._resolveTickFontOptions(b),S=D.lineHeight,T=F(x)?x.length:1;let R=T/2,H=C.color,V=C.textStrokeColor,st=C.textStrokeWidth,rt,lt=M;if(a?(v=k,M==="inner"&&(lt=b===y-1?this.options.reverse?"left":"right":b===0?this.options.reverse?"right":"left":"center"),A=n==="top"?h==="near"||g!==0?-T*S+S/2:h==="center"?-O.highest.height/2-R*S+S:-O.highest.height+S/2:h==="near"||g!==0?S/2:h==="center"?O.highest.height/2-R*S:O.highest.height-T*S,c&&(A*=-1),g===0||C.showLabelBackdrop||(v+=S/2*Math.sin(g))):(w=k,A=(1-T)*S/2),C.showLabelBackdrop){let ut=et(C.backdropPadding),pt=O.heights[b],mt=O.widths[b],bt=A-ut.top,xt=0-ut.left;switch(P){case"middle":bt-=pt/2;break;case"bottom":bt-=pt}switch(M){case"center":xt-=mt/2;break;case"right":xt-=mt;break;case"inner":b===y-1?xt-=mt:b>0&&(xt-=mt/2)}rt={left:xt,top:bt,width:mt+ut.width,height:pt+ut.height,color:C.backdropColor}}m.push({label:x,font:D,textOffset:A,options:{rotation:g,color:H,strokeColor:V,strokeWidth:st,textAlign:lt,textBaseline:P,translation:[v,w],backdrop:rt}})}return m}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-ct(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,a=t+o,r=this._getLabelSizes().widest.width,l,h;return e==="left"?n?(h=this.right+o,s==="near"?l="left":s==="center"?(l="center",h+=r/2):(l="right",h+=r)):(h=this.right-a,s==="near"?l="right":s==="center"?(l="center",h-=r/2):(l="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?l="right":s==="center"?(l="center",h-=r/2):(l="left",h-=r)):(h=this.left+a,s==="near"?l="left":s==="center"?(l="center",h+=r/2):(l="right",h=this.right)):l="right",{textAlign:l,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,e=this.options.position;return e==="left"||e==="right"?{top:0,left:this.left,bottom:t.height,right:this.right}:e==="top"||e==="bottom"?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){let{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,a),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let s=this.ticks.findIndex(n=>n.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,a,r=(l,h,d)=>{d.width&&d.color&&(s.save(),s.lineWidth=d.width,s.strokeStyle=d.color,s.setLineDash(d.borderDash||[]),s.lineDashOffset=d.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(h.x,h.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=n.length;o<a;++o){let l=n[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;let r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue,h,d,c,u;this.isHorizontal()?(h=zt(t,this.left,a)-a/2,d=zt(t,this.right,r)+r/2,c=u=l):(c=zt(t,this.top,a)-a/2,u=zt(t,this.bottom,r)+r/2,h=d=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(h,c),e.lineTo(d,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;let e=this.ctx,s=this._computeLabelArea();s&&me(e,s);let n=this.getLabelItems(t);for(let o of n){let a=o.options,r=o.font;Ft(e,o.label,0,o.textOffset,r,a)}s&&be(e)}drawTitle(){let{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;let o=J(s.font),a=et(s.padding),r=s.align,l=o.lineHeight/2;e==="bottom"||e==="center"||z(e)?(l+=a.bottom,F(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=a.top;let{titleX:h,titleY:d,maxWidth:c,rotation:u}=function(f,p,g,m){let{top:b,left:y,bottom:_,right:x,chart:v}=f,{chartArea:w,scales:M}=v,k,D,S,T=0,A=_-b,P=x-y;if(f.isHorizontal()){if(D=tt(m,y,x),z(g)){let O=Object.keys(g)[0],C=g[O];S=M[O].getPixelForValue(C)+A-p}else S=g==="center"?(w.bottom+w.top)/2+A-p:Vn(f,g,p);k=x-y}else{if(z(g)){let O=Object.keys(g)[0],C=g[O];D=M[O].getPixelForValue(C)-P+p}else D=g==="center"?(w.left+w.right)/2-P+p:Vn(f,g,p);S=tt(m,_,b),T=g==="left"?-q:q}return{titleX:D,titleY:S,maxWidth:k,rotation:T}}(this,l,e,r);Ft(t,s.text,0,0,o,{color:s.color,maxWidth:c,rotation:u,textAlign:Va(r,e,n),textBaseline:"middle",translation:[h,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,e=t.ticks&&t.ticks.z||0,s=E(t.grid&&t.grid.z,-1),n=E(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Wt.prototype.draw?[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]:[{z:e,draw:o=>{this.draw(o)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[],o,a;for(o=0,a=e.length;o<a;++o){let r=e[o];r[s]!==this.id||t&&r.type!==t||n.push(r)}return n}_resolveTickFontOptions(t){return J(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Qe{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let e=Object.getPrototypeOf(t),s;(function(r){return"id"in r&&"defaults"in r})(e)&&(s=this.register(e));let n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,function(r,l,h){let d=Zt(Object.create(null),[h?U.get(h):{},U.get(l),r.defaults]);U.set(l,d),r.defaultRoutes&&function(c,u){Object.keys(u).forEach(f=>{let p=f.split("."),g=p.pop(),m=[c].concat(p).join("."),b=u[f].split("."),y=b.pop(),_=b.join(".");U.route(m,g,_,y)})}(l,r.defaultRoutes),r.descriptors&&U.describe(l,r.descriptors)}(t,a,s),this.override&&U.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){let e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in U[n]&&(delete U[n][s],this.override&&delete Yt[s])}}class Ba{constructor(){this.controllers=new Qe(At,"datasets",!0),this.elements=new Qe(Mt,"elements"),this.plugins=new Qe(Object,"plugins"),this.scales=new Qe(Wt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{let o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):B(n,a=>{let r=s||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,s){let n=Oe(t);N(s["before"+n],[],s),e[t](s),N(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){let n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var gt=new Ba;class Wa{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let o=n?this._descriptors(t).filter(n):this._descriptors(t),a=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,s,n){n=n||{};for(let o of t){let a=o.plugin;if(N(a[s],[e,n,o.options],a)===!1&&n.cancelable)return!1}return!0}invalidate(){I(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let s=t&&t.config,n=E(s.options&&s.options.plugins,{}),o=function(a){let r={},l=[],h=Object.keys(gt.plugins.items);for(let c=0;c<h.length;c++)l.push(gt.getPlugin(h[c]));let d=a.plugins||[];for(let c=0;c<d.length;c++){let u=d[c];l.indexOf(u)===-1&&(l.push(u),r[u.id]=!0)}return{plugins:l,localIds:r}}(s);return n!==!1||e?function(a,{plugins:r,localIds:l},h,d){let c=[],u=a.getContext();for(let f of r){let p=f.id,g=Na(h[p],d);g!==null&&c.push({plugin:f,options:Ha(a.config,{plugin:f,local:l[p]},g,u)})}return c}(t,o,n,e):[]}_notifyStateChanges(t){let e=this._oldCache||[],s=this._cache,n=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Na(i,t){return t||i!==!1?i===!0?{}:i:null}function Ha(i,{plugin:t,local:e},s,n){let o=i.pluginScopeKeys(t),a=i.getOptionScopes(s,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Zi(i,t){let e=U.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Hn(i){if(i==="x"||i==="y"||i==="r")return i}function Ji(i,...t){if(Hn(i))return i;for(let s of t){let n=s.axis||((e=s.position)==="top"||e==="bottom"?"x":e==="left"||e==="right"?"y":void 0)||i.length>1&&Hn(i[0].toLowerCase());if(n)return n}var e;throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function jn(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function ja(i,t){let e=Yt[i.type]||{scales:{}},s=t.scales||{},n=Zi(i.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{let r=s[a];if(!z(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let l=Ji(a,r,function(c,u){if(u.data&&u.data.datasets){let f=u.data.datasets.filter(p=>p.xAxisID===c||p.yAxisID===c);if(f.length)return jn(c,"x",f[0])||jn(c,"y",f[0])}return{}}(a,i),U.scales[r.type]),h=function(c,u){return c===u?"_index_":"_value_"}(l,n),d=e.scales||{};o[a]=Jt(Object.create(null),[{axis:l},r,d[l],d[h]])}),i.data.datasets.forEach(a=>{let r=a.type||i.type,l=a.indexAxis||Zi(r,t),h=(Yt[r]||{}).scales||{};Object.keys(h).forEach(d=>{let c=function(f,p){let g=f;return f==="_index_"?g=p:f==="_value_"&&(g=p==="x"?"y":"x"),g}(d,l),u=a[c+"AxisID"]||c;o[u]=o[u]||Object.create(null),Jt(o[u],[{axis:c},s[u],h[d]])})}),Object.keys(o).forEach(a=>{let r=o[a];Jt(r,[U.scales[r.type],U.scale])}),o}function $n(i){let t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=ja(i,t)}function Yn(i){return(i=i||{}).datasets=i.datasets||[],i.labels=i.labels||[],i}let Un=new Map,Xn=new Set;function ti(i,t){let e=Un.get(i);return e||(e=t(),Un.set(i,e),Xn.add(e)),e}let Se=(i,t,e)=>{let s=St(t,e);s!==void 0&&i.add(s)};class $a{constructor(t){this._config=function(e){return(e=e||{}).data=Yn(e.data),$n(e),e}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Yn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),$n(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ti(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ti(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ti(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id;return ti(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let s=this._scopeCache,n=s.get(t);return n&&!e||(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){let{options:n,type:o}=this,a=this._cachedScopes(t,s),r=a.get(e);if(r)return r;let l=new Set;e.forEach(d=>{t&&(l.add(t),d.forEach(c=>Se(l,t,c))),d.forEach(c=>Se(l,n,c)),d.forEach(c=>Se(l,Yt[o]||{},c)),d.forEach(c=>Se(l,U,c)),d.forEach(c=>Se(l,Ci,c))});let h=Array.from(l);return h.length===0&&h.push(Object.create(null)),Xn.has(e)&&a.set(e,h),h}chartOptionScopes(){let{options:t,type:e}=this;return[t,Yt[e]||{},U.datasets[e]||{},{type:e},U,Ci]}resolveNamedOptions(t,e,s,n=[""]){let o={$shared:!0},{resolver:a,subPrefixes:r}=qn(this._resolverCache,t,n),l=a;(function(h,d){let{isScriptable:c,isIndexable:u}=Ri(h);for(let f of d){let p=c(f),g=u(f),m=(g||p)&&h[f];if(p&&(Pt(m)||Ya(m))||g&&F(m))return!0}return!1})(a,e)&&(o.$shared=!1,l=Xt(a,s=Pt(s)?s():s,this.createResolver(t,s,r)));for(let h of e)o[h]=l[h];return o}createResolver(t,e,s=[""],n){let{resolver:o}=qn(this._resolverCache,t,s);return z(e)?Xt(o,e,void 0,n):o}}function qn(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));let n=e.join(),o=s.get(n);return o||(o={resolver:Ye(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}let Ya=i=>z(i)&&Object.getOwnPropertyNames(i).some(t=>Pt(i[t])),Ua=["top","bottom","left","right","chartArea"];function Kn(i,t){return i==="top"||i==="bottom"||Ua.indexOf(i)===-1&&t==="x"}function Gn(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Zn(i){let t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),N(e&&e.onComplete,[i],t)}function Xa(i){let t=i.chart,e=t.options.animation;N(e&&e.onProgress,[i],t)}function Jn(i){return Be()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}let ei={},Qn=i=>{let t=Jn(i);return Object.values(ei).filter(e=>e.canvas===t).pop()};function qa(i,t,e){let s=Object.keys(i);for(let n of s){let o=+n;if(o>=t){let a=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=a)}}}function ii(i,t,e){return i.options.clip?i[e]:t[e]}class K{static defaults=U;static instances=ei;static overrides=Yt;static registry=gt;static version="4.4.8";static getChart=Qn;static register(...t){gt.add(...t),to()}static unregister(...t){gt.remove(...t),to()}constructor(t,e){let s=this.config=new $a(e),n=Jn(t),o=Qn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Cn(n)),this.platform.updateConfig(s);let r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,h=l&&l.height,d=l&&l.width;this.id=ht(),this.ctx=r,this.canvas=l,this.width=d,this.height=h,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Wa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=As(c=>this.update(c),a.resizeDelay||0),this._dataChanges=[],ei[this.id]=this,r&&l?(vt.listen(this,"complete",Zn),vt.listen(this,"progress",Xa),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return I(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return gt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ai(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Li(this.canvas,this.ctx),this}stop(){return vt.stop(this),this}resize(t,e){vt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Ai(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),N(s.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){B(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((a,r)=>(a[r]=!1,a),{}),o=[];e&&(o=o.concat(Object.keys(e).map(a=>{let r=e[a],l=Ji(a,r),h=l==="r",d=l==="x";return{options:r,dposition:h?"chartArea":d?"bottom":"left",dtype:h?"radialLinear":d?"category":"linear"}}))),B(o,a=>{let r=a.options,l=r.id,h=Ji(l,r),d=E(r.type,a.dtype);r.position!==void 0&&Kn(r.position,h)===Kn(a.dposition)||(r.position=a.dposition),n[l]=!0;let c=null;l in s&&s[l].type===d?c=s[l]:(c=new(gt.getScale(d))({id:l,type:d,ctx:this.ctx,chart:this}),s[c.id]=c),c.init(r,t)}),B(n,(a,r)=>{a||delete s[r]}),B(s,a=>{it.configure(this,a,a.options),it.addBox(this,a)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Gn("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){let o=e[s],a=this.getDatasetMeta(s),r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=r,a.indexAxis=o.indexAxis||Zi(r,this.options),a.order=o.order||0,a.index=s,a.label=""+o.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{let l=gt.getController(r),{datasetElementType:h,dataElementType:d}=U.datasets[r];Object.assign(l,{dataElementType:gt.getElement(d),datasetElementType:h&>.getElement(h)}),a.controller=new l(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){B(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let h=0,d=this.data.datasets.length;h<d;h++){let{controller:c}=this.getDatasetMeta(h),u=!n&&o.indexOf(c)===-1;c.buildOrUpdateElements(u),a=Math.max(+c.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),n||B(o,h=>{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Gn("z","_idx"));let{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){B(this.scales,t=>{it.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);ci(e,s)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:s,start:n,count:o}of e)qa(t,n,s==="_removeElements"?-o:o)}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!ci(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;it.update(this,this.width,this.height,t);let e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],B(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,Pt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(vt.has(this)?this.attached&&!vt.running(this)&&vt.start(this):(this.draw(),Zn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let e=this._sortedMetasets,s=[],n,o;for(n=0,o=e.length;n<o;++n){let a=e[n];t&&!a.visible||s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,s=t._clip,n=!s.disabled,o=function(r,l){let{xScale:h,yScale:d}=r;return h&&d?{left:ii(h,l,"left"),right:ii(h,l,"right"),top:ii(d,l,"top"),bottom:ii(d,l,"bottom")}:l}(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(n&&me(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&be(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return wt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){let o=mn.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],s=this._metasets,n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Ot(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){let n=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);Qt(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(r=>r.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),vt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Li(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ei[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,e=this.platform,s=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},n=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};B(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,s=(l,h)=>{e.addEventListener(this,l,h),t[l]=h},n=(l,h)=>{t[l]&&(e.removeEventListener(this,l,h),delete t[l])},o=(l,h)=>{this.canvas&&this.resize(l,h)},a,r=()=>{n("attach",r),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){B(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},B(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){let n=s?"set":"remove",o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];let h=a&&this.getDatasetMeta(a.datasetIndex).controller;h&&h[n+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],s=t.map(({datasetIndex:n,index:o})=>{let a=this.getDatasetMeta(n);if(!a)throw new Error("No dataset found at index "+n);return{datasetIndex:n,element:a.data[o],index:o}});!Ht(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){let n=this.options.hover,o=(l,h)=>l.filter(d=>!h.some(c=>d.datasetIndex===c.datasetIndex&&d.index===c.index)),a=o(e,t),r=s?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){let s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;let o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){let{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,s,a),l=_s(t),h=function(c,u,f,p){return f&&c.type!=="mouseout"?p?u:c:null}(t,this._lastEvent,s,l);s&&(this._lastEvent=null,N(o.onHover,[t,r,this],this),l&&N(o.onClick,[t,r,this],this));let d=!Ht(r,n);return(d||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=h,d}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}function to(){return B(K.instances,i=>i._plugins.invalidate())}function Kt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Qi{static override(t){Object.assign(Qi.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Kt()}parse(){return Kt()}format(){return Kt()}add(){return Kt()}diff(){return Kt()}startOf(){return Kt()}endOf(){return Kt()}}var eo={_date:Qi};function Ka(i){let t=i.iScale,e=function(h,d){if(!h._cache.$bar){let c=h.getMatchingVisibleMetas(d),u=[];for(let f=0,p=c.length;f<p;f++)u=u.concat(c[f].controller.getAllParsedValues(h));h._cache.$bar=bi(u.sort((f,p)=>f-p))}return h._cache.$bar}(t,i.type),s,n,o,a,r=t._length,l=()=>{o!==32767&&o!==-32768&&(Qt(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=e.length;s<n;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,n=t.ticks.length;s<n;++s)o=t.getPixelForTick(s),l();return r}function io(i,t,e,s){return F(i)?function(n,o,a,r){let l=a.parse(n[0],r),h=a.parse(n[1],r),d=Math.min(l,h),c=Math.max(l,h),u=d,f=c;Math.abs(d)>Math.abs(c)&&(u=c,f=d),o[a.axis]=f,o._custom={barStart:u,barEnd:f,start:l,end:h,min:d,max:c}}(i,t,e,s):t[e.axis]=e.parse(i,s),t}function so(i,t,e,s){let n=i.iScale,o=i.vScale,a=n.getLabels(),r=n===o,l=[],h,d,c,u;for(h=e,d=e+s;h<d;++h)u=t[h],c={},c[n.axis]=r||n.parse(a[h],h),l.push(io(u,c,o,h));return l}function ts(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function Ga(i,t,e,s){let n=t.borderSkipped,o={};if(!n)return void(i.borderSkipped=o);if(n===!0)return void(i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});let{start:a,end:r,reverse:l,top:h,bottom:d}=function(c){let u,f,p,g,m;return c.horizontal?(u=c.base>c.x,f="left",p="right"):(u=c.base<c.y,f="bottom",p="top"),u?(g="end",m="start"):(g="start",m="end"),{start:f,end:p,reverse:u,top:g,bottom:m}}(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=h:(e._bottom||0)===s?n=d:(o[no(d,a,r,l)]=!0,n=h)),o[no(n,a,r,l)]=!0,i.borderSkipped=o}function no(i,t,e,s){var n,o,a;return s?(a=e,i=oo(i=(n=i)===(o=t)?a:n===a?o:n,e,t)):i=oo(i,t,e),i}function oo(i,t,e){return i==="start"?t:i==="end"?e:i}function Za(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class es extends At{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,a)=>{let r=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:n,lineWidth:r.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}};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){let s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o,a,r=l=>+s[l];if(z(s[t])){let{key:l="value"}=this._parsing;r=h=>+St(s[h],l)}for(o=t,a=t+e;o<a;++o)n._parsed[o]=r(o)}}_getRotation(){return ct(this.options.rotation-90)}_getCircumference(){return ct(this.options.circumference)}_getRotationExtents(){let t=Y,e=-Y;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){let n=this.chart.getDatasetMeta(s).controller,o=n._getRotation(),a=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){let e=this.chart,{chartArea:s}=e,n=this._cachedMeta,o=n.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(s.width,s.height)-a)/2,0),l=Math.min(j(this.options.cutout,r),1),h=this._getRingWeight(this.index),{circumference:d,rotation:c}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:p,offsetY:g}=function(v,w,M){let k=1,D=1,S=0,T=0;if(w<Y){let A=v,P=A+w,O=Math.cos(A),C=Math.sin(A),R=Math.cos(P),H=Math.sin(P),V=(mt,bt,xt)=>ee(mt,A,P,!0)?1:Math.max(bt,bt*M,xt,xt*M),st=(mt,bt,xt)=>ee(mt,A,P,!0)?-1:Math.min(bt,bt*M,xt,xt*M),rt=V(0,O,R),lt=V(q,C,H),ut=st($,O,R),pt=st($+q,C,H);k=(rt-ut)/2,D=(lt-pt)/2,S=-(rt+ut)/2,T=-(lt+pt)/2}return{ratioX:k,ratioY:D,offsetX:S,offsetY:T}}(c,d,l),m=(s.width-a)/u,b=(s.height-a)/f,y=Math.max(Math.min(m,b)/2,0),_=Z(this.options.radius,y),x=(_-Math.max(_*l,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=g*_,n.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*h,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){let s=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/Y)}updateElements(t,e,s,n){let o=n==="reset",a=this.chart,r=a.chartArea,l=a.options.animation,h=(r.left+r.right)/2,d=(r.top+r.bottom)/2,c=o&&l.animateScale,u=c?0:this.innerRadius,f=c?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(e,n),m,b=this._getRotation();for(m=0;m<e;++m)b+=this._circumference(m,o);for(m=e;m<e+s;++m){let y=this._circumference(m,o),_=t[m],x={x:h+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+y,circumference:y,outerRadius:f,innerRadius:u};g&&(x.options=p||this.resolveDataElementOptions(m,_.active?"active":n)),b+=y,this.updateElement(_,m,x,n)}}calculateTotal(){let t=this._cachedMeta,e=t.data,s,n=0;for(s=0;s<e.length;s++){let o=t._parsed[s];o===null||isNaN(o)||!this.chart.getDataVisibility(s)||e[s].hidden||(n+=Math.abs(o))}return n}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?Y*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=se(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0,s=this.chart,n,o,a,r,l;if(!t){for(n=0,o=s.data.datasets.length;n<o;++n)if(s.isDatasetVisible(n)){a=s.getDatasetMeta(n),t=a.data,r=a.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)l=r.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,n=t.length;s<n;++s){let o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class ao extends At{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,a)=>{let r=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:n,lineWidth:r.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=se(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return Fi.bind(this)(t,e,s,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{let o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),a=(o-Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,s,n){let o=n==="reset",a=this.chart,r=a.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,d=l.yCenter,c=l.getIndexAngle(0)-.5*$,u,f=c,p=360/this.countVisibleElements();for(u=0;u<e;++u)f+=this._computeAngle(u,n,p);for(u=e;u<e+s;u++){let g=t[u],m=f,b=f+this._computeAngle(u,n,p),y=a.getDataVisibility(u)?l.getDistanceFromCenterForValue(this.getParsed(u).r):0;f=b,o&&(r.animateScale&&(y=0),r.animateRotate&&(m=b=c));let _={x:h,y:d,innerRadius:0,outerRadius:y,startAngle:m,endAngle:b,options:this.resolveDataElementOptions(u,g.active?"active":n)};this.updateElement(g,u,_,n)}}countVisibleElements(){let t=this._cachedMeta,e=0;return t.data.forEach((s,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?ct(this.resolveDataElementOptions(t,e).angle||s):0}}var ro=Object.freeze({__proto__:null,BarController:class extends At{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(i,t,e,s){return so(i,t,e,s)}parseArrayData(i,t,e,s){return so(i,t,e,s)}parseObjectData(i,t,e,s){let{iScale:n,vScale:o}=i,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=n.axis==="x"?a:r,h=o.axis==="x"?a:r,d=[],c,u,f,p;for(c=e,u=e+s;c<u;++c)p=t[c],f={},f[n.axis]=n.parse(St(p,l),c),d.push(io(St(p,h),f,o,c));return d}updateRangeFromParsed(i,t,e,s){super.updateRangeFromParsed(i,t,e,s);let n=e._custom;n&&t===this._cachedMeta.vScale&&(i.min=Math.min(i.min,n.min),i.max=Math.max(i.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(i){let t=this._cachedMeta,{iScale:e,vScale:s}=t,n=this.getParsed(i),o=n._custom,a=ts(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+e.getLabelForValue(n[e.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(i){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,i)}updateElements(i,t,e,s){let n=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,r=a.getBasePixel(),l=a.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:c}=this._getSharedOptions(t,s);for(let u=t;u<t+e;u++){let f=this.getParsed(u),p=n||I(f[a.axis])?{base:r,head:r}:this._calculateBarValuePixels(u),g=this._calculateBarIndexPixels(u,h),m=(f._stacks||{})[a.axis],b={horizontal:l,base:p.base,enableBorderRadius:!m||ts(f._custom)||o===m._top||o===m._bottom,x:l?p.head:g.center,y:l?g.center:p.head,height:l?g.size:Math.abs(p.size),width:l?Math.abs(p.size):g.size};c&&(b.options=d||this.resolveDataElementOptions(u,i[u].active?"active":s));let y=b.options||i[u].options;Ga(b,y,m,o),Za(b,y,h.ratio),this.updateElement(i[u],u,b,s)}}_getStacks(i,t){let{iScale:e}=this._cachedMeta,s=e.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),n=e.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(t),r=a&&a[e.axis],l=h=>{let d=h._parsed.find(u=>u[e.axis]===r),c=d&&d[h.vScale.axis];if(I(c)||isNaN(c))return!0};for(let h of s)if((t===void 0||!l(h))&&((n===!1||o.indexOf(h.stack)===-1||n===void 0&&h.stack===void 0)&&o.push(h.stack),h.index===i))break;return o.length||o.push(void 0),o}_getStackCount(i){return this._getStacks(void 0,i).length}_getStackIndex(i,t,e){let s=this._getStacks(i,e),n=t!==void 0?s.indexOf(t):-1;return n===-1?s.length-1:n}_getRuler(){let i=this.options,t=this._cachedMeta,e=t.iScale,s=[],n,o;for(n=0,o=t.data.length;n<o;++n)s.push(e.getPixelForValue(this.getParsed(n)[e.axis],n));let a=i.barThickness;return{min:a||Ka(t),pixels:s,start:e._startPixel,end:e._endPixel,stackCount:this._getStackCount(),scale:e,grouped:i.grouped,ratio:a?1:i.categoryPercentage*i.barPercentage}}_calculateBarValuePixels(i){let{_cachedMeta:{vScale:t,_stacked:e,index:s},options:{base:n,minBarLength:o}}=this,a=n||0,r=this.getParsed(i),l=r._custom,h=ts(l),d,c,u=r[t.axis],f=0,p=e?this.applyStack(t,r,e):u;p!==u&&(f=p-u,p=u),h&&(u=l.barStart,p=l.barEnd-l.barStart,u!==0&&ft(u)!==ft(l.barEnd)&&(f=0),f+=u);let g=I(n)||h?f:n,m=t.getPixelForValue(g);if(d=this.chart.getDataVisibility(i)?t.getPixelForValue(f+p):m,c=d-m,Math.abs(c)<o){c=function(v,w,M){return v!==0?ft(v):(w.isHorizontal()?1:-1)*(w.min>=M?1:-1)}(c,t,a)*o,u===a&&(m-=c/2);let b=t.getPixelForDecimal(0),y=t.getPixelForDecimal(1),_=Math.min(b,y),x=Math.max(b,y);m=Math.max(Math.min(m,x),_),d=m+c,e&&!h&&(r._stacks[t.axis]._visualValues[s]=t.getValueForPixel(d)-t.getValueForPixel(m))}if(m===t.getPixelForValue(a)){let b=ft(c)*t.getLineWidthForValue(a)/2;m+=b,c-=b}return{size:c,base:m,head:d,center:d+c/2}}_calculateBarIndexPixels(i,t){let e=t.scale,s=this.options,n=s.skipNull,o=E(s.maxBarThickness,1/0),a,r;if(t.grouped){let l=n?this._getStackCount(i):t.stackCount,h=s.barThickness==="flex"?function(c,u,f,p){let g=u.pixels,m=g[c],b=c>0?g[c-1]:null,y=c<g.length-1?g[c+1]:null,_=f.categoryPercentage;b===null&&(b=m-(y===null?u.end-u.start:y-m)),y===null&&(y=m+m-b);let x=m-(m-Math.min(b,y))/2*_;return{chunk:Math.abs(y-b)/2*_/p,ratio:f.barPercentage,start:x}}(i,t,s,l):function(c,u,f,p){let g=f.barThickness,m,b;return I(g)?(m=u.min*f.categoryPercentage,b=f.barPercentage):(m=g*p,b=1),{chunk:m/p,ratio:b,start:u.pixels[c]-m/2}}(i,t,s,l),d=this._getStackIndex(this.index,this._cachedMeta.stack,n?i:void 0);a=h.start+h.chunk*d+h.chunk/2,r=Math.min(o,h.chunk*h.ratio)}else a=e.getPixelForValue(this.getParsed(i)[e.axis],i),r=Math.min(o,t.min*t.ratio);return{base:a-r/2,head:a+r/2,center:a,size:r}}draw(){let i=this._cachedMeta,t=i.vScale,e=i.data,s=e.length,n=0;for(;n<s;++n)this.getParsed(n)[t.axis]===null||e[n].hidden||e[n].draw(this._ctx)}},BubbleController:class extends At{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(i,t,e,s){let n=super.parsePrimitiveData(i,t,e,s);for(let o=0;o<n.length;o++)n[o]._custom=this.resolveDataElementOptions(o+e).radius;return n}parseArrayData(i,t,e,s){let n=super.parseArrayData(i,t,e,s);for(let o=0;o<n.length;o++){let a=t[e+o];n[o]._custom=E(a[2],this.resolveDataElementOptions(o+e).radius)}return n}parseObjectData(i,t,e,s){let n=super.parseObjectData(i,t,e,s);for(let o=0;o<n.length;o++){let a=t[e+o];n[o]._custom=E(a&&a.r&&+a.r,this.resolveDataElementOptions(o+e).radius)}return n}getMaxOverflow(){let i=this._cachedMeta.data,t=0;for(let e=i.length-1;e>=0;--e)t=Math.max(t,i[e].size(this.resolveDataElementOptions(e))/2);return t>0&&t}getLabelAndValue(i){let t=this._cachedMeta,e=this.chart.data.labels||[],{xScale:s,yScale:n}=t,o=this.getParsed(i),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y),l=o._custom;return{label:e[i]||"",value:"("+a+", "+r+(l?", "+l:"")+")"}}update(i){let t=this._cachedMeta.data;this.updateElements(t,0,t.length,i)}updateElements(i,t,e,s){let n=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:r,includeOptions:l}=this._getSharedOptions(t,s),h=o.axis,d=a.axis;for(let c=t;c<t+e;c++){let u=i[c],f=!n&&this.getParsed(c),p={},g=p[h]=n?o.getPixelForDecimal(.5):o.getPixelForValue(f[h]),m=p[d]=n?a.getBasePixel():a.getPixelForValue(f[d]);p.skip=isNaN(g)||isNaN(m),l&&(p.options=r||this.resolveDataElementOptions(c,u.active?"active":s),n&&(p.options.radius=0)),this.updateElement(u,c,p,s)}}resolveDataElementOptions(i,t){let e=this.getParsed(i),s=super.resolveDataElementOptions(i,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let n=s.radius;return t!=="active"&&(s.radius=0),s.radius+=E(e&&e._custom,n),s}},DoughnutController:es,LineController:class extends At{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(i){let t=this._cachedMeta,{dataset:e,data:s=[],_dataset:n}=t,o=this.chart._animationsDisabled,{start:a,count:r}=yi(t,s,o);this._drawStart=a,this._drawCount=r,vi(t)&&(a=0,r=s.length),e._chart=this.chart,e._datasetIndex=this.index,e._decimated=!!n._decimated,e.points=s;let l=this.resolveDatasetElementOptions(i);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(e,void 0,{animated:!o,options:l},i),this.updateElements(s,a,r,i)}updateElements(i,t,e,s){let n=s==="reset",{iScale:o,vScale:a,_stacked:r,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(t,s),c=o.axis,u=a.axis,{spanGaps:f,segment:p}=this.options,g=$t(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||n||s==="none",b=t+e,y=i.length,_=t>0&&this.getParsed(t-1);for(let x=0;x<y;++x){let v=i[x],w=m?v:{};if(x<t||x>=b){w.skip=!0;continue}let M=this.getParsed(x),k=I(M[u]),D=w[c]=o.getPixelForValue(M[c],x),S=w[u]=n||k?a.getBasePixel():a.getPixelForValue(r?this.applyStack(a,M,r):M[u],x);w.skip=isNaN(D)||isNaN(S)||k,w.stop=x>0&&Math.abs(M[c]-_[c])>g,p&&(w.parsed=M,w.raw=l.data[x]),d&&(w.options=h||this.resolveDataElementOptions(x,v.active?"active":s)),m||this.updateElement(v,x,w,s),_=M}}getMaxOverflow(){let i=this._cachedMeta,t=i.dataset,e=t.options&&t.options.borderWidth||0,s=i.data||[];if(!s.length)return e;let n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(e,n,o)/2}draw(){let i=this._cachedMeta;i.dataset.updateControlPoints(this.chart.chartArea,i.iScale.axis),super.draw()}},PieController:class extends es{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:ao,RadarController:class extends At{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(i){let t=this._cachedMeta.vScale,e=this.getParsed(i);return{label:t.getLabels()[i],value:""+t.getLabelForValue(e[t.axis])}}parseObjectData(i,t,e,s){return Fi.bind(this)(i,t,e,s)}update(i){let t=this._cachedMeta,e=t.dataset,s=t.data||[],n=t.iScale.getLabels();if(e.points=s,i!=="resize"){let o=this.resolveDatasetElementOptions(i);this.options.showLine||(o.borderWidth=0);let a={_loop:!0,_fullLoop:n.length===s.length,options:o};this.updateElement(e,void 0,a,i)}this.updateElements(s,0,s.length,i)}updateElements(i,t,e,s){let n=this._cachedMeta.rScale,o=s==="reset";for(let a=t;a<t+e;a++){let r=i[a],l=this.resolveDataElementOptions(a,r.active?"active":s),h=n.getPointPositionForValue(a,this.getParsed(a).r),d=o?n.xCenter:h.x,c=o?n.yCenter:h.y,u={x:d,y:c,angle:h.angle,skip:isNaN(d)||isNaN(c),options:l};this.updateElement(r,a,u,s)}}},ScatterController:class extends At{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(i){let t=this._cachedMeta,e=this.chart.data.labels||[],{xScale:s,yScale:n}=t,o=this.getParsed(i),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y);return{label:e[i]||"",value:"("+a+", "+r+")"}}update(i){let t=this._cachedMeta,{data:e=[]}=t,s=this.chart._animationsDisabled,{start:n,count:o}=yi(t,e,s);if(this._drawStart=n,this._drawCount=o,vi(t)&&(n=0,o=e.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:a,_dataset:r}=t;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!r._decimated,a.points=e;let l=this.resolveDatasetElementOptions(i);l.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:l},i)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(e,n,o,i)}addElements(){let{showLine:i}=this.options;!this.datasetElementType&&i&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(i,t,e,s){let n=s==="reset",{iScale:o,vScale:a,_stacked:r,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(t,s),d=this.getSharedOptions(h),c=this.includeOptions(s,d),u=o.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,m=$t(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||n||s==="none",y=t>0&&this.getParsed(t-1);for(let _=t;_<t+e;++_){let x=i[_],v=this.getParsed(_),w=b?x:{},M=I(v[f]),k=w[u]=o.getPixelForValue(v[u],_),D=w[f]=n||M?a.getBasePixel():a.getPixelForValue(r?this.applyStack(a,v,r):v[f],_);w.skip=isNaN(k)||isNaN(D)||M,w.stop=_>0&&Math.abs(v[u]-y[u])>m,g&&(w.parsed=v,w.raw=l.data[_]),c&&(w.options=d||this.resolveDataElementOptions(_,x.active?"active":s)),b||this.updateElement(x,_,w,s),y=v}this.updateSharedOptions(d,s,h)}getMaxOverflow(){let i=this._cachedMeta,t=i.data||[];if(!this.options.showLine){let a=0;for(let r=t.length-1;r>=0;--r)a=Math.max(a,t[r].size(this.resolveDataElementOptions(r))/2);return a>0&&a}let e=i.dataset,s=e.options&&e.options.borderWidth||0;if(!t.length)return s;let n=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,n,o)/2}}});function Ja(i,t,e,s){let n=qe(i.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(e-t)/2,a=Math.min(o,s*t/2),r=l=>{let h=(e-Math.min(o,l))*s/2;return Q(l,0,Math.min(o,h))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:Q(n.innerStart,0,a),innerEnd:Q(n.innerEnd,0,a)}}function le(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function si(i,t,e,s,n,o){let{x:a,y:r,startAngle:l,pixelMargin:h,innerRadius:d}=t,c=Math.max(t.outerRadius+s+e-h,0),u=d>0?d+s+e+h:0,f=0,p=n-l;if(s){let O=((d>0?d-s:0)+(c>0?c-s:0))/2;f=(p-(O!==0?p*O/(O+s):p))/2}let g=(p-Math.max(.001,p*c-e/$)/c)/2,m=l+g+f,b=n-g-f,{outerStart:y,outerEnd:_,innerStart:x,innerEnd:v}=Ja(t,u,c,b-m),w=c-y,M=c-_,k=m+y/w,D=b-_/M,S=u+x,T=u+v,A=m+x/S,P=b-v/T;if(i.beginPath(),o){let O=(k+D)/2;if(i.arc(a,r,c,k,O),i.arc(a,r,c,O,D),_>0){let V=le(M,D,a,r);i.arc(V.x,V.y,_,D,b+q)}let C=le(T,b,a,r);if(i.lineTo(C.x,C.y),v>0){let V=le(T,P,a,r);i.arc(V.x,V.y,v,b+q,P+Math.PI)}let R=(b-v/u+(m+x/u))/2;if(i.arc(a,r,u,b-v/u,R,!0),i.arc(a,r,u,R,m+x/u,!0),x>0){let V=le(S,A,a,r);i.arc(V.x,V.y,x,A+Math.PI,m-q)}let H=le(w,m,a,r);if(i.lineTo(H.x,H.y),y>0){let V=le(w,k,a,r);i.arc(V.x,V.y,y,m-q,k)}}else{i.moveTo(a,r);let O=Math.cos(k)*c+a,C=Math.sin(k)*c+r;i.lineTo(O,C);let R=Math.cos(D)*c+a,H=Math.sin(D)*c+r;i.lineTo(R,H)}i.closePath()}function Qa(i,t,e,s,n){let{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:h,borderJoinStyle:d,borderDash:c,borderDashOffset:u}=l,f=l.borderAlign==="inner";if(!h)return;i.setLineDash(c||[]),i.lineDashOffset=u,f?(i.lineWidth=2*h,i.lineJoin=d||"round"):(i.lineWidth=h,i.lineJoin=d||"bevel");let p=t.endAngle;if(o){si(i,t,e,s,p,n);for(let g=0;g<o;++g)i.stroke();isNaN(r)||(p=a+(r%Y||Y))}f&&function(g,m,b){let{startAngle:y,pixelMargin:_,x,y:v,outerRadius:w,innerRadius:M}=m,k=_/w;g.beginPath(),g.arc(x,v,w,y-k,b+k),M>_?(k=_/M,g.arc(x,v,M,b+k,y-k,!0)):g.arc(x,v,_,b+q,y-q),g.closePath(),g.clip()}(i,t,p),o||(si(i,t,e,s,p,n),i.stroke())}function lo(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function tr(i,t,e){i.lineTo(e.x,e.y)}function ho(i,t,e={}){let s=i.length,{start:n=0,end:o=s-1}=e,{start:a,end:r}=t,l=Math.max(n,a),h=Math.min(o,r),d=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:t.loop,ilen:h<l&&!d?s+h-l:h-l}}function er(i,t,e,s){let{points:n,options:o}=t,{count:a,start:r,loop:l,ilen:h}=ho(n,e,s),d=function(m){return m.stepped?Us:m.tension||m.cubicInterpolationMode==="monotone"?Xs:tr}(o),c,u,f,{move:p=!0,reverse:g}=s||{};for(c=0;c<=h;++c)u=n[(r+(g?h-c:c))%a],u.skip||(p?(i.moveTo(u.x,u.y),p=!1):d(i,f,u,g,o.stepped),f=u);return l&&(u=n[(r+(g?h:0))%a],d(i,f,u,g,o.stepped)),!!l}function ir(i,t,e,s){let n=t.points,{count:o,start:a,ilen:r}=ho(n,e,s),{move:l=!0,reverse:h}=s||{},d,c,u,f,p,g,m=0,b=0,y=x=>(a+(h?r-x:x))%o,_=()=>{f!==p&&(i.lineTo(m,p),i.lineTo(m,f),i.lineTo(m,g))};for(l&&(c=n[y(0)],i.moveTo(c.x,c.y)),d=0;d<=r;++d){if(c=n[y(d)],c.skip)continue;let x=c.x,v=c.y,w=0|x;w===u?(v<f?f=v:v>p&&(p=v),m=(b*m+x)/++b):(_(),i.lineTo(x,v),u=w,b=0,f=p=v),g=v}_()}function is(i){let t=i.options,e=t.borderDash&&t.borderDash.length;return i._decimated||i._loop||t.tension||t.cubicInterpolationMode==="monotone"||t.stepped||e?er:ir}let sr=typeof Path2D=="function";function nr(i,t,e,s){sr&&!t.options.segment?function(n,o,a,r){let l=o._path;l||(l=o._path=new Path2D,o.path(l,a,r)&&l.closePath()),lo(n,o.options),n.stroke(l)}(i,t,e,s):function(n,o,a,r){let{segments:l,options:h}=o,d=is(o);for(let c of l)lo(n,h,c.style),n.beginPath(),d(n,o,c,{start:a,end:a+r-1})&&n.closePath(),n.stroke()}(i,t,e,s)}class ni extends Mt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){let n=s.spanGaps?this._loop:this._fullLoop;sn(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=un(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){let s=this.options,n=t[e],o=this.points,a=Hi(this,{property:e,start:n,end:n});if(!a.length)return;let r=[],l=function(c){return c.stepped?an:c.tension||c.cubicInterpolationMode==="monotone"?rn:Vt}(s),h,d;for(h=0,d=a.length;h<d;++h){let{start:c,end:u}=a[h],f=o[c],p=o[u];if(f===p){r.push(f);continue}let g=l(f,p,Math.abs((n-f[e])/(p[e]-f[e])),s.stepped);g[e]=t[e],r.push(g)}return r.length===1?r[0]:r}pathSegment(t,e,s){return is(this)(t,this,e,s)}path(t,e,s){let n=this.segments,o=is(this),a=this._loop;e=e||0,s=s||this.points.length-e;for(let r of n)a&=o(t,this,r,{start:e,end:e+s-1});return!!a}draw(t,e,s,n){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),nr(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function co(i,t,e,s){let n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}function uo(i,t){let{x:e,y:s,base:n,width:o,height:a}=i.getProps(["x","y","base","width","height"],t),r,l,h,d,c;return i.horizontal?(c=a/2,r=Math.min(e,n),l=Math.max(e,n),h=s-c,d=s+c):(c=o/2,r=e-c,l=e+c,h=Math.min(s,n),d=Math.max(s,n)),{left:r,top:h,right:l,bottom:d}}function Nt(i,t,e,s){return i?0:Q(t,e,s)}function or(i){let t=uo(i),e=t.right-t.left,s=t.bottom-t.top,n=function(a,r,l){let h=a.options.borderWidth,d=a.borderSkipped,c=Vi(h);return{t:Nt(d.top,c.top,0,l),r:Nt(d.right,c.right,0,r),b:Nt(d.bottom,c.bottom,0,l),l:Nt(d.left,c.left,0,r)}}(i,e/2,s/2),o=function(a,r,l){let{enableBorderRadius:h}=a.getProps(["enableBorderRadius"]),d=a.options.borderRadius,c=Bt(d),u=Math.min(r,l),f=a.borderSkipped,p=h||z(d);return{topLeft:Nt(!p||f.top||f.left,c.topLeft,0,u),topRight:Nt(!p||f.top||f.right,c.topRight,0,u),bottomLeft:Nt(!p||f.bottom||f.left,c.bottomLeft,0,u),bottomRight:Nt(!p||f.bottom||f.right,c.bottomRight,0,u)}}(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function ss(i,t,e,s){let n=t===null,o=e===null,a=i&&!(n&&o)&&uo(i,s);return a&&(n||_t(t,a.left,a.right))&&(o||_t(e,a.top,a.bottom))}function ar(i,t){i.rect(t.x,t.y,t.w,t.h)}function ns(i,t,e={}){let s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,a=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+a,radius:i.radius}}var os=Object.freeze({__proto__:null,ArcElement:class extends Mt{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:i=>i!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(i){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,i&&Object.assign(this,i)}inRange(i,t,e){let s=this.getProps(["x","y"],e),{angle:n,distance:o}=pi(s,{x:i,y:t}),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],e),c=(this.options.spacing+this.options.borderWidth)/2,u=E(d,r-a),f=ee(n,a,r)&&a!==r,p=u>=Y||f,g=_t(o,l+c,h+c);return p&&g}getCenterPoint(i){let{x:t,y:e,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:r,spacing:l}=this.options,h=(s+n)/2,d=(o+a+l+r)/2;return{x:t+Math.cos(h)*d,y:e+Math.sin(h)*d}}tooltipPosition(i){return this.getCenterPoint(i)}draw(i){let{options:t,circumference:e}=this,s=(t.offset||0)/4,n=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=e>Y?Math.floor(e/Y):0,e===0||this.innerRadius<0||this.outerRadius<0)return;i.save();let a=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(a)*s,Math.sin(a)*s);let r=s*(1-Math.sin(Math.min($,e||0)));i.fillStyle=t.backgroundColor,i.strokeStyle=t.borderColor,function(l,h,d,c,u){let{fullCircles:f,startAngle:p,circumference:g}=h,m=h.endAngle;if(f){si(l,h,d,c,m,u);for(let b=0;b<f;++b)l.fill();isNaN(g)||(m=p+(g%Y||Y))}si(l,h,d,c,m,u),l.fill()}(i,this,r,n,o),Qa(i,this,r,n,o),i.restore()}},BarElement:class extends Mt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(i){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,i&&Object.assign(this,i)}draw(i){let{inflateAmount:t,options:{borderColor:e,backgroundColor:s}}=this,{inner:n,outer:o}=or(this),a=(r=o.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?ne:ar;var r;i.save(),o.w===n.w&&o.h===n.h||(i.beginPath(),a(i,ns(o,t,n)),i.clip(),a(i,ns(n,-t,o)),i.fillStyle=e,i.fill("evenodd")),i.beginPath(),a(i,ns(n,t)),i.fillStyle=s,i.fill(),i.restore()}inRange(i,t,e){return ss(this,i,t,e)}inXRange(i,t){return ss(this,i,null,t)}inYRange(i,t){return ss(this,null,i,t)}getCenterPoint(i){let{x:t,y:e,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],i);return{x:n?(t+s)/2:t,y:n?e:(e+s)/2}}getRange(i){return i==="x"?this.width/2:this.height/2}},LineElement:ni,PointElement:class extends Mt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(i){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,i&&Object.assign(this,i)}inRange(i,t,e){let s=this.options,{x:n,y:o}=this.getProps(["x","y"],e);return Math.pow(i-n,2)+Math.pow(t-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(i,t){return co(this,i,"x",t)}inYRange(i,t){return co(this,i,"y",t)}getCenterPoint(i){let{x:t,y:e}=this.getProps(["x","y"],i);return{x:t,y:e}}size(i){let t=(i=i||this.options||{}).radius||0;return t=Math.max(t,t&&i.hoverRadius||0),2*(t+(t&&i.borderWidth||0))}draw(i,t){let e=this.options;this.skip||e.radius<.1||!wt(this,t,this.size(e)/2)||(i.strokeStyle=e.borderColor,i.lineWidth=e.borderWidth,i.fillStyle=e.backgroundColor,$e(i,e,this.x,this.y))}getRange(){let i=this.options||{};return i.radius+i.hitRadius}}});function rr(i,t,e,s){let n=i.indexOf(t);return n===-1?((o,a,r,l)=>(typeof a=="string"?(r=o.push(a)-1,l.unshift({index:r,label:a})):isNaN(a)&&(r=null),r))(i,t,e,s):n!==i.lastIndexOf(t)?e:n}function fo(i){let t=this.getLabels();return i>=0&&i<t.length?t[i]:i}function go(i,t,{horizontal:e,minRotation:s}){let n=ct(s),o=(e?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class oi extends Wt{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 I(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds(),{min:n,max:o}=this,a=l=>n=e?n:l,r=l=>o=s?o:l;if(t){let l=ft(n),h=ft(o);l<0&&h<0?r(0):l>0&&h>0&&a(0)}if(n===o){let l=o===0?1:Math.abs(.05*o);r(o+l),t||a(n-l)}this.min=n,this.max=o}getTickLimit(){let t=this.options.ticks,e,{maxTicksLimit:s,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),s=s||11),s&&(e=Math.min(s,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,s=this.getTickLimit();s=Math.max(2,s);let n=function(o,a){let r=[],{bounds:l,step:h,min:d,max:c,precision:u,count:f,maxTicks:p,maxDigits:g,includeBounds:m}=o,b=h||1,y=p-1,{min:_,max:x}=a,v=!I(d),w=!I(c),M=!I(f),k=(x-_)/(g+1),D,S,T,A,P=ui((x-_)/y/b)*b;if(P<1e-14&&!v&&!w)return[{value:_},{value:x}];A=Math.ceil(x/P)-Math.floor(_/P),A>y&&(P=ui(A*P/y/b)*b),I(u)||(D=Math.pow(10,u),P=Math.ceil(P*D)/D),l==="ticks"?(S=Math.floor(_/P)*P,T=Math.ceil(x/P)*P):(S=_,T=x),v&&w&&h&&Ms((c-d)/h,P/1e3)?(A=Math.round(Math.min((c-d)/P,p)),P=(c-d)/A,S=d,T=c):M?(S=v?d:S,T=w?c:T,A=f-1,P=(T-S)/A):(A=(T-S)/P,A=te(A,Math.round(A),P/1e3)?Math.round(A):Math.ceil(A));let O=Math.max(gi(P),gi(S));D=Math.pow(10,I(u)?O:u),S=Math.round(S*D)/D,T=Math.round(T*D)/D;let C=0;for(v&&(m&&S!==d?(r.push({value:d}),S<d&&C++,te(Math.round((S+C*P)*D)/D,d,go(d,k,o))&&C++):S<d&&C++);C<A;++C){let R=Math.round((S+C*P)*D)/D;if(w&&R>c)break;r.push({value:R})}return w&&m&&T!==c?r.length&&te(r[r.length-1].value,c,go(c,k,o))?r[r.length-1].value=c:r.push({value:c}):w&&T!==c||r.push({value:T}),r}({maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},this._range||this);return t.bounds==="ticks"&&fi(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){let t=this.ticks,e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){let n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return se(t,this.chart.options.locale,this.options.ticks.format)}}class lr extends oi{static id="linear";static defaults={ticks:{callback:fe.formatters.numeric}};determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=L(t)?t:0,this.max=L(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,s=ct(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}let Pe=i=>Math.floor(Dt(i)),Gt=(i,t)=>Math.pow(10,Pe(i)+t);function po(i){return i/Math.pow(10,Pe(i))===1}function mo(i,t,e){let s=Math.pow(10,e),n=Math.floor(i/s);return Math.ceil(t/s)-n}function hr(i,{min:t,max:e}){t=X(i.min,t);let s=[],n=Pe(t),o=function(p,g){let m=Pe(g-p);for(;mo(p,g,m)>10;)m++;for(;mo(p,g,m)<10;)m--;return Math.min(m,Pe(p))}(t,e),a=o<0?Math.pow(10,Math.abs(o)):1,r=Math.pow(10,o),l=n>o?Math.pow(10,n):0,h=Math.round((t-l)*a)/a,d=Math.floor((t-l)/r/10)*r*10,c=Math.floor((h-d)/Math.pow(10,o)),u=X(i.min,Math.round((l+d+c*Math.pow(10,o))*a)/a);for(;u<e;)s.push({value:u,major:po(u),significand:c}),c>=10?c=c<15?15:20:c++,c>=20&&(o++,c=2,a=o>=0?1:a),u=Math.round((l+d+c*Math.pow(10,o))*a)/a;let f=X(i.max,u);return s.push({value:f,major:po(f),significand:c}),s}class cr extends Wt{static id="logarithmic";static defaults={ticks:{callback:fe.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let s=oi.prototype.parse.apply(this,[t,e]);if(s!==0)return L(s)&&s>0?s:null;this._zero=!0}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=L(t)?Math.max(0,t):null,this.max=L(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!L(this._userMin)&&(this.min=t===Gt(this.min,0)?Gt(this.min,-1):Gt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),s=this.min,n=this.max,o=r=>s=t?s:r,a=r=>n=e?n:r;s===n&&(s<=0?(o(1),a(10)):(o(Gt(s,-1)),a(Gt(n,1)))),s<=0&&o(Gt(n,-1)),n<=0&&a(Gt(s,1)),this.min=s,this.max=n}buildTicks(){let t=this.options,e=hr({min:this._userMin,max:this._userMax},this);return t.bounds==="ticks"&&fi(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return t===void 0?"0":se(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=Dt(t),this._valueRange=Dt(this.max)-Dt(t)}getPixelForValue(t){return t!==void 0&&t!==0||(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Dt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function as(i){let t=i.ticks;if(t.display&&i.display){let e=et(t.backdropPadding);return E(t.font&&t.font.size,U.font.size)+e.height}return 0}function bo(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:i<s||i>n?{start:t-e,end:t}:{start:t,end:t+e}}function dr(i){let t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?$/o:0;for(let c=0;c<o;c++){let u=a.setContext(i.getPointLabelContext(c));n[c]=u.padding;let f=i.getPointPosition(c,i.drawingArea+n[c],r),p=J(u.font),g=(l=i.ctx,h=p,d=F(d=i._pointLabels[c])?d:[d],{w:Ys(l,h.string,d),h:d.length*h.lineHeight});s[c]=g;let m=nt(i.getIndexAngle(c)+r),b=Math.round(Ae(m));ur(e,t,m,bo(b,f.x,g.w,0,180),bo(b,f.y,g.h,90,270))}var l,h,d;i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=function(c,u,f){let p=[],g=c._pointLabels.length,m=c.options,{centerPointLabels:b,display:y}=m.pointLabels,_={extra:as(m)/2,additionalAngle:b?$/g:0},x;for(let v=0;v<g;v++){_.padding=f[v],_.size=u[v];let w=fr(c,v,_);p.push(w),y==="auto"&&(w.visible=gr(w,x),w.visible&&(x=w))}return p}(i,s,n)}function ur(i,t,e,s,n){let o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e)),r=0,l=0;s.start<t.l?(r=(t.l-s.start)/o,i.l=Math.min(i.l,t.l-r)):s.end>t.r&&(r=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),n.start<t.t?(l=(t.t-n.start)/a,i.t=Math.min(i.t,t.t-l)):n.end>t.b&&(l=(n.end-t.b)/a,i.b=Math.max(i.b,t.b+l))}function fr(i,t,e){let s=i.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=e,l=i.getPointPosition(t,s+n+a,o),h=Math.round(Ae(nt(l.angle+q))),d=function(f,p,g){return g===90||g===270?f-=p/2:(g>270||g<90)&&(f-=p),f}(l.y,r.h,h),c=function(f){return f===0||f===180?"center":f<180?"left":"right"}(h),u=function(f,p,g){return g==="right"?f-=p:g==="center"&&(f-=p/2),f}(l.x,r.w,c);return{visible:!0,x:l.x,y:d,textAlign:c,left:u,top:d,right:u+r.w,bottom:d+r.h}}function gr(i,t){if(!t)return!0;let{left:e,top:s,right:n,bottom:o}=i;return!(wt({x:e,y:s},t)||wt({x:e,y:o},t)||wt({x:n,y:s},t)||wt({x:n,y:o},t))}function pr(i,t,e){let{left:s,top:n,right:o,bottom:a}=e,{backdropColor:r}=t;if(!I(r)){let l=Bt(t.borderRadius),h=et(t.backdropPadding);i.fillStyle=r;let d=s-h.left,c=n-h.top,u=o-s+h.width,f=a-n+h.height;Object.values(l).some(p=>p!==0)?(i.beginPath(),ne(i,{x:d,y:c,w:u,h:f,radius:l}),i.fill()):i.fillRect(d,c,u,f)}}function xo(i,t,e,s){let{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,Y);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let a=1;a<s;a++)o=i.getPointPosition(a,t),n.lineTo(o.x,o.y)}}class mr extends oi{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:fe.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=et(as(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!1);this.min=L(t)&&!isNaN(t)?t:0,this.max=L(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/as(this.options))}generateTickLabels(t){oi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{let n=N(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){let t=this.options;t.display&&t.pointLabels.display?dr(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){return nt(t*(Y/(this._pointLabels.length||1))+ct(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(I(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(I(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let s=e[t];return function(n,o,a){return Ot(n,{label:a,index:o,type:"pointLabel"})}(this.getContext(),t,s)}}getPointPosition(t,e,s=0){let n=this.getIndexAngle(t)-q+s;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:e,top:s,right:n,bottom:o}=this._pointLabelItems[t];return{left:e,top:s,right:n,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let s=this.ctx;s.save(),s.beginPath(),xo(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){let t=this.ctx,e=this.options,{angleLines:s,grid:n,border:o}=e,a=this._pointLabels.length,r,l,h;if(e.pointLabels.display&&function(d,c){let{ctx:u,options:{pointLabels:f}}=d;for(let p=c-1;p>=0;p--){let g=d._pointLabelItems[p];if(!g.visible)continue;let m=f.setContext(d.getPointLabelContext(p));pr(u,m,g);let b=J(m.font),{x:y,y:_,textAlign:x}=g;Ft(u,d._pointLabels[p],y,_+b.lineHeight/2,b,{color:m.color,textAlign:x,textBaseline:"middle"})}}(this,a),n.display&&this.ticks.forEach((d,c)=>{if(c!==0||c===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);let u=this.getContext(c),f=n.setContext(u),p=o.setContext(u);(function(g,m,b,y,_){let x=g.ctx,v=m.circular,{color:w,lineWidth:M}=m;!v&&!y||!w||!M||b<0||(x.save(),x.strokeStyle=w,x.lineWidth=M,x.setLineDash(_.dash||[]),x.lineDashOffset=_.dashOffset,x.beginPath(),xo(g,b,v,y),x.closePath(),x.stroke(),x.restore())})(this,f,l,a,p)}}),s.display){for(t.save(),r=a-1;r>=0;r--){let d=s.setContext(this.getPointLabelContext(r)),{color:c,lineWidth:u}=d;u&&c&&(t.lineWidth=u,t.strokeStyle=c,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),h=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(h.x,h.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;let n=this.getIndexAngle(0),o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;let h=s.setContext(this.getContext(l)),d=J(h.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),h.showLabelBackdrop){t.font=d.string,a=t.measureText(r.label).width,t.fillStyle=h.backdropColor;let c=et(h.backdropPadding);t.fillRect(-a/2-c.left,-o-d.size/2-c.top,a+c.width,d.size+c.height)}Ft(t,r.label,0,-o,d,{color:h.color,strokeColor:h.textStrokeColor,strokeWidth:h.textStrokeWidth})}),t.restore()}drawTitle(){}}let ai={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ot=Object.keys(ai);function _o(i,t){return i-t}function yo(i,t){if(I(t))return null;let e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts,a=t;return typeof s=="function"&&(a=s(a)),L(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(n&&(a=n!=="week"||!$t(o)&&o!==!0?e.startOf(a,n):e.startOf(a,"isoWeek",o)),+a)}function vo(i,t,e,s){let n=ot.length;for(let o=ot.indexOf(i);o<n-1;++o){let a=ai[ot[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=s)return ot[o]}return ot[n-1]}function wo(i,t,e){if(e){if(e.length){let{lo:s,hi:n}=Le(e,t);i[e[s]>=t?e[s]:e[n]]=!0}}else i[t]=!0}function Mo(i,t,e){let s=[],n={},o=t.length,a,r;for(a=0;a<o;++a)r=t[a],n[r]=a,s.push({value:r,major:!1});return o!==0&&e?function(l,h,d,c){let u=l._adapter,f=+u.startOf(h[0].value,c),p=h[h.length-1].value,g,m;for(g=f;g<=p;g=+u.add(g,1,c))m=d[g],m>=0&&(h[m].major=!0);return h}(i,s,n,e):s}class rs extends Wt{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){let s=t.time||(t.time={}),n=this._adapter=new eo._date(t.adapters.date);n.init(e),Jt(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:yo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,s=t.time.unit||"day",{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(h){a||isNaN(h.min)||(n=Math.min(n,h.min)),r||isNaN(h.max)||(o=Math.max(o,h.max))}a&&r||(l(this._getLabelBounds()),t.bounds==="ticks"&&t.ticks.source==="labels"||l(this.getMinMax(!1))),n=L(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=L(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){let t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);let o=this.min,a=Ds(n,o,this.max);return this._unit=e.unit||(s.autoSkip?vo(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(r,l,h,d,c){for(let u=ot.length-1;u>=ot.indexOf(h);u--){let f=ot[u];if(ai[f].common&&r._adapter.diff(c,d,f)>=l-1)return f}return ot[h?ot.indexOf(h):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=s.major.enabled&&this._unit!=="year"?function(r){for(let l=ot.indexOf(r)+1,h=ot.length;l<h;++l)if(ai[ot[l]].common)return ot[l]}(this._unit):void 0,this.initOffsets(n),t.reverse&&a.reverse(),Mo(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e,s,n=0,o=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=t.length===1?1-e:(this.getDecimalForValue(t[1])-e)/2,s=this.getDecimalForValue(t[t.length-1]),o=t.length===1?s:(s-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;n=Q(n,0,a),o=Q(o,0,a),this._offsets={start:n,end:o,factor:1/(n+1+o)}}_generate(){let t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,a=o.unit||vo(o.minUnit,e,s,this._getLabelCapacity(e)),r=E(n.ticks.stepSize,1),l=a==="week"&&o.isoWeekday,h=$t(l)||l===!0,d={},c,u,f=e;if(h&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,h?"day":a),t.diff(s,e,a)>1e5*r)throw new Error(e+" and "+s+" are too far apart with stepSize of "+r+" "+a);let p=n.ticks.source==="data"&&this.getDataTimestamps();for(c=f,u=0;c<s;c=+t.add(c,r,a),u++)wo(d,c,p);return c!==s&&n.bounds!=="ticks"&&u!==1||wo(d,c,p),Object.keys(d).sort(_o).map(g=>+g)}getLabelForValue(t){let e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){let s=this.options.time.displayFormats,n=this._unit,o=e||s[n];return this._adapter.format(t,o)}_tickFormatFunction(t,e,s,n){let o=this.options,a=o.ticks.callback;if(a)return N(a,[t,e,s],this);let r=o.time.displayFormats,l=this._unit,h=this._majorUnit,d=l&&r[l],c=h&&r[h],u=s[e],f=h&&c&&u&&u.major;return this._adapter.format(t,n||(f?c:d))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){let e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,s=this.ctx.measureText(t).width,n=ct(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),a=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:s*o+r*a,h:s*a+r*o}}_getLabelCapacity(t){let e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,Mo(this,[t],this._majorUnit),n),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t,e,s=this._cache.data||[];if(s.length)return s;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)s=s.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(s)}getLabelTimestamps(){let t=this._cache.labels||[],e,s;if(t.length)return t;let n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(yo(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return bi(t.sort(_o))}}function ri(i,t,e){let s,n,o,a,r=0,l=i.length-1;e?(t>=i[r].pos&&t<=i[l].pos&&({lo:r,hi:l}=yt(i,"pos",t)),{pos:s,time:o}=i[r],{pos:n,time:a}=i[l]):(t>=i[r].time&&t<=i[l].time&&({lo:r,hi:l}=yt(i,"time",t)),{time:s,pos:o}=i[r],{time:n,pos:a}=i[l]);let h=n-s;return h?o+(a-o)*(t-s)/h:o}var ko=Object.freeze({__proto__:null,CategoryScale:class extends Wt{static id="category";static defaults={ticks:{callback:fo}};constructor(i){super(i),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(i){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:s,label:n}of t)e[s]===n&&e.splice(s,1);this._addedLabels=[]}super.init(i)}parse(i,t){if(I(i))return null;let e=this.getLabels();return((s,n)=>s===null?null:Q(Math.round(s),0,n))(t=isFinite(t)&&e[t]===i?t:rr(e,i,E(t,i),this._addedLabels),e.length-1)}determineDataLimits(){let{minDefined:i,maxDefined:t}=this.getUserBounds(),{min:e,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(i||(e=0),t||(s=this.getLabels().length-1)),this.min=e,this.max=s}buildTicks(){let i=this.min,t=this.max,e=this.options.offset,s=[],n=this.getLabels();n=i===0&&t===n.length-1?n:n.slice(i,t+1),this._valueRange=Math.max(n.length-(e?0:1),1),this._startValue=this.min-(e?.5:0);for(let o=i;o<=t;o++)s.push({value:o});return s}getLabelForValue(i){return fo.call(this,i)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(i){return typeof i!="number"&&(i=this.parse(i)),i===null?NaN:this.getPixelForDecimal((i-this._startValue)/this._valueRange)}getPixelForTick(i){let t=this.ticks;return i<0||i>t.length-1?null:this.getPixelForValue(t[i].value)}getValueForPixel(i){return Math.round(this._startValue+this.getDecimalForPixel(i)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:lr,LogarithmicScale:cr,RadialLinearScale:mr,TimeScale:rs,TimeSeriesScale:class extends rs{static id="timeseries";static defaults=rs.defaults;constructor(i){super(i),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let i=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(i);this._minPos=ri(t,this.min),this._tableRange=ri(t,this.max)-this._minPos,super.initOffsets(i)}buildLookupTable(i){let{min:t,max:e}=this,s=[],n=[],o,a,r,l,h;for(o=0,a=i.length;o<a;++o)l=i[o],l>=t&&l<=e&&s.push(l);if(s.length<2)return[{time:t,pos:0},{time:e,pos:1}];for(o=0,a=s.length;o<a;++o)h=s[o+1],r=s[o-1],l=s[o],Math.round((h+r)/2)!==l&&n.push({time:l,pos:o/(a-1)});return n}_generate(){let i=this.min,t=this.max,e=super.getDataTimestamps();return e.includes(i)&&e.length||e.splice(0,0,i),e.includes(t)&&e.length!==1||e.push(t),e.sort((s,n)=>s-n)}_getTimestampsForTable(){let i=this._cache.all||[];if(i.length)return i;let t=this.getDataTimestamps(),e=this.getLabelTimestamps();return i=t.length&&e.length?this.normalize(t.concat(e)):t.length?t:e,i=this._cache.all=i,i}getDecimalForValue(i){return(ri(this._table,i)-this._minPos)/this._tableRange}getValueForPixel(i){let t=this._offsets,e=this.getDecimalForPixel(i)/t.factor-t.end;return ri(this._table,e*this._tableRange+this._minPos,!0)}}});let ls=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],So=ls.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Po(i){return ls[i%ls.length]}function Do(i){return So[i%So.length]}function br(i){let t=0;return(e,s)=>{let n=i.getDatasetMeta(s).controller;n instanceof es?t=function(o,a){return o.backgroundColor=o.data.map(()=>Po(a++)),a}(e,t):n instanceof ao?t=function(o,a){return o.backgroundColor=o.data.map(()=>Do(a++)),a}(e,t):n&&(t=function(o,a){return o.borderColor=Po(a),o.backgroundColor=Do(a),++a}(e,t))}}function Co(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}var xr={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;let{data:{datasets:s},options:n}=i.config,{elements:o}=n,a=Co(s)||(r=n)&&(r.borderColor||r.backgroundColor)||o&&Co(o)||U.borderColor!=="rgba(0,0,0,0.1)"||U.backgroundColor!=="rgba(0,0,0,0.1)";var r;if(!e.forceOverride&&a)return;let l=br(i);s.forEach(l)}};function Oo(i){if(i._decimated){let t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ao(i){i.data.datasets.forEach(t=>{Oo(t)})}var _r={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled)return void Ao(i);let s=i.width;i.data.datasets.forEach((n,o)=>{let{_data:a,indexAxis:r}=n,l=i.getDatasetMeta(o),h=a||n.data;if(re([r,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let d=i.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||i.options.parsing)return;let{start:c,count:u}=function(p,g){let m=g.length,b,y=0,{iScale:_}=p,{min:x,max:v,minDefined:w,maxDefined:M}=_.getUserBounds();return w&&(y=Q(yt(g,_.axis,x).lo,0,m-1)),b=M?Q(yt(g,_.axis,v).hi+1,y,m)-y:m-y,{start:y,count:b}}(l,h);if(u<=(e.threshold||4*s))return void Oo(n);let f;switch(I(a)&&(n._data=h,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}})),e.algorithm){case"lttb":f=function(p,g,m,b,y){let _=y.samples||b;if(_>=m)return p.slice(g,g+m);let x=[],v=(m-2)/(_-2),w=0,M=g+m-1,k,D,S,T,A,P=g;for(x[w++]=p[P],k=0;k<_-2;k++){let O,C=0,R=0,H=Math.floor((k+1)*v)+1+g,V=Math.min(Math.floor((k+2)*v)+1,m)+g,st=V-H;for(O=H;O<V;O++)C+=p[O].x,R+=p[O].y;C/=st,R/=st;let rt=Math.floor(k*v)+1+g,lt=Math.min(Math.floor((k+1)*v)+1,m)+g,{x:ut,y:pt}=p[P];for(S=T=-1,O=rt;O<lt;O++)T=.5*Math.abs((ut-C)*(p[O].y-pt)-(ut-p[O].x)*(R-pt)),T>S&&(S=T,D=p[O],A=O);x[w++]=D,P=A}return x[w++]=p[M],x}(h,c,u,s,e);break;case"min-max":f=function(p,g,m,b){let y,_,x,v,w,M,k,D,S,T,A=0,P=0,O=[],C=g+m-1,R=p[g].x,H=p[C].x-R;for(y=g;y<g+m;++y){_=p[y],x=(_.x-R)/H*b,v=_.y;let V=0|x;if(V===w)v<S?(S=v,M=y):v>T&&(T=v,k=y),A=(P*A+_.x)/++P;else{let st=y-1;if(!I(M)&&!I(k)){let rt=Math.min(M,k),lt=Math.max(M,k);rt!==D&&rt!==st&&O.push({...p[rt],x:A}),lt!==D&<!==st&&O.push({...p[lt],x:A})}y>0&&st!==D&&O.push(p[st]),O.push(_),w=V,P=0,S=T=v,M=k=D=y}}return O}(h,c,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=f})},destroy(i){Ao(i)}};function hs(i,t,e,s){if(s)return;let n=t[i],o=e[i];return i==="angle"&&(n=nt(n),o=nt(o)),{property:i,start:n,end:o}}function cs(i,t,e){for(;t>i;t--){let s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function To(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function Lo(i,t){let e=[],s=!1;return F(i)?(s=!0,e=i):e=function(n,o){let{x:a=null,y:r=null}=n||{},l=o.points,h=[];return o.segments.forEach(({start:d,end:c})=>{c=cs(d,c,l);let u=l[d],f=l[c];r!==null?(h.push({x:u.x,y:r}),h.push({x:f.x,y:r})):a!==null&&(h.push({x:a,y:u.y}),h.push({x:a,y:f.y}))}),h}(i,t),e.length?new ni({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Eo(i){return i&&i.fill!==!1}function yr(i,t,e){let s=i[t].fill,n=[t],o;if(!e)return s;for(;s!==!1&&n.indexOf(s)===-1;){if(!L(s))return s;if(o=i[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function vr(i,t,e){let s=function(o){let a=o.options,r=a.fill,l=E(r&&r.target,r);return l===void 0&&(l=!!a.backgroundColor),l===!1||l===null?!1:l===!0?"origin":l}(i);if(z(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return L(n)&&Math.floor(n)===n?function(o,a,r,l){return o!=="-"&&o!=="+"||(r=a+r),r===a||r<0||r>=l?!1:r}(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function wr(i,t,e){let s=[];for(let n=0;n<e.length;n++){let o=e[n],{first:a,last:r,point:l}=Mr(o,t,"x");if(!(!l||a&&r)){if(a)s.unshift(l);else if(i.push(l),!r)break}}i.push(...s)}function Mr(i,t,e){let s=i.interpolate(t,e);if(!s)return{};let n=s[e],o=i.segments,a=i.points,r=!1,l=!1;for(let h=0;h<o.length;h++){let d=o[h],c=a[d.start][e],u=a[d.end][e];if(_t(n,c,u)){r=n===c,l=n===u;break}}return{first:r,last:l,point:s}}class Ro{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){let{x:n,y:o,radius:a}=this;return e=e||{start:0,end:Y},t.arc(n,o,a,e.end,e.start,!0),!s.bounds}interpolate(t){let{x:e,y:s,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}}function kr(i){let{chart:t,fill:e,line:s}=i;if(L(e))return function(o,a){let r=o.getDatasetMeta(a);return r&&o.isDatasetVisible(a)?r.dataset:null}(t,e);if(e==="stack")return function(o){let{scale:a,index:r,line:l}=o,h=[],d=l.segments,c=l.points,u=function(f,p){let g=[],m=f.getMatchingVisibleMetas("line");for(let b=0;b<m.length;b++){let y=m[b];if(y.index===p)break;y.hidden||g.unshift(y.dataset)}return g}(a,r);u.push(Lo({x:null,y:a.bottom},l));for(let f=0;f<d.length;f++){let p=d[f];for(let g=p.start;g<=p.end;g++)wr(h,c[g],u)}return new ni({points:h,options:{}})}(i);if(e==="shape")return!0;let n=function(o){return(o.scale||{}).getPointPositionForValue?function(r){let{scale:l,fill:h}=r,d=l.options,c=l.getLabels().length,u=d.reverse?l.max:l.min,f=function(g,m,b){let y;return y=g==="start"?b:g==="end"?m.options.reverse?m.min:m.max:z(g)?g.value:m.getBaseValue(),y}(h,l,u),p=[];if(d.grid.circular){let g=l.getPointPositionForValue(0,u);return new Ro({x:g.x,y:g.y,radius:l.getDistanceFromCenterForValue(f)})}for(let g=0;g<c;++g)p.push(l.getPointPositionForValue(g,f));return p}(o):function(r){let{scale:l={},fill:h}=r,d=function(c,u){let f=null;return c==="start"?f=u.bottom:c==="end"?f=u.top:z(c)?f=u.getPixelForValue(c.value):u.getBasePixel&&(f=u.getBasePixel()),f}(h,l);if(L(d)){let c=l.isHorizontal();return{x:c?d:null,y:c?null:d}}return null}(o)}(i);return n instanceof Ro?n:Lo(n,s)}function ds(i,t,e){let s=kr(t),{line:n,scale:o,axis:a}=t,r=n.options,l=r.fill,h=r.backgroundColor,{above:d=h,below:c=h}=l||{};s&&n.points.length&&(me(i,e),function(u,f){let{line:p,target:g,above:m,below:b,area:y,scale:_}=f,x=p._loop?"angle":f.axis;u.save(),x==="x"&&b!==m&&(Io(u,g,y.top),zo(u,{line:p,target:g,color:m,scale:_,property:x}),u.restore(),u.save(),Io(u,g,y.bottom)),zo(u,{line:p,target:g,color:b,scale:_,property:x}),u.restore()}(i,{line:n,target:s,above:d,below:c,area:e,scale:o,axis:a}),be(i))}function Io(i,t,e){let{segments:s,points:n}=t,o=!0,a=!1;i.beginPath();for(let r of s){let{start:l,end:h}=r,d=n[l],c=n[cs(l,h,n)];o?(i.moveTo(d.x,d.y),o=!1):(i.lineTo(d.x,e),i.lineTo(d.x,d.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(c.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function zo(i,t){let{line:e,target:s,property:n,color:o,scale:a}=t,r=function(l,h,d){let c=l.segments,u=l.points,f=h.points,p=[];for(let g of c){let{start:m,end:b}=g;b=cs(m,b,u);let y=hs(d,u[m],u[b],g.loop);if(!h.segments){p.push({source:g,target:y,start:u[m],end:u[b]});continue}let _=Hi(h,y);for(let x of _){let v=hs(d,f[x.start],f[x.end],x.loop),w=Ni(g,u,v);for(let M of w)p.push({source:M,target:x,start:{[d]:To(y,v,"start",Math.max)},end:{[d]:To(y,v,"end",Math.min)}})}}return p}(e,s,n);for(let{source:l,target:h,start:d,end:c}of r){let{style:{backgroundColor:u=o}={}}=l,f=s!==!0;i.save(),i.fillStyle=u,Sr(i,a,f&&hs(n,d,c)),i.beginPath();let p=!!e.pathSegment(i,l),g;if(f){p?i.closePath():Fo(i,s,c,n);let m=!!s.pathSegment(i,h,{move:p,reverse:!0});g=p&&m,g||Fo(i,s,d,n)}i.closePath(),i.fill(g?"evenodd":"nonzero"),i.restore()}}function Sr(i,t,e){let{top:s,bottom:n}=t.chart.chartArea,{property:o,start:a,end:r}=e||{};o==="x"&&(i.beginPath(),i.rect(a,s,r-a,n-s),i.clip())}function Fo(i,t,e,s){let n=t.interpolate(e,s);n&&i.lineTo(n.x,n.y)}var Pr={id:"filler",afterDatasetsUpdate(i,t,e){let s=(i.data.datasets||[]).length,n=[],o,a,r,l;for(a=0;a<s;++a)o=i.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof ni&&(l={visible:i.isDatasetVisible(a),index:a,fill:vr(r,a,s),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],l&&l.fill!==!1&&(l.fill=yr(n,a,e.propagate))},beforeDraw(i,t,e){let s=e.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=n.length-1;a>=0;--a){let r=n[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),s&&r.fill&&ds(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){let o=s[n].$filler;Eo(o)&&ds(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){let s=t.meta.$filler;Eo(s)&&e.drawTime==="beforeDatasetDraw"&&ds(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};let Vo=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}};class Bo extends Mt{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,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=N(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);let s=t.labels,n=J(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Vo(s,o),h,d;e.font=n.string,this.isHorizontal()?(h=this.maxWidth,d=this._fitRows(a,o,r,l)+10):(d=this.maxHeight,h=this._fitCols(a,n,r,l)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){let{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],h=this.lineWidths=[0],d=n+r,c=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-d;return this.legendItems.forEach((p,g)=>{let m=s+e/2+o.measureText(p.text).width;(g===0||h[h.length-1]+m+2*r>a)&&(c+=d,h[h.length-(g>0?0:1)]=0,f+=d,u++),l[g]={left:0,top:f,row:u,width:m,height:n},h[h.length-1]+=m+r}),c}_fitCols(t,e,s,n){let{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],h=this.columnSizes=[],d=a-t,c=r,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:y,itemHeight:_}=function(x,v,w,M,k){let D=function(T,A,P,O){let C=T.text;return C&&typeof C!="string"&&(C=C.reduce((R,H)=>R.length>H.length?R:H)),A+P.size/2+O.measureText(C).width}(M,x,v,w),S=function(T,A,P){let O=T;return typeof A.text!="string"&&(O=Wo(A,P)),O}(k,M,v.lineHeight);return{itemWidth:D,itemHeight:S}}(s,e,o,m,n);b>0&&f+_+2*r>d&&(c+=u+r,h.push({width:u,height:f}),p+=u+r,g++,u=f=0),l[b]={left:p,top:f,col:g,width:y,height:_},u=Math.max(u,y),f+=_+r}),c+=u,h.push({width:u,height:f}),c}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,a=qt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=tt(s,this.left+n,this.right-this.lineWidths[r]);for(let h of e)r!==h.row&&(r=h.row,l=tt(s,this.left+n,this.right-this.lineWidths[r])),h.top+=this.top+t+n,h.left=a.leftForLtr(a.x(l),h.width),l+=h.width+n}else{let r=0,l=tt(s,this.top+t+n,this.bottom-this.columnSizes[r].height);for(let h of e)h.col!==r&&(r=h.col,l=tt(s,this.top+t+n,this.bottom-this.columnSizes[r].height)),h.top=l,h.left+=this.left+n,h.left=a.leftForLtr(a.x(h.left),h.width),l+=h.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;me(t,this),this._draw(),be(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:a}=t,r=U.color,l=qt(t.rtl,this.left,this.width),h=J(a.font),{padding:d}=a,c=h.size,u=c/2,f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=h.string;let{boxWidth:p,boxHeight:g,itemHeight:m}=Vo(a,c),b=this.isHorizontal(),y=this._computeTitleHeight();f=b?{x:tt(o,this.left+d,this.right-s[0]),y:this.top+d+y,line:0}:{x:this.left+d,y:tt(o,this.top+y+d,this.bottom-e[0].height),line:0},Bi(this.ctx,t.textDirection);let _=m+d;this.legendItems.forEach((x,v)=>{n.strokeStyle=x.fontColor,n.fillStyle=x.fontColor;let w=n.measureText(x.text).width,M=l.textAlign(x.textAlign||(x.textAlign=a.textAlign)),k=p+u+w,D=f.x,S=f.y;if(l.setWidth(this.width),b?v>0&&D+k+d>this.right&&(S=f.y+=_,f.line++,D=f.x=tt(o,this.left+d,this.right-s[f.line])):v>0&&S+_>this.bottom&&(D=f.x=D+e[f.line].width+d,f.line++,S=f.y=tt(o,this.top+y+d,this.bottom-e[f.line].height)),function(T,A,P){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();let O=E(P.lineWidth,1);if(n.fillStyle=E(P.fillStyle,r),n.lineCap=E(P.lineCap,"butt"),n.lineDashOffset=E(P.lineDashOffset,0),n.lineJoin=E(P.lineJoin,"miter"),n.lineWidth=O,n.strokeStyle=E(P.strokeStyle,r),n.setLineDash(E(P.lineDash,[])),a.usePointStyle){let C={radius:g*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:O},R=l.xPlus(T,p/2);Ei(n,C,R,A+u,a.pointStyleWidth&&p)}else{let C=A+Math.max((c-g)/2,0),R=l.leftForLtr(T,p),H=Bt(P.borderRadius);n.beginPath(),Object.values(H).some(V=>V!==0)?ne(n,{x:R,y:C,w:p,h:g,radius:H}):n.rect(R,C,p,g),n.fill(),O!==0&&n.stroke()}n.restore()}(l.x(D),S,x),D=Ts(M,D+p+u,b?D+k:this.right,t.rtl),function(T,A,P){Ft(n,P.text,T,A+m/2,h,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})}(l.x(D),S,x),b)f.x+=k+d;else if(typeof x.text!="string"){let T=h.lineHeight;f.y+=Wo(x,T)+d}else f.y+=_}),Wi(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,s=J(e.font),n=et(e.padding);if(!e.display)return;let o=qt(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=s.size/2,h=n.top+l,d,c=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),d=this.top+h,c=tt(t.align,c,this.right-u);else{let p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);d=h+tt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}let f=tt(r,c,c+u);a.textAlign=o.textAlign(Ee(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,Ft(a,e.text,f,d,s)}_computeTitleHeight(){let t=this.options.title,e=J(t.font),s=et(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(_t(t,this.left,this.right)&&_t(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],_t(t,n.left,n.left+n.width)&&_t(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){let e=this.options;if(!function(a,r){return!!((a==="mousemove"||a==="mouseout")&&(r.onHover||r.onLeave)||r.onClick&&(a==="click"||a==="mouseup"))}(t.type,e))return;let s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let a=this._hoveredItem,r=(o=s,(n=a)!==null&&o!==null&&n.datasetIndex===o.datasetIndex&&n.index===o.index);a&&!r&&N(e.onLeave,[t,a,this],this),this._hoveredItem=s,s&&!r&&N(e.onHover,[t,s,this],this)}else s&&N(e.onClick,[t,s,this],this);var n,o}}function Wo(i,t){return t*(i.text?i.text.length:0)}var Dr={id:"legend",_element:Bo,start(i,t,e){let s=i.legend=new Bo({ctx:i.ctx,options:e,chart:i});it.configure(i,s,e),it.addBox(i,s)},stop(i){it.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){let s=i.legend;it.configure(i,s,e),s.options=e},afterUpdate(i){let t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){let s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){let t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{let h=l.controller.getStyle(e?0:void 0),d=et(h.borderWidth);return{text:t[l.index].label,fillStyle:h.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:h.borderColor,pointStyle:s||h.pointStyle,rotation:h.rotation,textAlign:n||h.textAlign,borderRadius:a&&(r||h.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class us extends Mt{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){let s=this.options;if(this.left=0,this.top=0,!s.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;let n=F(s.text)?s.text.length:1;this._padding=et(s.padding);let o=n*J(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:s,bottom:n,right:o,options:a}=this,r=a.align,l,h,d,c=0;return this.isHorizontal()?(h=tt(r,s,o),d=e+t,l=o-s):(a.position==="left"?(h=s+t,d=tt(r,n,e),c=-.5*$):(h=o-t,d=tt(r,e,n),c=.5*$),l=n-e),{titleX:h,titleY:d,maxWidth:l,rotation:c}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let s=J(e.font),n=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:l}=this._drawArgs(n);Ft(t,e.text,0,0,s,{color:e.color,maxWidth:r,rotation:l,textAlign:Ee(e.align),textBaseline:"middle",translation:[o,a]})}}var Cr={id:"title",_element:us,start(i,t,e){(function(s,n){let o=new us({ctx:s.ctx,options:n,chart:s});it.configure(s,o,n),it.addBox(s,o),s.titleBlock=o})(i,e)},stop(i){let t=i.titleBlock;it.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){let s=i.titleBlock;it.configure(i,s,e),s.options=e},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}};let li=new WeakMap;var Or={id:"subtitle",start(i,t,e){let s=new us({ctx:i.ctx,options:e,chart:i});it.configure(i,s,e),it.addBox(i,s),li.set(i,s)},stop(i){it.removeBox(i,li.get(i)),li.delete(i)},beforeUpdate(i,t,e){let s=li.get(i);it.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};let De={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){let a=i[t].element;if(a&&a.hasValue()){let r=a.tooltipPosition();s.add(r.x),n+=r.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((a,r)=>a+r)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e,s,n,o=t.x,a=t.y,r=Number.POSITIVE_INFINITY;for(e=0,s=i.length;e<s;++e){let l=i[e].element;if(l&&l.hasValue()){let h=Te(t,l.getCenterPoint());h<r&&(r=h,n=l)}}if(n){let l=n.tooltipPosition();o=l.x,a=l.y}return{x:o,y:a}}};function kt(i,t){return t&&(F(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Tt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
`)>-1?i.split(`
|
|
`):i}function Ar(i,t){let{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:i,label:a,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function No(i,t){let e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=J(t.bodyFont),h=J(t.titleFont),d=J(t.footerFont),c=o.length,u=n.length,f=s.length,p=et(t.padding),g=p.height,m=0,b=s.reduce((x,v)=>x+v.before.length+v.lines.length+v.after.length,0);b+=i.beforeBody.length+i.afterBody.length,c&&(g+=c*h.lineHeight+(c-1)*t.titleSpacing+t.titleMarginBottom),b&&(g+=f*(t.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*t.bodySpacing),u&&(g+=t.footerMarginTop+u*d.lineHeight+(u-1)*t.footerSpacing);let y=0,_=function(x){m=Math.max(m,e.measureText(x).width+y)};return e.save(),e.font=h.string,B(i.title,_),e.font=l.string,B(i.beforeBody.concat(i.afterBody),_),y=t.displayColors?a+2+t.boxPadding:0,B(s,x=>{B(x.before,_),B(x.lines,_),B(x.after,_)}),y=0,e.font=d.string,B(i.footer,_),e.restore(),m+=p.width,{width:m,height:g}}function Tr(i,t,e,s){let{x:n,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i,h="center";return s==="center"?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(d,c,u,f){let{x:p,width:g}=f,m=u.caretSize+u.caretPadding;return d==="left"&&p+g+m>c.width||d==="right"&&p-g-m<0||void 0}(h,i,t,e)&&(h="center"),h}function Ho(i,t,e){let s=e.yAlign||t.yAlign||function(n,o){let{y:a,height:r}=o;return a<r/2?"top":a>n.height-r/2?"bottom":"center"}(i,e);return{xAlign:e.xAlign||t.xAlign||Tr(i,t,e,s),yAlign:s}}function jo(i,t,e,s){let{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,h=n+o,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=Bt(a),p=function(m,b){let{x:y,width:_}=m;return b==="right"?y-=_:b==="center"&&(y-=_/2),y}(t,r),g=function(m,b,y){let{y:_,height:x}=m;return b==="top"?_+=y:_-=b==="bottom"?x+y:x/2,_}(t,l,h);return l==="center"?r==="left"?p+=h:r==="right"&&(p-=h):r==="left"?p-=Math.max(d,u)+n:r==="right"&&(p+=Math.max(c,f)+n),{x:Q(p,0,s.width-t.width),y:Q(g,0,s.height-t.height)}}function hi(i,t,e){let s=et(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function $o(i){return kt([],Tt(i))}function Yo(i,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}let Uo={beforeTitle:W,title(i){if(i.length>0){let t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:W,beforeBody:W,beforeLabel:W,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");let e=i.formattedValue;return I(e)||(t+=e),t},labelColor(i){let t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.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(i){let t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:W,afterBody:W,beforeFooter:W,footer:W,afterFooter:W};function at(i,t,e,s){let n=i[t].call(e,s);return n===void 0?Uo[t].call(e,s):n}class Xo extends Mt{static positioners=De;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new Xi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,s=this._tooltipItems,Ot(t,{tooltip:e,tooltipItems:s,type:"tooltip"})));var t,e,s}getTitle(t,e){let{callbacks:s}=e,n=at(s,"beforeTitle",this,t),o=at(s,"title",this,t),a=at(s,"afterTitle",this,t),r=[];return r=kt(r,Tt(n)),r=kt(r,Tt(o)),r=kt(r,Tt(a)),r}getBeforeBody(t,e){return $o(at(e.callbacks,"beforeBody",this,t))}getBody(t,e){let{callbacks:s}=e,n=[];return B(t,o=>{let a={before:[],lines:[],after:[]},r=Yo(s,o);kt(a.before,Tt(at(r,"beforeLabel",this,o))),kt(a.lines,at(r,"label",this,o)),kt(a.after,Tt(at(r,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return $o(at(e.callbacks,"afterBody",this,t))}getFooter(t,e){let{callbacks:s}=e,n=at(s,"beforeFooter",this,t),o=at(s,"footer",this,t),a=at(s,"afterFooter",this,t),r=[];return r=kt(r,Tt(n)),r=kt(r,Tt(o)),r=kt(r,Tt(a)),r}_createItems(t){let e=this._active,s=this.chart.data,n=[],o=[],a=[],r,l,h=[];for(r=0,l=e.length;r<l;++r)h.push(Ar(this.chart,e[r]));return t.filter&&(h=h.filter((d,c,u)=>t.filter(d,c,u,s))),t.itemSort&&(h=h.sort((d,c)=>t.itemSort(d,c,s))),B(h,d=>{let c=Yo(t.callbacks,d);n.push(at(c,"labelColor",this,d)),o.push(at(c,"labelPointStyle",this,d)),a.push(at(c,"labelTextColor",this,d))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=h,h}update(t,e){let s=this.options.setContext(this.getContext()),n=this._active,o,a=[];if(n.length){let r=De[s.position].call(this,n,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);let l=this._size=No(this,s),h=Object.assign({},r,l),d=Ho(this.chart,s,h),c=jo(s,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:c.x,y:c.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}else this.opacity!==0&&(o={opacity:0});this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){let o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){let{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=s,{topLeft:l,topRight:h,bottomLeft:d,bottomRight:c}=Bt(r),{x:u,y:f}=t,{width:p,height:g}=e,m,b,y,_,x,v;return o==="center"?(x=f+g/2,n==="left"?(m=u,b=m-a,_=x+a,v=x-a):(m=u+p,b=m+a,_=x-a,v=x+a),y=m):(b=n==="left"?u+Math.max(l,d)+a:n==="right"?u+p-Math.max(h,c)-a:this.caretX,o==="top"?(_=f,x=_-a,m=b-a,y=b+a):(_=f+g,x=_+a,m=b+a,y=b-a),v=_),{x1:m,x2:b,x3:y,y1:_,y2:x,y3:v}}drawTitle(t,e,s){let n=this.title,o=n.length,a,r,l;if(o){let h=qt(s.rtl,this.x,this.width);for(t.x=hi(this,s.titleAlign,s),e.textAlign=h.textAlign(s.titleAlign),e.textBaseline="middle",a=J(s.titleFont),r=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(n[l],h.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=s.titleMarginBottom-r)}}_drawColorBox(t,e,s,n,o){let a=this.labelColors[s],r=this.labelPointStyles[s],{boxHeight:l,boxWidth:h}=o,d=J(o.bodyFont),c=hi(this,"left",o),u=n.x(c),f=l<d.lineHeight?(d.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){let g={radius:Math.min(h,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},m=n.leftForLtr(u,h)+h/2,b=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,$e(t,g,m,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,$e(t,g,m,b)}else{t.lineWidth=z(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;let g=n.leftForLtr(u,h),m=n.leftForLtr(n.xPlus(u,1),h-2),b=Bt(a.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ne(t,{x:g,y:p,w:h,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ne(t,{x:m,y:p+1,w:h-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,h,l),t.strokeRect(g,p,h,l),t.fillStyle=a.backgroundColor,t.fillRect(m,p+1,h-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){let{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:h,boxPadding:d}=s,c=J(s.bodyFont),u=c.lineHeight,f=0,p=qt(s.rtl,this.x,this.width),g=function(k){e.fillText(k,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(a),b,y,_,x,v,w,M;for(e.textAlign=a,e.textBaseline="middle",e.font=c.string,t.x=hi(this,m,s),e.fillStyle=s.bodyColor,B(this.beforeBody,g),f=r&&m!=="right"?a==="center"?h/2+d:h+2+d:0,x=0,w=n.length;x<w;++x){for(b=n[x],y=this.labelTextColors[x],e.fillStyle=y,B(b.before,g),_=b.lines,r&&_.length&&(this._drawColorBox(e,t,x,p,s),u=Math.max(c.lineHeight,l)),v=0,M=_.length;v<M;++v)g(_[v]),u=c.lineHeight;B(b.after,g)}f=0,u=c.lineHeight,B(this.afterBody,g),t.y-=o}drawFooter(t,e,s){let n=this.footer,o=n.length,a,r;if(o){let l=qt(s.rtl,this.x,this.width);for(t.x=hi(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",a=J(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){let{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:h,height:d}=s,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:p}=Bt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+c,l),a==="top"&&this.drawCaret(t,e,s,n),e.lineTo(r+h-u,l),e.quadraticCurveTo(r+h,l,r+h,l+u),a==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(r+h,l+d-p),e.quadraticCurveTo(r+h,l+d,r+h-p,l+d),a==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(r+f,l+d),e.quadraticCurveTo(r,l+d,r,l+d-f),a==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(r,l+c),e.quadraticCurveTo(r,l,r+c,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){let a=De[t.position].call(this,this._active,this._eventPosition);if(!a)return;let r=this._size=No(this,t),l=Object.assign({},a,this._size),h=Ho(e,t,l),d=jo(t,l,h,e);n._to===d.x&&o._to===d.y||(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),s=this.opacity;if(!s)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;let a=et(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Bi(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Wi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let s=this._active,n=t.map(({datasetIndex:r,index:l})=>{let h=this.chart.getDatasetMeta(r);if(!h)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:h.data[l],index:l}}),o=!Ht(s,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),r=this._positionChanged(a,t),l=e||!Ht(a,o)||r;return l&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){let o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);let a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){let{caretX:s,caretY:n,options:o}=this,a=De[o.position].call(this,t,e);return a!==!1&&(s!==a.x||n!==a.y)}}var Lr={id:"tooltip",_element:Xo,positioners:De,afterInit(i,t,e){e&&(i.tooltip=new Xo({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){let t=i.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){let e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Uo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};return K.register(ro,ko,os,G),K.helpers={...wa},K._adapters=eo,K.Animation=Tn,K.Animations=Xi,K.animator=vt,K.controllers=gt.controllers.items,K.DatasetController=At,K.Element=Mt,K.elements=os,K.Interaction=mn,K.layouts=it,K.platforms=On,K.Scale=Wt,K.Ticks=fe,Object.assign(K,ro,ko,os,G,On),K.Chart=K,typeof window<"u"&&(window.Chart=K),K})});var Qr=Wr(Ko());window.chartInstances=window.chartInstances||{};(function(){if(!window.chartScriptInitialized){let G=function(){let L=getComputedStyle(document.documentElement);return{foreground:L.getPropertyValue("--foreground").trim()||"#000",background:L.getPropertyValue("--background").trim()||"#fff",mutedForeground:L.getPropertyValue("--muted-foreground").trim()||"#666",border:L.getPropertyValue("--border").trim()||"#ccc"}},W=function(L){if(!L||!L.id||!L.hasAttribute("data-chart-id")||L.hasAttribute("data-initialized"))return;L.setAttribute("data-initialized","true"),window.chartInstances[L.id]&&ht(L);let X=L.getAttribute("data-chart-id"),E=document.getElementById(X);if(E)try{let j=JSON.parse(E.textContent),Z=G();Chart.defaults.elements.point.radius=0,Chart.defaults.elements.point.hoverRadius=5;let N=["pie","doughnut","bar","radar"].includes(j.type),B={display:j.showLegend||!1,labels:{color:Z.foreground}},Ht={backgroundColor:Z.background,bodyColor:Z.mutedForeground,titleColor:Z.foreground,borderColor:Z.border,borderWidth:1},jt=j.type==="radar"?{r:{grid:{color:Z.border,display:j.showYGrid!==!1},ticks:{color:Z.mutedForeground,backdropColor:"transparent",display:j.showYLabels!==!1},angleLines:{color:Z.border,display:j.showXGrid!==!1},pointLabels:{color:Z.foreground,font:{size:12}},border:{display:j.showYAxis!==!1,color:Z.border},beginAtZero:!0}}:{x:{beginAtZero:!0,display:j.showXLabels!==!1||j.showXGrid!==!1||j.showXAxis!==!1,border:{display:j.showXAxis!==!1,color:Z.border},ticks:{display:j.showXLabels!==!1,color:Z.mutedForeground},grid:{display:j.showXGrid!==!1,color:Z.border},stacked:j.stacked||!1},y:{offset:!0,beginAtZero:!0,display:j.showYLabels!==!1||j.showYGrid!==!1||j.showYAxis!==!1,border:{display:j.showYAxis!==!1,color:Z.border},ticks:{display:j.showYLabels!==!1,color:Z.mutedForeground},grid:{display:j.showYGrid!==!1,color:Z.border},stacked:j.stacked||!1}},Ce={...j,options:{responsive:!0,maintainAspectRatio:!1,interaction:{intersect:!!N,axis:"xy",mode:N?"nearest":"index"},indexAxis:j.horizontal?"y":"x",plugins:{legend:B,tooltip:Ht},scales:jt}};window.chartInstances[L.id]=new Chart(L,Ce)}catch{}},ht=function(L){if(!(!L||!L.id||!window.chartInstances[L.id]))try{window.chartInstances[L.id].destroy()}finally{delete window.chartInstances[L.id]}},I=function(L=document){if(!(typeof Chart>"u"))for(let X of L.querySelectorAll("canvas[data-chart-id]:not([data-initialized])"))W(X)},F=function(){typeof Chart<"u"?I():setTimeout(F,100)};window.templUI=window.templUI||{},window.templUI.chart={init:I,cleanup:ht},document.addEventListener("DOMContentLoaded",F),new MutationObserver(()=>{let L;clearTimeout(L),L=setTimeout(()=>{for(let X of document.querySelectorAll("canvas[data-chart-id]"))window.chartInstances[X.id]&&(ht(X),W(X))},50)}).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),window.chartScriptInitialized=!0}})();})();
|
|
/*!
|
|
* Chart.js v4.4.8
|
|
* https://www.chartjs.org
|
|
* (c) 2025 Chart.js Contributors
|
|
* Released under the MIT License
|
|
*/
|
|
/*!
|
|
* @kurkle/color v0.3.2
|
|
* https://github.com/kurkle/color#readme
|
|
* (c) 2023 Jukka Kurkela
|
|
* Released under the MIT License
|
|
*/
|